Skip to content

Commit 0a0b9fd

Browse files
committed
tweetNaCL: fix winrandom
problem: random byte generation on windows got stuck in an infinite loop solution: the failure test is incorrect. Change it
1 parent 571ee21 commit 0a0b9fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tweetnacl/contrib/randombytes/winrandom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void randombytes(unsigned char *x,unsigned long long xlen)
2222
if (xlen < 1048576) i = (unsigned) xlen; else i = 1048576;
2323

2424
ret = CryptGenRandom(hProvider, i, x);
25-
if (ret != FALSE) {
25+
if (ret == FALSE) {
2626
Sleep(1);
2727
continue;
2828
}

0 commit comments

Comments
 (0)