summaryrefslogtreecommitdiffstats
path: root/crypto/md5.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/md5.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/md5.c')
-rw-r--r--crypto/md5.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/crypto/md5.c b/crypto/md5.c
index b7ad6f27e9..74c9b706f0 100644
--- a/crypto/md5.c
+++ b/crypto/md5.c
@@ -28,8 +28,7 @@
#include <common.h>
#include <digest.h>
#include <init.h>
-
-#include "internal.h"
+#include <crypto/internal.h>
struct MD5Context {
__u32 buf[4];
@@ -290,7 +289,11 @@ static int digest_md5_final(struct digest *d, unsigned char *md)
}
static struct digest_algo md5 = {
- .name = "md5",
+ .base = {
+ .name = "md5",
+ .driver_name = "md5-generic",
+ .priority = 0,
+ },
.init = digest_md5_init,
.update = digest_md5_update,
.final = digest_md5_final,