Versions in this module Expand all Collapse all v0 v0.0.1 Apr 22, 2023 Changes in this version + var ErrInvalidCommitment = errors.New("invalid commitment") + var ErrInvalidPoK = errors.New("invalid proof of knowledge") + var ErrInvalidPrimalityProof = errors.New("invalid paillier public key primality proof") + var ErrInvalidProofPair = errors.New("cannot prove for invalid proof pair") + var ErrInvalidRangeProof = errors.New("invalid range proof") + func Commit(data []byte) (Comm, Nonce, error) + func NewPrivKey(modulus *big.Int) (*eckey.SecretKey, error) + type BitSlice []byte + func (b BitSlice) Bit(i int) byte + type CiphertextPair struct + C1 *big.Int + C2 *big.Int + func NewCiphertextPairs(size int) []CiphertextPair + type Comm = Uint256 + func (c *Comm) Verify(data []byte, nonce *Nonce) error + type Config struct + NPaillierBits int + NthRootSecBits int + Q *big.Int + Q3 *big.Int + QSquared *big.Int + RangeSecBits int + type DLogPoK struct + PK eckey.CompressedPublicKey + Sig schnorr.Signature + func NewDLogPK(plaintext []byte, sk *eckey.SecretKey) (*DLogPoK, error) + func (p *DLogPoK) Bytes() []byte + func (p *DLogPoK) Verify(plaintext []byte) error + type Nonce = Uint256 + type PaillierNthRootProof struct + A *big.Int + PK *paillier.PublicKey + SecBits int + U *big.Int + Z *big.Int + func ProvePaillierNthRoot(pk *paillier.PublicKey, secbits int) (*PaillierNthRootProof, error) + func (p *PaillierNthRootProof) Verify() error + type ProofPair struct + J byte + R1 *big.Int + R2 *big.Int + W1 *big.Int + W2 *big.Int + func NewProofPairs(size int) []ProofPair + type RangeProof struct + CtxtPairs []CiphertextPair + ProofPairs []ProofPair + type RangeProofProver struct + Accuracy int + ChallengeComm Comm + CtxtPairs []CiphertextPair + PSK *paillier.PrivateKey + Q *big.Int + Q3 *big.Int + R *big.Int + SecPairs []SecretPair + X *big.Int + func NewRangeProofProver(x *big.Int, r *big.Int, q *big.Int, q3 *big.Int, psk *paillier.PrivateKey, ...) (*RangeProofProver, error) + func (p *RangeProofProver) Prove(challenge BitSlice, nonce *Nonce) ([]ProofPair, error) + type RangeProofVerifier struct + Accuracy int + C *big.Int + Challenge BitSlice + Comm Comm + CtxtPairs []CiphertextPair + Nonce Nonce + PPK *paillier.PublicKey + Q3 *big.Int + func NewRangeProofVerifier(q3 *big.Int, accuracy int) (*RangeProofVerifier, error) + func (p *RangeProofVerifier) ReceiveCtxt(c *big.Int, ppk *paillier.PublicKey, ctxtPairs []CiphertextPair) + func (p *RangeProofVerifier) Verify(proofPairs []ProofPair) error + type SecretPair struct + R1 *big.Int + R2 *big.Int + W1 *big.Int + W2 *big.Int + func NewSecretPairs(size int) []SecretPair + type Uint256 [32]byte