Skip to content

feat(eddsa): Bandersnatch in Assign helpers, re-enable the Bandersnat… - #1818

Merged
ivokub merged 2 commits into
Consensys-Incorporated:masterfrom
ZKNoxHQ:feat/bandersnatch-eddsa-assign
Sep 14, 2026
Merged

ivokub merged 2 commits into
Consensys-Incorporated:masterfrom
ZKNoxHQ:feat/bandersnatch-eddsa-assign

Conversation

@rdubois-crypto

@rdubois-crypto rdubois-crypto commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Depends on Consensys-Incorporated/gnark-crypto#882

Description

Solve an incorrect import that drag Jujub instead of Bandersnatch. See also issue 881


Note

Medium Risk
Touches EdDSA witness decoding for a new curve; incorrect parsing would break or mis-verify circuits, but the change is narrow and covered by re-enabled tests.

Overview
Adds Bandersnatch (BLS12-381) support for decompressing public keys and signatures in the std EdDSA Assign path, and bumps gnark-crypto to pick up the matching curve definitions (Consensys-Incorporated/gnark-crypto#882).

parseSignature and parsePoint now handle tedwards.BLS12_381_BANDERSNATCH using ecc/bls12-381/bandersnatch point types instead of the wrong Jubjub/twisted-Edwards import (issue #881). The integration test for Bandersnatch + MiMC is turned back on, with forge-test offset handling aligned to the other 32-byte curves.

Reviewed by Cursor Bugbot for commit a0d0387. Bugbot is set up for automated code reviews on this repo. Configure here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved issues were identified, and the supplied assessments support approval.

Pull request overview

Adds Bandersnatch support to EdDSA key and signature decoding, with renewed integration-test coverage.

Changes:

  • Decode Bandersnatch compressed points using the correct package.
  • Support Bandersnatch signature scalar offsets.
  • Re-enable Bandersnatch EdDSA tests.
File summaries
File Changes
std/signature/eddsa/eddsa.go Adds Bandersnatch point and signature parsing.
std/signature/eddsa/eddsa_test.go Re-enables Bandersnatch EdDSA tests.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ivokub

ivokub commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Depends on Consensys-Incorporated/gnark-crypto#882

Description

Solve an incorrect import that drag Jujub instead of Bandersnatch. See also issue 881

Note

Medium Risk Changes live in signature parsing and witness assignment for a new curve ID; mistakes could break in-circuit verification for Bandersnatch, but the change mirrors existing curve branches and adds test coverage.

Overview Adds Bandersnatch (BLS12_381_BANDERSNATCH) to the EdDSA circuit helpers that decode compressed binary keys and signatures into witness fields.

parsePoint and parseSignature now import and use gnark-crypto/ecc/bls12-381/bandersnatch (instead of the wrong Jubjub/twisted Edwards path) with the same 32-byte compressed layout as BLS12-381 twisted Edwards. Tests re-enable the Bandersnatch MiMC configuration and teach the signature-forge helper the 32-byte S offset for that curve ID.

Depends on Consensys-Incorporated/gnark-crypto#882.

Reviewed by Cursor Bugbot for commit 12fb2c5. Bugbot is set up for automated code reviews on this repo. Configure here.

Thanks for the PR!

gnark-crypto now has the fix, can you also go get github.com/consensys/gnark-crypto@master in this branch? I don't have push permissions to fix it.

@rdubois-crypto
rdubois-crypto force-pushed the feat/bandersnatch-eddsa-assign branch from 12fb2c5 to a0d0387 Compare September 14, 2026 09:45
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgolang/​github.com/​consensys/​gnark-crypto@​v0.21.1-0.20260912000500-b6021c71b163 ⏵ v0.21.1-0.20260913224755-1409fe59205276 +1100100100100

View full report

@rdubois-crypto

Copy link
Copy Markdown
Contributor Author

Done: rebased on master and bumped gnark-crypto to master (go get github.com/consensys/gnark-crypto@master, the pseudo-version carrying #882). TestEddsa passes locally including the re-enabled Bandersnatch configuration; the CodeQL job should be green too now.

@ivokub ivokub left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, looks good -- the tests pass locally for me as well. The failing CI test is due to code generation update which updates the included testing tinyfield package. I'll address it in a separate PR.

@ivokub
ivokub merged commit 888e4de into Consensys-Incorporated:master Sep 14, 2026
15 of 16 checks passed
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