hash2curve

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: MIT Imports: 9 Imported by: 0

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

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

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

Elligator2Montgomery implements the Elligator2 mapping to Curve25519.

func ExpandXMD

func ExpandXMD(id crypto.Hash, input, dst []byte, length int) []byte

ExpandXMD expands the input and dst using the given fixed length hash function.

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

func HashToFieldXMD(id crypto.Hash, input, dst []byte, length int) (u, v *field.Element)

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

func HashToScalarXMD(id crypto.Hash, input, dst []byte, length int) []byte

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

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