[][src]Struct win_crypto_ng::hash::HashAlgorithm

pub struct HashAlgorithm<Kind: AlgorithmKind> { /* fields omitted */ }

Hashing algorithm

Implementations

impl<Kind: AlgorithmKind> HashAlgorithm<Kind>[src]

pub fn open(id: Kind) -> Result<Self>[src]

Open a hash algorithm provider

Examples

let algo = HashAlgorithm::open(HashAlgorithmId::Sha256);

assert!(algo.is_ok());

impl HashAlgorithm<HashAlgorithmId>[src]

pub fn new_hash(&self) -> Result<Hash>[src]

Creates a new hash from the algorithm

impl HashAlgorithm<MacAlgorithmId>[src]

pub fn new_mac(&self, secret: &[u8], iv: Option<&[u8]>) -> Result<Hash>[src]

Creates a new Message Authentication Code (MAC), if supported by the backing algorithm (AES-GMAC/AES-CMAC).

Passing IV is required for GMAC mode, otherwise don't pass it for OMAC.

Auto Trait Implementations

impl<Kind> RefUnwindSafe for HashAlgorithm<Kind> where
    Kind: RefUnwindSafe

impl<Kind> Send for HashAlgorithm<Kind> where
    Kind: Send

impl<Kind> !Sync for HashAlgorithm<Kind>

impl<Kind> Unpin for HashAlgorithm<Kind> where
    Kind: Unpin

impl<Kind> UnwindSafe for HashAlgorithm<Kind> where
    Kind: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.