Skip to content

Add GenerateCosignatureV1Key and NewStrictVerifierForCosignatureV1 - #299

Open
mhutchinson wants to merge 1 commit into
transparency-dev:mainfrom
mhutchinson:note-cosigv1-keys
Open

mhutchinson wants to merge 1 commit into
transparency-dev:mainfrom
mhutchinson:note-cosigv1-keys

Conversation

@mhutchinson

Copy link
Copy Markdown
Contributor

Callers had no direct way to generate Ed25519 cosignature/v1 (0x04) key pairs without converting plain Ed25519 keys, and policy parsing had to inspect raw vkey bytes itself to reject non-cosignature witness keys because the existing verifier constructor also accepted plain Ed25519 keys.

  • Add GenerateCosignatureV1Key for direct key type 0x04 generation, matching GenerateMLDSAKey and golang.org/x/mod/sumdb/note.GenerateKey.
  • Add NewStrictVerifierForCosignatureV1 accepting only dedicated C2SP cosignature key types (0x04 and 0x06) while keeping NewVerifierForCosignatureV1 backwards-compatible with 0x01 vkeys.
  • Switch policy.TLogPolicy.Unmarshal to NewStrictVerifierForCosignatureV1, removing its manual witness key-type check TODO.

Callers had no direct way to generate Ed25519 cosignature/v1 (0x04) key pairs without converting plain Ed25519 keys, and policy parsing had to inspect raw vkey bytes itself to reject non-cosignature witness keys because the existing verifier constructor also accepted plain Ed25519 keys.

- Add GenerateCosignatureV1Key for direct key type 0x04 generation, matching GenerateMLDSAKey and golang.org/x/mod/sumdb/note.GenerateKey.
- Add NewStrictVerifierForCosignatureV1 accepting only dedicated C2SP cosignature key types (0x04 and 0x06) while keeping NewVerifierForCosignatureV1 backwards-compatible with 0x01 vkeys.
- Switch policy.TLogPolicy.Unmarshal to NewStrictVerifierForCosignatureV1, removing its manual witness key-type check TODO.
@mhutchinson
mhutchinson requested a review from a team as a code owner November 11, 2026 16:18
@mhutchinson
mhutchinson requested a review from roger2hk November 11, 2026 16:18
@codecov-commenter

codecov-commenter commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.18%. Comparing base (fa00c16) to head (1c88c74).
⚠️ Report is 207 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #299      +/-   ##
==========================================
+ Coverage   82.57%   92.18%   +9.61%     
==========================================
  Files           5       10       +5     
  Lines         241     1113     +872     
==========================================
+ Hits          199     1026     +827     
- Misses         30       87      +57     
+ Partials       12        0      -12     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mhutchinson
mhutchinson requested review from AlCutter and removed request for roger2hk November 11, 2026 16:19
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