Documentation ¶
Overview ¶
Package common
Package common ¶
@author: xwc1125 @date: 2019/9/25
Package common ¶
Package common ¶
Package common ¶
Package common ¶
@author: xwc1125 @date: 2019/9/25
Index ¶
- Variables
- func Commit(data []byte) (Comm, Nonce, error)
- func NewPrivKey(modulus *big.Int) (*eckey.SecretKey, error)
- type BitSlice
- type CiphertextPair
- type Comm
- type Config
- type DLogPoK
- type Nonce
- type PaillierNthRootProof
- type ProofPair
- type RangeProof
- type RangeProofProver
- type RangeProofVerifier
- type SecretPair
- type Uint256
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidRangeProof = errors.New("invalid range proof") ErrInvalidProofPair = errors.New("cannot prove for invalid proof pair") )
View Source
var ErrInvalidCommitment = errors.New("invalid commitment")
View Source
var ErrInvalidPoK = errors.New("invalid proof of knowledge")
View Source
var (
ErrInvalidPrimalityProof = errors.New(
"invalid paillier public key primality proof",
)
)
Functions ¶
Types ¶
type CiphertextPair ¶
func NewCiphertextPairs ¶
func NewCiphertextPairs(size int) []CiphertextPair
type DLogPoK ¶
type DLogPoK struct { PK eckey.CompressedPublicKey Sig schnorr.Signature }
type PaillierNthRootProof ¶
type PaillierNthRootProof struct { PK *paillier.PublicKey U *big.Int A *big.Int Z *big.Int SecBits int }
func ProvePaillierNthRoot ¶
func ProvePaillierNthRoot( pk *paillier.PublicKey, secbits int) (*PaillierNthRootProof, error)
func (*PaillierNthRootProof) Verify ¶
func (p *PaillierNthRootProof) Verify() error
type ProofPair ¶
func NewProofPairs ¶
type RangeProof ¶
type RangeProof struct { CtxtPairs []CiphertextPair ProofPairs []ProofPair }
type RangeProofProver ¶
type RangeProofProver struct { X *big.Int R *big.Int PSK *paillier.PrivateKey Q *big.Int Q3 *big.Int ChallengeComm Comm Accuracy int SecPairs []SecretPair CtxtPairs []CiphertextPair }
随机证明的证明者
func NewRangeProofProver ¶
type RangeProofVerifier ¶
type RangeProofVerifier struct { C *big.Int PPK *paillier.PublicKey Q3 *big.Int Challenge BitSlice Comm Comm Nonce Nonce Accuracy int CtxtPairs []CiphertextPair }
随机证明的验证者
func NewRangeProofVerifier ¶
func NewRangeProofVerifier( q3 *big.Int, accuracy int) (*RangeProofVerifier, error)
func (*RangeProofVerifier) ReceiveCtxt ¶
func (p *RangeProofVerifier) ReceiveCtxt( c *big.Int, ppk *paillier.PublicKey, ctxtPairs []CiphertextPair)
func (*RangeProofVerifier) Verify ¶
func (p *RangeProofVerifier) Verify(proofPairs []ProofPair) error
type SecretPair ¶
func NewSecretPairs ¶
func NewSecretPairs(size int) []SecretPair
Click to show internal directories.
Click to hide internal directories.