internal

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package internal implements the core functionalities for RFC9380 on NIST groups.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapToCurveSSWU

func MapToCurveSSWU(fp *field.Field, a, b, z, fe *big.Int) (x, y *big.Int)

MapToCurveSSWU implements the Simplified SWU method for Weierstrass curves for any base field.

Types

type NistCurve

type NistCurve[point nistECPoint[point]] struct {
	GroupOrder big.Int
	// contains filtered or unexported fields
}

NistCurve defines the core characteristics of a NIST curve and its prime-order group.

func (*NistCurve[point]) EncodeXMD

func (c *NistCurve[point]) EncodeXMD(input, dst []byte) point

EncodeXMD maps input and dst onto a point on the curve.

func (*NistCurve[point]) HashXMD

func (c *NistCurve[point]) HashXMD(input, dst []byte) point

HashXMD maps input and dst onto a point on the curve.

func (*NistCurve[point]) SetCurveParams

func (c *NistCurve[point]) SetCurveParams(prime *big.Int, newPoint func() point)

SetCurveParams sets the curve's field and utility function for a new point.

func (*NistCurve[point]) SetMapping

func (c *NistCurve[point]) SetMapping(hash crypto.Hash, b *big.Int, z int, secLength uint)

SetMapping sets the curve's parameters for hash-to-curve.

Directories

Path Synopsis
Package field provides modular operations over very high integers.
Package field provides modular operations over very high integers.

Jump to

Keyboard shortcuts

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