Documentation
¶
Overview ¶
Package sign provides post-quantum signature algorithms
Index ¶
- func VerifyTranscript(signer Signer, pk PublicKey, transcript, signature []byte) bool
- type MLDSA2Impl
- func (m *MLDSA2Impl) GenerateKeyPair() (PublicKey, PrivateKey, error)
- func (m *MLDSA2Impl) PrivateKeySize() int
- func (m *MLDSA2Impl) PublicKeySize() int
- func (m *MLDSA2Impl) Sign(sk PrivateKey, message []byte) ([]byte, error)
- func (m *MLDSA2Impl) SignatureSize() int
- func (m *MLDSA2Impl) Verify(pk PublicKey, message, signature []byte) bool
- type MLDSA2PrivateKey
- type MLDSA2PublicKey
- type MLDSA3Impl
- func (m *MLDSA3Impl) GenerateKeyPair() (PublicKey, PrivateKey, error)
- func (m *MLDSA3Impl) PrivateKeySize() int
- func (m *MLDSA3Impl) PublicKeySize() int
- func (m *MLDSA3Impl) Sign(sk PrivateKey, message []byte) ([]byte, error)
- func (m *MLDSA3Impl) SignatureSize() int
- func (m *MLDSA3Impl) Verify(pk PublicKey, message, signature []byte) bool
- type PrivateKey
- type PublicKey
- type SigID
- type Signer
- type TranscriptSigner
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MLDSA2Impl ¶
type MLDSA2Impl struct{}
MLDSA2Impl implements ML-DSA-44 (Dilithium2)
func (*MLDSA2Impl) GenerateKeyPair ¶
func (m *MLDSA2Impl) GenerateKeyPair() (PublicKey, PrivateKey, error)
GenerateKeyPair generates a new ML-DSA-44 key pair
func (*MLDSA2Impl) PrivateKeySize ¶
func (m *MLDSA2Impl) PrivateKeySize() int
func (*MLDSA2Impl) PublicKeySize ¶
func (m *MLDSA2Impl) PublicKeySize() int
Size methods for ML-DSA-44
func (*MLDSA2Impl) Sign ¶
func (m *MLDSA2Impl) Sign(sk PrivateKey, message []byte) ([]byte, error)
Sign creates a signature
func (*MLDSA2Impl) SignatureSize ¶
func (m *MLDSA2Impl) SignatureSize() int
type MLDSA2PrivateKey ¶
type MLDSA2PrivateKey struct {
// contains filtered or unexported fields
}
MLDSA2PrivateKey represents an ML-DSA-44 private key
func (*MLDSA2PrivateKey) Equal ¶
func (sk *MLDSA2PrivateKey) Equal(other PrivateKey) bool
func (*MLDSA2PrivateKey) Public ¶
func (sk *MLDSA2PrivateKey) Public() PublicKey
type MLDSA2PublicKey ¶
type MLDSA2PublicKey struct {
// contains filtered or unexported fields
}
MLDSA2PublicKey represents an ML-DSA-44 public key
func (*MLDSA2PublicKey) Equal ¶
func (pk *MLDSA2PublicKey) Equal(other PublicKey) bool
type MLDSA3Impl ¶
type MLDSA3Impl struct{}
MLDSA3Impl implements ML-DSA-65 (Dilithium3)
func (*MLDSA3Impl) GenerateKeyPair ¶
func (m *MLDSA3Impl) GenerateKeyPair() (PublicKey, PrivateKey, error)
GenerateKeyPair generates a new ML-DSA-65 key pair
func (*MLDSA3Impl) PrivateKeySize ¶
func (m *MLDSA3Impl) PrivateKeySize() int
func (*MLDSA3Impl) PublicKeySize ¶
func (m *MLDSA3Impl) PublicKeySize() int
Size methods for ML-DSA-65
func (*MLDSA3Impl) Sign ¶
func (m *MLDSA3Impl) Sign(sk PrivateKey, message []byte) ([]byte, error)
Sign creates a signature
func (*MLDSA3Impl) SignatureSize ¶
func (m *MLDSA3Impl) SignatureSize() int
type PrivateKey ¶
type PrivateKey interface {
Bytes() []byte
Public() PublicKey
Equal(PrivateKey) bool
}
PrivateKey represents a signature private key
type Signer ¶
type Signer interface {
// GenerateKeyPair generates a new signing key pair
GenerateKeyPair() (PublicKey, PrivateKey, error)
// Sign creates a signature
Sign(sk PrivateKey, message []byte) ([]byte, error)
// Verify verifies a signature
Verify(pk PublicKey, message, signature []byte) bool
// PublicKeySize returns the size of public keys
PublicKeySize() int
// PrivateKeySize returns the size of private keys
PrivateKeySize() int
// SignatureSize returns the size of signatures
SignatureSize() int
}
Signer interface for signature algorithms
type TranscriptSigner ¶
type TranscriptSigner struct {
// contains filtered or unexported fields
}
TranscriptSigner signs protocol transcripts
func NewTranscriptSigner ¶
func NewTranscriptSigner(signer Signer, sk PrivateKey) *TranscriptSigner
NewTranscriptSigner creates a new transcript signer
func (*TranscriptSigner) SignTranscript ¶
func (ts *TranscriptSigner) SignTranscript(transcript []byte) ([]byte, error)
SignTranscript signs a protocol transcript