VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Crypto.c
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-09 14:25:52 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-08-15 01:09:11 +0200
commite90e24b30b379752bf6531c663085de1d2a653d7 (patch)
tree6ff3a18a2e9dedb9e506d67f2c560e1c8f657e47 /src/Common/Crypto.c
parent0b2c8b09c6eb3ddce22fa88c34a640881f8f2177 (diff)
downloadVeraCrypt-e90e24b30b379752bf6531c663085de1d2a653d7.tar.gz
VeraCrypt-e90e24b30b379752bf6531c663085de1d2a653d7.zip
Windows: Add support for Streebog (hash) and kuznyechik (encryption)
Diffstat (limited to 'src/Common/Crypto.c')
-rw-r--r--src/Common/Crypto.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Common/Crypto.c b/src/Common/Crypto.c
index 16115bf6..69d5b5dc 100644
--- a/src/Common/Crypto.c
+++ b/src/Common/Crypto.c
@@ -58,6 +58,7 @@ static Cipher Ciphers[] =
#if defined(CIPHER_GOST89)
{ GOST89, L"GOST89", 16, 32, GOST_KS },
#endif // defined(CIPHER_GOST89)
+ { KUZNYECHIK, L"Kuznyechik",16, 32, KUZNYECHIK_KS },
#endif
{ 0, 0, 0, 0, 0 }
};
@@ -78,6 +79,7 @@ static EncryptionAlgorithm EncryptionAlgorithms[] =
#if defined(CIPHER_GOST89)
{ { GOST89, 0 }, { XTS, 0 }, 1 },
#endif // defined(CIPHER_GOST89)
+ { { KUZNYECHIK, 0 }, { XTS, 0 }, 1 },
{ { TWOFISH, AES, 0 }, { XTS, 0 }, 1 },
{ { SERPENT, TWOFISH, AES, 0 }, { XTS, 0 }, 1 },
{ { AES, SERPENT, 0 }, { XTS, 0 }, 1 },
@@ -112,6 +114,7 @@ static Hash Hashes[] =
{ WHIRLPOOL, L"Whirlpool", FALSE, FALSE },
{ SHA256, L"SHA-256", FALSE, TRUE },
{ RIPEMD160, L"RIPEMD-160", TRUE, TRUE },
+ { STREEBOG, L"Streebog", FALSE, FALSE },
{ 0, 0, 0 }
};
#endif
@@ -156,6 +159,9 @@ int CipherInit (int cipher, unsigned char *key, unsigned __int8 *ks)
gost_set_key(key, (gost_kds*)ks);
break;
#endif // && defined(CIPHER_GOST89)
+ case KUZNYECHIK:
+ kuznyechik_set_key(key, (kuznyechik_kds*)ks);
+ break;
#endif // !defined(TC_WINDOWS_BOOT)
default:
@@ -189,6 +195,7 @@ void EncipherBlock(int cipher, void *data, void *ks)
#if defined(CIPHER_GOST89)
case GOST89: gost_encrypt(data, data, ks, 1); break;
#endif // defined(CIPHER_GOST89)
+ case KUZNYECHIK: kuznyechik_encrypt_block(data, data, ks); break;
#endif // !defined(TC_WINDOWS_BOOT)
default: TC_THROW_FATAL_EXCEPTION; // Unknown/wrong ID
}
@@ -252,6 +259,7 @@ void DecipherBlock(int cipher, void *data, void *ks)
#if defined(CIPHER_GOST89)
case GOST89: gost_decrypt(data, data, ks, 1); break;
#endif // defined(CIPHER_GOST89)
+ case KUZNYECHIK: kuznyechik_decrypt_block(data, data, ks); break;
#endif // !defined(TC_WINDOWS_BOOT)