pub struct Keccak { /* private fields */ }
Expand description
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§
Source§impl Keccak
impl Keccak
Sourcepub fn new(security: SecurityLevel, width: StateBitsWidth) -> Keccak
pub fn new(security: SecurityLevel, width: StateBitsWidth) -> Keccak
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
Auto Trait Implementations§
impl Freeze for Keccak
impl RefUnwindSafe for Keccak
impl Send for Keccak
impl Sync for Keccak
impl Unpin for Keccak
impl UnwindSafe for Keccak
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more