crypto

package
v0.0.0-...-d26b62e Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportPublicKey

func ExportPublicKey(pk *ecdsa.PublicKey) (string, error)

Encode the given public key to a base64 string of PKIX, ASN.1 DER form.

func ReadECDSAKeys

func ReadECDSAKeys(skPath string, pkPath string) (*ecdsa.PrivateKey, *ecdsa.PublicKey, error)

Types

type VRFNumberGenerator

type VRFNumberGenerator struct {
	// contains filtered or unexported fields
}

func NewVRFNumberGenerator

func NewVRFNumberGenerator(sk *ecdsa.PrivateKey, pk *ecdsa.PublicKey) *VRFNumberGenerator

Create a new VRF number generator from the given private/public key.

func (*VRFNumberGenerator) Generate

func (v *VRFNumberGenerator) Generate() (now int64, alpha, beta, pi []byte, err error)

Generate

func (*VRFNumberGenerator) GenerateNumber

func (v *VRFNumberGenerator) GenerateNumber(max int) int

func (*VRFNumberGenerator) GetPublicKey

func (v *VRFNumberGenerator) GetPublicKey() *ecdsa.PublicKey

Get the public key of the VRF number generator.

func (*VRFNumberGenerator) Verify

func (v *VRFNumberGenerator) Verify(alpha []byte, beta []byte, pi []byte) (bool, error)

Jump to

Keyboard shortcuts

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