Thanks to visit codestin.com
Credit goes to docs.rs

Crate whirlpool

Crate whirlpool 

Source
Expand description

An 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 http://www.larc.usp.br/~pbarreto/WhirlpoolPage.html.

§Usage

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

// create a hasher object, to use it do not forget to import `Digest` trait
let mut hasher = Whirlpool::new();
// write input message
hasher.update(b"Hello Whirlpool");
// read hash digest (it will consume hasher)
let result = hasher.finalize();

assert_eq!(result[..], hex!("
    8eaccdc136903c458ea0b1376be2a5fc9dc5b8ce8892a3b4f43366e2610c206c
    a373816495e63db0fff2ff25f75aa7162f332c9f518c3036456502a8414d300a
")[..]);

Also see RustCrypto/hashes readme.

Re-exports§

pub use digest;

Structs§

WhirlpoolCore
Core Whirlpool hasher state.

Traits§

Digest
Convenience wrapper trait covering functionality of cryptographic hash functions with fixed output size.

Type Aliases§

Whirlpool
Whirlpool hasher state.