Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProvePartialPreimageKnowledge ¶
func ProvePartialPreimageKnowledge(homomorphism func(*big.Int) *big.Int, H crypto.Group, v1, u1, u2 *big.Int, iterations int) bool
ProvePartialPreimageKnowledge demonstrates how prover can prove that he knows f^(-1)(u1) and the verifier does not know whether knowledge of f^(-1)(u1) or f^(-1)(u2) was proved. Note that PartialDLogKnowledge is a special case of PartialPreimageKnowledge.
Types ¶
type PartialProver ¶
type PartialProver struct { Homomorphism func(*big.Int) *big.Int H crypto.Group // contains filtered or unexported fields }
func NewPartialProver ¶
func (*PartialProver) GetProofData ¶
func (*PartialProver) GetProofRandomData ¶
func (p *PartialProver) GetProofRandomData() (*common.Pair, *common.Pair)
GetProofRandomData returns Homomorphism(r1) and Homomorphism(z2)/(u2^c2) in random order and where r1, z2, c2 are random from H.
type PartialVerifier ¶
type PartialVerifier struct { Homomorphism func(*big.Int) *big.Int H crypto.Group // contains filtered or unexported fields }
func NewPartialVerifier ¶
func (*PartialVerifier) GetChallenge ¶
func (v *PartialVerifier) GetChallenge() *big.Int
func (*PartialVerifier) SetProofRandomData ¶
func (v *PartialVerifier) SetProofRandomData(pair1, pair2 *common.Pair)
type Prover ¶
type Prover struct { Homomorphism func(*big.Int) *big.Int H crypto.Group // contains filtered or unexported fields }
Prover proves that it knows v such that f(v) = u, given homomorphism f: H -> G and u from group G. This is a generalized Schnorr prover, but one-bit challenges need to be used to enable extractor (more to be added in docs).
func (*Prover) GetProofData ¶
GetProofData receives challenge defined by a verifier, and returns z = r * v^challenge.
func (*Prover) GetProofRandomData ¶
Chooses random r from H and returns QOneWayHomomorpism(r).
type Verifier ¶
type Verifier struct { Homomorphism func(*big.Int) *big.Int H crypto.Group // contains filtered or unexported fields }