Documentation ¶
Overview ¶
Package schnorr implements a Schnorr proof, as described and used in Doerner, et al. https://eprint.iacr.org/2018/499.pdf see Functionalities 6. it also implements a "committed" version, as described in Functionality 7.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecommitVerify ¶
func DecommitVerify(proof *Proof, commitment Commitment, curve *curves.Curve, basepoint curves.Point, uniqueSessionId []byte) error
DecommitVerify receives a `Proof` and a `Commitment`; it first checks that the proof actually opens the commitment; then it verifies the proof. returns and error if either on eof thse fail.
func Verify ¶
func Verify(proof *Proof, curve *curves.Curve, basepoint curves.Point, uniqueSessionId []byte) error
Verify verifies the `proof`, given the prover parameters `scalar` and `curve`. As for the prover, we allow `basePoint == nil`, in this case, it's auto-assigned to be the group's default generator.
Types ¶
type Commitment ¶
type Commitment = []byte
type Proof ¶
Proof contains the (c, s) schnorr proof. `Statement` is the curve point you're proving knowledge of discrete log of, with respect to the base point.
type Prover ¶
type Prover struct {
// contains filtered or unexported fields
}
func NewProver ¶
NewProver generates a `Prover` object, ready to generate Schnorr proofs on any given point. We allow the option `basePoint == nil`, in which case `basePoint` is auto-assigned to be the "default" generator for the group.
func (*Prover) Prove ¶
Prove generates and returns a Schnorr proof, given the scalar witness `x`. in the process, it will actually also construct the statement (just one curve mult in this case)
func (*Prover) ProveCommit ¶
ProveCommit generates _and_ commits to a schnorr proof which is later revealed; see Functionality 7. returns the Proof and Commitment.