X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost_grasshopper_cipher.c;h=a045a92d754eb780692150649aed8beea50bacdc;hb=refs%2Fpull%2F86%2Fhead;hp=0d0eacb7623f89280b44218fd3c16eaaba1892e3;hpb=23f3265d293c91a80988dadcb4f7e36b60dbef0a;p=openssl-gost%2Fengine.git diff --git a/gost_grasshopper_cipher.c b/gost_grasshopper_cipher.c index 0d0eacb..a045a92 100644 --- a/gost_grasshopper_cipher.c +++ b/gost_grasshopper_cipher.c @@ -365,11 +365,14 @@ int gost_grasshopper_cipher_do_cbc(EVP_CIPHER_CTX *ctx, unsigned char *out, currentOutputBlock, &c->buffer); grasshopper_copy128(currentBlock, currentOutputBlock); } else { + grasshopper_w128_t tmp; + + grasshopper_copy128(&tmp, currentInputBlock); grasshopper_decrypt_block(&c->decrypt_round_keys, currentInputBlock, currentOutputBlock, &c->buffer); grasshopper_append128(currentOutputBlock, currentBlock); - grasshopper_copy128(currentBlock, currentInputBlock); + grasshopper_copy128(currentBlock, &tmp); } }