pub struct ECIESPoseidonEncryption<TE: TwistedEdwardsParameters> where
TE::BaseField: PoseidonDefaultParametersField, { /* private fields */ }
Trait Implementations
sourceimpl<TE: TwistedEdwardsParameters> Clone for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
TE: TwistedEdwardsParameters,
impl<TE: TwistedEdwardsParameters> Clone for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
TE: TwistedEdwardsParameters,
sourceimpl<TE: TwistedEdwardsParameters> Debug for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
TE: TwistedEdwardsParameters,
impl<TE: TwistedEdwardsParameters> Debug for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
TE: TwistedEdwardsParameters,
sourceimpl<TE: TwistedEdwardsParameters> EncryptionScheme for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
impl<TE: TwistedEdwardsParameters> EncryptionScheme for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
sourcefn generate_asymmetric_key<R: Rng + CryptoRng>(
&self,
public_key: &Self::PublicKey,
rng: &mut R
) -> (Self::ScalarRandomness, Self::CiphertextRandomizer, Self::SymmetricKey)
fn generate_asymmetric_key<R: Rng + CryptoRng>(
&self,
public_key: &Self::PublicKey,
rng: &mut R
) -> (Self::ScalarRandomness, Self::CiphertextRandomizer, Self::SymmetricKey)
Given an RNG, returns the following:
ⓘ
randomness := r
ciphertext_randomizer := G^r
symmetric_key := public_key^r == G^ar
sourcefn generate_symmetric_key(
&self,
private_key: &<Self as EncryptionScheme>::PrivateKey,
ciphertext_randomizer: Self::CiphertextRandomizer
) -> Option<Self::SymmetricKey>
fn generate_symmetric_key(
&self,
private_key: &<Self as EncryptionScheme>::PrivateKey,
ciphertext_randomizer: Self::CiphertextRandomizer
) -> Option<Self::SymmetricKey>
Given the private key and ciphertext randomizer, return the following:
ⓘ
symmetric_key := public_key^r == (G^r)^private_key
sourcefn generate_symmetric_key_commitment(
&self,
symmetric_key: &Self::SymmetricKey
) -> Self::SymmetricKeyCommitment
fn generate_symmetric_key_commitment(
&self,
symmetric_key: &Self::SymmetricKey
) -> Self::SymmetricKeyCommitment
Given the symmetric key, return the following:
ⓘ
symmetric_key_commitment := H(public_key^r) == H((G^r)^private_key)
sourcefn encrypt(
&self,
symmetric_key: &Self::SymmetricKey,
message: &[u8]
) -> Result<Vec<u8>, EncryptionError>
fn encrypt(
&self,
symmetric_key: &Self::SymmetricKey,
message: &[u8]
) -> Result<Vec<u8>, EncryptionError>
Encrypts the given message, and returns the following:
ⓘ
ciphertext := to_bytes_le![C_1, ..., C_n], where C_i := R_i + M_i, and R_i := H_i(G^ar)
sourcefn decrypt(
&self,
symmetric_key: &Self::SymmetricKey,
ciphertext: &[u8]
) -> Result<Vec<u8>, EncryptionError>
fn decrypt(
&self,
symmetric_key: &Self::SymmetricKey,
ciphertext: &[u8]
) -> Result<Vec<u8>, EncryptionError>
Decrypts the given ciphertext with the given symmetric key.
type CiphertextRandomizer = TE::BaseField
type Parameters = TEAffine<TE>
type PrivateKey = TE::ScalarField
type PublicKey = TEAffine<TE>
type ScalarRandomness = TE::ScalarField
type SymmetricKey = TE::BaseField
type SymmetricKeyCommitment = TE::BaseField
fn setup(message: &str) -> Self
fn generate_private_key<R: Rng + CryptoRng>(
&self,
rng: &mut R
) -> Self::PrivateKey
fn generate_public_key(&self, private_key: &Self::PrivateKey) -> Self::PublicKey
fn parameters(&self) -> &<Self as EncryptionScheme>::Parameters
fn private_key_size_in_bits() -> usize
sourceimpl<TE: TwistedEdwardsParameters> From<Affine<TE>> for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
impl<TE: TwistedEdwardsParameters> From<Affine<TE>> for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
sourceimpl<TE: TwistedEdwardsParameters> FromBytes for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
impl<TE: TwistedEdwardsParameters> FromBytes for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
sourceimpl<TE: TwistedEdwardsParameters> PartialEq<ECIESPoseidonEncryption<TE>> for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
TE: TwistedEdwardsParameters,
impl<TE: TwistedEdwardsParameters> PartialEq<ECIESPoseidonEncryption<TE>> for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
TE: TwistedEdwardsParameters,
sourceimpl<TE: TwistedEdwardsParameters> ToBytes for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
impl<TE: TwistedEdwardsParameters> ToBytes for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
sourceimpl<TE: TwistedEdwardsParameters> ToConstraintField<<TE as ModelParameters>::BaseField> for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
impl<TE: TwistedEdwardsParameters> ToConstraintField<<TE as ModelParameters>::BaseField> for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
fn to_field_elements(&self) -> Result<Vec<TE::BaseField>, ConstraintFieldError>
impl<TE: TwistedEdwardsParameters> Eq for ECIESPoseidonEncryption<TE> where
TE::BaseField: PoseidonDefaultParametersField,
TE: TwistedEdwardsParameters,
Auto Trait Implementations
impl<TE> RefUnwindSafe for ECIESPoseidonEncryption<TE> where
<TE as ModelParameters>::BaseField: RefUnwindSafe,
impl<TE> Send for ECIESPoseidonEncryption<TE>
impl<TE> Sync for ECIESPoseidonEncryption<TE>
impl<TE> Unpin for ECIESPoseidonEncryption<TE> where
<TE as ModelParameters>::BaseField: Unpin,
impl<TE> UnwindSafe for ECIESPoseidonEncryption<TE> where
<TE as ModelParameters>::BaseField: UnwindSafe + RefUnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more