Skip to content

Add and use richer interfaces for signer/subtreesigner.#264

Merged
AlCutter merged 1 commit into
transparency-dev:mainfrom
AlCutter:note_interfaces
Jul 10, 2026
Merged

Add and use richer interfaces for signer/subtreesigner.#264
AlCutter merged 1 commit into
transparency-dev:mainfrom
AlCutter:note_interfaces

Conversation

@AlCutter

Copy link
Copy Markdown
Collaborator

This allows custom out-of-tree implementations, e.g. signers backend by HSMs, to be used across the transparency-dev repos, where formats/note Signers are used.

This is a breaking change, but likely to pass un-noticed in most uses of these signers/verifiers, but locations which create new signers and returned pointers to these type will need a small tweak to fix.

@AlCutter AlCutter requested a review from roger2hk July 10, 2026 11:18
@AlCutter AlCutter requested a review from a team as a code owner July 10, 2026 11:18
@codecov-commenter

codecov-commenter commented Jul 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.90909% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.58%. Comparing base (fa00c16) to head (34d6663).
⚠️ Report is 175 commits behind head on main.

Files with missing lines Patch % Lines
note/note_cosigv1.go 90.90% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #264      +/-   ##
==========================================
- Coverage   82.57%   76.58%   -6.00%     
==========================================
  Files           5        8       +3     
  Lines         241      696     +455     
==========================================
+ Hits          199      533     +334     
- Misses         30       90      +60     
- Partials       12       73      +61     

☔ 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.

@roger2hk roger2hk 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.

Add new unit tests to cover the newly added NewMLDSASigner, NewMLDSAVerifier, or the algMLDSA44 case in NewSignerForCosignatureV1.

Comment thread note/note_cosigv1.go

// SubtreeSigner is a signer that can produce both note and subtree signatures.
type SubtreeSigner struct {
type subtreeSigner struct {

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.

Suggested change
type subtreeSigner struct {
// subtreeSigner is a concrete implementation of the extended SubtreeSigner interface above.
type subtreeSigner struct {

This allows other implementations, e.g. signers backend by HSMs, to be
used across the transparency-dev repos, where formats/note Signers are used.
@AlCutter

Copy link
Copy Markdown
Collaborator Author

Add new unit tests to cover the newly added NewMLDSASigner, NewMLDSAVerifier, or the algMLDSA44 case in NewSignerForCosignatureV1.

Maybe I'm not understanding, but this fairly unrelated to the PR, which is just abstracting an interface... Those c'tors were already present, and there are also already tests for NewMLDSA and NewMLDSAVerifier:

$ grep -e "NewMLDSA\(Signer\|Verifier\)" note/*test.go
note/note_cosigv1_test.go:      signer, err := NewMLDSASigner(skey)
note/note_cosigv1_test.go:      verifier, err := NewMLDSAVerifier(vkey)
note/note_cosigv1_test.go:      signer, err := NewMLDSASigner(skey)
note/note_cosigv1_test.go:                      s, err := NewMLDSASigner(skey)
note/note_cosigv1_test.go:                              t.Fatalf("NewMLDSASigner(%q): %v", skey, err)
note/note_cosigv1_test.go:                      v, err := NewMLDSAVerifier(vkey)
note/note_cosigv1_test.go:                              t.Fatalf("NewMLDSAVerifier(%q): %v", vkey, err)

Happy to double back and add more tests later if you think they're necessary, though.

@AlCutter AlCutter merged commit af9e607 into transparency-dev:main Jul 10, 2026
14 checks passed
@AlCutter AlCutter deleted the note_interfaces branch July 10, 2026 12:48
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