mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-13 11:56:28 +08:00
fix cbc bug
This commit is contained in:
@@ -294,7 +294,7 @@ int sm4_cbc_decrypt_update(SM4_CBC_CTX *ctx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
*outlen = 0;
|
*outlen = 0;
|
||||||
if (ctx->block_nbytes < SM4_BLOCK_SIZE) {
|
if (ctx->block_nbytes) {
|
||||||
left = SM4_BLOCK_SIZE - ctx->block_nbytes;
|
left = SM4_BLOCK_SIZE - ctx->block_nbytes;
|
||||||
if (inlen <= left) {
|
if (inlen <= left) {
|
||||||
memcpy(ctx->block + ctx->block_nbytes, in, inlen);
|
memcpy(ctx->block + ctx->block_nbytes, in, inlen);
|
||||||
|
|||||||
Reference in New Issue
Block a user