vrfEd

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2019 License: GPL-3.0, GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	N2 = 32 // ceil(log2(q) / 8)
	N  = N2 / 2

	NOSIGN = 3
)
View Source
const (
	// PublicKeySize is the size, in bytes, of public keys as used in this package.
	PublicKeySize = 32
	// PrivateKeySize is the size, in bytes, of private keys as used in this package.
	PrivateKeySize = 64
	// SignatureSize is the size, in bytes, of signatures generated and verified by this package.
	SignatureSize = 64
)

Variables

View Source
var (
	ErrMalformedInput = errors.New("ECVRF: malformed input")
	ErrDecodeError    = errors.New("ECVRF: decode error")
	ErrInternalError  = errors.New("ECVRF: internal error")
)

Functions

func ECVRF_decode_proof

func ECVRF_decode_proof(pi []byte) (r *edwards25519.ExtendedGroupElement, c *[N2]byte, s *[N2]byte, err error)

func ECVRF_hash_points

func ECVRF_hash_points(ps ...[]byte) *big.Int

func ECVRF_hash_to_curve

func ECVRF_hash_to_curve(m []byte, pk []byte) *edwards25519.ExtendedGroupElement

func ECVRF_proof2hash

func ECVRF_proof2hash(pi []byte) []byte

func ECVRF_prove

func ECVRF_prove(pk []byte, sk []byte, m []byte) (pi []byte, err error)

assume <pk, sk> were generated by ed25519.GenerateKey()

func ECVRF_verify

func ECVRF_verify(pk []byte, pi []byte, m []byte) (bool, error)

func ExtendedGroupElementCMove

func ExtendedGroupElementCMove(t, u *edwards25519.ExtendedGroupElement, b int32)

func F2IP

func F2IP(f *[32]byte) *big.Int

convert a field number (in LittleEndian) to a big int

func I2OSP

func I2OSP(b *big.Int, n int) []byte

func IP2F

func IP2F(b *big.Int) *[32]byte

func OS2ECP

func OS2ECP(os []byte, sign byte) *edwards25519.ExtendedGroupElement

func OS2IP

func OS2IP(os []byte) *big.Int

func S2OS

func S2OS(s []byte) []byte

just prepend the sign octet

Types

type CachedGroupElement

type CachedGroupElement struct {
	Z, T2d edwards25519.FieldElement
	// contains filtered or unexported fields
}

copied from edwards25519.go and const.go in golang.org/x/crypto/ed25519/internal/edwards25519

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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