diff options
-rw-r--r-- | drivers/crypto/nx/nx-sha256.c | 2 | ||||
-rw-r--r-- | drivers/crypto/nx/nx-sha512.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/nx/nx-sha256.c b/drivers/crypto/nx/nx-sha256.c index 6547a7104bf6..da0b24a7633f 100644 --- a/drivers/crypto/nx/nx-sha256.c +++ b/drivers/crypto/nx/nx-sha256.c | |||
@@ -129,7 +129,7 @@ static int nx_sha256_update(struct shash_desc *desc, const u8 *data, | |||
129 | NX_CPB_FDM(csbcpb) |= NX_FDM_CONTINUATION; | 129 | NX_CPB_FDM(csbcpb) |= NX_FDM_CONTINUATION; |
130 | 130 | ||
131 | total -= to_process; | 131 | total -= to_process; |
132 | data += to_process; | 132 | data += to_process - sctx->count; |
133 | sctx->count = 0; | 133 | sctx->count = 0; |
134 | in_sg = nx_ctx->in_sg; | 134 | in_sg = nx_ctx->in_sg; |
135 | } while (leftover >= SHA256_BLOCK_SIZE); | 135 | } while (leftover >= SHA256_BLOCK_SIZE); |
diff --git a/drivers/crypto/nx/nx-sha512.c b/drivers/crypto/nx/nx-sha512.c index 236e6afeab10..4ae5b0f221d5 100644 --- a/drivers/crypto/nx/nx-sha512.c +++ b/drivers/crypto/nx/nx-sha512.c | |||
@@ -131,7 +131,7 @@ static int nx_sha512_update(struct shash_desc *desc, const u8 *data, | |||
131 | NX_CPB_FDM(csbcpb) |= NX_FDM_CONTINUATION; | 131 | NX_CPB_FDM(csbcpb) |= NX_FDM_CONTINUATION; |
132 | 132 | ||
133 | total -= to_process; | 133 | total -= to_process; |
134 | data += to_process; | 134 | data += to_process - sctx->count[0]; |
135 | sctx->count[0] = 0; | 135 | sctx->count[0] = 0; |
136 | in_sg = nx_ctx->in_sg; | 136 | in_sg = nx_ctx->in_sg; |
137 | } while (leftover >= SHA512_BLOCK_SIZE); | 137 | } while (leftover >= SHA512_BLOCK_SIZE); |