hash2curve

package module
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2022 License: MIT Imports: 8 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).

Types

This section is empty.

Jump to

Keyboard shortcuts

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