SHA3_256

Type Alias SHA3_256 

Source
pub type SHA3_256 = Keccak_Generic<136>;
Expand description

SHA-3-256 is one of the SHA-3 family members which is standard hash alogrithms. According to the descryption about Keccak:

  • The parameter L = 6
  • The parameter W = 2 ^ L (= 6) = 64 bits which means u64
  • The parameter B = 25 X W (=64) = 1600 bits (= 200 bytes) which is the whole size of the state, [[u64; 5]; 5]
  • The parameter C = 2 X output length (= 256) = 512 bits
  • The parameter R = B (= 1600) - C (= 512) = 1088 bits (= 136 bytes)
  • The number of Rounds is 12 + 2 X L (= 6) = 24 rounds

§Simple Example

use cryptocol::hash::SHA3_256;
let mut sha3 = SHA3_256::new();
sha3.absorb_str("");
let txt = sha3.get_hash_value_in_string();
println!("sha3 = {}", txt);
assert_eq!(txt, "A7FFC6F8BF1ED76651C14756A061D662F580FF4DE43B49FA82D80A4B80F8434A");

Aliased Type§

pub struct SHA3_256 { /* private fields */ }