Skip to content

Conversation

kayabaNerve
Copy link
Contributor

Builds on #816. Resolves #817.

The underlying field elements are unsafe for public consumption as they have
undefined arithmetic after a certain amount of uses. This trait solves the
problem as following:
- Defining a `ff::Field` wrapper which reduces after _every operation_
- Defining a bespoke `LazyField` trait which tracks consumed capacity using
  `typenum`
- Definining a wrapper so any existing `ff::Field` may satisfy `LazyField`
  (actually allowing the `LazyField` trait to be considered for usage)
- Defining a marker trait for any lazy field with a certain amount of capacity,
  so code generic to the field may still reduce how often they perform modular
  reductions
- Implementing `LazyField` for `FieldElement`
…`LazyField` trait

Adds a simple wrapper which stops dependents from accessing the underlying type.
All always return reduced outputs for all four backends present within
curve25519-dalek. This may be an unnecessary design choice of the backends,
offering potential future improvements, yet it's one we can take advantage of
here.
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.

Support uncompressed point deserialization
2 participants