FiloSottile / FiloSottile/mldsa
Verify API can't verify signatures created with crypto.MLDSAMu
- Dominant language
- Go
- Stars
- 7
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
While using the package, I noticed what seems to be an API inconsistency between signing and verification.
``PrivateKey.Sign`` accepts ``crypto.SignerOpts``, allowing callers to use ``mldsacrypto.MLDSAMu``:
```
sig, err := sk.Sign(nil, mu, mldsacrypto.MLDSAMu)
```
Internally this calls ``SignExternalMu``.
However, the public verification API is:
```
func Verify(pk *PublicKey, message []byte, signature []byte, opts *Options) error
```
which only accepts ``*Options``. There doesn't appear to be a way to indicate that message is an externally computed μ representative, and Verify always calls the regular ``mldsa.Verify`` internally.
As a result, a signature produced via ``mldsacrypto.MLDSAMu`` cannot be verified through the public ``Verify`` API. The only corresponding implementation appears to be the internal ``mldsa.VerifyExternalMu``, which is not exported.
Contributor guide
Research direction
Start with PrivateKey.Sign and the public Verify entry point, then trace their calls to SignExternalMu, mldsa.Verify, and mldsa.VerifyExternalMu. Determine how the public API should represent an externally computed μ and confirm that signatures made with mldsacrypto.MLDSAMu can be verified without breaking regular verification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend-api-design, cryptography
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100