Struct tiny_keccak::Sha3 [−][src]
The SHA3
hash functions defined in FIPS-202
.
Usage
[dependencies]
tiny-keccak = { version = "2.0.0", features = ["sha3"] }
Example
let input = b"hello world"; let mut output = [0; 32]; let expected = b"\ \x64\x4b\xcc\x7e\x56\x43\x73\x04\x09\x99\xaa\xc8\x9e\x76\x22\xf3\ \xca\x71\xfb\xa1\xd9\x72\xfd\x94\xa3\x1c\x3b\xfb\xf2\x4e\x39\x38\ "; let mut sha3 = Sha3::v256(); sha3.update(input); sha3.finalize(&mut output); assert_eq!(expected, &output);
Implementations
impl Sha3
[src]
pub fn v224() -> Sha3
[src]
Creates new Sha3
hasher with a security level of 224 bits.
pub fn v256() -> Sha3
[src]
Creates new Sha3
hasher with a security level of 256 bits.
pub fn v384() -> Sha3
[src]
Creates new Sha3
hasher with a security level of 384 bits.
pub fn v512() -> Sha3
[src]
Creates new Sha3
hasher with a security level of 512 bits.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Sha3
impl Send for Sha3
impl Sync for Sha3
impl Unpin for Sha3
impl UnwindSafe for Sha3
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,