diff options
| author | daniel <daniel@planethacker.net> | 2025-05-06 16:57:32 -0700 |
|---|---|---|
| committer | daniel <daniel@planethacker.net> | 2025-05-06 16:57:32 -0700 |
| commit | 2278df1493e064c197913e49b5d1935942d83448 (patch) | |
| tree | 42f06ab2f76e2ddf228bafbb03f79621975a4534 /include/entropy.h | |
initial import
Diffstat (limited to 'include/entropy.h')
| -rw-r--r-- | include/entropy.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/entropy.h b/include/entropy.h new file mode 100644 index 0000000..e246682 --- /dev/null +++ b/include/entropy.h @@ -0,0 +1,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); |
