Skip to content

primefield: add PrimeFieldExt trait#1809

Merged
tarcieri merged 1 commit into
masterfrom
primefield/prime-field-ext
Jun 16, 2026
Merged

primefield: add PrimeFieldExt trait#1809
tarcieri merged 1 commit into
masterfrom
primefield/prime-field-ext

Conversation

@tarcieri

Copy link
Copy Markdown
Member

Adds a trait for specifying the endianness of the serialized representation of a field element as a stopgap until zkcrypto/rfcs#4 is accepted.

This uses the ByteOrder enum and replaces the previous FIELD_REPR_IS_BE flag on PrimeCurveParams. It also means Radix16Decomposition now "Just Works" and doesn't need an endianness parameter passed to new.

The primefield::monty_field_element! macro now writes impls for this trait, sourcing the endianness information from the MontyFieldParams.

Adds a trait for specifying the endianness of the serialized
representation of a field element as a stopgap until zkcrypto/rfcs#4 is
accepted.

This uses the `ByteOrder` enum and replaces the previous
`FIELD_REPR_IS_BE` flag on `PrimeCurveParams`. It also means
`Radix16Decomposition` now "Just Works" and doesn't need an endianness
parameter passed to `new`.

The `primefield::monty_field_element!` macro now writes impls for this
trait, sourcing the endianness information from the `MontyFieldParams`.
@tarcieri tarcieri merged commit 13ce847 into master Jun 16, 2026
165 checks passed
@tarcieri tarcieri deleted the primefield/prime-field-ext branch June 16, 2026 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant