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

Randomness/entropy metrics for byte samples (token-randomness analysis). More...

#include <stddef.h>
Include dependency graph for n_entropy.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  N_ENTROPY_BIT
 per-bit statistics across a set of equal-length samples More...
struct  N_ENTROPY_POS
 per-position statistics across a set of equal-length samples More...

Functions

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.
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).
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_monobit (const unsigned char *data, size_t len)
 Fraction of set bits in the sample (0.0 .
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.
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).
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

Randomness/entropy metrics for byte samples (token-randomness analysis).

Author
Castagnier Mickael
Version
1.0

Definition in file n_entropy.h.