EncryptionKey

Trait EncryptionKey 

Source
pub trait EncryptionKey<P>: Key<P> {
    // Required methods
    fn encrypt_with_nonce(
        &self,
        plaintext: &P,
        nonce: &Self::Nonce,
    ) -> Self::Ciphertext;
    fn encrypt<R: CryptoRng + ?Sized>(
        &self,
        plaintext: &P,
        rng: &mut R,
    ) -> (Self::Ciphertext, Self::Nonce);
}

Required Methods§

Source

fn encrypt_with_nonce( &self, plaintext: &P, nonce: &Self::Nonce, ) -> Self::Ciphertext

Source

fn encrypt<R: CryptoRng + ?Sized>( &self, plaintext: &P, rng: &mut R, ) -> (Self::Ciphertext, Self::Nonce)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<const S: usize, const S_UNSAT: usize, const D: usize, const D_UNSAT: usize, const Q: usize> EncryptionKey<Uint<S>> for PublicKey<S, D>
where Uint<S>: Concat<Output = Uint<D>>, Odd<Uint<S>>: PrecomputeInverter<Inverter = SafeGcdInverter<S, S_UNSAT>>, Uint<D>: Split<Output = Uint<S>> + Concat<Output = Uint<Q>>, Odd<Uint<D>>: PrecomputeInverter<Inverter = SafeGcdInverter<D, D_UNSAT>>, Uint<Q>: Split<Output = Uint<D>>,