Skip to content

Conversation

daxpedda
Copy link
Contributor

The specification states:

Generate a random byte array with Ns bytes and attempt to map to a Scalar by calling DeserializeScalar in constant time. If it succeeds, return the result. If it fails, try again with another random byte array until the procedure succeeds.

While the elliptic-curve implementation did just that, the curve25519-dalek did not, instead it simply reduced to a correct scalar. The specification proposes an alternative to rejection sampling, however for Ristretto255 it requires reducing from 48 bytes, the curve25519-dalek implementation was reducing from 64 bytes.

With the help of FromOkm we might want to consider switching to a constant-time implementation instead. However I'm awaiting feedback on this errata: https://www.rfc-editor.org/errata/eid8393.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 25, 2025
Copy link
Contributor

@kevinlewi kevinlewi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kevinlewi kevinlewi merged commit f3f4fef into facebook:main May 7, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants