summaryrefslogtreecommitdiffstats
path: root/crypto/digest.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/digest.c')
-rw-r--r--crypto/digest.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/crypto/digest.c b/crypto/digest.c
index 7869c049e9..7670ed06b7 100644
--- a/crypto/digest.c
+++ b/crypto/digest.c
@@ -58,6 +58,24 @@ end:
return ret;
}
+int digest_generic_digest(struct digest *d, const void *data,
+ unsigned int len, u8 *md)
+
+{
+ int ret;
+
+ if (!data || len == 0 || !md)
+ return -EINVAL;
+
+ ret = digest_init(d);
+ if (ret)
+ return ret;
+ ret = digest_update(d, data, len);
+ if (ret)
+ return ret;
+ return digest_final(d, md);
+}
+
int digest_algo_register(struct digest_algo *d)
{
if (!d || !d->name || !d->update || !d->final || !d->verify ||