]> wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost_grasshopper_cipher.c
Add more GOST R 34.10-2012 parameters
[openssl-gost/engine.git] / gost_grasshopper_cipher.c
index 0d0eacb7623f89280b44218fd3c16eaaba1892e3..a045a92d754eb780692150649aed8beea50bacdc 100644 (file)
@@ -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);
         }
     }