schnorr

package
v0.0.0-...-1c741c1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2019 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Commit

func Commit(V, R *btcec.PublicKey, m []byte) *btcec.PublicKey

Commit is calculatd by the following formula

sG = R - h(R, m) * V

Where

s: sign for the message m
G: elliptic curve base
R: R-point
m: message
V: oracle's public key

func CommitMulti

func CommitMulti(
	V *btcec.PublicKey, Rs []*btcec.PublicKey, msgs [][]byte,
) *btcec.PublicKey

CommitMulti calculates a commitment by summing commitments of multiple msgs

func Sign

func Sign(opriv, rpriv *btcec.PrivateKey, m []byte) []byte

Sign is calculated by the following formula

s = k - h(R, m) * v

Where

s: sign
h: hash function
k: random nonce
R: R-point R = kG
m: message
G: elliptic curve base
v: oracle's private key

Parameters:

rpriv: random point EC private key opriv: oracle's EC private key
m: message

func SumSigs

func SumSigs(signs [][]byte) []byte

SumSigs sums signs up for a multi-message commitment

func Verify

func Verify(P *btcec.PublicKey, sign []byte) bool

Verify verfies sG = R - h(R, m) * V

Types

This section is empty.

Jump to

Keyboard shortcuts

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