aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/digest.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/digest.c')
-rw-r--r--crypto/digest.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/crypto/digest.c b/crypto/digest.c
index 062d0a5a2c89..2d9d509c2c51 100644
--- a/crypto/digest.c
+++ b/crypto/digest.c
@@ -20,7 +20,7 @@
20 20
21static void init(struct crypto_tfm *tfm) 21static void init(struct crypto_tfm *tfm)
22{ 22{
23 tfm->__crt_alg->cra_digest.dia_init(crypto_tfm_ctx(tfm)); 23 tfm->__crt_alg->cra_digest.dia_init(tfm);
24} 24}
25 25
26static void update(struct crypto_tfm *tfm, 26static void update(struct crypto_tfm *tfm,
@@ -46,16 +46,14 @@ static void update(struct crypto_tfm *tfm,
46 unsigned int bytes = 46 unsigned int bytes =
47 alignmask + 1 - (offset & alignmask); 47 alignmask + 1 - (offset & alignmask);
48 bytes = min(bytes, bytes_from_page); 48 bytes = min(bytes, bytes_from_page);
49 tfm->__crt_alg->cra_digest.dia_update 49 tfm->__crt_alg->cra_digest.dia_update(tfm, p,
50 (crypto_tfm_ctx(tfm), p, 50 bytes);
51 bytes);
52 p += bytes; 51 p += bytes;
53 bytes_from_page -= bytes; 52 bytes_from_page -= bytes;
54 l -= bytes; 53 l -= bytes;
55 } 54 }
56 tfm->__crt_alg->cra_digest.dia_update 55 tfm->__crt_alg->cra_digest.dia_update(tfm, p,
57 (crypto_tfm_ctx(tfm), p, 56 bytes_from_page);
58 bytes_from_page);
59 crypto_kunmap(src, 0); 57 crypto_kunmap(src, 0);
60 crypto_yield(tfm); 58 crypto_yield(tfm);
61 offset = 0; 59 offset = 0;
@@ -83,8 +81,7 @@ static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
83 u32 flags; 81 u32 flags;
84 if (tfm->__crt_alg->cra_digest.dia_setkey == NULL) 82 if (tfm->__crt_alg->cra_digest.dia_setkey == NULL)
85 return -ENOSYS; 83 return -ENOSYS;
86 return tfm->__crt_alg->cra_digest.dia_setkey(crypto_tfm_ctx(tfm), 84 return tfm->__crt_alg->cra_digest.dia_setkey(tfm, key, keylen, &flags);
87 key, keylen, &flags);
88} 85}
89 86
90static void digest(struct crypto_tfm *tfm, 87static void digest(struct crypto_tfm *tfm,