go1.20.5
GoThrough

curve25519.PointSize

// PointSize is the size of the point input to X25519. const PointSize = 32

curve25519.ScalarSize

// ScalarSize is the size of the scalar input to X25519. const ScalarSize = 32

curve25519.Basepoint

// Basepoint is the canonical Curve25519 generator. var Basepoint []byte

curve25519.ScalarBaseMult

// ScalarBaseMult sets dst to the product scalar * base where base is the // standard generator. // // It is recommended to use the X25519 function with Basepoint instead, as // copying into fixed size arrays can lead to unexpected bugs. func ScalarBaseMult(dst *[32]byte, scalar *[32]byte)

curve25519.ScalarMult

// ScalarMult sets dst to the product scalar * point. // // Deprecated: when provided a low-order point, ScalarMult will set dst to all // zeroes, irrespective of the scalar. Instead, use the X25519 function, which // will return an error. func ScalarMult(dst *[32]byte, scalar *[32]byte, point *[32]byte)

curve25519.X25519

// X25519 returns the result of the scalar multiplication (scalar * point), // according to RFC 7748, Section 5. scalar, point and the return value are // slices of 32 bytes. // // scalar can be generated at random, for example with crypto/rand. point should // be either Basepoint or the output of another X25519 call. // // If point is Basepoint (but not if it's a different slice with the same // contents) a precomputed implementation might be used for performance. func X25519(scalar []byte, point []byte) ([]byte, error)