VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/Random.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common/Random.c')
-rw-r--r--src/Common/Random.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Common/Random.c b/src/Common/Random.c
index 32b38e44..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;
}
@@ -299,10 +304,16 @@ BOOL Randmix ()
case WHIRLPOOL:
WHIRLPOOL_init (&wctx);
- WHIRLPOOL_add (pRandPool, RNG_POOL_SIZE * 8, &wctx);
+ WHIRLPOOL_add (pRandPool, RNG_POOL_SIZE, &wctx);
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;