fhelium.ir.dialects.ntt
Logical number-theoretic-transform operations used below CKKS lowering.
The number-theoretic transform (NTT) evaluates a polynomial in
The transform operations distinguish the complete source and destination residue representations needed by ciphertext and plaintext transitions. The parameter operand carries the RNS arithmetic parameters. Additional Tensor operands carry transform tables after their layout is selected. An operation can leave its algorithm and execution implementation unassigned; selection does not change its residue transitions or frequency ordering.
FHEliumNtt
data View source
FHEliumNtt = Dialect('fhelium_ntt', [*_NTT_OPERATION_TYPES, AutomorphismOp], [])AutomorphismOp
class View source
AutomorphismOp(value, indices, result_type)Bases: IRDLOperation
Gather NTT evaluations through supplied Galois permutation indices.
For bit-reversed evaluation coordinates, indices[j] selects the evaluation of the input polynomial at the root obtained by raising the destination root to the Galois exponent. The gather preserves components, prime rows, batch axes, scale, and Montgomery residues. The index Tensor is a live operand; the result owns storage independent of the input.
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_ntt.automorphism' | |
value | operand_def(RnsBundleType) | |
indices | operand_def() | |
result | result_def(RnsBundleType) | |
traits | traits_def(Pure()) |
dependencies
method
def dependencies() -> OperationDependencies: ...CoefficientMontgomeryToNttMontgomeryOp
class View source
CoefficientMontgomeryToNttMontgomeryOp()Bases: _NttOp
Compute the forward negacyclic NTT of Montgomery coefficients.
Each input coefficient row represents
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_ntt.coefficient_montgomery_to_ntt_montgomery' |
dependencies
method
def dependencies() -> OperationDependencies: ...Describe result reads in this operation's value coordinates.
CoefficientStandardToNttMontgomeryOp
class View source
CoefficientStandardToNttMontgomeryOp()Bases: _NttOp
Compute the forward negacyclic NTT from standard residues.
For every active prime
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_ntt.coefficient_standard_to_ntt_montgomery' |
dependencies
method
def dependencies() -> OperationDependencies: ...Describe result reads in this operation's value coordinates.
NttMontgomeryToCoefficientMontgomeryOp
class View source
NttMontgomeryToCoefficientMontgomeryOp()Bases: _NttOp
Compute the inverse negacyclic NTT and retain Montgomery residues.
For every active prime
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_ntt.ntt_montgomery_to_coefficient_montgomery' |
dependencies
method
def dependencies() -> OperationDependencies: ...Describe result reads in this operation's value coordinates.
NttMontgomeryToCoefficientStandardOp
class View source
NttMontgomeryToCoefficientStandardOp()Bases: _NttOp
Compute the inverse negacyclic NTT and leave standard residues.
For each active prime
Attributes
| Name | Type | Default/value |
|---|---|---|
name | 'fhelium_ntt.ntt_montgomery_to_coefficient_standard' |
dependencies
method
def dependencies() -> OperationDependencies: ...Describe result reads in this operation's value coordinates.
OPERATION_SPECS
constant View source
OPERATION_SPECS: tuple[OperationSpec, ...] = tuple((registered_operation_spec(operation_type, 'ntt', validator=flat_with_attributes('ntt_backend', 'ntt_algorithm', 'ntt_group_width', 'ntt_radix', 'ntt_table_layout', 'ckks_config')) for operation_type in _NTT_OPERATION_TYPES)) + (registered_operation_spec(AutomorphismOp, 'ntt'),)