Skip to content

Conversation

@radik878
Copy link
Contributor

Replace assert(s <= N/2) with assert(int.from_bytes(s, "big") <= N // 2) in EIPS/eip-8030.md. s is a 32-byte slice; comparing bytes to a number is invalid.
Use integer conversion and floor division to avoid type errors and match EIP-2 low-s rule (<= n/2) for malleability mitigation.
This change corrects the verification logic without altering the intended semantics of the P-256 low-s requirement.

@radik878 radik878 requested a review from eth-bot as a code owner October 27, 2025 20:11
@github-actions github-actions bot added c-update Modifies an existing proposal s-draft This EIP is a Draft t-core labels Oct 27, 2025
@eth-bot
Copy link
Collaborator

eth-bot commented Oct 27, 2025

File EIPS/eip-8030.md

Requires 1 more reviewers from @SirSpudlington

@eth-bot eth-bot added the a-review Waiting on author to review label Oct 27, 2025
@SirSpudlington
Copy link
Contributor

The provided code is language agnostic. Replacing assert(s <= N/2) with assert(int.from_bytes(s, "big") <= N // 2) just hurts readability. The following ... + y.to_bytes(32, "big") is only there to explicitly state that the output is concatination not addition. EIP code is used to define how algorithms work, and is rarely (never) used directly.

In future, please do not use LLMs to generate PRs as they commonly make up issues.

@radik878
Copy link
Contributor Author

The provided code is language agnostic. Replacing assert(s <= N/2) with assert(int.from_bytes(s, "big") <= N // 2) just hurts readability. The following ... + y.to_bytes(32, "big") is only there to explicitly state that the output is concatination not addition. EIP code is used to define how algorithms work, and is rarely (never) used directly.

In future, please do not use LLMs to generate PRs as they commonly make up issues.

ok , sorry

@radik878 radik878 closed this Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a-review Waiting on author to review c-update Modifies an existing proposal s-draft This EIP is a Draft t-core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants