Skip to contents

Construct a Paillier public and private key pair given a fixed number of bits

Construct a Paillier public and private key pair given a fixed number of bits

Format

An R6::R6Class() generator object

Methods

PaillierKeyPair$getPrivateKey()

Return the private key

Public fields

pubkey

the public key

Methods


Method new()

Create a new public private key pair with specified number of modulus bits

Usage

PaillierKeyPair$new(modulusBits)

Arguments

modulusBits

the number of bits to use

Returns

a PaillierKeyPair object


Method getPrivateKey()

Return the private key

Usage

PaillierKeyPair$getPrivateKey()

Returns

the private key


Method clone()

The objects of this class are cloneable with this method.

Usage

PaillierKeyPair$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

keys <- PaillierKeyPair$new(1024)
keys$pubkey
#> <PaillierPublicKey>
#>   Public:
#>     add: function (a, b) 
#>     add_real: function (den, a, b) 
#>     bits: 1024
#>     clone: function (deep = FALSE) 
#>     encrypt: function (m) 
#>     initialize: function (bits, n) 
#>     mult: function (a, b) 
#>     n: 13513891455470442392728615117337774955015770408059685429 ...
#>     nPlusOne: 13513891455470442392728615117337774955015770408059685429 ...
#>     nSquared: 18262526227023703188755128798122578316842762524824305454 ...
#>     sub: function (a, b) 
#>     sub_real: function (den, a, b) 
#>   Private:
#>     randomize: function (a) 
keys$getPrivateKey()
#> <PaillierPrivateKey>
#>   Public:
#>     clone: function (deep = FALSE) 
#>     decrypt: function (c) 
#>     getLambda: function () 
#>     initialize: function (lambda, pubkey) 
#>     pubkey: PaillierPublicKey, R6
#>   Private:
#>     lambda: 67569457277352211963643075586688874775078852040298427149 ...
#>     x: 10467730736249515472776798664340932798070920882170095764 ...