23 releases

new 0.11.0-pre.5 Mar 5, 2025
0.11.0-pre.4 Jul 27, 2024
0.11.0-pre.2 Jan 19, 2024
0.10.4 Sep 2, 2022
0.3.0 Nov 17, 2016

#2775 in Cryptography

Download history 35607/week @ 2024-11-17 37426/week @ 2024-11-24 44048/week @ 2024-12-01 47091/week @ 2024-12-08 43840/week @ 2024-12-15 9837/week @ 2024-12-22 16858/week @ 2024-12-29 39566/week @ 2025-01-05 44630/week @ 2025-01-12 43574/week @ 2025-01-19 49194/week @ 2025-01-26 42471/week @ 2025-02-02 43605/week @ 2025-02-09 40507/week @ 2025-02-16 44929/week @ 2025-02-23 42442/week @ 2025-03-02

173,067 downloads per month
Used in 31 crates (21 directly)

MIT/Apache

63KB
2.5K SLoC

RustCrypto: Whirlpool

crate Docs Apache2/MIT licensed Rust Version Project Chat Build Status

Pure Rust implementation of the Whirlpool cryptographic hash algorithm.

This is the algorithm recommended by NESSIE (New European Schemes for Signatures, Integrity and Encryption; an European research project).

The constants used by Whirlpool were changed twice (2001 and 2003) - this crate only implements the most recent standard. The two older Whirlpool implementations (sometimes called Whirlpool-0 (pre 2001) and Whirlpool-T (pre 2003)) were not used much anyway (both have never been recommended by NESSIE).

For details see this page.

Examples

use whirlpool::{Whirlpool, Digest};
use hex_literal::hex;

let mut hasher = Whirlpool::new();
hasher.update(b"Hello Whirlpool");
let hash = hasher.finalize();

assert_eq!(hash, hex!(
    "8eaccdc136903c458ea0b1376be2a5fc9dc5b8ce8892a3b4f43366e2610c206c"
    "a373816495e63db0fff2ff25f75aa7162f332c9f518c3036456502a8414d300a"
));

// Hex-encode hash using https://docs.rs/base16ct
let hex_hash = base16ct::lower::encode_string(&hash);
assert_eq!(
    hex_hash,
    "8eaccdc136903c458ea0b1376be2a5fc9dc5b8ce8892a3b4f43366e2610c206c\
     a373816495e63db0fff2ff25f75aa7162f332c9f518c3036456502a8414d300a",
);

Also, see the examples section in the RustCrypto/hashes readme.

License

The crate is licensed under either of:

at your option.

Contribution

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.

Dependencies

~605KB
~16K SLoC