ExpandedKey

Mojo struct 🡭

ExpandedKey

@memory_only
struct ExpandedKey[P: Pmull]

Precomputed key material for POLYVAL using the R/F algorithm.

Stores H and D values for each power, where D = swap(H) ⊕ (H0 × P1).

Only h1/d1 are needed for single-block processing (update_block). The higher powers h2/d2 .. h4/d4 are precomputed for 4-block aggregated processing (update_par_blocks), which multiplies each of the 4 blocks by a different power of H and reduces once — added later.

Parameters

  • P (Pmull)

Fields

  • h1 (FieldElement)
  • d1 (FieldElement)
  • h2 (FieldElement)
  • d2 (FieldElement)
  • h3 (FieldElement)
  • d3 (FieldElement)
  • h4 (FieldElement)
  • d4 (FieldElement)

Implemented traits

AnyType, Copyable, Deinitable, Equatable, Movable, Writable

Methods

__init__

fn def __init__(out self, h: Array[UInt8, Int(16)])

Args:

  • h (Array[UInt8, Int(16)])
  • self (Self)

Returns:

Self

zeros

@staticmethod
fn def zeros() -> Self

Returns:

Self