R, RRsource
const (
R = 4294967296 // 2³²
RR = 2365951 // R² mod q, aka R in the Montgomery domain
)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) []bytefunc 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) errorfunc VerifyExternalMu(pub *PublicKey, μ []byte, sig []byte) errortype PrivateKey struct {
// contains filtered or unexported fields
}func GenerateKey44() *PrivateKeyfunc GenerateKey65() *PrivateKeyfunc GenerateKey87() *PrivateKeyfunc 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.
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)