Documentation
¶
Index ¶
- Variables
- func DSASign(sym [57]byte, pub Point, msg []byte) [114]byte
- func DSAVerify(sig [114]byte, pub Point, msg []byte) bool
- func Ed448DeriveSecret(pubkey PublicKey, privkey PrivateKey) [56]byte
- func Ed448Sign(privkey PrivateKey, message []byte) [114]byte
- func Ed448Verify(pubkey PublicKey, signature, message []byte) bool
- func EdPrivateKeyToX448(edKey PrivateKey) [56]byte
- func EdPublicKeyToX448(edKey PublicKey) [56]byte
- func SignSecretAndNonce(secret, n PrivateKey, msg []byte) [114]byte
- func SignWithPrivate(privkey PrivateKey, message []byte) [114]byte
- type Point
- func NewPoint(a [nLimbs]uint32, b [nLimbs]uint32, c [nLimbs]uint32, d [nLimbs]uint32) Point
- func NewPointFromBytes(in ...[]byte) Point
- func PointByPrivate(p PrivateKey) Point
- func PointBySecret(p PrivateKey) Point
- func PointDoubleScalarMulNonsecret(q Point, a, b Scalar) Point
- func PointScalarMul(q Point, a Scalar) Point
- func PrecomputedScalarMul(a Scalar) Point
- type PrivateKey
- type PublicKey
- type Scalar
Constants ¶
This section is empty.
Variables ¶
var ( // Cofactor is the ratio between the order of the group (p) and the one // from the subgroup (q). Cofactor = byte(4) //ScalarQ is the prime order of the curve (q). ScalarQ = &scalar{ 0xab5844f3, 0x2378c292, 0x8dc58f55, 0x216cc272, 0xaed63690, 0xc44edb49, 0x7cca23e9, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff, 0x3fffffff, } //BasePoint is the base point of the curve. BasePoint = &twExtendedPoint{ &bigNumber{ 0x0ffffffe, 0x0fffffff, 0x0fffffff, 0x0fffffff, 0x0fffffff, 0x0fffffff, 0x0fffffff, 0x0fffffff, 0x00000003, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, }, &bigNumber{ 0x0f752992, 0x081e6d37, 0x01c28721, 0x03078ead, 0x0394666c, 0x0135cfd2, 0x00506061, 0x041149c5, 0x0f5490b3, 0x031d30e4, 0x090dc141, 0x09020149, 0x04c1e328, 0x052341b0, 0x03c10a1b, 0x01423785, }, &bigNumber{ 0x0ffffffb, 0x0fffffff, 0x0fffffff, 0x0fffffff, 0x0fffffff, 0x0fffffff, 0x0fffffff, 0x0fffffff, 0x0ffffffe, 0x0fffffff, 0x0fffffff, 0x0fffffff, 0x0fffffff, 0x0fffffff, 0x0fffffff, 0x0fffffff, }, &bigNumber{ 0x00660415, 0x08f205b7, 0x0fd3824f, 0x0881c60c, 0x0d08500d, 0x0377a638, 0x04672615, 0x08c66d5d, 0x08e08e13, 0x0e52fa55, 0x01b6983d, 0x087770ae, 0x0a0aa7ff, 0x04388f55, 0x05cf1a91, 0x0b4d9a78, }, } )
Functions ¶
func DSASign ¶
DSASign implements EdDSA style signing for Ed448 - equivalent of goldilocks_ed448_sign
func DSAVerify ¶
DSAVerify implements EdDSA style verifying for Ed448 equivalent of goldilocks_ed48_verify
func Ed448DeriveSecret ¶
func Ed448DeriveSecret(pubkey PublicKey, privkey PrivateKey) [56]byte
func Ed448Sign ¶
func Ed448Sign(privkey PrivateKey, message []byte) [114]byte
func Ed448Verify ¶
func EdPrivateKeyToX448 ¶
func EdPrivateKeyToX448(edKey PrivateKey) [56]byte
func EdPublicKeyToX448 ¶
func SignSecretAndNonce ¶
func SignSecretAndNonce(secret, n PrivateKey, msg []byte) [114]byte
func SignWithPrivate ¶
func SignWithPrivate(privkey PrivateKey, message []byte) [114]byte
Types ¶
type Point ¶
type Point interface {
IsOnCurve() bool
Equals(q Point) bool
EqualsMask(q Point) uint32
Copy() Point
Add(q, r Point)
Sub(q, r Point)
Double() Point
Encode() []byte
Decode(src []byte, identity bool) (bool, error)
EdDSAEncode() []byte
EdDSADecode(src []byte) bool
}
Point is a interface of a Ed448 point
func NewPointFromBytes ¶
NewPointFromBytes returns an Ed448 point from a byte slice.
func PointByPrivate ¶
func PointByPrivate(p PrivateKey) Point
func PointBySecret ¶
func PointBySecret(p PrivateKey) Point
func PointDoubleScalarMulNonsecret ¶
PointDoubleScalarMulNonsecret returns the addition of two multiplications: a given point (q) by a given scalar (b) and the base point of the curve by a given scalar (a): q * b + basePoint * a. @warning: This function takes variable time, and may leak the scalars used. It is designed for signature verification.
func PointScalarMul ¶
PointScalarMul returns the multiplication of a given point (p) by a given scalar (a): q * a.
func PrecomputedScalarMul ¶
PrecomputedScalarMul returns the multiplication of a given scalar (a) by the precomputed base point of the curve: basePoint * a.
type PrivateKey ¶
type PrivateKey [57]byte
func BytesToPrivateKey ¶
func BytesToPrivateKey(key []byte) (pk PrivateKey)
func Ed448GenerateKey ¶
func Ed448GenerateKey(reader io.Reader) (PrivateKey, error)
func PrivateToSecret ¶
func PrivateToSecret(pk PrivateKey) PrivateKey
type PublicKey ¶
type PublicKey [57]byte
func BytesToPublicKey ¶
func Ed448DerivePublicKey ¶
func Ed448DerivePublicKey(privkey PrivateKey) PublicKey
func PrivateToPublic ¶
func PrivateToPublic(privkey PrivateKey) PublicKey
func SecretToPublic ¶
func SecretToPublic(sk PrivateKey) PublicKey