aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/crypto/sha256_s390.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/crypto/sha256_s390.c')
-rw-r--r--arch/s390/crypto/sha256_s390.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/s390/crypto/sha256_s390.c b/arch/s390/crypto/sha256_s390.c
index 1ec5e92b3454..f573df30f31d 100644
--- a/arch/s390/crypto/sha256_s390.c
+++ b/arch/s390/crypto/sha256_s390.c
@@ -31,9 +31,9 @@ struct s390_sha256_ctx {
31 u8 buf[2 * SHA256_BLOCK_SIZE]; 31 u8 buf[2 * SHA256_BLOCK_SIZE];
32}; 32};
33 33
34static void sha256_init(void *ctx) 34static void sha256_init(struct crypto_tfm *tfm)
35{ 35{
36 struct s390_sha256_ctx *sctx = ctx; 36 struct s390_sha256_ctx *sctx = crypto_tfm_ctx(tfm);
37 37
38 sctx->state[0] = 0x6a09e667; 38 sctx->state[0] = 0x6a09e667;
39 sctx->state[1] = 0xbb67ae85; 39 sctx->state[1] = 0xbb67ae85;
@@ -44,12 +44,12 @@ static void sha256_init(void *ctx)
44 sctx->state[6] = 0x1f83d9ab; 44 sctx->state[6] = 0x1f83d9ab;
45 sctx->state[7] = 0x5be0cd19; 45 sctx->state[7] = 0x5be0cd19;
46 sctx->count = 0; 46 sctx->count = 0;
47 memset(sctx->buf, 0, sizeof(sctx->buf));
48} 47}
49 48
50static void sha256_update(void *ctx, const u8 *data, unsigned int len) 49static void sha256_update(struct crypto_tfm *tfm, const u8 *data,
50 unsigned int len)
51{ 51{
52 struct s390_sha256_ctx *sctx = ctx; 52 struct s390_sha256_ctx *sctx = crypto_tfm_ctx(tfm);
53 unsigned int index; 53 unsigned int index;
54 int ret; 54 int ret;
55 55
@@ -108,9 +108,9 @@ static void pad_message(struct s390_sha256_ctx* sctx)
108} 108}
109 109
110/* Add padding and return the message digest */ 110/* Add padding and return the message digest */
111static void sha256_final(void* ctx, u8 *out) 111static void sha256_final(struct crypto_tfm *tfm, u8 *out)
112{ 112{
113 struct s390_sha256_ctx *sctx = ctx; 113 struct s390_sha256_ctx *sctx = crypto_tfm_ctx(tfm);
114 114
115 /* must perform manual padding */ 115 /* must perform manual padding */
116 pad_message(sctx); 116 pad_message(sctx);