summaryrefslogtreecommitdiffstats
path: root/crypto/sha4.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2015-03-25 12:56:14 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-03-27 07:49:45 +0100
commitab5b2c35e143a87483700ca92d7fd50292a891d0 (patch)
treef2aaba38fb2ff847ab1e19d0d611fb3aa0be0a01 /crypto/sha4.c
parente10cc0b3330d4dd72fef076a7f1b2b67cb271a12 (diff)
downloadbarebox-ab5b2c35e143a87483700ca92d7fd50292a891d0.tar.gz
barebox-ab5b2c35e143a87483700ca92d7fd50292a891d0.tar.xz
crypto: prepare to allow multiple digest driver
This will allow to have hw driver or asm optimised driver. Use a priority level to determine which one to use at runtime. The generic one will be 0. 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.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/crypto/sha4.c b/crypto/sha4.c
index 1b91e7fcc3..cb62d1d2f2 100644
--- a/crypto/sha4.c
+++ b/crypto/sha4.c
@@ -28,8 +28,7 @@
#include <init.h>
#include <linux/string.h>
#include <asm/byteorder.h>
-
-#include "internal.h"
+#include <crypto/internal.h>
#define SHA384_SUM_LEN 48
#define SHA512_SUM_LEN 64
@@ -305,7 +304,12 @@ static int digest_sha384_init(struct digest *d)
}
static struct digest_algo m384 = {
- .name = "sha384",
+ .base = {
+ .name = "sha384",
+ .driver_name = "sha384-generic",
+ .priority = 0,
+ },
+
.init = digest_sha384_init,
.update = digest_sha4_update,
.final = digest_sha4_final,
@@ -338,7 +342,12 @@ static int digest_sha512_init(struct digest *d)
}
static struct digest_algo m512 = {
- .name = "sha512",
+ .base = {
+ .name = "sha512",
+ .driver_name = "sha512-generic",
+ .priority = 0,
+ },
+
.init = digest_sha512_init,
.update = digest_sha4_update,
.final = digest_sha4_final,