logo

Crate fsb

source · []
Expand description

An implementation of the FSB cryptographic hash algorithms. The FSB hash function was one of the submissions to SHA-3, the cryptographic hash algorithm competition organized by the NIST.

There are 5 standard versions of the FSB hash function:

  • FSB-160
  • FSB-224
  • FSB-256
  • FSB-384
  • FSB-512

Examples

Output size of FSB-256 is fixed, so its functionality is usually accessed via the Digest trait:

use hex_literal::hex;
use fsb::{Digest, Fsb256};

// create a FSB-256 object
let mut hasher = Fsb256::new();

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

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

assert_eq!(result[..], hex!("
    0f036dc3761aed2cba9de586a85976eedde6fa8f115c0190763decc02f28edbc
")[..]);

Also see RustCrypto/hashes readme.

Re-exports

pub use digest;

Structs

Core FSB-160 hasher state

Core FSB-224 hasher state

Core FSB-256 hasher state

Core FSB-384 hasher state

Core FSB-512 hasher state

Traits

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

Type Definitions

FSB-160 hasher state

FSB-224 hasher state

FSB-256 hasher state

FSB-384 hasher state

FSB-512 hasher state