| PaillierPublicKey | R Documentation |
Construct a Paillier public key with the given modulus.
Construct a Paillier public key with the given modulus.
An R6::R6Class() generator object
bitsthe number of bits in the modulus
nthe modulus
nSquaredthe square of the modulus
nPlusOneone more than the modulus
new()Create a new public key and precompute some internal values for efficiency
PaillierPublicKey$new(bits, n)
bitsnumber of bits to use
nthe modulus to use
a new PaillierPublicKey object
encrypt()Encrypt a message
PaillierPublicKey$encrypt(m)
mthe message
the encrypted message
add()Add two encrypted messages
PaillierPublicKey$add(a, b)
aa message
banother message
the sum of a and b
sub()Subtract one encrypted message from another
PaillierPublicKey$sub(a, b)
aa message
banother message
the difference a - b
add_real()Return the sum a + b
of an encrypted real message a,
a list consisting of a encrypted
integer part (named int) and an
encrypted fractional part (named frac),
and a real number a using
den as denominator in the rational
approximation.
PaillierPublicKey$add_real(den, a, b)
denthe denominator to use for rational approximations
athe real message, a list consisting of the integer and fractional parts named int and frac respectively
ba simple real number
sub_real()Return the difference a - b
of an encrypted real message a,
a list consisting of a encrypted
integer part (named int) and an
encrypted fractional part (named frac),
and a real number b using
den as denominator in the rational
approximation.
PaillierPublicKey$sub_real(den, a, b)
denthe denominator to use for rational approximations
athe real message, a list consisting of the integer and fractional parts named int and frac respectively
ba simple real number
mult()Return the product of two encrypted
messages a and b
PaillierPublicKey$mult(a, b)
aa message
banother message
the product of a and b
clone()The objects of this class are cloneable with this method.
PaillierPublicKey$clone(deep = FALSE)
deepWhether to make a deep clone.
PaillierPrivateKey() which goes hand-in-hand with this object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.