Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

secp256k1proto: split APrimeFE.from_bytes into checked and wrapping variants #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

theStack
Copy link
Contributor

@theStack theStack commented Feb 2, 2025

Note that the issue title refers to a from_int method, but since the check-or-wraparound discussion mostly concerns the initialization of scalars/fes from byte-strings (e.g. pseudo-random data from tagged hash results), the split-up is applied on the .from_bytes method. As suggested in #77, the BIP-340 implementation is not adapted and still applies the wrapping manually (% GE.ORDER), in order to keep it close to the reference implementation.

Resolves #77.

This is the first step of splitting up the `APrimeFE` deserialization
method into a checked and wrapping variant.
Note that this function is intentionally not used in the BIP-340
implementation to keep it close to the reference implementation.
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.

secp256k1proto: Split APrime.from_int into a wrapping and a checked variant
1 participant