aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorPhil Sutter <phil.sutter@viprinet.com>2011-05-05 09:29:05 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2011-05-11 01:06:21 -0400
commit7759995c75ae0cbd4c861582908449f6b6208e7a (patch)
treed31801ebe8907a1795e76c8736d46786b2091833 /drivers/crypto
parent8652348754a1f538daa1eab248e5c9c4c3600204 (diff)
crypto: mv_cesa - copy remaining bytes to SRAM only when needed
Signed-off-by: Phil Sutter <phil.sutter@viprinet.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/mv_cesa.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/crypto/mv_cesa.c b/drivers/crypto/mv_cesa.c
index a2d9e394f80f..d704ed0e7d3d 100644
--- a/drivers/crypto/mv_cesa.c
+++ b/drivers/crypto/mv_cesa.c
@@ -525,12 +525,6 @@ static void mv_start_new_hash_req(struct ahash_request *req)
525 hw_bytes = req->nbytes + ctx->extra_bytes; 525 hw_bytes = req->nbytes + ctx->extra_bytes;
526 old_extra_bytes = ctx->extra_bytes; 526 old_extra_bytes = ctx->extra_bytes;
527 527
528 if (unlikely(ctx->extra_bytes)) {
529 memcpy(cpg->sram + SRAM_DATA_IN_START, ctx->buffer,
530 ctx->extra_bytes);
531 p->crypt_len = ctx->extra_bytes;
532 }
533
534 ctx->extra_bytes = hw_bytes % SHA1_BLOCK_SIZE; 528 ctx->extra_bytes = hw_bytes % SHA1_BLOCK_SIZE;
535 if (ctx->extra_bytes != 0 529 if (ctx->extra_bytes != 0
536 && (!ctx->last_chunk || ctx->count > MAX_HW_HASH_SIZE)) 530 && (!ctx->last_chunk || ctx->count > MAX_HW_HASH_SIZE))
@@ -546,6 +540,12 @@ static void mv_start_new_hash_req(struct ahash_request *req)
546 p->complete = mv_hash_algo_completion; 540 p->complete = mv_hash_algo_completion;
547 p->process = mv_process_hash_current; 541 p->process = mv_process_hash_current;
548 542
543 if (unlikely(old_extra_bytes)) {
544 memcpy(cpg->sram + SRAM_DATA_IN_START, ctx->buffer,
545 old_extra_bytes);
546 p->crypt_len = old_extra_bytes;
547 }
548
549 mv_process_hash_current(1); 549 mv_process_hash_current(1);
550 } else { 550 } else {
551 copy_src_to_buf(p, ctx->buffer + old_extra_bytes, 551 copy_src_to_buf(p, ctx->buffer + old_extra_bytes,