Documentation ¶
Index ¶
- type CSPaillier
- func (csp *CSPaillier) Abs(a *big.Int) (*big.Int, error)
- func (csp *CSPaillier) Decrypt(u, e, v, label *big.Int) (*big.Int, error)
- func (csp *CSPaillier) Encrypt(m, label *big.Int) (*big.Int, *big.Int, *big.Int, error)
- func (csp *CSPaillier) GetChallenge() *big.Int
- func (csp *CSPaillier) GetOpeningMsg(m *big.Int) (*big.Int, *big.Int)
- func (csp *CSPaillier) GetProofData(c *big.Int) (*big.Int, *big.Int, *big.Int)
- func (csp *CSPaillier) GetProofRandomData(u, e, label *big.Int) (*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, error)
- func (csp *CSPaillier) SetProofRandomData(u1, e1, v1, delta1, l1, c *big.Int)
- func (csp *CSPaillier) SetVerifierEncData(u, e, v, delta, label, l *big.Int)
- func (csp *CSPaillier) Verify(rTilde, sTilde, mTilde *big.Int) bool
- type CSPaillierProverEncData
- type CSPaillierProverRandomData
- type CSPaillierPubKey
- type CSPaillierSecKey
- type CSPaillierSecParams
- type CSPaillierVerifierEncData
- type CSPaillierVerifierRandomData
- type Paillier
- type PaillierPubKey
- type VerifiableEncGroup
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CSPaillier ¶
type CSPaillier struct { SecParams *CSPaillierSecParams PubKey *CSPaillierPubKey SecKey *CSPaillierSecKey // contains filtered or unexported fields }
CSPaillier represents Camenisch-Shoup variant of Paillier to make it (Paillier) CCA2 secure. http://eprint.iacr.org/2002/161.pdf
func NewCSPaillier ¶
func NewCSPaillier(secParams *CSPaillierSecParams) *CSPaillier
func NewCSPaillierFromPubKey ¶
func NewCSPaillierFromPubKey(pubKey *CSPaillierPubKey) *CSPaillier
func NewCSPaillierFromSecKey ¶
func NewCSPaillierFromSecKey(secKey *CSPaillierSecKey) (*CSPaillier, error)
func (*CSPaillier) GetChallenge ¶
func (csp *CSPaillier) GetChallenge() *big.Int
func (*CSPaillier) GetOpeningMsg ¶
Returns l = g1^m * h1^s where s is a random integer smaller than n/4.
func (*CSPaillier) GetProofData ¶
Prover should use this function to compute data for second (last) sigma protocol message.
func (*CSPaillier) GetProofRandomData ¶
func (csp *CSPaillier) GetProofRandomData(u, e, label *big.Int) (*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, error)
Prover (encryptor) should use this function to generate values for the first sigma protocol message.
func (*CSPaillier) SetProofRandomData ¶
func (csp *CSPaillier) SetProofRandomData(u1, e1, v1, delta1, l1, c *big.Int)
Verifier should call this function when it receives proof random data as the second protocol message.
func (*CSPaillier) SetVerifierEncData ¶
func (csp *CSPaillier) SetVerifierEncData(u, e, v, delta, label, l *big.Int)
Verifier should call this function when it receives l = g1^m * h1^s as the first protocol message.
type CSPaillierPubKey ¶
type CSPaillierPubKey struct { N *big.Int G *big.Int Y1 *big.Int Y2 *big.Int Y3 *big.Int // the parameters below are for verifiable encryption Gamma *schnorr.Group // for discrete logarithm VerifiableEncGroupN *big.Int VerifiableEncGroupG1 *big.Int VerifiableEncGroupH1 *big.Int K int K1 int }
CSPaillierPubKey currently does not use auxiliary parameters/primes - no additional n, p, q parameters (as specified in a paper, original n, p, q can be used).
type CSPaillierSecKey ¶
type CSPaillierSecParams ¶
type Paillier ¶
type Paillier struct {
// contains filtered or unexported fields
}
https://pirk.incubator.apache.org/papers/1999_asiacrypt_paillier_paper.pdf
func NewPaillier ¶
func NewPubPaillier ¶
func NewPubPaillier(pubKey *PaillierPubKey) *Paillier
func (*Paillier) GetPubKey ¶
func (paillier *Paillier) GetPubKey() *PaillierPubKey
type PaillierPubKey ¶
type PaillierPubKey struct {
// contains filtered or unexported fields
}
type VerifiableEncGroup ¶
type VerifiableEncGroup struct { *qr.RSASpecial G1 *big.Int H1 *big.Int // contains filtered or unexported fields }
func NewVerifiableEncGroup ¶
func NewVerifiableEncGroup(primes *qr.RSASpecialPrimes) (*VerifiableEncGroup, error)