| NCP {distcomp} | R Documentation |
R6 object to use as non-cooperating party in a distributed homomorphic computation
Description
NCP objects are worker objects that separate a
master process from communicating directly with the worker
processes. Typically two such are needed for a distributed
homomorphic computation. A master process can communicate with
NCP objects and the NCP objects can communicate
with worker processes. However, the two NCP objects,
designated by numbers 1 and 2, are non-cooperating in the sense
that they don't communicate with each other and are isolated
from each other.
Public fields
pubkeythe master's public key visible to everyone
pubkey_bitsthe number of bits in the public key (used for reconstructing public key remotely by serializing to character)
pubkey_nthe
nfor the public key used for reconstructing public key remotelydenthe denominator for rational arithmetic
den_bitsthe number of bits in the denominator used for reconstructing denominator remotely
Methods
Public methods
Method new()
Create a new NCP object.
Usage
NCP$new( ncp_defn, comp_defn, sites = list(), pubkey_bits = NULL, pubkey_n = NULL, den_bits = NULL )
Arguments
ncp_defnthe NCP definition; see example
comp_defnthe computation definition
siteslist of sites
pubkey_bitsthe number of bits in public key
pubkey_nthe
nfor the public keyden_bitsthe number of bits in the denominator (power of 2) used in rational approximations
Returns
a new NCP object
Method getStateful()
Retrieve the value of the stateful field
Usage
NCP$getStateful()
Method setParams()
Set some parameters of the NCP object for homomorphic computations
Usage
NCP$setParams(pubkey_bits, pubkey_n, den_bits)
Arguments
pubkey_bitsthe number of bits in public key
pubkey_nthe
nfor the public keyden_bitsthe number of bits in the denominator (power of 2) used in rational approximations
Method getSites()
Retrieve the value of the private sites field
Usage
NCP$getSites()
Method setSites()
Set the value of the private sites field
Usage
NCP$setSites(sites)
Arguments
sitesthe list of sites
Method addSite()
Add a url or worker object for a site for participating in the distributed computation. The worker object can be used to avoid complications in debugging remote calls during prototyping.
Usage
NCP$addSite(name, url = NULL, worker = NULL)
Arguments
nameof the site
urlweb url of the site; exactly one of
urlorworkershould be specifiedworkerworker object for the site; exactly one of
urlorworkershould be specified
Method cleanupInstance()
Clean up by destroying instance objects created in workspace.
Usage
NCP$cleanupInstance(token)
Arguments
tokenthe token for the instance
Method run()
Run the distributed homomorphic computation
Usage
NCP$run(token)
Arguments
tokena unique token for the run, used to ensure that correct parts of cached results are returned appropriately
Returns
the result of the computation
Method clone()
The objects of this class are cloneable with this method.
Usage
NCP$clone(deep = FALSE)
Arguments
deepWhether to make a deep clone.