statechain

package
v0.0.0-...-d238806 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2019 License: GPL-2.0, GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Curve *btcec.KoblitzCurve = btcec.S256() // take only the curve, can't use other stuff
View Source
var Storage map[string][]*big.Int

Functions

func BlindClientBlind

func BlindClientBlind(Rx *big.Int, Ry *big.Int, m []byte, Px, Py *big.Int) (
	*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int)

func BlindClientUnblind

func BlindClientUnblind(alpha *big.Int, sig *big.Int) *big.Int

func BlindServerNonce

func BlindServerNonce() (*big.Int, *big.Int, *big.Int)

func BlindServerSign

func BlindServerSign(k *big.Int, c *big.Int, privkey *big.Int) *big.Int

func BytesToNum

func BytesToNum(byteString []byte) *big.Int

func Construct22SchnorrPubkey

func Construct22SchnorrPubkey(a, Ax, Ay, b, Bx, By *big.Int) (*big.Int, *big.Int, *big.Int, *big.Int,
	*big.Int, *big.Int, *big.Int, *big.Int)

func ConstructAdaptorSig

func ConstructAdaptorSig(x, Px, Py *big.Int, m []byte) (*big.Int,
	*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int)

func Generate22AdaptorSchnorrChallenge

func Generate22AdaptorSchnorrChallenge(Jx, Jy, Rax, Ray, Rbx, Rby, Tx, Ty *big.Int, m []byte) *big.Int

func Generate22SchnorrChallenge

func Generate22SchnorrChallenge(Jx, Jy, Rax, Ray, Rbx, Rby *big.Int, m []byte) *big.Int

func GetNewKeys

func GetNewKeys() (*big.Int, *big.Int, *big.Int, error)

func GetRandomness

func GetRandomness() *big.Int

func InitStorage

func InitStorage()

func MuSig2CreateSign

func MuSig2CreateSign(x1, X1x, X1y, x2, X2x, X2y, r1, R1x, R1y, r2, R2x, R2y *big.Int,
	m []byte) (*big.Int, *big.Int, *big.Int, *big.Int, *big.Int)

func MuSig2Verify

func MuSig2Verify(Rx, Ry, Xx, Xy, s *big.Int, m []byte) bool

func NewPrivateKey

func NewPrivateKey() (*big.Int, error)

func PubkeyPointsFromPrivkey

func PubkeyPointsFromPrivkey(privkey *big.Int) (*big.Int, *big.Int)

func SchnorrSign

func SchnorrSign(k, Px, Py *big.Int, m []byte, privkey *big.Int) (*big.Int, *big.Int, *big.Int)

func SchnorrVerify

func SchnorrVerify(sig *big.Int, Rx, Ry *big.Int, Px, Py *big.Int, m []byte) bool

func SerializeCompressed

func SerializeCompressed(pkx *big.Int, pky *big.Int) []byte

SerializeCompressed serializes a public key in a 33-byte compressed format.

func StateServerRequestNewPubkey

func StateServerRequestNewPubkey(userPubkey []byte) (*big.Int, *big.Int, error)

func StatechainGenMuSigKey

func StatechainGenMuSigKey(X1x, X1y, X2x, X2y *big.Int) ([]byte, *big.Int, *big.Int)

func StatechainRequestBlindSig

func StatechainRequestBlindSig(userSig *big.Int, blindedMsg *big.Int, k *big.Int,
	userPubkey []byte, Bx, By *big.Int, nextUserPubkey []byte) (*big.Int, error)

func VerifyAdaptorSig

func VerifyAdaptorSig(spr, Rx, Ry, Tx, Ty, Px, Py *big.Int, m []byte) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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