pub struct SchmidtSamoaPrivateKey { /* private fields */ }Expand description
Private key for the Schmidt-Samoa primitive.
Implementations§
Source§impl SchmidtSamoaPrivateKey
impl SchmidtSamoaPrivateKey
Sourcepub fn decrypt_raw(&self, ciphertext: &BigUint) -> BigUint
pub fn decrypt_raw(&self, ciphertext: &BigUint) -> BigUint
Apply the raw private map c^d mod gamma.
This recovers the original message only for plaintexts represented in
the range [0, gamma).
Sourcepub fn decrypt(&self, ciphertext: &BigUint) -> Vec<u8> ⓘ
pub fn decrypt(&self, ciphertext: &BigUint) -> Vec<u8> ⓘ
Decrypt a ciphertext back into the big-endian byte string that was interpreted as the plaintext integer.
Sourcepub fn decrypt_bytes(&self, ciphertext: &[u8]) -> Option<Vec<u8>>
pub fn decrypt_bytes(&self, ciphertext: &[u8]) -> Option<Vec<u8>>
Decrypt a byte-encoded ciphertext produced by SchmidtSamoaPublicKey::encrypt_bytes.
Sourcepub fn to_key_blob(&self) -> Vec<u8> ⓘ
pub fn to_key_blob(&self) -> Vec<u8> ⓘ
Encode the private key in the crate-defined binary format.
Sourcepub fn from_key_blob(blob: &[u8]) -> Option<Self>
pub fn from_key_blob(blob: &[u8]) -> Option<Self>
Decode the private key from the crate-defined binary format.
Trait Implementations§
Source§impl Clone for SchmidtSamoaPrivateKey
impl Clone for SchmidtSamoaPrivateKey
Source§fn clone(&self) -> SchmidtSamoaPrivateKey
fn clone(&self) -> SchmidtSamoaPrivateKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SchmidtSamoaPrivateKey
impl Debug for SchmidtSamoaPrivateKey
Source§impl PartialEq for SchmidtSamoaPrivateKey
impl PartialEq for SchmidtSamoaPrivateKey
Source§fn eq(&self, other: &SchmidtSamoaPrivateKey) -> bool
fn eq(&self, other: &SchmidtSamoaPrivateKey) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for SchmidtSamoaPrivateKey
impl StructuralPartialEq for SchmidtSamoaPrivateKey
Auto Trait Implementations§
impl Freeze for SchmidtSamoaPrivateKey
impl RefUnwindSafe for SchmidtSamoaPrivateKey
impl Send for SchmidtSamoaPrivateKey
impl Sync for SchmidtSamoaPrivateKey
impl Unpin for SchmidtSamoaPrivateKey
impl UnsafeUnpin for SchmidtSamoaPrivateKey
impl UnwindSafe for SchmidtSamoaPrivateKey
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