pub struct IntegerElGamalSK { /* private fields */ }Expand description
Decryption key for Integer-based ElGamal
Trait Implementations§
Source§impl DecryptionKey<IntegerElGamalPK> for IntegerElGamalSK
impl DecryptionKey<IntegerElGamalPK> for IntegerElGamalSK
Source§fn decrypt_raw(
&self,
public_key: &IntegerElGamalPK,
ciphertext: &IntegerElGamalCiphertext,
) -> UnsignedInteger
fn decrypt_raw( &self, public_key: &IntegerElGamalPK, ciphertext: &IntegerElGamalCiphertext, ) -> UnsignedInteger
Decrypts an ElGamal ciphertext using the secret key.
println!("The decrypted message is {}", secret_key.decrypt(&ciphertext));
// Prints: "The decrypted message is 5".Source§fn decrypt_identity_raw(
&self,
public_key: &IntegerElGamalPK,
ciphertext: &<IntegerElGamalPK as EncryptionKey>::Ciphertext,
) -> bool
fn decrypt_identity_raw( &self, public_key: &IntegerElGamalPK, ciphertext: &<IntegerElGamalPK as EncryptionKey>::Ciphertext, ) -> bool
Returns true if the encrypted value equals the identity. This is typically faster than a full decryption.
Source§fn decrypt<'pk>(
&self,
ciphertext: &AssociatedCiphertext<'pk, <PK as EncryptionKey>::Ciphertext, PK>,
) -> <PK as EncryptionKey>::Plaintext
fn decrypt<'pk>( &self, ciphertext: &AssociatedCiphertext<'pk, <PK as EncryptionKey>::Ciphertext, PK>, ) -> <PK as EncryptionKey>::Plaintext
Decrypt the associated ciphertext using the secret key.
Source§fn decrypt_identity<'pk>(
&self,
ciphertext: &AssociatedCiphertext<'pk, <PK as EncryptionKey>::Ciphertext, PK>,
) -> bool
fn decrypt_identity<'pk>( &self, ciphertext: &AssociatedCiphertext<'pk, <PK as EncryptionKey>::Ciphertext, PK>, ) -> bool
Returns true if the associated ciphertext encrypts the identity. This is typically faster than a full decryption.
Auto Trait Implementations§
impl Freeze for IntegerElGamalSK
impl RefUnwindSafe for IntegerElGamalSK
impl Send for IntegerElGamalSK
impl !Sync for IntegerElGamalSK
impl Unpin for IntegerElGamalSK
impl UnwindSafe for IntegerElGamalSK
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.