summaryrefslogtreecommitdiffstats
path: root/arch/s390/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/crypto')
-rw-r--r--arch/s390/crypto/sha1_s390.c23
-rw-r--r--arch/s390/crypto/sha256_s390.c1
2 files changed, 12 insertions, 12 deletions
diff --git a/arch/s390/crypto/sha1_s390.c b/arch/s390/crypto/sha1_s390.c
index 98c896b86dcd..36bb5346a8c4 100644
--- a/arch/s390/crypto/sha1_s390.c
+++ b/arch/s390/crypto/sha1_s390.c
@@ -40,19 +40,20 @@ struct crypt_s390_sha1_ctx {
u8 buffer[2 * SHA1_BLOCK_SIZE];
};
-static void
-sha1_init(void *ctx)
+static void sha1_init(void *ctx_arg)
{
- static const struct crypt_s390_sha1_ctx initstate = {
- .state = {
- 0x67452301,
- 0xEFCDAB89,
- 0x98BADCFE,
- 0x10325476,
- 0xC3D2E1F0
- },
+ struct crypt_s390_sha1_ctx *ctx = ctx_arg;
+ static const u32 initstate[5] = {
+ 0x67452301,
+ 0xEFCDAB89,
+ 0x98BADCFE,
+ 0x10325476,
+ 0xC3D2E1F0
};
- memcpy(ctx, &initstate, sizeof(initstate));
+
+ ctx->count = 0;
+ memcpy(ctx->state, &initstate, sizeof(initstate));
+ ctx->buf_len = 0;
}
static void
diff --git a/arch/s390/crypto/sha256_s390.c b/arch/s390/crypto/sha256_s390.c
index 1ec5e92b3454..2c76e7bee41c 100644
--- a/arch/s390/crypto/sha256_s390.c
+++ b/arch/s390/crypto/sha256_s390.c
@@ -44,7 +44,6 @@ static void sha256_init(void *ctx)
sctx->state[6] = 0x1f83d9ab;
sctx->state[7] = 0x5be0cd19;
sctx->count = 0;
- memset(sctx->buf, 0, sizeof(sctx->buf));
}
static void sha256_update(void *ctx, const u8 *data, unsigned int len)