diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2015-03-25 12:56:14 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-03-27 07:49:45 +0100 |
commit | ab5b2c35e143a87483700ca92d7fd50292a891d0 (patch) | |
tree | f2aaba38fb2ff847ab1e19d0d611fb3aa0be0a01 /crypto/sha1.c | |
parent | e10cc0b3330d4dd72fef076a7f1b2b67cb271a12 (diff) | |
download | barebox-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/sha1.c')
-rw-r--r-- | crypto/sha1.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/sha1.c b/crypto/sha1.c index b108f8ae31..a2ca191899 100644 --- a/crypto/sha1.c +++ b/crypto/sha1.c @@ -26,7 +26,7 @@ #include <linux/string.h> #include <asm/byteorder.h> -#include "internal.h" +#include <crypto/internal.h> #define SHA1_SUM_POS -0x20 #define SHA1_SUM_LEN 20 @@ -311,7 +311,12 @@ static int digest_sha1_final(struct digest *d, unsigned char *md) } static struct digest_algo m = { - .name = "sha1", + .base = { + .name = "sha1", + .driver_name = "sha1-generic", + .priority = 0, + }, + .init = digest_sha1_init, .update = digest_sha1_update, .final = digest_sha1_final, |