edwards25519

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 21, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package edwards25519 implements RFC9380 for the edwards25519 group, and returns points and scalars in filippo.io/edwards25519.

Index

Constants

View Source
const (
	// H2C represents the hash-to-curve string identifier.
	H2C = "edwards25519_XMD:SHA-512_ELL2_RO_"

	// E2C represents the encode-to-curve string identifier.
	E2C = "edwards25519_XMD:SHA-512_ELL2_NU_"
)

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 Elligator2Edwards

func Elligator2Edwards(e *field.Element) *edwards25519.Point

Elligator2Edwards maps the field element to a point on Edwards25519.

func Elligator2Montgomery

func Elligator2Montgomery(e *field.Element) (x, y *field.Element)

Elligator2Montgomery implements the Elligator2 mapping to Curve25519.

func EncodeToCurve

func EncodeToCurve(input, dst []byte) *edwards25519.Point

EncodeToCurve implements encode-to-curve mapping to Edwards25519 of input with dst. The DST must not be empty or nil, and is recommended to be longer than 16 bytes.

func HashToCurve

func HashToCurve(input, dst []byte) *edwards25519.Point

HashToCurve implements hash-to-curve mapping to Edwards25519 of input with dst. The DST must not be empty or nil, and is recommended to be longer than 16 bytes.

func HashToScalar

func HashToScalar(input, dst []byte) *edwards25519.Scalar

HashToScalar returns a safe mapping of the arbitrary input to a scalar for the Edwards25519 group. The DST must not be empty or nil, and is recommended to be longer than 16 bytes.

func MontgomeryToEdwards

func MontgomeryToEdwards(u, v *field.Element) (x, y *field.Element)

MontgomeryToEdwards lifts a Curve25519 point to its Edwards25519 equivalent.

func MontgomeryUToEdwardsY

func MontgomeryUToEdwardsY(u *field.Element) *field.Element

MontgomeryUToEdwardsY transforms a Curve25519 x (or u) coordinate to an Edwards25519 y coordinate.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL