diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2015-03-25 12:56:15 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-03-27 07:49:45 +0100 |
commit | c3fe3d705949c83029560c8eebb280dff6fc50d6 (patch) | |
tree | db0f864c53cea7e7dc7ead2c49dfec93512288ee /crypto/sha2.c | |
parent | ab5b2c35e143a87483700ca92d7fd50292a891d0 (diff) | |
download | barebox-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/sha2.c')
-rw-r--r-- | crypto/sha2.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/crypto/sha2.c b/crypto/sha2.c index 42c40da757..f7b8bebde2 100644 --- a/crypto/sha2.c +++ b/crypto/sha2.c @@ -315,16 +315,10 @@ static struct digest_algo m224 = { static int sha224_digest_register(void) { - int ret; - if (!IS_ENABLED(CONFIG_SHA224)) return 0; - ret = digest_algo_register(&m224); - if (ret) - return ret; - - return digest_hmac_register(&m224, 64); + return digest_algo_register(&m224); } device_initcall(sha224_digest_register); @@ -353,15 +347,9 @@ static struct digest_algo m256 = { static int sha256_digest_register(void) { - int ret; - if (!IS_ENABLED(CONFIG_SHA256)) return 0; - ret = digest_algo_register(&m256); - if (ret) - return ret; - - return digest_hmac_register(&m256, 64); + return digest_algo_register(&m256); } device_initcall(sha256_digest_register); |