RustCrypto/block-ciphers

magma: provide a way to support both gost28147 and magma subkeys order

lumag opened this issue · 1 comments

lumag commented

GOST 28147-89 and GOST R 34.12-2015 ended up using different subkeys schedule during encryption. For the non-formal description see the RFC. Please provide a way to support both of them. From my experience the easies (and most probably the most correct) way to achieve this is to specify Gost89 ciphers (original subkeys order) using all defined SBox-es (including the TC26-A one) and to specify a separate (Magma) cipher fixed to use TC26-A S-Box and using "new" subkeys order.

The linked RFC describes the GOST R 34.12-2015 version. The test vectors from it are used in the doc example. Can you link test vectors for the older version? IIRC the original GOST does not contain them. The only thing which comes to mind is the KExp15 and KImp15 functions which (for some very weird reason) use the older version of the cipher.