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§
Sourcefn fiat_shamir_challenge(&self, elements: &[&BigUint]) -> BigUint
fn fiat_shamir_challenge(&self, elements: &[&BigUint]) -> BigUint
Generate Fiat-Shamir challenge
Sourcefn prove_knowledge_of_dlog(
&self,
secret: &BigUint,
base: &BigUint,
result: &BigUint,
) -> ProofOfKnowledge
fn prove_knowledge_of_dlog( &self, secret: &BigUint, base: &BigUint, result: &BigUint, ) -> ProofOfKnowledge
Prove knowledge of discrete log
Sourcefn verify_knowledge_of_dlog(
&self,
proof: &ProofOfKnowledge,
base: &BigUint,
result: &BigUint,
) -> bool
fn verify_knowledge_of_dlog( &self, proof: &ProofOfKnowledge, base: &BigUint, result: &BigUint, ) -> bool
Verify proof of knowledge
Sourcefn encrypt_with_proof(
&self,
plaintext: &BigUint,
randomness: Option<BigUint>,
) -> Result<(Ciphertext, ProofOfCorrectEncryption)>
fn encrypt_with_proof( &self, plaintext: &BigUint, randomness: Option<BigUint>, ) -> Result<(Ciphertext, ProofOfCorrectEncryption)>
Encrypt with proof
Sourcefn verify_encryption_proof(
&self,
ciphertext: &Ciphertext,
plaintext: &BigUint,
proof: &ProofOfCorrectEncryption,
) -> bool
fn verify_encryption_proof( &self, ciphertext: &Ciphertext, plaintext: &BigUint, proof: &ProofOfCorrectEncryption, ) -> bool
Verify encryption proof
Sourcefn prove_ciphertext_equality(
&self,
ct1: &Ciphertext,
ct2: &Ciphertext,
randomness1: &BigUint,
randomness2: &BigUint,
) -> Result<ProofOfEquality>
fn prove_ciphertext_equality( &self, ct1: &Ciphertext, ct2: &Ciphertext, randomness1: &BigUint, randomness2: &BigUint, ) -> Result<ProofOfEquality>
Prove ciphertext equality
Sourcefn verify_equality_proof(
&self,
ct1: &Ciphertext,
ct2: &Ciphertext,
proof: &ProofOfEquality,
) -> bool
fn verify_equality_proof( &self, ct1: &Ciphertext, ct2: &Ciphertext, proof: &ProofOfEquality, ) -> bool
Verify equality proof
Sourcefn homomorphic_operation_with_proof(
&self,
ct1: &Ciphertext,
ct2: &Ciphertext,
) -> Result<(Ciphertext, ProofOfCorrectOperation)>
fn homomorphic_operation_with_proof( &self, ct1: &Ciphertext, ct2: &Ciphertext, ) -> Result<(Ciphertext, ProofOfCorrectOperation)>
Homomorphic operation with proof
Sourcefn verify_operation_proof(
&self,
ct1: &Ciphertext,
ct2: &Ciphertext,
result: &Ciphertext,
proof: &ProofOfCorrectOperation,
) -> bool
fn verify_operation_proof( &self, ct1: &Ciphertext, ct2: &Ciphertext, result: &Ciphertext, proof: &ProofOfCorrectOperation, ) -> bool
Verify operation proof
Sourcefn rerandomize_with_proof(
&self,
ciphertext: &Ciphertext,
) -> Result<(Ciphertext, ProofOfReRandomization)>
fn rerandomize_with_proof( &self, ciphertext: &Ciphertext, ) -> Result<(Ciphertext, ProofOfReRandomization)>
Re-randomize with proof
Sourcefn verify_rerandomization_proof(
&self,
original: &Ciphertext,
rerandomized: &Ciphertext,
proof: &ProofOfReRandomization,
) -> bool
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".