Beispiel #1
0
int main(int argc, char **argv){
	
	struct source ds;
	unsigned int size = 256*1024*1024;
	unsigned char* buf=malloc(size);
	clock_t start = clock();
	ds.s_entropy = 7.84;
	entropy_fill(&ds, buf, size);
	printf("Time elapsed: %f\n", ((double)clock() - start) / CLOCKS_PER_SEC);
	printf("The entropy of buf: %f\n", buf_entropy(buf, size));
	free(buf);
	return 0;
}
void entropy_init(aug_state* state)
{
    uint32_t seeds[1];
    entropy_fill((void*) seeds, sizeof(seeds));
    set_seed(state,  seeds[0]);
}