Patchwork [U-Boot,3/4,v5] gen: Add ACE acceleration to hash

login
register
mail settings
Submitter Akshay Saraswat
Date March 6, 2013, 2:18 p.m.
Message ID <1362579536-3109-4-git-send-email-akshay.s@samsung.com>
Download mbox | patch
Permalink /patch/225498/
State Changes Requested
Delegated to: Minkyu Kang
Headers show

Comments

Akshay Saraswat - March 6, 2013, 2:18 p.m.
ACE H/W acceleration support is added to hash
which can be used to test SHA 256 hash algorithm.

Signed-off-by: ARUN MANKUZHI <arun.m@samsung.com>
Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
---
Changes since v1:
	- Added sha256 support to "hash" command instead of new sha256 command.

Changes sice v2:
	- Added new nodes for SHA1 and SHA256 in struct hash_algo for the case when ACE is enabled.
	- Added new declaration for function pointer hash_func_ws with different return type.

Changes sice v3:
	- Changed command names to lower case in algo struct.
	- Added generic ace_sha config.

Changes sice v4:
	- Changed function names in struct algo.
	- Replaced ACE_SHA_TYPE to CHUNSZ in struct algo.

 common/hash.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
Kim Phillips - March 7, 2013, 1:24 a.m.
On Wed, 6 Mar 2013 09:18:55 -0500
Akshay Saraswat <akshay.s@samsung.com> wrote:

> ACE H/W acceleration support is added to hash
> which can be used to test SHA 256 hash algorithm.
> 
> Signed-off-by: ARUN MANKUZHI <arun.m@samsung.com>
> Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
> ---

this doesn't even apply any more:

Applying: gen: Add ACE acceleration to hash
error: patch failed: common/hash.c:28
error: common/hash.c: patch does not apply
Patch failed at 0001 gen: Add ACE acceleration to hash

Kim
Simon Glass - March 7, 2013, 2:03 p.m.
On Wed, Mar 6, 2013 at 6:18 AM, Akshay Saraswat <akshay.s@samsung.com> wrote:
> ACE H/W acceleration support is added to hash
> which can be used to test SHA 256 hash algorithm.
>
> Signed-off-by: ARUN MANKUZHI <arun.m@samsung.com>
> Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>

From my side this looks good, thanks.

Acked-by: Simon Glass <sjg@chomium.org>

> ---
> Changes since v1:
>         - Added sha256 support to "hash" command instead of new sha256 command.
>
> Changes sice v2:
>         - Added new nodes for SHA1 and SHA256 in struct hash_algo for the case when ACE is enabled.
>         - Added new declaration for function pointer hash_func_ws with different return type.
>
> Changes sice v3:
>         - Changed command names to lower case in algo struct.
>         - Added generic ace_sha config.
>
> Changes sice v4:
>         - Changed function names in struct algo.
>         - Replaced ACE_SHA_TYPE to CHUNSZ in struct algo.
>
>  common/hash.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>

Patch

diff --git a/common/hash.c b/common/hash.c
index e3a6e43..1aa23fb 100644
--- a/common/hash.c
+++ b/common/hash.c
@@ -28,12 +28,26 @@ 
 #include <hash.h>
 #include <sha1.h>
 #include <sha256.h>
+#include <ace_sha.h>
 
 /*
  * These are the hash algorithms we support. Chips which support accelerated
  * crypto could perhaps add named version of these algorithms here.
  */
 static struct hash_algo hash_algo[] = {
+#ifdef CONFIG_ACE_SHA
+	{
+		"sha1",
+		SHA1_SUM_LEN,
+		ace_sha1,
+		CHUNKSZ_SHA1,
+	}, {
+		"sha256",
+		SHA256_SUM_LEN,
+		ace_sha256,
+		CHUNKSZ_SHA256,
+	},
+#endif
 #ifdef CONFIG_SHA1
 	{
 		"SHA1",