Documentation ¶
Overview ¶
Package fourq implements FourQ, a high-speed elliptic curve at the 128-bit security level.
Index ¶
- Variables
- func IsOnCurve(pt [32]byte) bool
- func IsOnCurveU(pt [64]byte) bool
- func ScalarBaseMult(k []byte) ([32]byte, bool)
- func ScalarBaseMultU(k []byte) ([64]byte, bool)
- func ScalarMult(pt [32]byte, k []byte, clearCofactor bool) ([32]byte, bool)
- func ScalarMultU(pt [64]byte, k []byte, clearCofactor bool) ([64]byte, bool)
Constants ¶
This section is empty.
Variables ¶
var (
Order, _ = new(big.Int).SetString("73846995687063900142583536357581573884798075859800097461294096333596429543", 10)
// G is the compressed generator point.
G = [32]byte{
0x87, 0xb2, 0xcb, 0x2b, 0x46, 0xa2, 0x24, 0xb9,
0x5a, 0x78, 0x20, 0xa1, 0x9b, 0xee, 0x3f, 0x0e,
0x5c, 0x8b, 0x4c, 0x84, 0x44, 0xc3, 0xa7, 0x49,
0x42, 0x02, 0x0e, 0x63, 0xf8, 0x4a, 0x1c, 0x6e,
}
// GU is the uncompressed generator point.
GU = [64]byte{
0xaa, 0x33, 0x38, 0x7b, 0xad, 0x92, 0x65, 0x28,
0x05, 0xb3, 0x2f, 0x7c, 0x23, 0x72, 0x34, 0x1a,
0xf6, 0x77, 0xac, 0x60, 0xb3, 0x9f, 0x86, 0x96,
0x9c, 0xaa, 0x78, 0x28, 0x3f, 0x55, 0x1f, 0x1e,
0x87, 0xb2, 0xcb, 0x2b, 0x46, 0xa2, 0x24, 0xb9,
0x5a, 0x78, 0x20, 0xa1, 0x9b, 0xee, 0x3f, 0x0e,
0x5c, 0x8b, 0x4c, 0x84, 0x44, 0xc3, 0xa7, 0x49,
0x42, 0x02, 0x0e, 0x63, 0xf8, 0x4a, 0x1c, 0x6e,
}
)
Functions ¶
func IsOnCurve ¶
IsOnCurve returns true if pt represents a compressed point on the curve (including the identity point and points in a non-prime order subgroup) and false otherwise.
func IsOnCurveU ¶
IsOnCurveU returns true if pt represents an uncompressed point on the curve.
func ScalarBaseMult ¶
ScalarBaseMult returns the generator multiplied by scalar k, compressed. k's slice should be 32 bytes long or shorter (or the function will return nil and false).
func ScalarBaseMultU ¶
ScalarBaseMultU returns the generator multiplied by scalar k, uncompressed.
func ScalarMult ¶
ScalarMult returns the compressed point multiplied by scalar k. The function returns false if pt does not represent a point on the curve, of if the output is the identity point. When clearCofactor=true, it additionally returns false when pt is not in the prime-order subgroup.
Types ¶
This section is empty.