aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/crypto/sha1_s390.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/crypto/sha1_s390.c')
-rw-r--r--arch/s390/crypto/sha1_s390.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/s390/crypto/sha1_s390.c b/arch/s390/crypto/sha1_s390.c
index 36bb5346a8c4..9d34a35b1aa5 100644
--- a/arch/s390/crypto/sha1_s390.c
+++ b/arch/s390/crypto/sha1_s390.c
@@ -40,9 +40,9 @@ struct crypt_s390_sha1_ctx {
40 u8 buffer[2 * SHA1_BLOCK_SIZE]; 40 u8 buffer[2 * SHA1_BLOCK_SIZE];
41}; 41};
42 42
43static void sha1_init(void *ctx_arg) 43static void sha1_init(struct crypto_tfm *tfm)
44{ 44{
45 struct crypt_s390_sha1_ctx *ctx = ctx_arg; 45 struct crypt_s390_sha1_ctx *ctx = crypto_tfm_ctx(tfm);
46 static const u32 initstate[5] = { 46 static const u32 initstate[5] = {
47 0x67452301, 47 0x67452301,
48 0xEFCDAB89, 48 0xEFCDAB89,
@@ -56,13 +56,13 @@ static void sha1_init(void *ctx_arg)
56 ctx->buf_len = 0; 56 ctx->buf_len = 0;
57} 57}
58 58
59static void 59static void sha1_update(struct crypto_tfm *tfm, const u8 *data,
60sha1_update(void *ctx, const u8 *data, unsigned int len) 60 unsigned int len)
61{ 61{
62 struct crypt_s390_sha1_ctx *sctx; 62 struct crypt_s390_sha1_ctx *sctx;
63 long imd_len; 63 long imd_len;
64 64
65 sctx = ctx; 65 sctx = crypto_tfm_ctx(tfm);
66 sctx->count += len * 8; //message bit length 66 sctx->count += len * 8; //message bit length
67 67
68 //anything in buffer yet? -> must be completed 68 //anything in buffer yet? -> must be completed
@@ -111,10 +111,9 @@ pad_message(struct crypt_s390_sha1_ctx* sctx)
111} 111}
112 112
113/* Add padding and return the message digest. */ 113/* Add padding and return the message digest. */
114static void 114static void sha1_final(struct crypto_tfm *tfm, u8 *out)
115sha1_final(void* ctx, u8 *out)
116{ 115{
117 struct crypt_s390_sha1_ctx *sctx = ctx; 116 struct crypt_s390_sha1_ctx *sctx = crypto_tfm_ctx(tfm);
118 117
119 //must perform manual padding 118 //must perform manual padding
120 pad_message(sctx); 119 pad_message(sctx);