Skip to main content

Module field

Module field 

Source
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§

FieldCodecEngine
Serial canonical encoder/decoder for field elements.
FieldCodecIn
Request accepted by FieldCodecEngine.
FieldCodecOut
Response from FieldCodecEngine.
FieldCodecRegs
Registered datapath state for FieldCodecEngine.
FieldElement2625
Field element stored as ten alternating 26/25-bit limbs in 32-bit lanes.
FieldMulEngine
Area-oriented serial field multiply/add/subtract engine.
FieldMulIn
Command accepted by serial or parallel field arithmetic engines.
FieldMulOut
Response from serial or parallel field arithmetic engines.
FieldMulRegs
Registered datapath state for FieldMulEngine.
FieldPowController
Controller that schedules fixed exponentiation chains on a shared multiplier.
FieldPowControllerIn
Combined request and shared-multiplier response for FieldPowController.
FieldPowControllerOut
External response and shared-multiplier command from FieldPowController.
FieldPowEngine
Self-contained exponentiation engine with an internal serial multiplier.
FieldPowIn
Exponentiation or multiply request.
FieldPowOut
Exponentiation-controller response.
FieldPowRegs
Registered temporaries for the fixed exponentiation chains.
ParallelFieldMulBank4
Four independent parallel field engines used by point-operation DAGs.
ParallelFieldMulEngine
One ten-output-lane field multiply/add/subtract engine.

Enums§

FieldCodecState
Internal state of the canonical field codec.
FieldMulState
Internal state of the area-oriented serial field engine.
FieldPowState
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 + b and restore output limb bounds.
FIELD_OP_MUL
Multiply a * b mod p.
FIELD_OP_SUB
Subtract a - b mod p and restore output limb bounds.
FIELD_POW_INVERT
Compute multiplicative inverse base^(p-2).
FIELD_POW_MUL
Multiply base * other through 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.5 values 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.5 limbs.
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 FieldPowController to its private FieldMulEngine.
field_reduce_wide_kernel
Reduce ten wide convolution accumulators to FieldElement2625.
field_sub_bias_2625_kernel
Subtract with a multiple-of-p bias 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.