libsodium/test/default/randombytes.c
Frank Denis 5c946f9c61 Move tests to test/default and windows to quirks/windows.
test/default contains only tests using the default primitives
for a given operation. We need to add other tests as well.
2013-02-09 04:21:32 +08:00

17 lines
313 B
C

#include "randombytes.h"
unsigned char x[65536];
unsigned long long freq[256];
int main(void)
{
unsigned long long i;
randombytes(x,sizeof x);
for (i = 0;i < 256;++i) freq[i] = 0;
for (i = 0;i < sizeof x;++i) ++freq[255 & (int) x[i]];
for (i = 0;i < 256;++i) if (!freq[i]) return 111;
return 0;
}