fhelium/ckks_operations.h
#include <fhelium/ckks_operations.h> · namespace fhelium::ckks
Whole CKKS operations over prepared tables: key switching, conjugation, relinearization with optional joint rescale, rotation, hoisted rotation groups, rotation sums, grouped rotation weighted sums, modulus raising, compressed-plaintext and scalar arithmetic, slot encoding and decoding, encryption, and decryption.
A ciphertext has shape [component, limb, N] over the active Q rows. The hybrid key switch decomposes component one into the digits of KeySwitchOptions, lifts each digit to QP, multiplies it with the key digit in NTT Montgomery form, and divides the accumulated products by the auxiliary product KeySwitchTables (fhelium/operation_tables.h): the fields read by fhelium/rns_operations.h (hybrid_modup_digit, moddown_qp_to_q, moddown_ntt_qp_to_q, moddown_add_rescale), the crt tables of each digit for the CRT ModUp methods, q_parameters, and the q, qp, and p NTT schedules. A key has shape [key_digit, 2, limb, N] with NTT Montgomery QP residues. Rotation steps follow torch.roll(slots, shifts=step); rotation_galois_element in fhelium/ckks_tables.h maps them to polynomial automorphisms, and each rotation reads the GaloisTables of its automorphism. The _out forms write the result into caller-supplied Tensors with the result's shape, dtype, and device that do not overlap the operands.
KeySwitchOptions
struct View source
Selection of the decomposition, ModUp, ModDown, and domains of one key switch.
| Member | Description |
|---|---|
std::string ntt_backend | NTT policy name (fhelium/ntt_operations.h). |
std::vector<int64_t> digits | Flattened (start, stop, key_digit) triples of the hybrid digits. |
int64_t key_row_start = 0 | First key row that corresponds to QP row zero. |
int64_t key_p_row_start = -1 | First key row of the trailing auxiliary rows, or key_row_start. |
std::vector<int64_t> key_q_rows | Key rows of the active Q rows, in operand order, when they do not form one interval starting at key_row_start; empty otherwise. A nonempty list requires key_p_row_start, and each run of consecutive key rows is one contiguous digit product. |
std::string basis_conversion = "exact" | Digit lift: exact (Garner) reads the mixed-radix fields of KeySwitchTables::digits; crt (raw CRT) and normalized_crt (centered CRT) read their crt fields. ModDown divides by moddown_crt is defined (fhelium::rns::moddown_qp_to_q) and exactly otherwise. |
int64_t p_count = 0 | Number of auxiliary rows that trail the Q rows of the QP accumulator. |
std::string moddown_rounding = "nearest" | nearest or floor ModDown rounding. |
std::string input_domain = "coefficient" | Domain of the input ciphertext: coefficient (standard residues) or ntt (Montgomery residues). |
std::string output_domain = "coefficient" | Domain of the result, encoded as for input_domain; NTT results hold lazy residues. |
std::vector<at::Tensor> key_seeds | Seed rows [key_digit, 6] of seeded keys, one per key operand in operand order; empty when the keys are dense. A seeded key stores only [key_digit, 1, key_rows, N], and the products generate keyswitch_accumulate_digit_products_). |
int64_t key_rounds = 0 | ChaCha rounds of the seeded keys; 0 for dense keys. |
JointRescaleOptions
struct View source
Joint ModDown and rescale of a relinearization (fhelium::rns::moddown_add_rescale).
| Member | Description |
|---|
| Function | Devices | Summary |
|---|---|---|
key_switch_products | Any device | Accumulates the hybrid key products of coefficient standard Q polynomial component into NTT Montgomery QP accumulators of shape [2, *batch, limb, N]. |
key_switch | Any device | Switches CT2 source from the key's source secret to its destination secret. |
key_switch_out | Any device | Out form of key_switch. |
relinearize | Any device | Relinearizes NTT Montgomery CT3 source to CT2. |
relinearize_out | Any device | Out form of relinearize. A defined workspace holds the temporaries: a contiguous uint8 Tensor of at least relinearize_workspace_bytes bytes on the source device with a 256-byte aligned base. With an undefined workspace, the temporaries are allocated per call. |
relinearize_workspace_bytes | Any device | Workspace bytes of relinearize_out for these operands; reads only their sizes, dtypes and devices. |
rotate | Any device | Rotates CT2 source by one slot step: applies the Galois automorphism galois of the step to both components and key-switches component one. |
rotate_out | Any device | Out form of rotate. |
rotation_digits | Any device | Returns the hoisted digits [digit, *batch, qp_limb, N] of coefficient standard Q polynomial component: every hybrid digit lifted to QP once and transformed to NTT Montgomery form, shared by the key products of several rotations (rotate_hoisted). |
rotation_digits_out | Any device | Out form of rotation_digits. |
rotate_hoisted | Any device | Rotates a CT2 by the automorphism galois of one slot step from its component zero c0 and the hoisted digits hoisted_digits of its component one (rotation_digits). |
rotate_hoisted_out | Any device | Out form of rotate_hoisted. A defined workspace holds the temporaries: a contiguous uint8 Tensor of at least rotate_hoisted_workspace_bytes bytes on the device of c0 with a 256-byte aligned base. With an undefined workspace, the temporaries are allocated per call. |
rotate_hoisted_workspace_bytes | Any device | Workspace bytes of rotate_hoisted_out; reads only the sizes, dtypes and devices of the operands. |
rotate_many | Any device | Rotates coefficient standard CT2 source by every step of galois, decomposing component one once (rotation_digits, rotate_hoisted). keys[i] belongs to galois[i]. |
rotate_many_out | Any device | Out form of rotate_many. workspace is a contiguous uint8 Tensor on the device of source with a 256-byte aligned base and at least rotate_many_workspace_bytes bytes; it holds the hoisted digits, the accumulators and the ModDown temporaries. With an undefined workspace, the temporaries are allocated per call. |
rotate_many_workspace_bytes | Any device | Workspace bytes of rotate_many_out. Only the sizes and dtypes of the operands are read, so Meta and fake Tensors qualify. |
rotation_sum_add_ | Any device | Adds the rotation source to the rotation-sum accumulators. |
rotation_sum_add_workspace_bytes | Any device | Workspace bytes of rotation_sum_add_; zero for step zero (no galois). Reads only the sizes, dtypes and devices of the operands. |
rotation_sum_finish_ | Any device | Returns the coefficient standard rotation sum of the accumulators of rotation_sum_add_ with one shared quotient. |
rotation_sum_finish_out_ | Any device | Out form of rotation_sum_finish_. A defined workspace holds the temporaries: a contiguous uint8 Tensor of at least rotation_sum_finish_workspace_bytes bytes on the device of products with a 256-byte aligned base. With an undefined workspace, the temporaries are allocated per call. |
rotation_sum_finish_workspace_bytes | Any device | Workspace bytes of rotation_sum_finish_out_; reads only the sizes, dtypes and devices of the operands. |
rotation_sum | Any device | Returns rotation_sum_add_ for every source, then rotation_sum_finish_). keys lists the keys of the nonzero steps in order, and galois[i] holds the automorphism of steps[i]; entries of zero steps are unread. |
rotation_sum_out | Any device | Out form of rotation_sum. |
grouped_rotation_weighted_sum | Any device | Returns group_count sums plaintexts[g * term_count + j]) in NTT Montgomery form. |
grouped_rotation_weighted_sum_out | Any device | Out form of grouped_rotation_weighted_sum. |
encapsulated_modulus_raise | Any device | Raises CT2 source from its low basis through the encapsulation keys. |
key_switch_products | Any device | Key operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form. |
key_switch | Any device | Key operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form. |
relinearize | Any device | Key operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form. |
rotate | Any device | Key operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form. |
rotate_hoisted | Any device | Key operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form. |
rotate_many | Any device | Key operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form. |
rotation_sum | Any device | Key operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form. |
grouped_rotation_weighted_sum | Any device | Key operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form. |
encapsulated_modulus_raise | Any device | Key operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form. |
add_compressed_plaintext | Any device | Returns ciphertext with the compressed plaintext compressed added to component zero. |
add_compressed_plaintext_ | Any device | In-place form of add_compressed_plaintext; returns ciphertext. |
add_compressed_plaintext_out | Any device | Out form of add_compressed_plaintext. out has the shape, dtype and device of ciphertext and is ciphertext or disjoint from it; the multiplication and scalar out forms below have the same requirement. |
multiply_compressed_plaintext | Any device | Returns every component of ciphertext multiplied by the compressed Montgomery plaintext compressed with the layouts of add_compressed_plaintext. Strided plaintexts fill the implicit positions with the product of the one-value cyclic row implicit. |
multiply_compressed_plaintext_ | Any device | In-place form of multiply_compressed_plaintext; returns ciphertext. |
multiply_compressed_plaintext_out | Any device | Out form of multiply_compressed_plaintext. |
scalar_arithmetic | Any device | Adds or multiplies the real scalar |
scalar_arithmetic_out | Any device | Out form of scalar_arithmetic. |
encode | Any device | Encodes complex slots [*batch, slot] into stochastically rounded integer coefficients [*batch, N] at scale |
decode | Any device | Decodes coefficients [*batch, N] to the leading is_real. |
prepare_periodic_plaintext | Any device | Prepares the compact plaintext of the periodic message pre. |
encrypt | Any device | Encrypts integer coefficients [*batch, N] under public key [2, limb, N]. |
decrypt_phase | Any device | Evaluates the phase ciphertext as coefficient standard residues. |
reconstruct_q_coefficients | Any device | Returns the centered integer class modulo the product of the primes of source_parameters as float64 [*batch, N]. |
decrypt | Any device | Decrypts ciphertext and reconstructs its centered Q coefficients (decrypt_phase with tables.ring, then reconstruct_q_coefficients). |
key_switch_products
function View source
at::Tensor fhelium::ckks::key_switch_products(
const at::Tensor& component,
const at::Tensor& key,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const std::optional<at::Tensor>& accumulator = std::nullopt);2
3
4
5
6
Devices: Any device
Accumulates the hybrid key products of coefficient standard Q polynomial component into NTT Montgomery QP accumulators of shape [2, *batch, limb, N].
When accumulator is supplied, products are added to it in place and it is returned; otherwise a zero accumulator is allocated.
key_switch
function View source
at::Tensor fhelium::ckks::key_switch(
const at::Tensor& source,
const at::Tensor& key,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const std::optional<GaloisTables>& conjugation = std::nullopt);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.key_switch
fhelium_ckks_ops::key_switch(Tensor source, Tensor key, Tensor?[] tables, Tensor?[] conjugation, ) -> TensorSwitches CT2 source from the key's source secret to its destination secret.
For input phase conjugation, the Galois tables of options.
key_switch_out
function View source
void fhelium::ckks::key_switch_out(
const at::Tensor& source,
const at::Tensor& key,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const std::optional<GaloisTables>& conjugation,
at::Tensor& out);2
3
4
5
6
7
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.key_switch_out
fhelium_ckks_ops::key_switch_out(Tensor source, Tensor key, Tensor?[] tables, Tensor?[] conjugation, , Tensor(a!) out) -> ()Out form of key_switch.
relinearize
function View source
at::Tensor fhelium::ckks::relinearize(
const at::Tensor& source,
const at::Tensor& key,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const std::optional<JointRescaleOptions>& rescale_options = std::nullopt);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.relinearize
fhelium_ckks_ops::relinearize(Tensor source, Tensor key, Tensor?[] tables, , bool rescale, int q_count, int joint_drop_count, bool joint_drop_is_prefix) -> TensorRelinearizes NTT Montgomery CT3 source to CT2.
Component two is switched with the relinearization key and the corrections are added to components zero and one. With rescale, the division by rescale_options.
relinearize_out
function View source
void fhelium::ckks::relinearize_out(
const at::Tensor& source,
const at::Tensor& key,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const std::optional<JointRescaleOptions>& rescale_options,
at::Tensor& out,
const at::Tensor& workspace = at::Tensor());2
3
4
5
6
7
8
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.relinearize_out
fhelium_ckks_ops::relinearize_out(Tensor source, Tensor key, Tensor?[] tables, , bool rescale, int q_count, int joint_drop_count, bool joint_drop_is_prefix, Tensor(a!) out, Tensor(b!)? workspace=None) -> ()Out form of relinearize. A defined workspace holds the temporaries: a contiguous uint8 Tensor of at least relinearize_workspace_bytes bytes on the source device with a 256-byte aligned base. With an undefined workspace, the temporaries are allocated per call.
relinearize_workspace_bytes
function View source
int64_t fhelium::ckks::relinearize_workspace_bytes(
const at::Tensor& source,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const std::optional<JointRescaleOptions>& rescale_options = std::nullopt);2
3
4
5
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.relinearize_workspace_bytes
fhelium_ckks_ops::relinearize_workspace_bytes(Tensor source, Tensor key, Tensor?[] tables, , bool rescale, int q_count, int joint_drop_count, bool joint_drop_is_prefix) -> intWorkspace bytes of relinearize_out for these operands; reads only their sizes, dtypes and devices.
rotate
function View source
at::Tensor fhelium::ckks::rotate(
const at::Tensor& source,
const at::Tensor& key,
const GaloisTables& galois,
const KeySwitchTables& tables,
const KeySwitchOptions& options);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotate
fhelium_ckks_ops::rotate(Tensor source, Tensor key, Tensor?[] galois, Tensor?[] tables, ) -> TensorRotates CT2 source by one slot step: applies the Galois automorphism galois of the step to both components and key-switches component one.
rotate_out
function View source
void fhelium::ckks::rotate_out(
const at::Tensor& source,
const at::Tensor& key,
const GaloisTables& galois,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
at::Tensor& out);2
3
4
5
6
7
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotate_out
fhelium_ckks_ops::rotate_out(Tensor source, Tensor key, Tensor?[] galois, Tensor?[] tables, , Tensor(a!) out) -> ()Out form of rotate.
rotation_digits
function View source
at::Tensor fhelium::ckks::rotation_digits(
const at::Tensor& component,
const KeySwitchTables& tables,
const KeySwitchOptions& options);2
3
4
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotation_digits
fhelium_ckks_ops::rotation_digits(Tensor component, Tensor?[] tables, ) -> TensorReturns the hoisted digits [digit, *batch, qp_limb, N] of coefficient standard Q polynomial component: every hybrid digit lifted to QP once and transformed to NTT Montgomery form, shared by the key products of several rotations (rotate_hoisted).
rotation_digits_out
function View source
void fhelium::ckks::rotation_digits_out(
const at::Tensor& component,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
at::Tensor& out);2
3
4
5
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotation_digits_out
fhelium_ckks_ops::rotation_digits_out(Tensor component, Tensor?[] tables, , Tensor(a!) out) -> ()Out form of rotation_digits.
rotate_hoisted
function View source
at::Tensor fhelium::ckks::rotate_hoisted(
const at::Tensor& c0,
const at::Tensor& hoisted_digits,
const at::Tensor& key,
const GaloisTables& galois,
const KeySwitchTables& tables,
const KeySwitchOptions& options);2
3
4
5
6
7
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotate_hoisted
fhelium_ckks_ops::rotate_hoisted(Tensor c0, Tensor hoisted_digits, Tensor key, Tensor?[] galois, Tensor?[] tables, ) -> TensorRotates a CT2 by the automorphism galois of one slot step from its component zero c0 and the hoisted digits hoisted_digits of its component one (rotation_digits).
The NTT gather of the step permutes each digit in the key-product load. With coefficient output, c0 holds coefficient standard residues; with NTT output (options.output_domain), c0 holds NTT Montgomery residues and the result holds lazy NTT Montgomery residues.
rotate_hoisted_out
function View source
void fhelium::ckks::rotate_hoisted_out(
const at::Tensor& c0,
const at::Tensor& hoisted_digits,
const at::Tensor& key,
const GaloisTables& galois,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
at::Tensor& out,
const at::Tensor& workspace = at::Tensor());2
3
4
5
6
7
8
9
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotate_hoisted_out
fhelium_ckks_ops::rotate_hoisted_out(Tensor c0, Tensor hoisted_digits, Tensor key, Tensor?[] galois, Tensor?[] tables, , Tensor(a!) out, Tensor(b!)? workspace=None) -> ()Out form of rotate_hoisted. A defined workspace holds the temporaries: a contiguous uint8 Tensor of at least rotate_hoisted_workspace_bytes bytes on the device of c0 with a 256-byte aligned base. With an undefined workspace, the temporaries are allocated per call.
rotate_hoisted_workspace_bytes
function View source
int64_t fhelium::ckks::rotate_hoisted_workspace_bytes(
const at::Tensor& c0,
const at::Tensor& hoisted_digits,
const KeySwitchTables& tables,
const KeySwitchOptions& options);2
3
4
5
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotate_hoisted_workspace_bytes
fhelium_ckks_ops::rotate_hoisted_workspace_bytes(Tensor c0, Tensor hoisted_digits, Tensor key, Tensor?[] galois, Tensor?[] tables, ) -> intWorkspace bytes of rotate_hoisted_out; reads only the sizes, dtypes and devices of the operands.
rotate_many
function View source
std::vector<at::Tensor> fhelium::ckks::rotate_many(
const at::Tensor& source,
at::TensorList keys,
c10::ArrayRef<GaloisTables> galois,
const KeySwitchTables& tables,
const KeySwitchOptions& options);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotate_many
fhelium_ckks_ops::rotate_many(Tensor source, Tensor[] keys, Tensor?[] galois, Tensor?[] tables, ) -> Tensor[]Rotates coefficient standard CT2 source by every step of galois, decomposing component one once (rotation_digits, rotate_hoisted). keys[i] belongs to galois[i].
rotate_many_out
function View source
void fhelium::ckks::rotate_many_out(
const at::Tensor& source,
at::TensorList keys,
c10::ArrayRef<GaloisTables> galois,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
at::TensorList out,
at::Tensor& workspace);2
3
4
5
6
7
8
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotate_many_out
fhelium_ckks_ops::rotate_many_out(Tensor source, Tensor[] keys, Tensor?[] galois, Tensor?[] tables, , Tensor(a!)[] out, Tensor(b!)? workspace=None) -> ()Out form of rotate_many. workspace is a contiguous uint8 Tensor on the device of source with a 256-byte aligned base and at least rotate_many_workspace_bytes bytes; it holds the hoisted digits, the accumulators and the ModDown temporaries. With an undefined workspace, the temporaries are allocated per call.
rotate_many_workspace_bytes
function View source
int64_t fhelium::ckks::rotate_many_workspace_bytes(
const at::Tensor& source,
at::TensorList keys,
c10::ArrayRef<GaloisTables> galois,
const KeySwitchTables& tables,
const KeySwitchOptions& options);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotate_many_workspace_bytes
fhelium_ckks_ops::rotate_many_workspace_bytes(Tensor source, Tensor[] keys, Tensor?[] galois, Tensor?[] tables, ) -> intWorkspace bytes of rotate_many_out. Only the sizes and dtypes of the operands are read, so Meta and fake Tensors qualify.
rotation_sum_add_
function View source
void fhelium::ckks::rotation_sum_add_(
at::Tensor& ordinary,
at::Tensor& products,
const at::Tensor& source,
const std::optional<at::Tensor>& key,
const std::optional<GaloisTables>& galois,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const at::Tensor& workspace = at::Tensor());2
3
4
5
6
7
8
9
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotation_sum_add_
fhelium_ckks_ops::rotation_sum_add_(Tensor(a!) ordinary, Tensor(b!) products, Tensor source, Tensor? key, Tensor?[] galois, Tensor?[] tables, , Tensor(c!)? workspace=None) -> ()Adds the rotation source to the rotation-sum accumulators.
ordinary ([2, *batch, limb, N] over Q) and products ([2, *batch, qp_limb, N]) start as zeros. A nonzero step applies its Galois automorphism galois, adds component zero to ordinary[0], and adds the key products of component one to products in NTT Montgomery form; step zero (no galois) adds both components to ordinary and leaves products unread. ordinary keeps the input domain of options: lazy NTT Montgomery or coefficient standard residues. A defined workspace holds the temporaries of a nonzero step: a contiguous uint8 Tensor of at least rotation_sum_add_workspace_bytes bytes on the device of source with a 256-byte aligned base. With an undefined workspace, the temporaries are allocated per call.
rotation_sum_add_workspace_bytes
function View source
int64_t fhelium::ckks::rotation_sum_add_workspace_bytes(
const at::Tensor& source,
const std::optional<GaloisTables>& galois,
const KeySwitchTables& tables,
const KeySwitchOptions& options);2
3
4
5
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotation_sum_add_workspace_bytes
fhelium_ckks_ops::rotation_sum_add_workspace_bytes(Tensor ordinary, Tensor products, Tensor source, Tensor? key, Tensor?[] galois, Tensor?[] tables, ) -> intWorkspace bytes of rotation_sum_add_; zero for step zero (no galois). Reads only the sizes, dtypes and devices of the operands.
rotation_sum_finish_
function View source
at::Tensor fhelium::ckks::rotation_sum_finish_(
at::Tensor& ordinary,
at::Tensor& products,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const std::optional<JointRescaleOptions>& rescale = std::nullopt);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotation_sum_finish_
fhelium_ckks_ops::rotation_sum_finish_(Tensor(a!) ordinary, Tensor(b!) products, Tensor?[] tables, , bool rescale, int joint_drop_count, bool joint_drop_is_prefix) -> TensorReturns the coefficient standard rotation sum of the accumulators of rotation_sum_add_ with one shared quotient.
With accumulated key products ordinary with coefficient input, the result without rescale is options.moddown_rounding; it reads sum_p_montgomery, sum_quotient_parameters, sum_quotient_inverses and the optional sum_quotient_half. With rescale, the result is the joint ModDown and rescale rns::moddown_add_rescale over the next basis options.moddown_rounding; it reads the joint tables. Both accumulators are overwritten.
rotation_sum_finish_out_
function View source
void fhelium::ckks::rotation_sum_finish_out_(
at::Tensor& ordinary,
at::Tensor& products,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const std::optional<JointRescaleOptions>& rescale,
at::Tensor& out,
const at::Tensor& workspace = at::Tensor());2
3
4
5
6
7
8
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotation_sum_finish_out_
fhelium_ckks_ops::rotation_sum_finish_out_(Tensor(a!) ordinary, Tensor(b!) products, Tensor?[] tables, , bool rescale, int joint_drop_count, bool joint_drop_is_prefix, Tensor(c!) out, Tensor(d!)? workspace=None) -> ()Out form of rotation_sum_finish_. A defined workspace holds the temporaries: a contiguous uint8 Tensor of at least rotation_sum_finish_workspace_bytes bytes on the device of products with a 256-byte aligned base. With an undefined workspace, the temporaries are allocated per call.
rotation_sum_finish_workspace_bytes
function View source
int64_t fhelium::ckks::rotation_sum_finish_workspace_bytes(
const at::Tensor& ordinary,
const at::Tensor& products,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const std::optional<JointRescaleOptions>& rescale = std::nullopt);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotation_sum_finish_workspace_bytes
fhelium_ckks_ops::rotation_sum_finish_workspace_bytes(Tensor ordinary, Tensor products, Tensor?[] tables, , bool rescale, int joint_drop_count, bool joint_drop_is_prefix) -> intWorkspace bytes of rotation_sum_finish_out_; reads only the sizes, dtypes and devices of the operands.
rotation_sum
function View source
at::Tensor fhelium::ckks::rotation_sum(
at::TensorList sources,
at::TensorList keys,
c10::IntArrayRef steps,
c10::ArrayRef<GaloisTables> galois,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const std::optional<JointRescaleOptions>& rescale = std::nullopt);2
3
4
5
6
7
8
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotation_sum
fhelium_ckks_ops::rotation_sum(Tensor[] sources, Tensor[] keys, int[] steps, Tensor?[] galois, Tensor?[] tables, , bool rescale, int joint_drop_count, bool joint_drop_is_prefix) -> TensorReturns rotation_sum_add_ for every source, then rotation_sum_finish_). keys lists the keys of the nonzero steps in order, and galois[i] holds the automorphism of steps[i]; entries of zero steps are unread.
rotation_sum_out
function View source
void fhelium::ckks::rotation_sum_out(
at::TensorList sources,
at::TensorList keys,
c10::IntArrayRef steps,
c10::ArrayRef<GaloisTables> galois,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const std::optional<JointRescaleOptions>& rescale,
at::Tensor& out);2
3
4
5
6
7
8
9
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotation_sum_out
fhelium_ckks_ops::rotation_sum_out(Tensor[] sources, Tensor[] keys, int[] steps, Tensor?[] galois, Tensor?[] tables, , bool rescale, int joint_drop_count, bool joint_drop_is_prefix, Tensor(a!) out) -> ()Out form of rotation_sum.
grouped_rotation_weighted_sum
function View source
at::Tensor fhelium::ckks::grouped_rotation_weighted_sum(
const at::Tensor& source,
at::TensorList keys,
c10::IntArrayRef baby_steps,
c10::ArrayRef<GaloisTables> galois,
at::TensorList plaintexts,
int64_t group_count,
const KeySwitchTables& tables,
const KeySwitchOptions& options);2
3
4
5
6
7
8
9
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.grouped_rotation_weighted_sum
fhelium_ckks_ops::grouped_rotation_weighted_sum(Tensor source, Tensor[] keys, int[] baby_steps, Tensor?[] galois, Tensor[] plaintexts, int group_count, Tensor?[] tables, ) -> TensorReturns group_count sums plaintexts[g * term_count + j]) in NTT Montgomery form.
Component one of the coefficient standard CT2 source is decomposed once; keys lists the keys of the nonzero baby steps in order, and galois[j] holds the automorphism of baby step [group, component, limb, N] with NTT Montgomery residues.
grouped_rotation_weighted_sum_out
function View source
void fhelium::ckks::grouped_rotation_weighted_sum_out(
const at::Tensor& source,
at::TensorList keys,
c10::IntArrayRef baby_steps,
c10::ArrayRef<GaloisTables> galois,
at::TensorList plaintexts,
int64_t group_count,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
at::Tensor& out);2
3
4
5
6
7
8
9
10
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.grouped_rotation_weighted_sum_out
fhelium_ckks_ops::grouped_rotation_weighted_sum_out(Tensor source, Tensor[] keys, int[] baby_steps, Tensor?[] galois, Tensor[] plaintexts, int group_count, Tensor?[] tables, , Tensor(a!) out) -> ()Out form of grouped_rotation_weighted_sum.
encapsulated_modulus_raise
function View source
at::Tensor fhelium::ckks::encapsulated_modulus_raise(
const at::Tensor& source,
const at::Tensor& low_key,
const at::Tensor& return_key,
const EncapsulationTables& tables,
const KeySwitchOptions& low_options,
int64_t return_drop_count,
int64_t target_row_start,
int64_t q_count);2
3
4
5
6
7
8
9
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.encapsulated_modulus_raise
fhelium_ckks_ops::encapsulated_modulus_raise(Tensor source, Tensor low_key, Tensor return_key, Tensor?[] tables, , int return_drop_count, int target_row_start, int q_count) -> TensorRaises CT2 source from its low basis through the encapsulation keys.
The source is key-switched with low_key under low_options and the low tables into the low secret relation, extended to the target basis by fhelium::rns::centered_basis_extend with the raise tables, and returned to the main secret with the one-digit return_key, which encodes target_row_start$, return NTT schedules, quotient_order, quotient_parameters, quotient_inverses, target_parameters, and quotient_half for nearest rounding.
key_switch_products
function View source
at::Tensor fhelium::ckks::key_switch_products(
const at::Tensor& component,
const KeySwitchKey& key,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const std::optional<at::Tensor>& accumulator = std::nullopt);2
3
4
5
6
Devices: Any device
Key operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form.
key_switch
function View source
at::Tensor fhelium::ckks::key_switch(
const at::Tensor& source,
const KeySwitchKey& key,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const std::optional<GaloisTables>& conjugation = std::nullopt);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.key_switch
fhelium_ckks_ops::key_switch(Tensor source, Tensor key, Tensor?[] tables, Tensor?[] conjugation, ) -> TensorKey operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form.
relinearize
function View source
at::Tensor fhelium::ckks::relinearize(
const at::Tensor& source,
const KeySwitchKey& key,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const std::optional<JointRescaleOptions>& rescale_options = std::nullopt);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.relinearize
fhelium_ckks_ops::relinearize(Tensor source, Tensor key, Tensor?[] tables, , bool rescale, int q_count, int joint_drop_count, bool joint_drop_is_prefix) -> TensorKey operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form.
rotate
function View source
at::Tensor fhelium::ckks::rotate(
const at::Tensor& source,
const KeySwitchKey& key,
const GaloisTables& galois,
const KeySwitchTables& tables,
const KeySwitchOptions& options);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotate
fhelium_ckks_ops::rotate(Tensor source, Tensor key, Tensor?[] galois, Tensor?[] tables, ) -> TensorKey operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form.
rotate_hoisted
function View source
at::Tensor fhelium::ckks::rotate_hoisted(
const at::Tensor& c0,
const at::Tensor& hoisted_digits,
const KeySwitchKey& key,
const GaloisTables& galois,
const KeySwitchTables& tables,
const KeySwitchOptions& options);2
3
4
5
6
7
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotate_hoisted
fhelium_ckks_ops::rotate_hoisted(Tensor c0, Tensor hoisted_digits, Tensor key, Tensor?[] galois, Tensor?[] tables, ) -> TensorKey operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form.
rotate_many
function View source
std::vector<at::Tensor> fhelium::ckks::rotate_many(
const at::Tensor& source,
const std::vector<KeySwitchKey>& keys,
c10::ArrayRef<GaloisTables> galois,
const KeySwitchTables& tables,
const KeySwitchOptions& options);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotate_many
fhelium_ckks_ops::rotate_many(Tensor source, Tensor[] keys, Tensor?[] galois, Tensor?[] tables, ) -> Tensor[]Key operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form.
rotation_sum
function View source
at::Tensor fhelium::ckks::rotation_sum(
at::TensorList sources,
const std::vector<KeySwitchKey>& keys,
c10::IntArrayRef steps,
c10::ArrayRef<GaloisTables> galois,
const KeySwitchTables& tables,
const KeySwitchOptions& options,
const std::optional<JointRescaleOptions>& rescale = std::nullopt);2
3
4
5
6
7
8
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.rotation_sum
fhelium_ckks_ops::rotation_sum(Tensor[] sources, Tensor[] keys, int[] steps, Tensor?[] galois, Tensor?[] tables, , bool rescale, int joint_drop_count, bool joint_drop_is_prefix) -> TensorKey operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form.
grouped_rotation_weighted_sum
function View source
at::Tensor fhelium::ckks::grouped_rotation_weighted_sum(
const at::Tensor& source,
const std::vector<KeySwitchKey>& keys,
c10::IntArrayRef baby_steps,
c10::ArrayRef<GaloisTables> galois,
at::TensorList plaintexts,
int64_t group_count,
const KeySwitchTables& tables,
const KeySwitchOptions& options);2
3
4
5
6
7
8
9
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.grouped_rotation_weighted_sum
fhelium_ckks_ops::grouped_rotation_weighted_sum(Tensor source, Tensor[] keys, int[] baby_steps, Tensor?[] galois, Tensor[] plaintexts, int group_count, Tensor?[] tables, ) -> TensorKey operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form.
encapsulated_modulus_raise
function View source
at::Tensor fhelium::ckks::encapsulated_modulus_raise(
const at::Tensor& source,
const KeySwitchKey& low_key,
const KeySwitchKey& return_key,
const EncapsulationTables& tables,
const KeySwitchOptions& low_options,
int64_t return_drop_count,
int64_t target_row_start,
int64_t q_count);2
3
4
5
6
7
8
9
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.encapsulated_modulus_raise
fhelium_ckks_ops::encapsulated_modulus_raise(Tensor source, Tensor low_key, Tensor return_key, Tensor?[] tables, , int return_drop_count, int target_row_start, int q_count) -> TensorKey operands of KeySwitchKey type. Each overload equals its Tensor form with the key data and, for compact keys, options.key_seeds and options.key_rounds taken from the keys; the keys of one call share one form.
add_compressed_plaintext
function View source
at::Tensor fhelium::ckks::add_compressed_plaintext(
const at::Tensor& ciphertext,
const at::Tensor& compressed,
const std::optional<at::Tensor>& implicit,
const at::Tensor& parameters,
std::string_view layout,
std::string_view polynomial_domain);2
3
4
5
6
7
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.add_compressed_plaintext
fhelium_ckks_ops::add_compressed_plaintext(Tensor ciphertext, Tensor compressed, Tensor? implicit, Tensor parameters, str layout, str polynomial_domain) -> TensorReturns ciphertext with the compressed plaintext compressed added to component zero.
layout is cyclic (one period repeated over the coefficients), contiguous (leading coefficients), or strided_sparse (every implicit holding the value of the other positions). Coefficient-domain plaintexts hold
add_compressed_plaintext_
function View source
at::Tensor& fhelium::ckks::add_compressed_plaintext_(
at::Tensor& ciphertext,
const at::Tensor& compressed,
const std::optional<at::Tensor>& implicit,
const at::Tensor& parameters,
std::string_view layout,
std::string_view polynomial_domain);2
3
4
5
6
7
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.add_compressed_plaintext_
fhelium_ckks_ops::add_compressed_plaintext_(Tensor(a!) ciphertext, Tensor compressed, Tensor? implicit, Tensor parameters, str layout, str polynomial_domain) -> Tensor(a!)In-place form of add_compressed_plaintext; returns ciphertext.
add_compressed_plaintext_out
function View source
void fhelium::ckks::add_compressed_plaintext_out(
const at::Tensor& ciphertext,
const at::Tensor& compressed,
const std::optional<at::Tensor>& implicit,
const at::Tensor& parameters,
std::string_view layout,
std::string_view polynomial_domain,
at::Tensor& out);2
3
4
5
6
7
8
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.add_compressed_plaintext_out
fhelium_ckks_ops::add_compressed_plaintext_out(Tensor ciphertext, Tensor compressed, Tensor? implicit, Tensor parameters, str layout, str polynomial_domain, Tensor(a!) out) -> ()Out form of add_compressed_plaintext. out has the shape, dtype and device of ciphertext and is ciphertext or disjoint from it; the multiplication and scalar out forms below have the same requirement.
multiply_compressed_plaintext
function View source
at::Tensor fhelium::ckks::multiply_compressed_plaintext(
const at::Tensor& ciphertext,
const at::Tensor& compressed,
const std::optional<at::Tensor>& implicit,
const at::Tensor& parameters,
std::string_view layout);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.multiply_compressed_plaintext
fhelium_ckks_ops::multiply_compressed_plaintext(Tensor ciphertext, Tensor compressed, Tensor? implicit, Tensor parameters, str layout) -> TensorReturns every component of ciphertext multiplied by the compressed Montgomery plaintext compressed with the layouts of add_compressed_plaintext. Strided plaintexts fill the implicit positions with the product of the one-value cyclic row implicit.
multiply_compressed_plaintext_
function View source
at::Tensor& fhelium::ckks::multiply_compressed_plaintext_(
at::Tensor& ciphertext,
const at::Tensor& compressed,
const std::optional<at::Tensor>& implicit,
const at::Tensor& parameters,
std::string_view layout);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.multiply_compressed_plaintext_
fhelium_ckks_ops::multiply_compressed_plaintext_(Tensor(a!) ciphertext, Tensor compressed, Tensor? implicit, Tensor parameters, str layout) -> Tensor(a!)In-place form of multiply_compressed_plaintext; returns ciphertext.
multiply_compressed_plaintext_out
function View source
void fhelium::ckks::multiply_compressed_plaintext_out(
const at::Tensor& ciphertext,
const at::Tensor& compressed,
const std::optional<at::Tensor>& implicit,
const at::Tensor& parameters,
std::string_view layout,
at::Tensor& out);2
3
4
5
6
7
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.multiply_compressed_plaintext_out
fhelium_ckks_ops::multiply_compressed_plaintext_out(Tensor ciphertext, Tensor compressed, Tensor? implicit, Tensor parameters, str layout, Tensor(a!) out) -> ()Out form of multiply_compressed_plaintext.
scalar_arithmetic
function View source
at::Tensor fhelium::ckks::scalar_arithmetic(
const at::Tensor& ciphertext,
const at::Tensor& parameters,
at::Tensor& seed,
double scalar,
double scalar_scale,
bool add);2
3
4
5
6
7
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.scalar_arithmetic
fhelium_ckks_ops::scalar_arithmetic(Tensor ciphertext, Tensor parameters, Tensor(a!) seed, float scalar, float scalar_scale, bool add) -> TensorAdds or multiplies the real scalar
The integer seed at its current nonce and lifted to every row of parameters with rns::lift_integer_coefficients, and the nonce of seed advances by one. add adds it to the constant coefficient of component zero; otherwise every component is multiplied by it.
scalar_arithmetic_out
function View source
void fhelium::ckks::scalar_arithmetic_out(
const at::Tensor& ciphertext,
const at::Tensor& parameters,
at::Tensor& seed,
double scalar,
double scalar_scale,
bool add,
at::Tensor& out);2
3
4
5
6
7
8
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.scalar_arithmetic_out
fhelium_ckks_ops::scalar_arithmetic_out(Tensor ciphertext, Tensor parameters, Tensor(a!) seed, float scalar, float scalar_scale, bool add, Tensor(b!) out) -> ()Out form of scalar_arithmetic.
encode
function View source
at::Tensor fhelium::ckks::encode(
const at::Tensor& message,
const at::Tensor& pre,
const at::Tensor& twister,
at::Tensor& seed,
double scale);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.encode
fhelium_ckks_ops::encode(Tensor message, Tensor pre, Tensor twister, Tensor(a!) seed, float scale) -> TensorEncodes complex slots [*batch, slot] into stochastically rounded integer coefficients [*batch, N] at scale
The message is padded to the slot count, placed by the slot permutation pre, extended conjugate-symmetrically, transformed by a forward FFT, and multiplied by the twist twister (slot_permutations, slot_twist). Rounding reads the stream seed at its current nonce and advances the nonce by one. Every scaled coefficient must satisfy c10::ValueError with the largest magnitude and the scale.
decode
function View source
at::Tensor fhelium::ckks::decode(
const at::Tensor& coefficients,
const at::Tensor& post,
const at::Tensor& skewer,
double scale,
bool is_real);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.decode
fhelium_ckks_ops::decode(Tensor coefficients, Tensor post, Tensor skewer, float scale, bool is_real) -> TensorDecodes coefficients [*batch, N] to the leading is_real.
prepare_periodic_plaintext
function View source
std::vector<at::Tensor> fhelium::ckks::prepare_periodic_plaintext(
const at::Tensor& message,
const at::Tensor& pre,
const at::Tensor& twister,
at::Tensor& seed,
const at::Tensor& parameters,
const at::Tensor& twice_moduli,
const at::Tensor& even,
const at::Tensor& odd,
const at::Tensor& twiddles,
int64_t ring_dimension,
double scale,
std::string_view polynomial_domain);2
3
4
5
6
7
8
9
10
11
12
13
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.prepare_periodic_plaintext
fhelium_ckks_ops::prepare_periodic_plaintext(Tensor message, Tensor pre, Tensor twister, Tensor(a!) seed, Tensor parameters, Tensor twice_moduli, Tensor even, Tensor odd, Tensor twiddles, int ring_dimension, float scale, str polynomial_domain) -> Tensor[]Prepares the compact plaintext of the periodic message pre.
Rounding of coefficient seed at its current nonce, and the nonce advances by one. NTT output applies the even, odd, twiddles; coefficient output returns Montgomery residues and a zero implicit row.
encrypt
function View source
at::Tensor fhelium::ckks::encrypt(
const at::Tensor& coefficients,
const at::Tensor& public_key,
const RingTables& tables,
at::Tensor& seed,
const at::Tensor& cdt_table,
std::string_view ntt_backend,
int64_t key_row_start,
std::string_view output_domain);2
3
4
5
6
7
8
9
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.encrypt
fhelium_ckks_ops::encrypt(Tensor coefficients, Tensor public_key, Tensor?[] tables, Tensor(a!) seed, Tensor cdt_table, str ntt_backend, int key_row_start, str output_domain) -> TensorEncrypts integer coefficients [*batch, N] under public key [2, limb, N].
With ternary mask cdt_table from the stream seed at nonces tables.forward.parameters starting at key row key_row_start, and the nonce of seed advances by three.
decrypt_phase
function View source
at::Tensor fhelium::ckks::decrypt_phase(
const at::Tensor& ciphertext,
const at::Tensor& secret_key,
const RingTables& tables,
std::string_view ntt_backend,
int64_t key_row_start,
std::string_view input_domain);2
3
4
5
6
7
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.decrypt_phase
fhelium_ckks_ops::decrypt_phase(Tensor ciphertext, Tensor secret_key, Tensor?[] tables, str ntt_backend, int key_row_start, str input_domain) -> TensorEvaluates the phase ciphertext as coefficient standard residues.
reconstruct_q_coefficients
function View source
at::Tensor fhelium::ckks::reconstruct_q_coefficients(
const at::Tensor& residues,
const at::Tensor& source_parameters,
const at::Tensor& normalizers,
const at::Tensor& propagation,
const at::Tensor& half_digits);2
3
4
5
6
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.reconstruct_q_coefficients
fhelium_ckks_ops::reconstruct_q_coefficients(Tensor residues, Tensor source_parameters, Tensor normalizers, Tensor propagation, Tensor half_digits) -> TensorReturns the centered integer class modulo the product of the primes of source_parameters as float64 [*batch, N].
decrypt
function View source
at::Tensor fhelium::ckks::decrypt(
const at::Tensor& ciphertext,
const at::Tensor& secret_key,
const DecryptionTables& tables,
std::string_view ntt_backend,
int64_t key_row_start,
std::string_view input_domain);2
3
4
5
6
7
Devices: Any device
Torch operator: torch.ops.fhelium_ckks_ops.decrypt
fhelium_ckks_ops::decrypt(Tensor ciphertext, Tensor secret_key, Tensor?[] tables, str ntt_backend, int key_row_start, str input_domain) -> TensorDecrypts ciphertext and reconstructs its centered Q coefficients (decrypt_phase with tables.ring, then reconstruct_q_coefficients).