From patchwork Tue Mar 5 13:19:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [U-Boot,4/5,v4] gen: Add ACE acceleration to hash Date: Tue, 05 Mar 2013 03:19:59 -0000 From: Akshay Saraswat X-Patchwork-Id: 225021 Message-Id: <1362489600-20991-5-git-send-email-akshay.s@samsung.com> To: u-boot@lists.denx.de Cc: prashanth.g@samsung.com ACE H/W acceleration support is added to hash which can be used to test SHA 256 hash algorithm. Tested with command "hash sha256 0x40008000 0x2B 0x40009000". Used mm and md to write a standard string to memory location 0x40008000 and ran the above command to verify the output. Signed-off-by: ARUN MANKUZHI Signed-off-by: Akshay Saraswat --- 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. common/hash.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/common/hash.c b/common/hash.c index e3a6e43..10da26d 100644 --- a/common/hash.c +++ b/common/hash.c @@ -28,12 +28,26 @@ #include #include #include +#include /* * 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_sha_hash_digest, + ACE_SHA_TYPE_SHA1, + }, { + "sha256", + SHA256_SUM_LEN, + ace_sha_hash_digest, + ACE_SHA_TYPE_SHA256, + }, +#endif #ifdef CONFIG_SHA1 { "SHA1",