crypto

package
v0.0.0-...-23aeb14 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Secp256k1N, _  = new(big.Int).SetString("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141", 16)
	Secp256k1halfN = new(big.Int).Div(Secp256k1N, big.NewInt(2))
)

Functions

func EvaluatePoly

func EvaluatePoly(coefficient []*big.Int, x *big.Int) *big.Int

func GetRandCoefficients

func GetRandCoefficients(num int) ([]*big.Int, error)

func Lagrange

func Lagrange(f []*big.Int, x []*big.Int) *big.Int

Lagrange's polynomial interpolation algorithm

func RandFieldElement

func RandFieldElement(c elliptic.Curve) (k *big.Int, err error)

randFieldElement returns a random element of the field underlying the given curve using the procedure given in [NSA] A.2.1.

func SenderEcrecover

func SenderEcrecover(sighash, sig []byte) (common.Address, error)

func TransSignature

func TransSignature(R *big.Int, S *big.Int, V uint64) ([]byte, error)

func UintRand

func UintRand(MaxValue uint64) (uint64, error)

func ValidatePrivateKey

func ValidatePrivateKey(k *big.Int) bool

func ValidatePublicKey

func ValidatePublicKey(k *ecdsa.PublicKey) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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