Expand description
Field arithmetic modulo 2^255 - 19.
The compatibility backend uses FieldElement2625 and exposes serial
and four-lane engines. Encoding, inversion, square-root chains, and
parallel multiplication are implemented by the owning
rhdl_ed25519_field crate.
Modules§
- parallel
- Ten-lane, area-bounded field arithmetic engine.
Structs§
- Field
Codec Engine - Serial canonical encoder/decoder for field elements.
- Field
Codec In - Request accepted by
FieldCodecEngine. - Field
Codec Out - Response from
FieldCodecEngine. - Field
Codec Regs - Registered datapath state for
FieldCodecEngine. - Field
Element2625 - Field element stored as ten alternating 26/25-bit limbs in 32-bit lanes.
- Field
MulEngine - Area-oriented serial field multiply/add/subtract engine.
- Field
MulIn - Command accepted by serial or parallel field arithmetic engines.
- Field
MulOut - Response from serial or parallel field arithmetic engines.
- Field
MulRegs - Registered datapath state for
FieldMulEngine. - Field
PowController - Controller that schedules fixed exponentiation chains on a shared multiplier.
- Field
PowController In - Combined request and shared-multiplier response for
FieldPowController. - Field
PowController Out - External response and shared-multiplier command from
FieldPowController. - Field
PowEngine - Self-contained exponentiation engine with an internal serial multiplier.
- Field
PowIn - Exponentiation or multiply request.
- Field
PowOut - Exponentiation-controller response.
- Field
PowRegs - Registered temporaries for the fixed exponentiation chains.
- Parallel
Field MulBank4 - Four independent parallel field engines used by point-operation DAGs.
- Parallel
Field MulEngine - One ten-output-lane field multiply/add/subtract engine.
Enums§
- Field
Codec State - Internal state of the canonical field codec.
- Field
MulState - Internal state of the area-oriented serial field engine.
- Field
PowState - Internal exponentiation-chain state.
Constants§
- FIELD_
CODEC_ DECODE - Decode bytes and report whether the input encoding was canonical.
- FIELD_
CODEC_ ENCODE - Encode a field element to canonical bytes.
- FIELD_
OP_ ADD - Add
a + band restore output limb bounds. - FIELD_
OP_ MUL - Multiply
a * b mod p. - FIELD_
OP_ SUB - Subtract
a - b mod pand restore output limb bounds. - FIELD_
POW_ INVERT - Compute multiplicative inverse
base^(p-2). - FIELD_
POW_ MUL - Multiply
base * otherthrough the shared controller interface. - FIELD_
POW_ P58 - Compute
base^((p-5)/8)for point decoding. - FIELD_
POW_ SQRT - Compute the fixed square-root exponentiation used by point decoding.
Functions§
- field_
add_ 2625_ kernel - Add two loose radix-
2^25.5values limb by limb. - field_
carry_ reduce_ 2625_ kernel - Propagate alternating 26/25-bit carries and fold bit 255 by factor 19.
- field_
codec_ engine_ kernel - Next-state/output kernel for
FieldCodecEngine. - field_
equal_ kernel - Compare two field elements after canonical encoding.
- field_
from_ bytes_ kernel - Parse 32 little-endian bytes into radix-
2^25.5limbs. - field_
is_ negative_ kernel - Return the parity bit of the canonical little-endian encoding.
- field_
is_ zero_ kernel - Return whether a field element is zero after canonical encoding.
- field_
minus_ one_ kernel - Synthesizable canonical representation of
-1 mod p. - field_
mul_ engine_ kernel - Next-state and output kernel for
FieldMulEngine. - field_
neg_ 2625_ kernel - Negate a bounded field element modulo
p. - field_
one - Return the multiplicative identity as a host-side digital value.
- field_
one_ kernel - Synthesizable constructor for the multiplicative identity.
- field_
pow_ controller_ kernel - Next-state/output kernel for
FieldPowController. - field_
pow_ engine_ kernel - Wires
FieldPowControllerto its privateFieldMulEngine. - field_
reduce_ wide_ kernel - Reduce ten wide convolution accumulators to
FieldElement2625. - field_
sub_ bias_ 2625_ kernel - Subtract with a multiple-of-
pbias that prevents negative limbs. - field_
to_ bytes_ kernel - Carry, canonicalize, and encode a field element as 32 little-endian bytes.
- field_
zero - Return the additive identity as a host-side digital value.
- field_
zero_ kernel - Synthesizable constructor for the additive identity.
- lookup_
select8_ kernel - Constant-pattern selection from eight candidate field values.