Skip to content

perf: reduce the bsb22 hash-to-field buffer in two halves - #33

Merged
ananas-block merged 1 commit into
Lightprotocol:masterfrom
Atamanov:perf/chunked-bsb22-hash-to-field
Sep 23, 2026
Merged

ananas-block merged 1 commit into
Lightprotocol:masterfrom
Atamanov:perf/chunked-bsb22-hash-to-field

Conversation

@Atamanov

@Atamanov Atamanov commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

from_le_bytes_mod_order converts only the leading modulus_bytes minus one bytes directly, then folds each remaining byte through a field multiply and add. A 48-byte buffer runs 17 of those steps. Two 24-byte halves stay under the direct-conversion limit and recombine with one multiply and one add.

BSB22 verify drops from 211,461 to 144,138 CU at one public input. Plain Groth16 is unchanged.

@Atamanov
Atamanov force-pushed the perf/chunked-bsb22-hash-to-field branch from 07c97b1 to 162fd78 Compare August 5, 2026 13:35
@Atamanov
Atamanov force-pushed the perf/chunked-bsb22-hash-to-field branch from 162fd78 to d0b8455 Compare August 5, 2026 13:41
@ananas-block
ananas-block merged commit 8b84442 into Lightprotocol:master Sep 23, 2026
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.

2 participants