Skip to content

mtpublisher: ML-DSA signatures using trees/cosignature - #8933

Open
beautifulentropy wants to merge 1 commit into
mainfrom
mtpublisher-use-cosignature
Open

mtpublisher: ML-DSA signatures using trees/cosignature#8933
beautifulentropy wants to merge 1 commit into
mainfrom
mtpublisher-use-cosignature

Conversation

@beautifulentropy

@beautifulentropy beautifulentropy commented Aug 6, 2026

Copy link
Copy Markdown
Member

Generate the mirror key pair in genmtpki, load the mirror key through privatekey.Load(), and load the mirror public key through a new loadMLDSAPublicKey(). Grant the mtpublisher user SELECT on latestCheckpoint. The mtpublisher's checkpoint query is now identical to the mtca's and will soon replace it.

Part of #8738

@beautifulentropy
beautifulentropy marked this pull request as ready for review August 6, 2026 19:38
@beautifulentropy
beautifulentropy requested a review from a team as a code owner August 6, 2026 19:38
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

@beautifulentropy, this PR appears to contain configuration and/or SQL schema changes. Please ensure that a corresponding deployment ticket has been filed with the new values.

@beautifulentropy
beautifulentropy force-pushed the mtpublisher-use-cosignature branch 2 times, most recently from ee37590 to da140c6 Compare August 7, 2026 14:07
@beautifulentropy
beautifulentropy removed the request for review from aarongable August 7, 2026 15:49
@beautifulentropy
beautifulentropy force-pushed the mtpublisher-use-cosignature branch from 2cc1b2e to 1048f2f Compare August 7, 2026 17:25

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

LGTM modulo some config concerns.

Comment on lines +44 to +46
// MirrorKeyFile holds the PEM-encoded ML-DSA-44 private key used to
// cosign checkpoints.
MirrorKeyFile string `validate:"required"`

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.

This feels easy to lose track of. This is a test-only stopgap until there are mirror instances out there to do real cosigning. I think this needs to be dripping in red flags -- config key name, doc string, etc -- indicating that it is test only.

Same goes for MirrorPublicKeyFile and MirrorID config keys above.

@beautifulentropy beautifulentropy Aug 12, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is will be coming out quite quickly. My next task is/was to separate the mirror from the publisher and establish an interface that makes it easy to mock out the Mirror in Publisher unit tests along with the Publisher and Mirror in MTCA unit tests. The part of this is delivered in #8934, the latter half is larger and forthcoming.


// MirrorPublicKeyFile holds the PEM-encoded ML-DSA-44 public key used
// to verify cosignatures.
MirrorPublicKeyFile string `validate:"required"`

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.

Is MirrorPublicKeyFile actually necessary? Since we're loading the private key, can't we just use privatekey.Public() to get the bit we need for the Verifier?

This would also allow loadMLDSAPublicKey to be dropped from this PR.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is actually quite necessary; as I mentioned above the private key will be coming out but cosignature verification is still essential.

"SELECT id, mtcLogID, treeSize, mirrorSignature FROM checkpoints WHERE mtcLogID = ? ORDER BY treeSize DESC LIMIT 1",
`SELECT id, checkpoints.mtcLogID, mtcaSignature, mirrorID,
mirrorSignature, treeSize, rootHash
FROM latestCheckpoint JOIN checkpoints

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.

JOINs make me nervous from a performance standpoint, but also I'm not good enough at databases to analyze whether this is well-constructed. Can you justify this construction in a comment?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This and the query below is line for line the same query used in the MTCA today and being removed from it in #8934, a PR which depends on this change.

Given this is a simple relocation, do you feel it still warrants a comment?

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