summaryrefslogtreecommitdiffstats
path: root/crypto/sha1.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2015-03-11 17:53:08 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-03-13 08:32:28 +0100
commit2f3c3f512b2ff5023a4177e167eb6b55055fe883 (patch)
tree3df19abcf2a21b3909037825bed82f723901a37e /crypto/sha1.c
parent3a436924121456c1347acedac31c9e19b2893565 (diff)
downloadbarebox-2f3c3f512b2ff5023a4177e167eb6b55055fe883.tar.gz
barebox-2f3c3f512b2ff5023a4177e167eb6b55055fe883.tar.xz
digest: add HMAC support for md5, sha1, sha224, sha256, sha384, sha512
the hmac algo will be registered as hmac(%s) such as hmac(sha256) Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'crypto/sha1.c')
-rw-r--r--crypto/sha1.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/crypto/sha1.c b/crypto/sha1.c
index b6f4cbbc5a..766e4eace2 100644
--- a/crypto/sha1.c
+++ b/crypto/sha1.c
@@ -26,6 +26,8 @@
#include <linux/string.h>
#include <asm/byteorder.h>
+#include "internal.h"
+
#define SHA1_SUM_POS -0x20
#define SHA1_SUM_LEN 20
@@ -319,8 +321,12 @@ static struct digest_algo m = {
static int sha1_digest_register(void)
{
- digest_algo_register(&m);
+ int ret;
- return 0;
+ ret = digest_algo_register(&m);
+ if (ret)
+ return ret;
+
+ return digest_hmac_register(&m, 64);
}
device_initcall(sha1_digest_register);