diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-01-06 18:01:29 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-01-26 22:45:41 +0100 |
commit | fedba5aaef6d980a57380c7caf9a545b4457b29e (patch) | |
tree | c8366903dbbdd4f268071c77630aac6b3dfd0a8d /crypto/md5.c | |
parent | bc94fb379a46f9b4dabc982953a8d553c909bedb (diff) | |
download | barebox-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 'crypto/md5.c')
-rw-r--r-- | crypto/md5.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/md5.c b/crypto/md5.c index 23892babce..f8f52bf4a5 100644 --- a/crypto/md5.c +++ b/crypto/md5.c @@ -293,6 +293,7 @@ static struct digest_algo md5 = { .name = "md5", .driver_name = "md5-generic", .priority = 0, + .algo = HASH_ALGO_MD5, }, .init = digest_md5_init, .update = digest_md5_update, |