mirror of
https://github.com/luxfi/crypto.git
synced 2026-07-27 01:54:50 +00:00
feat(pqc): add VerifySignature simplified API
- Add VerifySignature method to ML-DSA and SLH-DSA public keys - Keep Verify method for crypto.Signer compatibility - Add documentation clarifying opts parameter is ignored
This commit is contained in:
@@ -192,7 +192,13 @@ func (priv *PrivateKey) Sign(rand io.Reader, message []byte, opts crypto.SignerO
|
||||
}
|
||||
|
||||
// Verify verifies a signature with the public key using circl
|
||||
// The opts parameter is ignored but kept for crypto.Signer interface compatibility
|
||||
func (pub *PublicKey) Verify(message, signature []byte, opts crypto.SignerOpts) bool {
|
||||
return pub.VerifySignature(message, signature)
|
||||
}
|
||||
|
||||
// VerifySignature verifies a signature with the public key (simplified API)
|
||||
func (pub *PublicKey) VerifySignature(message, signature []byte) bool {
|
||||
switch pub.mode {
|
||||
case MLDSA44:
|
||||
var pk mldsa44.PublicKey
|
||||
|
||||
@@ -205,7 +205,13 @@ func (priv *PrivateKey) Sign(rand io.Reader, message []byte, opts crypto.SignerO
|
||||
}
|
||||
|
||||
// Verify verifies a signature with the public key using circl
|
||||
// The opts parameter is ignored but kept for crypto.Signer interface compatibility
|
||||
func (pub *PublicKey) Verify(message, signature []byte, opts crypto.SignerOpts) bool {
|
||||
return pub.VerifySignature(message, signature)
|
||||
}
|
||||
|
||||
// VerifySignature verifies a signature with the public key (simplified API)
|
||||
func (pub *PublicKey) VerifySignature(message, signature []byte) bool {
|
||||
id := modeToID(pub.mode)
|
||||
if !id.IsValid() {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user