pub struct DecryptionKey<P>where
P: PkeParams,{
s_hat: NttVector<P::K>,
}Expand description
A DecryptionKey provides the ability to generate a new key pair, and decrypt an
encrypted value.
Fields§
§s_hat: NttVector<P::K>Implementations§
Source§impl<P> DecryptionKey<P>where
P: PkeParams,
impl<P> DecryptionKey<P>where
P: PkeParams,
Sourcepub fn generate(d: &B32) -> (Self, EncryptionKey<P>)
pub fn generate(d: &B32) -> (Self, EncryptionKey<P>)
Generate a new random decryption key according to the K-PKE.KeyGen procedure.
Sourcepub fn decrypt(
&self,
ciphertext: &Array<u8, <P as PkeParams>::CiphertextSize>,
) -> B32
pub fn decrypt( &self, ciphertext: &Array<u8, <P as PkeParams>::CiphertextSize>, ) -> B32
Decrypt ciphertext to obtain the encrypted value, according to the K-PKE.Decrypt procedure.
Sourcepub fn as_bytes(&self) -> Array<u8, <P as PkeParams>::NttVectorSize>
pub fn as_bytes(&self) -> Array<u8, <P as PkeParams>::NttVectorSize>
Represent this decryption key as a byte array (s_hat)
Sourcepub fn from_bytes(enc: &Array<u8, <P as PkeParams>::NttVectorSize>) -> Self
pub fn from_bytes(enc: &Array<u8, <P as PkeParams>::NttVectorSize>) -> Self
Parse an decryption key from a byte array (s_hat)
Trait Implementations§
Source§impl<P> Clone for DecryptionKey<P>
impl<P> Clone for DecryptionKey<P>
Source§fn clone(&self) -> DecryptionKey<P>
fn clone(&self) -> DecryptionKey<P>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<P> Debug for DecryptionKey<P>
impl<P> Debug for DecryptionKey<P>
Source§impl<P> Default for DecryptionKey<P>
impl<P> Default for DecryptionKey<P>
Source§fn default() -> DecryptionKey<P>
fn default() -> DecryptionKey<P>
Returns the “default value” for a type. Read more
Source§impl<P> PartialEq for DecryptionKey<P>
impl<P> PartialEq for DecryptionKey<P>
impl<P> StructuralPartialEq for DecryptionKey<P>where
P: PkeParams,
Auto Trait Implementations§
impl<P> Freeze for DecryptionKey<P>
impl<P> RefUnwindSafe for DecryptionKey<P>
impl<P> Send for DecryptionKey<P>
impl<P> Sync for DecryptionKey<P>
impl<P> Unpin for DecryptionKey<P>
impl<P> UnwindSafe for DecryptionKey<P>
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