rizin/librz/hash/algorithms/entropy/entropy.h
Giovanni 82e7917294
Refactoring Hash (#1082)
* Added authors and licenses and plugin access to crypto related files
* removed `rz_hash` and related files
* introduced `rz_msg_digest_*` with plugins
* updated all old methods with newer ones.
* added HMAC support to `rz-hash` (moved key option under `-K`)
* removed wrong algorithms on `woD`/`woE`
* fixed parity digest size
* fixed the behaviour on all hash functions
* added unit test for hash
* optimized code for HMAC key calculation
* removed hash legacy tests
2021-05-02 20:47:17 +08:00

21 lines
531 B
C

// SPDX-FileCopyrightText: 2021 deroad <wargio@libero.it>
// SPDX-License-Identifier: LGPL-3.0-only
#ifndef RZ_ENTROPY_H
#define RZ_ENTROPY_H
#include <rz_types.h>
#define RZ_HASH_ENTROPY_DIGEST_SIZE sizeof(double)
#define RZ_HASH_ENTROPY_BLOCK_LENGTH 0
typedef struct entropy_t {
ut64 count[256];
ut64 size;
} RzEntropy;
bool rz_entropy_init(RzEntropy *ctx);
bool rz_entropy_update(RzEntropy *ctx, const ut8 *data, size_t len);
bool rz_entropy_final(ut8 *digest, RzEntropy *ctx, bool fraction);
#endif /* RZ_ENTROPY_H */