Struct keccak_rust::Keccak [−][src]
pub struct Keccak { /* fields omitted */ }
An implementation of keccak functions. The Keccak reference
.
Example
[dependencies]
keccak-rust = *
extern crate keccak_rust; use keccak_rust::*; const YOUR_INPUT_BYTES: [u8; 12] = [72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 33]; fn main() { let mut keccak = Keccak::new(SecurityLevel::SHA256, StateBitsWidth::F1600); keccak.append(&mut YOUR_INPUT_BYTES); println!("{:?}", keccak.hash()); }
Implementations
impl Keccak
[src]
impl Keccak
[src]pub fn new(security: SecurityLevel, width: StateBitsWidth) -> Keccak
[src]
Creates a new keccak state with a provided security level and state bits width.
Possible securities levels:
- SHA224 (224 bit)
- SHA256 (256 bit)
- SHA384 (384 bit)
- SHA512 (512 bit)
Possible state bits widths:
- f25
- f50
- f100
- f200
- f400
- f800
- f1600
pub fn append(&mut self, input: &BytesArr)
[src]
Appends input to current state
pub fn hash(&mut self) -> BytesVec
[src]
Returns keccak hash based on current state
Auto Trait Implementations
impl RefUnwindSafe for Keccak
impl RefUnwindSafe for Keccak
impl UnwindSafe for Keccak
impl UnwindSafe for Keccak