fhelium.ir.dialects.ntt
Logical number-theoretic-transform operations used below CKKS lowering.
The number-theoretic transform (NTT) evaluates a polynomial in
The four 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], [])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))