File: test.c

package info (click to toggle)
nacl 20110221-5
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,448 kB
  • ctags: 21,301
  • sloc: asm: 19,669; ansic: 13,302; cpp: 1,125; sh: 852; makefile: 10
file content (15 lines) | stat: -rw-r--r-- 313 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "randombytes-impl.h"

unsigned char x[65536];
unsigned long long freq[256];

int main()
{
  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;
}