[][src]Crate cryptonight_hash

An implementation of the CryptoNight digest algorithm.

Usage

use cryptonight_hash::{CryptoNight, Digest};

// Create the CryptoNight hasher
let mut hasher = CryptoNight::new();

// Input some data into the hasher
hasher.input(b"This is ");

// Insert more data as needed.
hasher.input("a test");

// Finalize the result. This will temporary allocate a 2MB buffer.
let result = hasher.result();

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

Be sure to refer to the RustCrypto/hashes readme for more more information about the Digest traits.

Structs

CryptoNight

CryptoNight version 0 implementation.

Traits

BlockInput

Trait to indicate that digest function processes data in blocks of size BlockSize.

Digest

The Digest trait specifies an interface common for digest functions.

FixedOutput

Trait for returning digest result with the fixed size

Input

Trait for processing input data

Reset

Trait for resetting hash instances