Documentation ¶
Overview ¶
Package proof range proof via sum of three squares (3SPR) Paper: Removing the Strong RSA Assumption from Arguments over the Integers Link: https://eprint.iacr.org/2016/128
Package proof range proof via sum of three squares (3SPR) Paper: Removing the Strong RSA Assumption from Arguments over the Integers Link: https://eprint.iacr.org/2016/128
Package proof zkPoKE Protocol zkPoKE for R_{PoKE} Paper: Batching Techniques for Accumulators with Applications to IOPs and Stateless Blockchains Link: https://eprint.iacr.org/2018/1188.pdf
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArgOfPositivity ¶
type ArgOfPositivity struct {
// contains filtered or unexported fields
}
ArgOfPositivity is the argument of positivity of an integer
func NewArgOfPositivity ¶
func NewArgOfPositivity(commit3 Int3, commitment zkAoPCommitment, response *zkAoPResponse) *ArgOfPositivity
NewArgOfPositivity generates a new argument of positivity
type Int3 ¶
Int3 is the 3-number big integer group
func ThreeSquares ¶
ThreeSquares calculates the three square sum of a given integer i.e. target = t1^2 + t2^2 + t3^2 Please note that we only consider the situation of target = 4N + 1, as in our range proof implementation, every integer passed to this function is in the form of 4N + 1.
type Int4 ¶
Int4 is the 4-number big integer group
type PublicParameters ¶
PublicParameters holds public parameters initialized during the setup procedure
func NewPublicParameters ¶
func NewPublicParameters(n, g, h *big.Int) *PublicParameters
NewPublicParameters generates a new public parameter configuration
type RPProver ¶
type RPProver struct {
// contains filtered or unexported fields
}
RPProver refers to the Prover in zero-knowledge integer range proof
func NewRPProver ¶
func NewRPProver(pp *PublicParameters, r, a, b *big.Int) *RPProver
NewRPProver generates a new range proof prover
type RPVerifier ¶
type RPVerifier struct {
// contains filtered or unexported fields
}
RPVerifier refers to the Verifier in zero-knowledge integer range proof
func NewRPVerifier ¶
func NewRPVerifier(pp *PublicParameters, a, b *big.Int) *RPVerifier
NewRPVerifier generates a new range proof verifier
func (*RPVerifier) Verify ¶
func (r *RPVerifier) Verify(proof *RangeProof) bool
Verify verifies the range proof
func (*RPVerifier) VerifyResponse ¶
func (r *RPVerifier) VerifyResponse(response *rpResponse) bool
VerifyResponse verifies the response, if accepts, return true; otherwise, return false
type RangeProof ¶
type RangeProof struct {
// contains filtered or unexported fields
}
RangeProof is the proof for range proof
func NewRangeProof ¶
func NewRangeProof(c *big.Int, commit3 Int3, commitment rpCommitment, response *rpResponse) *RangeProof
NewRangeProof generates a new proof for range proof
type ZKAoPProver ¶
ZKAoPProver refers to the Prover in zero-knowledge integer argument of positivity
func NewZKAoPProver ¶
func NewZKAoPProver(pp *PublicParameters, r *big.Int) *ZKAoPProver
NewZKAoPProver generates a new argument-of-positivity prover
func (*ZKAoPProver) Prove ¶
func (r *ZKAoPProver) Prove(x *big.Int) (*ArgOfPositivity, error)
Prove generates the proof for range proof
type ZKAoPVerifier ¶
type ZKAoPVerifier struct {
// contains filtered or unexported fields
}
ZKAoPVerifier refers to the Verifier in zero-knowledge integer argument of positivity
func NewZKAoPVerifier ¶
func NewZKAoPVerifier(pp *PublicParameters, c *big.Int) *ZKAoPVerifier
NewZKAoPVerifier generates a new integer argument of positivity verifier
func (*ZKAoPVerifier) Verify ¶
func (r *ZKAoPVerifier) Verify(proof *ArgOfPositivity) bool
Verify verifies the argument of positivity
func (*ZKAoPVerifier) VerifyResponse ¶
func (r *ZKAoPVerifier) VerifyResponse(response *zkAoPResponse) bool
VerifyResponse verifies the response, if accepts, return true; otherwise, return false
type ZKPoKEProof ¶
type ZKPoKEProof struct {
// contains filtered or unexported fields
}
ZKPoKEProof represents the proof of knowledge of exponentiation
type ZKPoKEProver ¶
type ZKPoKEProver struct {
// contains filtered or unexported fields
}
ZKPoKEProver is the prover for proof of exponentiation
func NewZKPoKEProver ¶
func NewZKPoKEProver(pp *PublicParameters) *ZKPoKEProver
NewZKPoKEProver creates a new prover of proof of exponentiation
func (*ZKPoKEProver) Prove ¶
func (zp *ZKPoKEProver) Prove(u, x *big.Int) (*ZKPoKEProof, error)
Prove generates the proof for proof of exponentiation
type ZKPoKEVerifier ¶
type ZKPoKEVerifier struct {
// contains filtered or unexported fields
}
ZKPoKEVerifier is the verifier for proof of exponentiation
func NewZKPoKEVerifier ¶
func NewZKPoKEVerifier(pp *PublicParameters) *ZKPoKEVerifier
NewZKPoKEVerifier creates a new verifier of proof of exponentiation
func (*ZKPoKEVerifier) Verify ¶
func (zv *ZKPoKEVerifier) Verify(proof *ZKPoKEProof, u, w *big.Int) (bool, error)
Verify checks the proof of exponentiation
func (*ZKPoKEVerifier) VerifyResponse ¶
func (zv *ZKPoKEVerifier) VerifyResponse(c, l, u, w *big.Int, response *zkPoKEResponse, commit *zkPoKECommitment) (bool, error)
VerifyResponse verifies the response of the verifier