fix cbc bug

This commit is contained in:
s-s-L-L
2022-08-24 12:56:53 +08:00
parent 8d957bbe70
commit 20ed2db606

View File

@@ -294,7 +294,7 @@ int sm4_cbc_decrypt_update(SM4_CBC_CTX *ctx,
}
*outlen = 0;
if (ctx->block_nbytes < SM4_BLOCK_SIZE) {
if (ctx->block_nbytes) {
left = SM4_BLOCK_SIZE - ctx->block_nbytes;
if (inlen <= left) {
memcpy(ctx->block + ctx->block_nbytes, in, inlen);