Thanks to visit codestin.com
Credit goes to pkg.go.dev

hash_to_curve

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2025 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func G1Isogeny

func G1Isogeny(pX, pY *fp.Element)

G1 computes the isogeny map of the curve element, given by its coordinates pX and pY. It mutates the coordinates pX and pY to the new coordinates of the isogeny map.

func G1IsogenyMap

func G1IsogenyMap() [4][]fp.Element

G1IsogenyMap returns the isogeny map for the curve. The isogeny map is a list of polynomial coefficients for the x and y coordinate computation. The order of the coefficients is as follows: - x numerator, x denominator, y numerator, y denominator.

func G1MulByZ

func G1MulByZ(z *fp.Element, x *fp.Element)

G1MulByZ multiplies x by [11] and stores the result in z

func G1NotZero

func G1NotZero(x *fp.Element) uint64

func G1SSWUIsogenyCurveCoefficients

func G1SSWUIsogenyCurveCoefficients() (A fp.Element, B fp.Element)

G1SSWUCurveCoefficients returns the coefficients of the SSWU curve.

func G1SSWUIsogenyZ

func G1SSWUIsogenyZ() fp.Element

G1SSWUIsogenyZ returns the recommended Z value of the SSWU curve.

See https://www.rfc-editor.org/rfc/rfc9380.html#weierstrass

func G1Sgn0

func G1Sgn0(z *fp.Element) uint64

G1Sgn0 is an algebraic substitute for the notion of sign in ordered fields. Namely, every non-zero quadratic residue in a finite field of characteristic =/= 2 has exactly two square roots, one of each sign.

See: https://www.rfc-editor.org/rfc/rfc9380.html#name-the-sgn0-function

The sign of an element is not obviously related to that of its Montgomery form

func G1SqrtRatio

func G1SqrtRatio(z *fp.Element, u *fp.Element, v *fp.Element) uint64

G1SqrtRatio computes the square root of u/v and returns 0 iff u/v was indeed a quadratic residue. If not, we get sqrt(Z * u / v). Recall that Z is non-residue. If v = 0, u/v is meaningless and the output is unspecified, without raising an error. The main idea is that since the computation of the square root involves taking large powers of u/v, the inversion of v can be avoided

func G2Isogeny

func G2Isogeny(pX, pY *fptower.E2)

G2 computes the isogeny map of the curve element, given by its coordinates pX and pY. It mutates the coordinates pX and pY to the new coordinates of the isogeny map.

func G2IsogenyMap

func G2IsogenyMap() [4][]fptower.E2

G2IsogenyMap returns the isogeny map for the curve. The isogeny map is a list of polynomial coefficients for the x and y coordinate computation. The order of the coefficients is as follows: - x numerator, x denominator, y numerator, y denominator.

func G2MulByZ

func G2MulByZ(z *fptower.E2, x *fptower.E2)

G2MulByZ multiplies x by [-2, -1] and stores the result in z

func G2NotZero

func G2NotZero(x *fptower.E2) uint64

func G2SSWUIsogenyCurveCoefficients

func G2SSWUIsogenyCurveCoefficients() (A fptower.E2, B fptower.E2)

G2SSWUCurveCoefficients returns the coefficients of the SSWU curve.

func G2SSWUIsogenyZ

func G2SSWUIsogenyZ() fptower.E2

G2SSWUIsogenyZ returns the recommended Z value of the SSWU curve.

See https://www.rfc-editor.org/rfc/rfc9380.html#weierstrass

func G2Sgn0

func G2Sgn0(z *fptower.E2) uint64

G2Sgn0 is an algebraic substitute for the notion of sign in ordered fields. Namely, every non-zero quadratic residue in a finite field of characteristic =/= 2 has exactly two square roots, one of each sign.

See: https://www.rfc-editor.org/rfc/rfc9380.html#name-the-sgn0-function

The sign of an element is not obviously related to that of its Montgomery form

func G2SqrtRatio

func G2SqrtRatio(z *fptower.E2, u *fptower.E2, v *fptower.E2) uint64

G2SqrtRatio computes the square root of u/v and returns 0 iff u/v was indeed a quadratic residue. If not, we get sqrt(Z * u / v). Recall that Z is non-residue. If v = 0, u/v is meaningless and the output is unspecified, without raising an error. The main idea is that since the computation of the square root involves taking large powers of u/v, the inversion of v can be avoided

Types

This section is empty.

Jump to

Keyboard shortcuts

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