Struct snarkvm_gadgets::algorithms::encryption::ecies_poseidon::ECIESPoseidonEncryptionGadget
source · [−]pub struct ECIESPoseidonEncryptionGadget<TE: TwistedEdwardsParameters<BaseField = F>, F: PrimeField> where
TE::BaseField: PoseidonDefaultParametersField, { /* private fields */ }
Expand description
ECIES Poseidon encryption gadget
Trait Implementations
sourceimpl<TE: TwistedEdwardsParameters<BaseField = F>, F: PrimeField> AllocGadget<ECIESPoseidonEncryption<TE>, F> for ECIESPoseidonEncryptionGadget<TE, F> where
TE::BaseField: PoseidonDefaultParametersField,
impl<TE: TwistedEdwardsParameters<BaseField = F>, F: PrimeField> AllocGadget<ECIESPoseidonEncryption<TE>, F> for ECIESPoseidonEncryptionGadget<TE, F> where
TE::BaseField: PoseidonDefaultParametersField,
fn alloc_constant<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<ECIESPoseidonEncryption<TE>>, CS: ConstraintSystem<F>>(
_cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<ECIESPoseidonEncryption<TE>>, CS: ConstraintSystem<F>>(
_cs: CS,
_value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc_input<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<ECIESPoseidonEncryption<TE>>, CS: ConstraintSystem<F>>(
_cs: CS,
_value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc_checked<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<V>, CS: ConstraintSystem<F>>(
cs: CS,
f: Fn
) -> Result<Self, SynthesisError>
fn alloc_input_checked<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<V>, CS: ConstraintSystem<F>>(
cs: CS,
f: Fn
) -> Result<Self, SynthesisError>
sourceimpl<TE: TwistedEdwardsParameters<BaseField = F>, F: PrimeField> Clone for ECIESPoseidonEncryptionGadget<TE, F> where
TE::BaseField: PoseidonDefaultParametersField,
TE: TwistedEdwardsParameters<BaseField = F>,
F: PrimeField,
impl<TE: TwistedEdwardsParameters<BaseField = F>, F: PrimeField> Clone for ECIESPoseidonEncryptionGadget<TE, F> where
TE::BaseField: PoseidonDefaultParametersField,
TE: TwistedEdwardsParameters<BaseField = F>,
F: PrimeField,
sourceimpl<TE: TwistedEdwardsParameters<BaseField = F>, F: PrimeField> Debug for ECIESPoseidonEncryptionGadget<TE, F> where
TE::BaseField: PoseidonDefaultParametersField,
TE: TwistedEdwardsParameters<BaseField = F>,
F: PrimeField,
impl<TE: TwistedEdwardsParameters<BaseField = F>, F: PrimeField> Debug for ECIESPoseidonEncryptionGadget<TE, F> where
TE::BaseField: PoseidonDefaultParametersField,
TE: TwistedEdwardsParameters<BaseField = F>,
F: PrimeField,
sourceimpl<TE: TwistedEdwardsParameters<BaseField = F>, F: PrimeField + PoseidonDefaultParametersField> EncryptionGadget<ECIESPoseidonEncryption<TE>, F> for ECIESPoseidonEncryptionGadget<TE, F>
impl<TE: TwistedEdwardsParameters<BaseField = F>, F: PrimeField + PoseidonDefaultParametersField> EncryptionGadget<ECIESPoseidonEncryption<TE>, F> for ECIESPoseidonEncryptionGadget<TE, F>
sourcefn check_symmetric_key_commitment<CS: ConstraintSystem<TE::BaseField>>(
&self,
cs: CS,
symmetric_key: &Self::SymmetricKeyGadget
) -> Result<Self::SymmetricKeyCommitmentGadget, SynthesisError>
fn check_symmetric_key_commitment<CS: ConstraintSystem<TE::BaseField>>(
&self,
cs: CS,
symmetric_key: &Self::SymmetricKeyGadget
) -> Result<Self::SymmetricKeyCommitmentGadget, SynthesisError>
On input the symmetric key, outputs the symmetric key commitment.
sourcefn check_encryption_from_symmetric_key<CS: ConstraintSystem<F>>(
&self,
cs: CS,
symmetric_key: &Self::SymmetricKeyGadget,
plaintext: &[UInt8]
) -> Result<Vec<UInt8>, SynthesisError>
fn check_encryption_from_symmetric_key<CS: ConstraintSystem<F>>(
&self,
cs: CS,
symmetric_key: &Self::SymmetricKeyGadget,
plaintext: &[UInt8]
) -> Result<Vec<UInt8>, SynthesisError>
Assumes symmetric key is committed before hand. Otherwise, this allows the decrypter to open the ciphertext to any plaintext.
Returns
The ciphertext produced by this key.
type CiphertextRandomizer = ECIESPoseidonCiphertextRandomizerGadget<TE, F>
type PrivateKeyGadget = ECIESPoseidonEncryptionPrivateKeyGadget<TE, F>
type PublicKeyGadget = ECIESPoseidonEncryptionPublicKeyGadget<TE, F>
type ScalarRandomnessGadget = ECIESPoseidonEncryptionRandomnessGadget<TE>
type SymmetricKeyCommitmentGadget = FpGadget<F>
type SymmetricKeyGadget = ECIESPoseidonEncryptionSymmetricKeyGadget<TE, F>
fn check_public_key_gadget<CS: ConstraintSystem<TE::BaseField>>(
&self,
cs: CS,
private_key: &Self::PrivateKeyGadget
) -> Result<Self::PublicKeyGadget, SynthesisError>
fn check_encryption_from_scalar_randomness<CS: ConstraintSystem<F>>(
&self,
cs: CS,
randomness: &Self::ScalarRandomnessGadget,
public_key: &Self::PublicKeyGadget,
message: &[UInt8]
) -> Result<(Self::CiphertextRandomizer, Vec<UInt8>, Self::SymmetricKeyGadget), SynthesisError>
fn check_encryption_from_ciphertext_randomizer<CS: ConstraintSystem<F>>(
&self,
cs: CS,
ciphertext_randomizer: &Self::CiphertextRandomizer,
private_key: &Self::PrivateKeyGadget,
message: &[UInt8]
) -> Result<Vec<UInt8>, SynthesisError>
sourceimpl<TE: TwistedEdwardsParameters<BaseField = F>, F: PrimeField> PartialEq<ECIESPoseidonEncryptionGadget<TE, F>> for ECIESPoseidonEncryptionGadget<TE, F> where
TE::BaseField: PoseidonDefaultParametersField,
TE: TwistedEdwardsParameters<BaseField = F>,
F: PrimeField,
impl<TE: TwistedEdwardsParameters<BaseField = F>, F: PrimeField> PartialEq<ECIESPoseidonEncryptionGadget<TE, F>> for ECIESPoseidonEncryptionGadget<TE, F> where
TE::BaseField: PoseidonDefaultParametersField,
TE: TwistedEdwardsParameters<BaseField = F>,
F: PrimeField,
impl<TE: TwistedEdwardsParameters<BaseField = F>, F: PrimeField> Eq for ECIESPoseidonEncryptionGadget<TE, F> where
TE::BaseField: PoseidonDefaultParametersField,
TE: TwistedEdwardsParameters<BaseField = F>,
F: PrimeField,
Auto Trait Implementations
impl<TE, F> RefUnwindSafe for ECIESPoseidonEncryptionGadget<TE, F> where
F: RefUnwindSafe,
impl<TE, F> Send for ECIESPoseidonEncryptionGadget<TE, F>
impl<TE, F> Sync for ECIESPoseidonEncryptionGadget<TE, F>
impl<TE, F> Unpin for ECIESPoseidonEncryptionGadget<TE, F> where
F: Unpin,
impl<TE, F> UnwindSafe for ECIESPoseidonEncryptionGadget<TE, F> where
F: 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