Skip to content

Conversation

@randombit
Copy link
Contributor

In from_wide_bytes, use a single scalar multiplication rather than 255 doublings. This function is in turn called by hash_to_scalar. With this change the cost of hash_to_scalar is reduced from ~2800 nanoseconds to ~330 nanoseconds.

Hashing to scalar is used for MEGa encryption and decryption, for generating challenges in ZK proofs, and for rerandomizing the presignature.

…p256r1

In from_wide_bytes, use a single scalar multiplication rather than 255 doublings.
This function is in turn called by hash_to_scalar. With this change the cost of
hash_to_scalar is reduced from ~2800 nanoseconds to ~330 nanoseconds.

Hashing to scalar is used for MEGa encryption and decryption, for generating
challenges in ZK proofs, and for rerandomizing the presignature.
@randombit randombit requested a review from a team as a code owner February 11, 2026 19:40
@github-actions github-actions bot added the perf label Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant