27#ifndef __NILOREA_ENTROPY_HEADER
28#define __NILOREA_ENTROPY_HEADER
double p_value
upper-tail p-value of chi_square
double chi_square
statistic against a uniform spread over the values seen
size_t ones
samples whose bit is set
size_t distinct
distinct byte values seen at this position
double p_value
two-sided p-value of z
double fraction
ones / sample count (0.5 is ideal)
double shannon
bits of entropy at this position (0 .
double z
z-score of the imbalance against a fair coin
size_t n_entropy_positions(const unsigned char *const *samples, size_t count, size_t sample_len, N_ENTROPY_POS *out, size_t max_out)
Per-POSITION analysis of a set of equal-length samples.
size_t n_entropy_bits(const unsigned char *const *samples, size_t count, size_t sample_len, N_ENTROPY_BIT *out, size_t max_out)
Per-BIT analysis of a set of equal-length samples.
size_t n_entropy_longest_run(const unsigned char *data, size_t len)
Length of the longest run of identical bits in the sample.
double n_entropy_shannon(const unsigned char *data, size_t len)
Shannon entropy of the byte sample, in bits per byte (0.0 .
double n_entropy_monobit(const unsigned char *data, size_t len)
Fraction of set bits in the sample (0.0 .
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_chi_square_p(double chi, size_t df)
Upper-tail p-value of a chi-square statistic (Wilson-Hilferty).
double n_entropy_runs_p(const unsigned char *data, size_t len)
Runs test over the sample's bit stream (NIST SP 800-22 style).
per-bit statistics across a set of equal-length samples
per-position statistics across a set of equal-length samples