hash2curve

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: MIT Imports: 10 Imported by: 2

README

Hash To Curve

hash2curve Go Reference codecov

  import "github.com/bytemare/hash2curve"

Package hash2curve provides hash-to-curve compatible hashing over arbitrary input. It implements the expanders and hashing to a field as specified in hash-to-curve.

What is hash2curve?

Hashing to curve allows representing arbitrary byte sequences as points on a curve (or elements in a group), therefore benefiting from interesting mathematical properties very useful in cryptographic protocols, like CPace, VOPRF, and OPAQUE.

References

Documentation Go Reference

You can find the documentation and usage examples in the package doc and the project wiki .

Versioning

SemVer is used for versioning. For the versions available, see the tags on the repository.

Contributing

Please read CONTRIBUTING.md for details on the code of conduct, and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Documentation

Overview

Package hash2curve provides hash-to-curve compatible hashing over arbitrary input.

It implements the latest hash-to-curve specification to date (https://datatracker.ietf.org/doc/draft-irtf-cfrg-hash-to-curve/).

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.

Package hash2curve provides hash-to-curve compatible input expansion.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 hash.Extendable, input, dst []byte, length int) []byte

ExpandXOF expands the input and dst using the given extendable output hash function.

func HashToFieldXMD

func HashToFieldXMD(id crypto.Hash, input, dst []byte, count, ext, securityLength int, modulo *big.Int) []*big.Int

HashToFieldXMD hashes the input with the domain separation tag (dst) to an integer under modulo, using an merkle-damgard based expander (e.g. SHA256).

func HashToFieldXOF

func HashToFieldXOF(id hash.Extendable, input, dst []byte, count, ext, securityLength int, modulo *big.Int) []*big.Int

HashToFieldXOF hashes the input with the domain separation tag (dst) to an integer under modulo, using an extensible output function (e.g. SHAKE).

func IsogenySecp256k13iso added in v0.2.1

func IsogenySecp256k13iso(x, y *big.Int) (px, py *big.Int, isIdentity bool)

IsogenySecp256k13iso is a 3-degree isogeny from Secp256k1 3-ISO to the Secp256k1 elliptic curve.

func MapToCurveSSWU added in v0.2.1

func MapToCurveSSWU(a, b, z, fe, order *big.Int) (x, y *big.Int)

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

Types

This section is empty.

Directories

Path Synopsis
internal
field
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