[][src]Crate groestl

An implementation of the Grøstl cryptographic hash function.

Usage

Groestl can produce a digest of any size between 1 and 64 bytes inclusive. This crate defines the common digest sizes (Groestl224, Groestl256, Groestl384, and Groestl512), but allows you to specify a custom size with the GroestlSmall and GroestlBig structs. GroestlSmall allows you to specify a digest size between 1 and 32 inclusive, and GroestlBig allows you to specify a digest size between 33 and 64 inclusive.

use groestl::{Digest, Groestl256};
use hex_literal::hex;

// create a Groestl-256 hasher instance
let mut hasher = Groestl256::default();

// process input message
hasher.update(b"my message");

// acquire hash digest in the form of GenericArray,
// which in this case is equivalent to [u8; 32]
let result = hasher.finalize();
assert_eq!(result[..], hex!("
    dc0283ca481efa76b7c19dd5a0b763dff0e867451bd9488a9c59f6c8b8047a86
"));

Also see RustCrypto/hashes readme.

Re-exports

pub use digest;

Structs

Groestl224
Groestl256
Groestl384
Groestl512
GroestlBig
GroestlSmall

Traits

Digest

The Digest trait specifies an interface common for digest functions.