Struct libpaillier::DecryptionKey
source · pub struct DecryptionKey { /* private fields */ }
Expand description
A Paillier decryption key
Implementations§
source§impl DecryptionKey
impl DecryptionKey
sourcepub fn with_primes(p: &BigNumber, q: &BigNumber) -> Option<Self>
pub fn with_primes(p: &BigNumber, q: &BigNumber) -> Option<Self>
Create a new key from two primes.
p
and q
are checked if prime
sourcepub fn with_primes_unchecked(p: &BigNumber, q: &BigNumber) -> Option<Self>
pub fn with_primes_unchecked(p: &BigNumber, q: &BigNumber) -> Option<Self>
Create a new key from two safe primes,
p
and q
are not checked to see if they are safe primes
sourcepub fn to_bytes(&self) -> Vec<u8>
pub fn to_bytes(&self) -> Vec<u8>
Get this key’s byte representation.
This measures about (n * 4) + 4 bytes or i.e. for a 2048 bit modulus == 1032 bytes.
Trait Implementations§
source§impl Clone for DecryptionKey
impl Clone for DecryptionKey
source§fn clone(&self) -> DecryptionKey
fn clone(&self) -> DecryptionKey
Returns a copy 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 Debug for DecryptionKey
impl Debug for DecryptionKey
source§impl<'de> Deserialize<'de> for DecryptionKey
impl<'de> Deserialize<'de> for DecryptionKey
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<&DecryptionKey> for EncryptionKey
impl From<&DecryptionKey> for EncryptionKey
source§fn from(sk: &DecryptionKey) -> EncryptionKey
fn from(sk: &DecryptionKey) -> EncryptionKey
Converts to this type from the input type.
source§impl Serialize for DecryptionKey
impl Serialize for DecryptionKey
Auto Trait Implementations§
impl RefUnwindSafe for DecryptionKey
impl Send for DecryptionKey
impl Sync for DecryptionKey
impl Unpin for DecryptionKey
impl UnwindSafe for DecryptionKey
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