Writes an object to a file, or, with filename = NULL, returns its
serialized form: a raw vector for the binary format and a character
string for JSON.
Arguments
- x
A
CryptoContext,PublicKey,PrivateKey,Ciphertext,EvalKeyorEvalKeyMap, or a list ofEvalKeyobjects (in memory only). For Binary FHE, aBinFHEContext,LWECiphertext,LWEPrivateKey,LWEPublicKeyorRingGSWBTKey(to a file only).- ...
Method arguments:
filename, a path, orNULL(default) to serialize in memory;format,"binary"(default) or"json".
Value
With a file name, TRUE invisibly. Otherwise a raw vector
(format = "binary") or a character string (format = "json").
Examples
cc <- fhe_context("BFV", plaintext_modulus = 65537, multiplicative_depth = 1)
keys <- key_gen(cc)
bytes <- fhe_serialize(keys@public)
pk <- fhe_deserialize_string(bytes, "PublicKey")
