NCP.RdNCP 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.
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 n for the public key used for reconstructing public key remotely
denthe denominator for rational arithmetic
den_bitsthe number of bits in the denominator used for reconstructing denominator remotely
new()Create a new NCP object.
NCP$new( ncp_defn, comp_defn, sites = list(), pubkey_bits = NULL, pubkey_n = NULL, den_bits = NULL )
ncp_defnthe NCP definition; see example
comp_defnthe computation definition
siteslist of sites
pubkey_bitsthe number of bits in public key
pubkey_nthe n for the public key
den_bitsthe number of bits in the denominator (power of 2) used in rational approximations
a new NCP object
getStateful()Retrieve the value of the stateful field
NCP$getStateful()
setParams()Set some parameters of the NCP object for homomorphic computations
NCP$setParams(pubkey_bits, pubkey_n, den_bits)
pubkey_bitsthe number of bits in public key
pubkey_nthe n for the public key
den_bitsthe number of bits in the denominator (power of 2) used in rational approximations
getSites()Retrieve the value of the private sites field
NCP$getSites()
setSites()Set the value of the private sites field
NCP$setSites(sites)
sitesthe list of sites
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.
NCP$addSite(name, url = NULL, worker = NULL)
nameof the site
urlweb url of the site; exactly one of url or worker should be specified
workerworker object for the site; exactly one of url or worker should be specified
cleanupInstance()Clean up by destroying instance objects created in workspace.
NCP$cleanupInstance(token)
tokenthe token for the instance
run()Run the distributed homomorphic computation
NCP$run(token)
tokena unique token for the run, used to ensure that correct parts of cached results are returned appropriately
the result of the computation
clone()The objects of this class are cloneable with this method.
NCP$clone(deep = FALSE)
deepWhether to make a deep clone.