PaillierPublicKey | R Documentation |
Construct a Paillier public key with the given modulus.
Construct a Paillier public key with the given modulus.
An R6Class
generator object
bits
the number of bits in the modulus
n
the modulus
nSquared
the square of the modulus
nPlusOne
one more than the modulus
new()
Create a new public key and precompute some internal values for efficiency
PaillierPublicKey$new(bits, n)
bits
number of bits to use
n
the modulus to use
a new PaillierPublicKey
object
encrypt()
Encrypt a message
PaillierPublicKey$encrypt(m)
m
the message
the encrypted message
add()
Add two encrypted messages
PaillierPublicKey$add(a, b)
a
a message
b
another message
the sum of a
and b
sub()
Subtract one encrypted message from another
PaillierPublicKey$sub(a, b)
a
a message
b
another 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)
den
the denominator to use for rational approximations
a
the real message, a list consisting of the integer and fractional parts named int
and frac
respectively
b
a 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)
den
the denominator to use for rational approximations
a
the real message, a list consisting of the integer and fractional parts named int
and frac
respectively
b
a simple real number
mult()
Return the product of two encrypted
messages a
and b
PaillierPublicKey$mult(a, b)
a
a message
b
another message
the product of a
and b
clone()
The objects of this class are cloneable with this method.
PaillierPublicKey$clone(deep = FALSE)
deep
Whether 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.