rizin/librz/hash/algorithms/sha1/sha1.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

23 lines
572 B
C

// SPDX-FileCopyrightText: 2021 deroad <wargio@libero.it>
// SPDX-License-Identifier: LGPL-3.0-only
#ifndef RZ_HASH_SHA1_H
#define RZ_HASH_SHA1_H
#include <rz_types.h>
#define RZ_HASH_SHA1_DIGEST_SIZE 0x14
#define RZ_HASH_SHA1_BLOCK_LENGTH 0x40
typedef struct sha1_context_t {
ut32 digest[5];
ut8 block[RZ_HASH_SHA1_BLOCK_LENGTH];
ut64 index;
ut64 len_high;
ut64 len_low;
} RzSHA1;
void rz_sha1_init(RzSHA1 *context);
bool rz_sha1_update(RzSHA1 *context, const ut8 *data, ut64 length);
void rz_sha1_fini(ut8 *hash, RzSHA1 *context);
#endif /* RZ_HASH_SHA1_H */