Rotom

‘rotom’ Dialect

Dialect for Rotom’s layout representation. See the Rotom paper: https://eprint.iacr.org/2025/1319

Rotom attributes

DimAttr

A single Rotom layout dimension.

Encodes a traversal dimension: logical axis index, size, and stride.

Sentinel dim values (no source tensor axis):

  • -1: replication (logical fill along this layout piece)
  • -2: gap (padding / unused slots; constrained to zero in materialization)

Non-negative dim values index into the logical tensor shape. In the assembly form the sentinels are spelled R (replication) and G (gap), e.g. [R:4:1]; the numeric ids are also accepted on input.

Parameters:

ParameterC++ typeDescription
dimint64_t
sizeint64_t
strideint64_t

LayoutAttr

A Rotom layout made from an ordered list of dims.

A Rotom layout is an ordered list of rotom.dim dimensions plus the slot count n (ciphertext slot capacity).

Rotom’s split between ciphertext dims and slot dims is denoted by a | inside the dims list (e.g., dims = [[0:2:4] | [0:4:1]]). Slot dims must fill n exactly; unused capacity is denoted with an explicit gap piece (e.g. [G:4:1]). See Section 4.2 of the Rotom paper.

Optional rolls encode a roll(i,j) metadata object: each pair (i, j) indexes into the dims array (the flattened ct_dims + slot_dims list) and rewrites dims[i]’s index to (idx_i - idx_j) mod size(dims[i]). The two extents need not match: the shift reduces modulo the rolled dim’s extent, so a smaller partner covers a prefix of the rotations and a larger one wraps.

Parameters:

ParameterC++ typeDescription
dims::mlir::ArrayAttr
nint64_t
rolls::mlir::DenseI64ArrayAttr

SeedAttr

A list of Rotom layouts for seeding.

Syntax:

#rotom.seed<
  ::mlir::ArrayAttr   # layouts
>

Contains a list of rotom.layout attributes representing the initial seeding layouts explored by Rotom.

Parameters:

ParameterC++ typeDescription
layouts::mlir::ArrayAttr