Commit cc8d35057ce7ae2f88cc65be0f839316c4641332
Committed by
Herbert Xu
1 parent
6677a776cf
Exists in
master
and in
7 other branches
crypto: mv_cesa - fill inner/outer IV fields only in HMAC case
Signed-off-by: Phil Sutter <phil.sutter@viprinet.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff
drivers/crypto/mv_cesa.c
... | ... | @@ -296,6 +296,7 @@ |
296 | 296 | static void mv_process_hash_current(int first_block) |
297 | 297 | { |
298 | 298 | struct ahash_request *req = ahash_request_cast(cpg->cur_req); |
299 | + const struct mv_tfm_hash_ctx *tfm_ctx = crypto_tfm_ctx(req->base.tfm); | |
299 | 300 | struct mv_req_hash_ctx *req_ctx = ahash_request_ctx(req); |
300 | 301 | struct req_progress *p = &cpg->p; |
301 | 302 | struct sec_accel_config op = { 0 }; |
... | ... | @@ -308,6 +309,8 @@ |
308 | 309 | break; |
309 | 310 | case COP_HMAC_SHA1: |
310 | 311 | op.config = CFG_OP_MAC_ONLY | CFG_MACM_HMAC_SHA1; |
312 | + memcpy(cpg->sram + SRAM_HMAC_IV_IN, | |
313 | + tfm_ctx->ivs, sizeof(tfm_ctx->ivs)); | |
311 | 314 | break; |
312 | 315 | } |
313 | 316 | |
... | ... | @@ -510,7 +513,6 @@ |
510 | 513 | { |
511 | 514 | struct req_progress *p = &cpg->p; |
512 | 515 | struct mv_req_hash_ctx *ctx = ahash_request_ctx(req); |
513 | - const struct mv_tfm_hash_ctx *tfm_ctx = crypto_tfm_ctx(req->base.tfm); | |
514 | 516 | int num_sgs, hw_bytes, old_extra_bytes, rc; |
515 | 517 | cpg->cur_req = &req->base; |
516 | 518 | memset(p, 0, sizeof(struct req_progress)); |
... | ... | @@ -522,8 +524,6 @@ |
522 | 524 | ctx->extra_bytes); |
523 | 525 | p->crypt_len = ctx->extra_bytes; |
524 | 526 | } |
525 | - | |
526 | - memcpy(cpg->sram + SRAM_HMAC_IV_IN, tfm_ctx->ivs, sizeof(tfm_ctx->ivs)); | |
527 | 527 | |
528 | 528 | if (unlikely(!ctx->first_hash)) { |
529 | 529 | writel(ctx->state[0], cpg->reg + DIGEST_INITIAL_VAL_A); |