提交 db1eafb8 编写于 作者: T Tianjia Zhang 提交者: Herbert Xu

crypto: s390/sha512 - Use macros instead of direct IV numbers

In the init functions of sha512 and sha384, the initial hash value
use macros instead of numbers.
Signed-off-by: NTianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 e0583b6a
...@@ -22,14 +22,14 @@ static int sha512_init(struct shash_desc *desc) ...@@ -22,14 +22,14 @@ static int sha512_init(struct shash_desc *desc)
{ {
struct s390_sha_ctx *ctx = shash_desc_ctx(desc); struct s390_sha_ctx *ctx = shash_desc_ctx(desc);
*(__u64 *)&ctx->state[0] = 0x6a09e667f3bcc908ULL; *(__u64 *)&ctx->state[0] = SHA512_H0;
*(__u64 *)&ctx->state[2] = 0xbb67ae8584caa73bULL; *(__u64 *)&ctx->state[2] = SHA512_H1;
*(__u64 *)&ctx->state[4] = 0x3c6ef372fe94f82bULL; *(__u64 *)&ctx->state[4] = SHA512_H2;
*(__u64 *)&ctx->state[6] = 0xa54ff53a5f1d36f1ULL; *(__u64 *)&ctx->state[6] = SHA512_H3;
*(__u64 *)&ctx->state[8] = 0x510e527fade682d1ULL; *(__u64 *)&ctx->state[8] = SHA512_H4;
*(__u64 *)&ctx->state[10] = 0x9b05688c2b3e6c1fULL; *(__u64 *)&ctx->state[10] = SHA512_H5;
*(__u64 *)&ctx->state[12] = 0x1f83d9abfb41bd6bULL; *(__u64 *)&ctx->state[12] = SHA512_H6;
*(__u64 *)&ctx->state[14] = 0x5be0cd19137e2179ULL; *(__u64 *)&ctx->state[14] = SHA512_H7;
ctx->count = 0; ctx->count = 0;
ctx->func = CPACF_KIMD_SHA_512; ctx->func = CPACF_KIMD_SHA_512;
...@@ -87,14 +87,14 @@ static int sha384_init(struct shash_desc *desc) ...@@ -87,14 +87,14 @@ static int sha384_init(struct shash_desc *desc)
{ {
struct s390_sha_ctx *ctx = shash_desc_ctx(desc); struct s390_sha_ctx *ctx = shash_desc_ctx(desc);
*(__u64 *)&ctx->state[0] = 0xcbbb9d5dc1059ed8ULL; *(__u64 *)&ctx->state[0] = SHA384_H0;
*(__u64 *)&ctx->state[2] = 0x629a292a367cd507ULL; *(__u64 *)&ctx->state[2] = SHA384_H1;
*(__u64 *)&ctx->state[4] = 0x9159015a3070dd17ULL; *(__u64 *)&ctx->state[4] = SHA384_H2;
*(__u64 *)&ctx->state[6] = 0x152fecd8f70e5939ULL; *(__u64 *)&ctx->state[6] = SHA384_H3;
*(__u64 *)&ctx->state[8] = 0x67332667ffc00b31ULL; *(__u64 *)&ctx->state[8] = SHA384_H4;
*(__u64 *)&ctx->state[10] = 0x8eb44a8768581511ULL; *(__u64 *)&ctx->state[10] = SHA384_H5;
*(__u64 *)&ctx->state[12] = 0xdb0c2e0d64f98fa7ULL; *(__u64 *)&ctx->state[12] = SHA384_H6;
*(__u64 *)&ctx->state[14] = 0x47b5481dbefa4fa4ULL; *(__u64 *)&ctx->state[14] = SHA384_H7;
ctx->count = 0; ctx->count = 0;
ctx->func = CPACF_KIMD_SHA_512; ctx->func = CPACF_KIMD_SHA_512;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册