pub trait HomomorphicAddition: EncryptionKey {
fn add(
&self,
ciphertext_a: &Self::Ciphertext,
ciphertext_b: &Self::Ciphertext
) -> Self::Ciphertext;
fn sub(
&self,
ciphertext_a: &Self::Ciphertext,
ciphertext_b: &Self::Ciphertext
) -> Self::Ciphertext;
fn mul_constant(
&self,
ciphertext: &Self::Ciphertext,
input: &Self::Input
) -> Self::Ciphertext;
fn add_constant(
&self,
ciphertext: &Self::Ciphertext,
constant: &Self::Plaintext
) -> Self::Ciphertext;
fn sub_constant(
&self,
ciphertext: &Self::Ciphertext,
constant: &Self::Plaintext
) -> Self::Ciphertext;
}
Expand description
Trait implemented by additively homomorphic cryptosystems
Required Methods
sourcefn add(
&self,
ciphertext_a: &Self::Ciphertext,
ciphertext_b: &Self::Ciphertext
) -> Self::Ciphertext
fn add(
&self,
ciphertext_a: &Self::Ciphertext,
ciphertext_b: &Self::Ciphertext
) -> Self::Ciphertext
Combines two ciphertexts so that their decrypted value reflects some addition operation
sourcefn sub(
&self,
ciphertext_a: &Self::Ciphertext,
ciphertext_b: &Self::Ciphertext
) -> Self::Ciphertext
fn sub(
&self,
ciphertext_a: &Self::Ciphertext,
ciphertext_b: &Self::Ciphertext
) -> Self::Ciphertext
Combines two ciphertexts so that their decrypted value reflects some subtract operation
sourcefn mul_constant(
&self,
ciphertext: &Self::Ciphertext,
input: &Self::Input
) -> Self::Ciphertext
fn mul_constant(
&self,
ciphertext: &Self::Ciphertext,
input: &Self::Input
) -> Self::Ciphertext
Applies some operation on a ciphertext so that the decrypted value reflects some multiplication with input
sourcefn add_constant(
&self,
ciphertext: &Self::Ciphertext,
constant: &Self::Plaintext
) -> Self::Ciphertext
fn add_constant(
&self,
ciphertext: &Self::Ciphertext,
constant: &Self::Plaintext
) -> Self::Ciphertext
Combines two ciphertexts so that their decrypted value reflects some addition operation with a constant
sourcefn sub_constant(
&self,
ciphertext: &Self::Ciphertext,
constant: &Self::Plaintext
) -> Self::Ciphertext
fn sub_constant(
&self,
ciphertext: &Self::Ciphertext,
constant: &Self::Plaintext
) -> Self::Ciphertext
Combines two ciphertexts so that their decrypted value reflects some subtract operation with a constant