Orion

‘orion’ Dialect

The orion dialect is an entry dialect for the Orion compiler into the heir ecosystem. It is primarily intended to enable comparisons between Orion and HEIR.

Because an existing translator was written that converts from Orion to HEIR’s CKKS dialect, this dialect serves to include the ops not supported by the CKKS dialect, but which are expressed as black boxes by Orion.

Orion ops

orion.chebyshev (heir::orion::ChebyshevOp)

Evaluates a Chebyshev polynomial on a ciphertext using pre-computed coefficients

Syntax:

operation ::= `orion.chebyshev` operands attr-dict `:` functional-type(operands, results)

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

AttributeMLIR TypeDescription
coefficients::mlir::ArrayAttrarray attribute
domain_start::mlir::FloatAttrAn Attribute containing a floating-point value
domain_end::mlir::FloatAttrAn Attribute containing a floating-point value

Operands:

OperandDescription
inputA ciphertext type

Results:

ResultDescription
resultA ciphertext type

orion.linear_transform (heir::orion::LinearTransformOp)

Apply a linear transformation to the input ciphertext using pre-computed diagonals

Syntax:

operation ::= `orion.linear_transform` operands attr-dict `:` functional-type(operands, results)

This operation applies a linear transformation on a ciphertext using the provided float diagonals.

The diagonals input is a tensor where each row represents one non-zero diagonal of the square matrix to evaluate.

The diagonal_indices attribute specifies the index of each corresponding diagonal in diagonals. I.e., the first diagonal in the original matrix may have been zero and omitted, and as a result the first entry of diagonals corresponds to the diagonal with index diagonal_indices[0], and so on.

The orion_level attribute specifies the modulus level at which the operation should be performed.

The bsgs_ratio attribute is used to optimize the linear transformation using the baby-step giant-step algorithm.

The slots attribute specifies the number of slots in the ciphertext.

Traits: AlwaysSpeculatableImplTrait

Interfaces: ConditionallySpeculatable, NoMemoryEffect (MemoryEffectOpInterface)

Effects: MemoryEffects::Effect{}

Attributes:

AttributeMLIR TypeDescription
diagonal_indices::mlir::DenseI32ArrayAttri32 dense array attribute
orion_level::mlir::IntegerAttrAn Attribute containing a integer value
bsgs_ratio::mlir::FloatAttrAn Attribute containing a floating-point value
slots::mlir::IntegerAttrAn Attribute containing a integer value

Operands:

OperandDescription
inputA ciphertext type
diagonalsfloating-point-like

Results:

ResultDescription
resultA ciphertext type