extendhash is a Rust library to compute hashes and hash extensions.
Supported hash algorithms:
It supports #![no_std]
. All hash algorithms and hash extensions are
implemented in constant functions (using const fn
) and can therefore
be used in constant values.
```rust use extendhash::sha256;
let secretdata = "This is a secret!".asbytes(); let hash = sha256::computehash(secretdata); let datalength = secretdata.len();
// Now we try computing a hash extension,
// assuming that secret_data
is not available.
// We only need hash
and data_length
.
let appendedmessage = "Appended message.".asbytes();
let combinedhash = sha256::extendhash(
hash, datalength, appendedmessage);
// Now we verify that combined_hash
matches the
// concatenation (note the intermediate padding):
let mut combineddata = Vec::
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.