Skip to content

Reject malformed 32-bit constants in AND/XOR and SHA256 compilation [LA_Suggestion3]#375

Merged
ashpect merged 1 commit into
v1from
rs/suggestion3_v1
Mar 26, 2026
Merged

Reject malformed 32-bit constants in AND/XOR and SHA256 compilation [LA_Suggestion3]#375
ashpect merged 1 commit into
v1from
rs/suggestion3_v1

Conversation

@rose2221

@rose2221 rose2221 commented Mar 22, 2026

Copy link
Copy Markdown
Collaborator
  • Add 32-bit width assertions before as u32 truncation in process_binop_opcode (3 sites) to reject constants exceeding 32 bits at compile time instead of silently truncating
  • Add matching assertion in cow_to_digit in binops.rs for self-contained validation independent of callers
  • Add 32-bit width assertion in sha256_compression.rs for hash value constants used in the optimization path
  • Refactor all assertion sites to bind into_bigint() once and reuse, avoiding redundant Montgomery-to-integer conversions

@rose2221 rose2221 changed the title Reject malformed 32-bit constants in AND/XOR and SHA256 compilation [LA] Reject malformed 32-bit constants in AND/XOR and SHA256 compilation [LA_Suggestion3] Mar 22, 2026
@rose2221 rose2221 changed the base branch from v1 to main March 23, 2026 05:38
@rose2221 rose2221 force-pushed the rs/suggestion3_v1 branch 2 times, most recently from e71696f to 9e8aca8 Compare March 23, 2026 05:43
@rose2221 rose2221 changed the base branch from main to v1 March 23, 2026 05:44
@ashpect ashpect force-pushed the rs/suggestion3_v1 branch from 9e8aca8 to 73827ce Compare March 26, 2026 16:24
@ashpect ashpect merged commit e769e1c into v1 Mar 26, 2026
0 of 2 checks passed
dcbuild3r pushed a commit that referenced this pull request May 16, 2026
Reject malformed 32-bit constants in AND/XOR and SHA256 compilation [LA_Suggestion3]
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.

3 participants