]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
gost_crypt: Fix IV length for Magma CTR mode
authorVitaly Chikunov <vt@altlinux.org>
Sat, 9 May 2020 03:15:32 +0000 (06:15 +0300)
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>
Sat, 9 May 2020 08:28:38 +0000 (11:28 +0300)
It's 4, half of block size.

gost_crypt.c

index 4e22145a46d27097ec4aa44d98b7a5e0c9c9cff4..268e3116c6d68bc22007375088da80686bb9beb4 100644 (file)
@@ -201,7 +201,7 @@ const EVP_CIPHER *cipher_magma_ctr(void)
         && ((_hidden_magma_ctr =
              EVP_CIPHER_meth_new(NID_magma_ctr, 1 /* block_size */ ,
                                  32 /* key_size */ )) == NULL
-            || !EVP_CIPHER_meth_set_iv_length(_hidden_magma_ctr, 8)
+            || !EVP_CIPHER_meth_set_iv_length(_hidden_magma_ctr, 4)
             || !EVP_CIPHER_meth_set_flags(_hidden_magma_ctr,
                                           EVP_CIPH_CTR_MODE |
                                           EVP_CIPH_NO_PADDING |