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/Common/Random.c | |
parent | 0b2c8b09c6eb3ddce22fa88c34a640881f8f2177 (diff) | |
download | VeraCrypt-e90e24b30b379752bf6531c663085de1d2a653d7.tar.gz VeraCrypt-e90e24b30b379752bf6531c663085de1d2a653d7.zip |
Windows: Add support for Streebog (hash) and kuznyechik (encryption)
Diffstat (limited to 'src/Common/Random.c')
-rw-r--r-- | src/Common/Random.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Common/Random.c b/src/Common/Random.c index 2be230fd..edc6acca 100644 --- a/src/Common/Random.c +++ b/src/Common/Random.c @@ -247,6 +247,7 @@ BOOL Randmix () RMD160_CTX rctx; sha512_ctx sctx; sha256_ctx s256ctx; + STREEBOG_CTX stctx; int poolIndex, digestIndex, digestSize; switch (HashFunction) @@ -267,6 +268,10 @@ BOOL Randmix () digestSize = WHIRLPOOL_DIGESTSIZE; break; + case STREEBOG: + digestSize = STREEBOG_DIGESTSIZE; + break; + default: TC_THROW_FATAL_EXCEPTION; } @@ -303,6 +308,12 @@ BOOL Randmix () WHIRLPOOL_finalize (&wctx, hashOutputBuffer); break; + case STREEBOG: + STREEBOG_init (&stctx); + STREEBOG_add (&stctx, pRandPool, RNG_POOL_SIZE); + STREEBOG_finalize (&stctx, hashOutputBuffer); + break; + default: // Unknown/wrong ID TC_THROW_FATAL_EXCEPTION; @@ -335,6 +346,10 @@ BOOL Randmix () burn (&wctx, sizeof(wctx)); break; + case STREEBOG: + burn (&stctx, sizeof(sctx)); + break; + default: // Unknown/wrong ID TC_THROW_FATAL_EXCEPTION; |