[CRYPTO] all: Pass tfm instead of ctx to algorithms
[GitHub/LineageOS/android_kernel_motorola_exynos9610.git] / arch / s390 / crypto / sha256_s390.c
index 2c76e7bee41ca95191df3a9bbefb5414c0eed06e..f573df30f31d28429b2f69ea819aec6a5775a8fa 100644 (file)
@@ -31,9 +31,9 @@ struct s390_sha256_ctx {
        u8 buf[2 * SHA256_BLOCK_SIZE];
 };
 
-static void sha256_init(void *ctx)
+static void sha256_init(struct crypto_tfm *tfm)
 {
-       struct s390_sha256_ctx *sctx = ctx;
+       struct s390_sha256_ctx *sctx = crypto_tfm_ctx(tfm);
 
        sctx->state[0] = 0x6a09e667;
        sctx->state[1] = 0xbb67ae85;
@@ -46,9 +46,10 @@ static void sha256_init(void *ctx)
        sctx->count = 0;
 }
 
-static void sha256_update(void *ctx, const u8 *data, unsigned int len)
+static void sha256_update(struct crypto_tfm *tfm, const u8 *data,
+                         unsigned int len)
 {
-       struct s390_sha256_ctx *sctx = ctx;
+       struct s390_sha256_ctx *sctx = crypto_tfm_ctx(tfm);
        unsigned int index;
        int ret;
 
@@ -107,9 +108,9 @@ static void pad_message(struct s390_sha256_ctx* sctx)
 }
 
 /* Add padding and return the message digest */
-static void sha256_final(void* ctx, u8 *out)
+static void sha256_final(struct crypto_tfm *tfm, u8 *out)
 {
-       struct s390_sha256_ctx *sctx = ctx;
+       struct s390_sha256_ctx *sctx = crypto_tfm_ctx(tfm);
 
        /* must perform manual padding */
        pad_message(sctx);