summaryrefslogtreecommitdiffstats
path: root/arch/arm/crypto
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-01-06 18:01:29 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-01-26 22:45:41 +0100
commitfedba5aaef6d980a57380c7caf9a545b4457b29e (patch)
treec8366903dbbdd4f268071c77630aac6b3dfd0a8d /arch/arm/crypto
parentbc94fb379a46f9b4dabc982953a8d553c909bedb (diff)
downloadbarebox-fedba5aaef6d980a57380c7caf9a545b4457b29e.tar.gz
barebox-fedba5aaef6d980a57380c7caf9a545b4457b29e.tar.xz
crypto: add digest_alloc_by_algo()
In barebox the function digest_alloc() allocates a digest based on a string. When a subsystem already uses an integer value to identify a digest it makes no sense to create a string and pass it to digest_alloc(), where it is parsed again. This patch adds the possibility to get a digest by an enum. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/crypto')
-rw-r--r--arch/arm/crypto/sha1_glue.c1
-rw-r--r--arch/arm/crypto/sha256_glue.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/crypto/sha1_glue.c b/arch/arm/crypto/sha1_glue.c
index 176aa9ec69..57cd9d1014 100644
--- a/arch/arm/crypto/sha1_glue.c
+++ b/arch/arm/crypto/sha1_glue.c
@@ -119,6 +119,7 @@ static struct digest_algo m = {
.name = "sha1",
.driver_name = "sha1-asm",
.priority = 150,
+ .algo = HASH_ALGO_SHA1,
},
.init = sha1_init,
diff --git a/arch/arm/crypto/sha256_glue.c b/arch/arm/crypto/sha256_glue.c
index f8086f6ac7..e649609a8e 100644
--- a/arch/arm/crypto/sha256_glue.c
+++ b/arch/arm/crypto/sha256_glue.c
@@ -173,6 +173,7 @@ static struct digest_algo sha224 = {
.name = "sha224",
.driver_name = "sha224-asm",
.priority = 150,
+ .algo = HASH_ALGO_SHA224,
},
.length = SHA224_DIGEST_SIZE,
@@ -195,6 +196,7 @@ static struct digest_algo sha256 = {
.name = "sha256",
.driver_name = "sha256-asm",
.priority = 150,
+ .algo = HASH_ALGO_SHA256,
},
.length = SHA256_DIGEST_SIZE,