diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-08-09 14:25:52 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2016-08-15 01:09:11 +0200 |
commit | e90e24b30b379752bf6531c663085de1d2a653d7 (patch) | |
tree | 6ff3a18a2e9dedb9e506d67f2c560e1c8f657e47 /src/Volume/Cipher.cpp | |
parent | 0b2c8b09c6eb3ddce22fa88c34a640881f8f2177 (diff) | |
download | VeraCrypt-e90e24b30b379752bf6531c663085de1d2a653d7.tar.gz VeraCrypt-e90e24b30b379752bf6531c663085de1d2a653d7.zip |
Windows: Add support for Streebog (hash) and kuznyechik (encryption)
Diffstat (limited to 'src/Volume/Cipher.cpp')
-rw-r--r-- | src/Volume/Cipher.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/Volume/Cipher.cpp b/src/Volume/Cipher.cpp index a90b3c46..69449088 100644 --- a/src/Volume/Cipher.cpp +++ b/src/Volume/Cipher.cpp @@ -16,6 +16,8 @@ #include "Crypto/Serpent.h" #include "Crypto/Twofish.h" #include "Crypto/Camellia.h" +#include "Crypto/GostCipher.h" +#include "Crypto/kuznyechik.h" #ifdef TC_AES_HW_CPU # include "Crypto/Aes_hw_cpu.h" @@ -80,6 +82,8 @@ namespace VeraCrypt l.push_back (shared_ptr <Cipher> (new CipherSerpent ())); l.push_back (shared_ptr <Cipher> (new CipherTwofish ())); l.push_back (shared_ptr <Cipher> (new CipherCamellia ())); + l.push_back (shared_ptr <Cipher> (new CipherGost89 ())); + l.push_back (shared_ptr <Cipher> (new CipherKuznyechik ())); return l; } @@ -264,6 +268,46 @@ namespace VeraCrypt camellia_set_key (key, ScheduledKey.Ptr()); } + // GOST89 + void CipherGost89::Decrypt (byte *data) const + { + gost_decrypt (data, data, (gost_kds *) ScheduledKey.Ptr(), 1); + } + + void CipherGost89::Encrypt (byte *data) const + { + gost_encrypt (data, data, (gost_kds *) ScheduledKey.Ptr(), 1); + } + + size_t CipherGost89::GetScheduledKeySize () const + { + return GOST_KS; + } + + void CipherGost89::SetCipherKey (const byte *key) + { + gost_set_key (key, (gost_kds *) ScheduledKey.Ptr()); + } + // Kuznyechik + void CipherKuznyechik::Decrypt (byte *data) const + { + kuznyechik_decrypt_block (data, data, (kuznyechik_kds *) ScheduledKey.Ptr()); + } + + void CipherKuznyechik::Encrypt (byte *data) const + { + kuznyechik_encrypt_block (data, data, (kuznyechik_kds *) ScheduledKey.Ptr()); + } + + size_t CipherKuznyechik::GetScheduledKeySize () const + { + return KUZNYECHIK_KS; + } + + void CipherKuznyechik::SetCipherKey (const byte *key) + { + kuznyechik_set_key (key, (kuznyechik_kds *) ScheduledKey.Ptr()); + } bool Cipher::HwSupportEnabled = true; } |