Skip to main content

VerifiableOperations

Trait VerifiableOperations 

Source
pub trait VerifiableOperations {
    // Required methods
    fn fiat_shamir_challenge(&self, elements: &[&BigUint]) -> BigUint;
    fn prove_knowledge_of_dlog(
        &self,
        secret: &BigUint,
        base: &BigUint,
        result: &BigUint,
    ) -> ProofOfKnowledge;
    fn verify_knowledge_of_dlog(
        &self,
        proof: &ProofOfKnowledge,
        base: &BigUint,
        result: &BigUint,
    ) -> bool;
    fn encrypt_with_proof(
        &self,
        plaintext: &BigUint,
        randomness: Option<BigUint>,
    ) -> Result<(Ciphertext, ProofOfCorrectEncryption)>;
    fn verify_encryption_proof(
        &self,
        ciphertext: &Ciphertext,
        plaintext: &BigUint,
        proof: &ProofOfCorrectEncryption,
    ) -> bool;
    fn prove_ciphertext_equality(
        &self,
        ct1: &Ciphertext,
        ct2: &Ciphertext,
        randomness1: &BigUint,
        randomness2: &BigUint,
    ) -> Result<ProofOfEquality>;
    fn verify_equality_proof(
        &self,
        ct1: &Ciphertext,
        ct2: &Ciphertext,
        proof: &ProofOfEquality,
    ) -> bool;
    fn homomorphic_operation_with_proof(
        &self,
        ct1: &Ciphertext,
        ct2: &Ciphertext,
    ) -> Result<(Ciphertext, ProofOfCorrectOperation)>;
    fn verify_operation_proof(
        &self,
        ct1: &Ciphertext,
        ct2: &Ciphertext,
        result: &Ciphertext,
        proof: &ProofOfCorrectOperation,
    ) -> bool;
    fn rerandomize_with_proof(
        &self,
        ciphertext: &Ciphertext,
    ) -> Result<(Ciphertext, ProofOfReRandomization)>;
    fn verify_rerandomization_proof(
        &self,
        original: &Ciphertext,
        rerandomized: &Ciphertext,
        proof: &ProofOfReRandomization,
    ) -> bool;
}
Expand description

Trait for verifiable operations

Required Methods§

Source

fn fiat_shamir_challenge(&self, elements: &[&BigUint]) -> BigUint

Generate Fiat-Shamir challenge

Source

fn prove_knowledge_of_dlog( &self, secret: &BigUint, base: &BigUint, result: &BigUint, ) -> ProofOfKnowledge

Prove knowledge of discrete log

Source

fn verify_knowledge_of_dlog( &self, proof: &ProofOfKnowledge, base: &BigUint, result: &BigUint, ) -> bool

Verify proof of knowledge

Source

fn encrypt_with_proof( &self, plaintext: &BigUint, randomness: Option<BigUint>, ) -> Result<(Ciphertext, ProofOfCorrectEncryption)>

Encrypt with proof

Source

fn verify_encryption_proof( &self, ciphertext: &Ciphertext, plaintext: &BigUint, proof: &ProofOfCorrectEncryption, ) -> bool

Verify encryption proof

Source

fn prove_ciphertext_equality( &self, ct1: &Ciphertext, ct2: &Ciphertext, randomness1: &BigUint, randomness2: &BigUint, ) -> Result<ProofOfEquality>

Prove ciphertext equality

Source

fn verify_equality_proof( &self, ct1: &Ciphertext, ct2: &Ciphertext, proof: &ProofOfEquality, ) -> bool

Verify equality proof

Source

fn homomorphic_operation_with_proof( &self, ct1: &Ciphertext, ct2: &Ciphertext, ) -> Result<(Ciphertext, ProofOfCorrectOperation)>

Homomorphic operation with proof

Source

fn verify_operation_proof( &self, ct1: &Ciphertext, ct2: &Ciphertext, result: &Ciphertext, proof: &ProofOfCorrectOperation, ) -> bool

Verify operation proof

Source

fn rerandomize_with_proof( &self, ciphertext: &Ciphertext, ) -> Result<(Ciphertext, ProofOfReRandomization)>

Re-randomize with proof

Source

fn verify_rerandomization_proof( &self, original: &Ciphertext, rerandomized: &Ciphertext, proof: &ProofOfReRandomization, ) -> bool

Verify re-randomization proof

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§