Trait scicrypt_traits::cryptosystems::DecryptionKey
source · [−]pub trait DecryptionKey<PK: EncryptionKey> {
fn decrypt_raw(
&self,
public_key: &PK,
ciphertext: &PK::Ciphertext
) -> PK::Plaintext;
fn decrypt_identity_raw(
&self,
public_key: &PK,
ciphertext: &PK::Ciphertext
) -> bool;
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
sourcefn decrypt_raw(
&self,
public_key: &PK,
ciphertext: &PK::Ciphertext
) -> PK::Plaintext
fn decrypt_raw(
&self,
public_key: &PK,
ciphertext: &PK::Ciphertext
) -> PK::Plaintext
Decrypt the ciphertext using the secret key and its related public key.
sourcefn decrypt_identity_raw(
&self,
public_key: &PK,
ciphertext: &PK::Ciphertext
) -> bool
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
sourcefn decrypt<'pk>(
&self,
ciphertext: &AssociatedCiphertext<'pk, PK::Ciphertext, PK>
) -> PK::Plaintext
fn decrypt<'pk>(
&self,
ciphertext: &AssociatedCiphertext<'pk, PK::Ciphertext, PK>
) -> PK::Plaintext
Decrypt the associated ciphertext using the secret key.
sourcefn decrypt_identity<'pk>(
&self,
ciphertext: &AssociatedCiphertext<'pk, PK::Ciphertext, PK>
) -> bool
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.