libsodium: Needed for Dnscrypto-proxy Release 1.3.0
[tomato.git] / release / src / router / libsodium / test / default / randombytes.c
blobf805c472c4d78d07ed484c2ecc3485d7ffb14601
1 #include "randombytes.h"
3 unsigned char x[65536];
4 unsigned long long freq[256];
6 int main(void)
8 unsigned long long i;
10 randombytes(x,sizeof x);
11 for (i = 0;i < 256;++i) freq[i] = 0;
12 for (i = 0;i < sizeof x;++i) ++freq[255 & (int) x[i]];
13 for (i = 0;i < 256;++i) if (!freq[i]) return 111;
15 return 0;