Skip to content

fix: increase MAX_SIG_STRUCTURE_SIZE to 8192#5

Merged
newtsjamie merged 1 commit into
mainfrom
fix/increase-sig-structure-size
Apr 7, 2026
Merged

fix: increase MAX_SIG_STRUCTURE_SIZE to 8192#5
newtsjamie merged 1 commit into
mainfrom
fix/increase-sig-structure-size

Conversation

@newtsjamie

@newtsjamie newtsjamie commented Apr 7, 2026

Copy link
Copy Markdown
Member

Summary

  • Increase MAX_SIG_STRUCTURE_SIZE from 5120 to 8192 in all 3 proof_b circuits
  • CapCut videos have sig_structure of 5241 bytes (RSA-4096 GlobalSign intermediate), exceeding the 5120 limit

Rationale

8192 chosen to handle:

  • Current: CapCut ~5241, Adobe ~4400, ChatGPT ~2700
  • Future: RSA-4096 3-cert chains up to ~6400 bytes
  • Enterprise: 4-cert chains up to ~8000 bytes

sha256_var() only hashes actual bytes — unused buffer costs zero constraints. Only signers with larger chains pay extra proving cost.

Test plan

  • Compile all 3 circuits with nargo compile
  • Verify existing signers (Adobe, ChatGPT, Leica, Google) still prove correctly
  • Verify CapCut video (5241 byte sig_structure) proves successfully

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Enhancements
    • Increased maximum buffer capacity for signature structures to support larger certificate chains and complex cryptographic configurations.

CapCut/Bytedance videos have sig_structure of 5241 bytes (RSA-4096
intermediate chain), exceeding the 5120 limit. Increase to 8192 to
accommodate RSA-4096 chains and future enterprise 4-cert chains.

sha256_var only hashes actual bytes, so unused buffer costs zero
constraints — only signers with larger chains pay the extra cost.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Apr 7, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a74fbc3c-36ad-415b-afa4-42b372bebdf3

📥 Commits

Reviewing files that changed from the base of the PR and between 8e7db67 and 7ac06dd.

📒 Files selected for processing (3)
  • proof_b/src/main.nr
  • proof_b_es256/src/main.nr
  • proof_b_ps256/src/main.nr

📝 Walkthrough

Walkthrough

Three Noir modules increased the MAX_SIG_STRUCTURE_SIZE constant from 5120 to 8192 bytes, expanding the buffer capacity for CBOR-encoded COSE Sig_structure. Comments were updated to reflect the new sizing basis. No logic, assertions, or interface signatures were altered.

Changes

Cohort / File(s) Summary
Buffer Size Configuration
proof_b/src/main.nr, proof_b_es256/src/main.nr, proof_b_ps256/src/main.nr
Increased MAX_SIG_STRUCTURE_SIZE from 5120 to 8192 bytes and updated associated documentation to reflect revised sizing rationale based on DER-encoded certificate chain dimensions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 Buffers grow in threes today,
5120 hops to 8192's way,
More room for certs and sig's embrace,
A hoppy change with breathing space!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately captures the main change: increasing MAX_SIG_STRUCTURE_SIZE to 8192 across all three proof_b circuits. It is specific, concise, and clearly communicates the primary modification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/increase-sig-structure-size

Comment @coderabbitai help to get the list of available commands and usage tips.

@newtsjamie newtsjamie merged commit 80e2a8a into main Apr 7, 2026
18 checks passed
@newtsjamie newtsjamie deleted the fix/increase-sig-structure-size branch April 10, 2026 09:37
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.

1 participant