Crate jh

source ·
Expand description

Implementation of the JH cryptographic hash function.

There are 4 standard versions of the JH hash function:

Examples

Hash functionality is usually accessed via the Digest trait:

use hex_literal::hex;
use jh::{Digest, Jh256};

// create a JH-256 object
let mut hasher = Jh256::new();

// write input message
hasher.update(b"hello");

// read hash digest
let result = hasher.finalize();

let expected = hex!("94fd3f4c564957c6754265676bf8b244c707d3ffb294e18af1f2e4f9b8306089");
assert_eq!(result[..], expected[..]);

Also see RustCrypto/hashes readme.

Re-exports

  • pub use compressor::f8_impl;
  • pub use digest;

Structs

Traits

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

Type Definitions