pub(crate) struct KeyDerivationKey(Zeroizing<[u8; 32]>);Expand description
Key derivation key for one private key and ciphertext.
Tuple Fields§
§0: Zeroizing<[u8; 32]>Implementations§
Source§impl KeyDerivationKey
impl KeyDerivationKey
Sourcepub(crate) fn derive(d: &BoxedUint, k: usize, ciphertext: &[u8]) -> Result<Self>
pub(crate) fn derive(d: &BoxedUint, k: usize, ciphertext: &[u8]) -> Result<Self>
Computes HMAC-SHA256(SHA256(I2OSP(d, k)), ciphertext).
The caller must establish that d fits in k octets and that its storage precision is public.
Use the supplied private exponent, not a reconstructed equivalent exponent. The ciphertext must have passed the public length check.
Sourcepub(crate) fn alternative_message(
&self,
k: usize,
) -> Result<(Zeroizing<Vec<u8>>, u16)>
pub(crate) fn alternative_message( &self, k: usize, ) -> Result<(Zeroizing<Vec<u8>>, u16)>
Derives the full alternative message and its candidate suffix length.
Both the length and message remain secret until the caller selects the final result together with the real plaintext. Do not slice at this candidate length or expose it separately before that selection.
Auto Trait Implementations§
impl Freeze for KeyDerivationKey
impl RefUnwindSafe for KeyDerivationKey
impl Send for KeyDerivationKey
impl Sync for KeyDerivationKey
impl Unpin for KeyDerivationKey
impl UnsafeUnpin for KeyDerivationKey
impl UnwindSafe for KeyDerivationKey
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