From b65eabe23d5910a26d741439b1f5ea45ba4a0777 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 25 Sep 2016 22:37:45 +0200 Subject: Add test vectors for Kuznyechik and GOST89 (the later is deprecated) --- src/Volume/Cipher.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/Volume/Cipher.cpp') diff --git a/src/Volume/Cipher.cpp b/src/Volume/Cipher.cpp index 69449088..3363f640 100644 --- a/src/Volume/Cipher.cpp +++ b/src/Volume/Cipher.cpp @@ -286,7 +286,28 @@ namespace VeraCrypt void CipherGost89::SetCipherKey (const byte *key) { - gost_set_key (key, (gost_kds *) ScheduledKey.Ptr()); + gost_set_key (key, (gost_kds *) ScheduledKey.Ptr(), 1); + } + + // GOST89 with static SBOX + void CipherGost89StaticSBOX::Decrypt (byte *data) const + { + gost_decrypt (data, data, (gost_kds *) ScheduledKey.Ptr(), 1); + } + + void CipherGost89StaticSBOX::Encrypt (byte *data) const + { + gost_encrypt (data, data, (gost_kds *) ScheduledKey.Ptr(), 1); + } + + size_t CipherGost89StaticSBOX::GetScheduledKeySize () const + { + return GOST_KS; + } + + void CipherGost89StaticSBOX::SetCipherKey (const byte *key) + { + gost_set_key (key, (gost_kds *) ScheduledKey.Ptr(), 0); } // Kuznyechik -- cgit v1.2.3