Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_entropy.c File Reference

Implementation of the byte-sample randomness metrics. More...

#include "nilorea/n_entropy.h"
#include <math.h>
+ Include dependency graph for n_entropy.c:

Go to the source code of this file.

Functions

double n_entropy_chi_square (const unsigned char *data, size_t len)
 Chi-square statistic of the byte histogram against a uniform distribution over 256 values.
 
double n_entropy_monobit (const unsigned char *data, size_t len)
 Fraction of set bits in the sample (0.0 .
 
double n_entropy_shannon (const unsigned char *data, size_t len)
 Shannon entropy of the byte sample, in bits per byte (0.0 .
 

Detailed Description

Implementation of the byte-sample randomness metrics.

Definition in file n_entropy.c.