Documentation ¶
Overview ¶
Package hash2curve provides hash-to-curve compatible hashing over arbitrary input.
Currently, it is specifically suited for hashing to Ristretto255, Curve25519, and Edwards25519. It implements the latest hash-to-curve specification to date (https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-hash-to-curve-11).
Package hash2curve provides hash-to-curve compatible hashing over arbitrary input.
Package hash2curve provides hash-to-curve compatible input expansion.
Package hash2curve provides hash-to-curve compatible input expansion.
Package hash2curve provides hash-to-curve compatible input expansion.
Index ¶
- func AffineToEdwards(x, y *field.Element) *edwards25519.Point
- func Elligator2Montgomery(e *field.Element) (x, y *field.Element)
- func ExpandXMD(id crypto.Hash, input, dst []byte, length int) []byte
- func ExpandXOF(id x.Extensible, input, dst []byte, length int) []byte
- func HashToEdwards25519(input, dst []byte) *edwards25519.Point
- func HashToFieldXMD(id crypto.Hash, input, dst []byte, length int) (u, v *field.Element)
- func HashToScalarXMD(id crypto.Hash, input, dst []byte, length int) []byte
- func MapToEdwards(e *field.Element) *edwards25519.Point
- func MontgomeryToEdwards(u, v *field.Element) (x, y *field.Element)
- func MontgomeryUToEdwardsY(u *field.Element) *field.Element
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AffineToEdwards ¶
func AffineToEdwards(x, y *field.Element) *edwards25519.Point
AffineToEdwards takes the affine coordinates of an Edwards25519 and returns a pointer to Point represented in extended projective coordinates.
func Elligator2Montgomery ¶
Elligator2Montgomery implements the Elligator2 mapping to Curve25519.
func ExpandXOF ¶
func ExpandXOF(id x.Extensible, input, dst []byte, length int) []byte
ExpandXOF expands the input and dst using the given extensible output hash function.
func HashToEdwards25519 ¶
func HashToEdwards25519(input, dst []byte) *edwards25519.Point
HashToEdwards25519 implements hash-to-curve mapping to Edwards25519 of input with dst.
func HashToFieldXMD ¶
HashToFieldXMD hashes the input and dst to the field and returns two field elements destined to be mapped to points on the destination curve.
func HashToScalarXMD ¶
HashToScalarXMD hashes the input and dst to the field and returns a uniformly distributed byte array, that can be used as a scalar.
func MapToEdwards ¶
func MapToEdwards(e *field.Element) *edwards25519.Point
MapToEdwards maps the field element to a point on Edwards25519.
func MontgomeryToEdwards ¶
MontgomeryToEdwards lifts a Curve25519 point to its Edwards25519 equivalent.
Types ¶
This section is empty.