Skip to content

Commit ccafe28

Browse files
committed
crypto: qat - Use crypto_shash_export_core
Use crypto_shash_export_core to export the core hash state without the partial blocks. Signed-off-by: Herbert Xu <[email protected]>
1 parent d9408b8 commit ccafe28

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/crypto/intel/qat/qat_common/qat_algs.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
#include <linux/crypto.h>
66
#include <crypto/internal/aead.h>
77
#include <crypto/internal/cipher.h>
8+
#include <crypto/internal/hash.h>
89
#include <crypto/internal/skcipher.h>
910
#include <crypto/aes.h>
1011
#include <crypto/sha1.h>
1112
#include <crypto/sha2.h>
12-
#include <crypto/hash.h>
1313
#include <crypto/hmac.h>
1414
#include <crypto/algapi.h>
1515
#include <crypto/authenc.h>
@@ -154,19 +154,19 @@ static int qat_alg_do_precomputes(struct icp_qat_hw_auth_algo_blk *hash,
154154

155155
switch (ctx->qat_hash_alg) {
156156
case ICP_QAT_HW_AUTH_ALGO_SHA1:
157-
if (crypto_shash_export(shash, &ctx->sha1))
157+
if (crypto_shash_export_core(shash, &ctx->sha1))
158158
return -EFAULT;
159159
for (i = 0; i < digest_size >> 2; i++, hash_state_out++)
160160
*hash_state_out = cpu_to_be32(ctx->sha1.state[i]);
161161
break;
162162
case ICP_QAT_HW_AUTH_ALGO_SHA256:
163-
if (crypto_shash_export(shash, &ctx->sha256))
163+
if (crypto_shash_export_core(shash, &ctx->sha256))
164164
return -EFAULT;
165165
for (i = 0; i < digest_size >> 2; i++, hash_state_out++)
166166
*hash_state_out = cpu_to_be32(ctx->sha256.state[i]);
167167
break;
168168
case ICP_QAT_HW_AUTH_ALGO_SHA512:
169-
if (crypto_shash_export(shash, &ctx->sha512))
169+
if (crypto_shash_export_core(shash, &ctx->sha512))
170170
return -EFAULT;
171171
for (i = 0; i < digest_size >> 3; i++, hash512_state_out++)
172172
*hash512_state_out = cpu_to_be64(ctx->sha512.state[i]);
@@ -190,19 +190,19 @@ static int qat_alg_do_precomputes(struct icp_qat_hw_auth_algo_blk *hash,
190190

191191
switch (ctx->qat_hash_alg) {
192192
case ICP_QAT_HW_AUTH_ALGO_SHA1:
193-
if (crypto_shash_export(shash, &ctx->sha1))
193+
if (crypto_shash_export_core(shash, &ctx->sha1))
194194
return -EFAULT;
195195
for (i = 0; i < digest_size >> 2; i++, hash_state_out++)
196196
*hash_state_out = cpu_to_be32(ctx->sha1.state[i]);
197197
break;
198198
case ICP_QAT_HW_AUTH_ALGO_SHA256:
199-
if (crypto_shash_export(shash, &ctx->sha256))
199+
if (crypto_shash_export_core(shash, &ctx->sha256))
200200
return -EFAULT;
201201
for (i = 0; i < digest_size >> 2; i++, hash_state_out++)
202202
*hash_state_out = cpu_to_be32(ctx->sha256.state[i]);
203203
break;
204204
case ICP_QAT_HW_AUTH_ALGO_SHA512:
205-
if (crypto_shash_export(shash, &ctx->sha512))
205+
if (crypto_shash_export_core(shash, &ctx->sha512))
206206
return -EFAULT;
207207
for (i = 0; i < digest_size >> 3; i++, hash512_state_out++)
208208
*hash512_state_out = cpu_to_be64(ctx->sha512.state[i]);

0 commit comments

Comments
 (0)