Struct hkdf::HkdfExtract [−][src]
pub struct HkdfExtract<D> where
D: Update + BlockInput + FixedOutput + Reset + Default + Clone,
D::BlockSize: ArrayLength<u8>,
D::OutputSize: ArrayLength<u8>, { /* fields omitted */ }Structure representing the streaming context of an HKDF-Extract operation
let mut extract_ctx = HkdfExtract::<Sha256>::new(Some(b"mysalt")); extract_ctx.input_ikm(b"hello"); extract_ctx.input_ikm(b" world"); let (streamed_res, _) = extract_ctx.finalize(); let (oneshot_res, _) = Hkdf::<Sha256>::extract(Some(b"mysalt"), b"hello world"); assert_eq!(streamed_res, oneshot_res);
Implementations
impl<D> HkdfExtract<D> where
D: Update + BlockInput + FixedOutput + Reset + Default + Clone,
D::BlockSize: ArrayLength<u8>,
D::OutputSize: ArrayLength<u8>, [src]
impl<D> HkdfExtract<D> where
D: Update + BlockInput + FixedOutput + Reset + Default + Clone,
D::BlockSize: ArrayLength<u8>,
D::OutputSize: ArrayLength<u8>, [src]pub fn new(salt: Option<&[u8]>) -> HkdfExtract<D>[src]
Initiates the HKDF-Extract context with the given optional salt
pub fn input_ikm(&mut self, ikm: &[u8])[src]
Feeds in additional input key material to the HKDF-Extract context
pub fn finalize(self) -> (GenericArray<u8, D::OutputSize>, Hkdf<D>)[src]
Completes the HKDF-Extract operation, returning both the generated pseudorandom key and
Hkdf struct for expanding.
Trait Implementations
impl<D: Clone> Clone for HkdfExtract<D> where
D: Update + BlockInput + FixedOutput + Reset + Default + Clone,
D::BlockSize: ArrayLength<u8>,
D::OutputSize: ArrayLength<u8>, [src]
impl<D: Clone> Clone for HkdfExtract<D> where
D: Update + BlockInput + FixedOutput + Reset + Default + Clone,
D::BlockSize: ArrayLength<u8>,
D::OutputSize: ArrayLength<u8>, [src]fn clone(&self) -> HkdfExtract<D>[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
Auto Trait Implementations
impl<D> RefUnwindSafe for HkdfExtract<D> where
D: RefUnwindSafe,
<<D as BlockInput>::BlockSize as ArrayLength<u8>>::ArrayType: RefUnwindSafe,
impl<D> RefUnwindSafe for HkdfExtract<D> where
D: RefUnwindSafe,
<<D as BlockInput>::BlockSize as ArrayLength<u8>>::ArrayType: RefUnwindSafe, impl<D> Send for HkdfExtract<D> where
D: Send,
impl<D> Send for HkdfExtract<D> where
D: Send, impl<D> Sync for HkdfExtract<D> where
D: Sync,
impl<D> Sync for HkdfExtract<D> where
D: Sync, impl<D> Unpin for HkdfExtract<D> where
D: Unpin,
<<D as BlockInput>::BlockSize as ArrayLength<u8>>::ArrayType: Unpin,
impl<D> Unpin for HkdfExtract<D> where
D: Unpin,
<<D as BlockInput>::BlockSize as ArrayLength<u8>>::ArrayType: Unpin, impl<D> UnwindSafe for HkdfExtract<D> where
D: UnwindSafe,
<<D as BlockInput>::BlockSize as ArrayLength<u8>>::ArrayType: UnwindSafe,
impl<D> UnwindSafe for HkdfExtract<D> where
D: UnwindSafe,
<<D as BlockInput>::BlockSize as ArrayLength<u8>>::ArrayType: UnwindSafe,