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
: theRustCrypto
symmetric cryptographic backend used to perform operations.
Required Methods§
sourcefn get_dem_encryptor_be32<R: CryptoRngCore>(
rng: &mut R,
recipient_public_key: &PublicKey,
) -> Result<(PublicKey, EncryptorBE32<RustCryptoBackend>), CryptoCoreError>
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.
sourcefn get_dem_encryptor_le31<R: CryptoRngCore>(
rng: &mut R,
recipient_public_key: &PublicKey,
) -> Result<(PublicKey, EncryptorLE31<RustCryptoBackend>), CryptoCoreError>
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.
sourcefn get_dem_decryptor_be32(
recipient_private_key: &PublicKey::PrivateKey,
ephemeral_public_key: &PublicKey,
) -> Result<DecryptorBE32<RustCryptoBackend>, CryptoCoreError>
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.
sourcefn get_dem_decryptor_le31(
recipient_private_key: &PublicKey::PrivateKey,
ephemeral_public_key: &PublicKey,
) -> Result<DecryptorLE31<RustCryptoBackend>, CryptoCoreError>
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.