const (
R = 4294967296 // 2³²
RR = 2365951 // R² mod q, aka R in the Montgomery domain
)
const (
PrivateKeySize = 32
PublicKeySize44 = 32 + 4*n*10/8
PublicKeySize65 = 32 + 6*n*10/8
PublicKeySize87 = 32 + 8*n*10/8
SignatureSize44 = 128/4 + 4*n*(17+1)/8 + 80 + 4
SignatureSize65 = 192/4 + 5*n*(19+1)/8 + 55 + 6
SignatureSize87 = 256/4 + 7*n*(19+1)/8 + 75 + 8
)
func Sign(priv *PrivateKey, msg []byte, context string) ([]byte, error)
func SignDeterministic(priv *PrivateKey, msg []byte, context string) ([]byte, error)
func SignExternalMu(priv *PrivateKey, μ []byte) ([]byte, error)
func SignExternalMuDeterministic(priv *PrivateKey, μ []byte) ([]byte, error)
func TestingOnlyPrivateKeySemiExpandedBytes(priv *PrivateKey) []byte
func TestingOnlySignExternalMuWithRandom(priv *PrivateKey, μ []byte, random []byte) ([]byte, error)
func TestingOnlySignWithRandom(priv *PrivateKey, msg []byte, context string, random []byte) ([]byte, error)
func Verify(pub *PublicKey, msg, sig []byte, context string) error
func VerifyExternalMu(pub *PublicKey, μ []byte, sig []byte) error
type PrivateKey struct {
// contains filtered or unexported fields
}
func GenerateKey44() *PrivateKey
func GenerateKey65() *PrivateKey
func GenerateKey87() *PrivateKey
func NewPrivateKey44(seed []byte) (*PrivateKey, error)
func NewPrivateKey65(seed []byte) (*PrivateKey, error)
func NewPrivateKey87(seed []byte) (*PrivateKey, error)
func TestingOnlyNewPrivateKeyFromSemiExpanded(sk []byte) (*PrivateKey, error)
TestingOnlyNewPrivateKeyFromSemiExpanded creates a PrivateKey from a semi-expanded private key encoding, for testing purposes. It rejects inconsistent keys.
PrivateKey.Bytes must NOT be called on the resulting key, as it will produce a random value.
func (priv *PrivateKey) Bytes() []byte
func (priv *PrivateKey) Equal(x *PrivateKey) bool
func (priv *PrivateKey) PublicKey() *PublicKey
type PublicKey struct {
// contains filtered or unexported fields
}
func NewPublicKey44(pk []byte) (*PublicKey, error)
func NewPublicKey65(pk []byte) (*PublicKey, error)
func NewPublicKey87(pk []byte) (*PublicKey, error)
func (pub *PublicKey) Bytes() []byte
func (pub *PublicKey) Equal(x *PublicKey) bool
func (pub *PublicKey) Parameters() string