diff options
Diffstat (limited to 'crypto/digest.c')
-rw-r--r-- | crypto/digest.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/crypto/digest.c b/crypto/digest.c index 0155a94e4b15..8f4593268ce0 100644 --- a/crypto/digest.c +++ b/crypto/digest.c | |||
@@ -21,54 +21,6 @@ | |||
21 | #include "internal.h" | 21 | #include "internal.h" |
22 | #include "scatterwalk.h" | 22 | #include "scatterwalk.h" |
23 | 23 | ||
24 | void crypto_digest_init(struct crypto_tfm *tfm) | ||
25 | { | ||
26 | struct crypto_hash *hash = crypto_hash_cast(tfm); | ||
27 | struct hash_desc desc = { .tfm = hash, .flags = tfm->crt_flags }; | ||
28 | |||
29 | crypto_hash_init(&desc); | ||
30 | } | ||
31 | EXPORT_SYMBOL_GPL(crypto_digest_init); | ||
32 | |||
33 | void crypto_digest_update(struct crypto_tfm *tfm, | ||
34 | struct scatterlist *sg, unsigned int nsg) | ||
35 | { | ||
36 | struct crypto_hash *hash = crypto_hash_cast(tfm); | ||
37 | struct hash_desc desc = { .tfm = hash, .flags = tfm->crt_flags }; | ||
38 | unsigned int nbytes = 0; | ||
39 | unsigned int i; | ||
40 | |||
41 | for (i = 0; i < nsg; i++) | ||
42 | nbytes += sg[i].length; | ||
43 | |||
44 | crypto_hash_update(&desc, sg, nbytes); | ||
45 | } | ||
46 | EXPORT_SYMBOL_GPL(crypto_digest_update); | ||
47 | |||
48 | void crypto_digest_final(struct crypto_tfm *tfm, u8 *out) | ||
49 | { | ||
50 | struct crypto_hash *hash = crypto_hash_cast(tfm); | ||
51 | struct hash_desc desc = { .tfm = hash, .flags = tfm->crt_flags }; | ||
52 | |||
53 | crypto_hash_final(&desc, out); | ||
54 | } | ||
55 | EXPORT_SYMBOL_GPL(crypto_digest_final); | ||
56 | |||
57 | void crypto_digest_digest(struct crypto_tfm *tfm, | ||
58 | struct scatterlist *sg, unsigned int nsg, u8 *out) | ||
59 | { | ||
60 | struct crypto_hash *hash = crypto_hash_cast(tfm); | ||
61 | struct hash_desc desc = { .tfm = hash, .flags = tfm->crt_flags }; | ||
62 | unsigned int nbytes = 0; | ||
63 | unsigned int i; | ||
64 | |||
65 | for (i = 0; i < nsg; i++) | ||
66 | nbytes += sg[i].length; | ||
67 | |||
68 | crypto_hash_digest(&desc, sg, nbytes, out); | ||
69 | } | ||
70 | EXPORT_SYMBOL_GPL(crypto_digest_digest); | ||
71 | |||
72 | static int init(struct hash_desc *desc) | 24 | static int init(struct hash_desc *desc) |
73 | { | 25 | { |
74 | struct crypto_tfm *tfm = crypto_hash_tfm(desc->tfm); | 26 | struct crypto_tfm *tfm = crypto_hash_tfm(desc->tfm); |