summaryrefslogtreecommitdiffstats
path: root/crypto/sha4.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2015-03-25 12:56:15 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-03-27 07:49:45 +0100
commitc3fe3d705949c83029560c8eebb280dff6fc50d6 (patch)
treedb0f864c53cea7e7dc7ead2c49dfec93512288ee /crypto/sha4.c
parentab5b2c35e143a87483700ca92d7fd50292a891d0 (diff)
downloadbarebox-c3fe3d705949c83029560c8eebb280dff6fc50d6.tar.gz
barebox-c3fe3d705949c83029560c8eebb280dff6fc50d6.tar.xz
crypto: hmac: move register to hmac
As we will use the best sha algo at runtime Add a new init level crypto_initcall to ensure that all the sha present before hmac Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'crypto/sha4.c')
-rw-r--r--crypto/sha4.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/crypto/sha4.c b/crypto/sha4.c
index cb62d1d2f2..3f8fa0d293 100644
--- a/crypto/sha4.c
+++ b/crypto/sha4.c
@@ -321,16 +321,10 @@ static struct digest_algo m384 = {
static int sha384_digest_register(void)
{
- int ret;
-
if (!IS_ENABLED(CONFIG_SHA384))
return 0;
- ret = digest_algo_register(&m384);
- if (ret)
- return ret;
-
- return digest_hmac_register(&m384, 128);
+ return digest_algo_register(&m384);
}
device_initcall(sha384_digest_register);
@@ -359,15 +353,9 @@ static struct digest_algo m512 = {
static int sha512_digest_register(void)
{
- int ret;
-
if (!IS_ENABLED(CONFIG_SHA512))
return 0;
- ret = digest_algo_register(&m512);
- if (ret)
- return ret;
-
- return digest_hmac_register(&m512, 128);
+ return digest_algo_register(&m512);
}
device_initcall(sha512_digest_register);