| make_ckks_packed_plaintext | R Documentation |
Encode a real-valued numeric vector as a CKKS packed plaintext.
The result is an unencrypted Plaintext object that can then
be passed to encrypt().
make_ckks_packed_plaintext(
cc,
values,
noise_scale_deg = 1L,
level = 0L,
params = NULL,
slots = 0L
)
cc |
A |
values |
A numeric vector to pack. Length must not exceed
|
noise_scale_deg |
Integer degree of the initial scaling
factor applied to the encoded plaintext, expressed as a power
of the scheme's scaling factor. Defaults to |
level |
Integer target encryption level of the encoded
plaintext. Defaults to |
params |
Advanced. An |
slots |
Integer number of CKKS slots to pack into.
Defaults to |
A Plaintext.
cc <- fhe_context("CKKS", multiplicative_depth = 2L,
scaling_mod_size = 50L, batch_size = 8L)
## Encode four reals into the CKKS slots. The remaining slots are
## zero-padded out to `batch_size`.
pt <- make_ckks_packed_plaintext(cc, c(0.25, 0.5, 0.75, 1))
pt
get_real_packed_value(set_length(pt, 4L))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.