Skip to main content

DecryptionKey

Trait DecryptionKey 

Source
pub trait DecryptionKey<PK: EncryptionKey> {
    // Required methods
    fn decrypt_raw(
        &self,
        public_key: &PK,
        ciphertext: &PK::Ciphertext,
    ) -> PK::Plaintext;
    fn decrypt_identity_raw(
        &self,
        public_key: &PK,
        ciphertext: &PK::Ciphertext,
    ) -> bool;

    // Provided methods
    fn decrypt<'pk>(
        &self,
        ciphertext: &AssociatedCiphertext<'pk, PK::Ciphertext, PK>,
    ) -> PK::Plaintext { ... }
    fn decrypt_identity<'pk>(
        &self,
        ciphertext: &AssociatedCiphertext<'pk, PK::Ciphertext, PK>,
    ) -> bool { ... }
}
Expand description

The decryption key.

Required Methods§

Source

fn decrypt_raw( &self, public_key: &PK, ciphertext: &PK::Ciphertext, ) -> PK::Plaintext

Decrypt the ciphertext using the secret key and its related public key.

Source

fn decrypt_identity_raw( &self, public_key: &PK, ciphertext: &PK::Ciphertext, ) -> bool

Returns true if the encrypted value equals the identity. This is typically faster than a full decryption.

Provided Methods§

Source

fn decrypt<'pk>( &self, ciphertext: &AssociatedCiphertext<'pk, PK::Ciphertext, PK>, ) -> PK::Plaintext

Decrypt the associated ciphertext using the secret key.

Source

fn decrypt_identity<'pk>( &self, ciphertext: &AssociatedCiphertext<'pk, PK::Ciphertext, PK>, ) -> bool

Returns true if the associated ciphertext encrypts the identity. This is typically faster than a full decryption.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§