Arithmetic: Homomorphic operations on ciphertexts

Description Usage Arguments Details Value Examples

Description

These special operations overload the standard behaviour of the arithmetic operations to work instead homomorphically on ciphertexts.

Usage

1
2
3
ct1 + ct2
ct1 - ct2
ct1 * ct2

Arguments

ct1,ct2

ciphertexts resulting from a call to enc

Details

Note that not all homomorphic encryption schemes will support all operations. Also, it is important to note that typically homomorphic operations cause an increase in the noise within a ciphertext. Once a certain number of operations have taken place the cipertext may no longer correctly decrypt. If a scheme is *fully* homomorphic, then it may be possible to apply a bootstrapping procedure which reduces the noise.

Value

A new ciphertext with the encrypted result of applying the operation to the messages held by the two original cipertexts.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
p <- pars("FandV")
keys <- keygen(p)
ct1 <- enc(keys$pk, 2)
ct2 <- enc(keys$pk, 3)
ctAdd <- ct1 + ct2
ctSub <- ct1 - ct2
ctMul <- ct1 * ct2

# Decrypt to 5, -1 and 6: the result of applying +, - and * to plain messages
dec(keys$sk, ctAdd)
dec(keys$sk, ctSub)
dec(keys$sk, ctMul)

iamtrask/R-Homomorphic-Encryption-Package documentation built on May 29, 2019, 2:56 p.m.