Trait cosmian_crypto_core::EciesStream

source ·
pub trait EciesStream<const PRIVATE_KEY_LENGTH: usize, const PUBLIC_KEY_LENGTH: usize, PublicKey: EciesEcPublicKey<PRIVATE_KEY_LENGTH, PUBLIC_KEY_LENGTH>, RustCryptoBackend>
where RustCryptoBackend: AeadInPlace + KeyInit, <RustCryptoBackend as AeadCore>::NonceSize: Sub<U5> + Sub<U4>, <<RustCryptoBackend as AeadCore>::NonceSize as Sub<U5>>::Output: ArrayLength<u8>, <<RustCryptoBackend as AeadCore>::NonceSize as Sub<U4>>::Output: ArrayLength<u8>,
{ // Required methods fn get_dem_encryptor_be32<R: CryptoRngCore>( rng: &mut R, recipient_public_key: &PublicKey, ) -> Result<(PublicKey, EncryptorBE32<RustCryptoBackend>), CryptoCoreError>; fn get_dem_encryptor_le31<R: CryptoRngCore>( rng: &mut R, recipient_public_key: &PublicKey, ) -> Result<(PublicKey, EncryptorLE31<RustCryptoBackend>), CryptoCoreError>; fn get_dem_decryptor_be32( recipient_private_key: &PublicKey::PrivateKey, ephemeral_public_key: &PublicKey, ) -> Result<DecryptorBE32<RustCryptoBackend>, CryptoCoreError>; fn get_dem_decryptor_le31( recipient_private_key: &PublicKey::PrivateKey, ephemeral_public_key: &PublicKey, ) -> Result<DecryptorLE31<RustCryptoBackend>, CryptoCoreError>; }
Expand description

Trait for ECIES stream cipher.

The EciesStream trait provides methods for creating encryptors and decryptors that work with streams of data.

§Type Parameters

  • PrivateKey: the type representing a private key.
  • PublicKey: the type representing a public key.
  • RustCryptoBackend: the RustCrypto symmetric cryptographic backend used to perform operations.

Required Methods§

source

fn get_dem_encryptor_be32<R: CryptoRngCore>( rng: &mut R, recipient_public_key: &PublicKey, ) -> Result<(PublicKey, EncryptorBE32<RustCryptoBackend>), CryptoCoreError>

Creates a EncryptorBE32 using the given public key.

source

fn get_dem_encryptor_le31<R: CryptoRngCore>( rng: &mut R, recipient_public_key: &PublicKey, ) -> Result<(PublicKey, EncryptorLE31<RustCryptoBackend>), CryptoCoreError>

Creates a EncryptorLE31 using the given public key.

source

fn get_dem_decryptor_be32( recipient_private_key: &PublicKey::PrivateKey, ephemeral_public_key: &PublicKey, ) -> Result<DecryptorBE32<RustCryptoBackend>, CryptoCoreError>

Creates a DecryptorBE32 using the given private key.

source

fn get_dem_decryptor_le31( recipient_private_key: &PublicKey::PrivateKey, ephemeral_public_key: &PublicKey, ) -> Result<DecryptorLE31<RustCryptoBackend>, CryptoCoreError>

Creates a DecryptorLE31 using the given private key.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl EciesStream<CURVE_25519_SECRET_LENGTH, X25519_PUBLIC_KEY_LENGTH, X25519CurvePoint, ChaChaPoly1305<StreamCipherCoreWrapper<XChaChaCore<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>>, UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>, B0>>> for EciesX25519XChaCha20

source§

impl<const PRIVATE_KEY_LENGTH: usize, const PUBLIC_KEY_LENGTH: usize, PublicKey: EciesEcPublicKey<PRIVATE_KEY_LENGTH, PUBLIC_KEY_LENGTH>> EciesStream<PRIVATE_KEY_LENGTH, PUBLIC_KEY_LENGTH, PublicKey, AesGcm<Aes128, UInt<UInt<UInt<UInt<UTerm, B1>, B1>, B0>, B0>>> for EciesAes128<PRIVATE_KEY_LENGTH, PUBLIC_KEY_LENGTH, PublicKey>