summaryrefslogtreecommitdiff
path: root/include/entropy.h
blob: e2466827c7e8a1dff7a932735427d574b91cd717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include <stddef.h>

#pragma once

typedef struct entropy_ctx {
	size_t  freq[256];
	size_t  total_bytes;
} entropy_ctx;

void entropy_init(entropy_ctx *ctx);
void entropy_update(entropy_ctx *ctx, const unsigned char *buf, size_t len);
double entropy_final(entropy_ctx *ctx);