Documentation ¶
Index ¶
- Variables
- func Combine(shares []*ShareStruct) (*big.Int, error)
- func Combine2(shares []*ShareStruct2) (*big.Int, error)
- func GenRandomInt(length int)
- func GenRandomSafePrime(length int)
- func GenerateKeyPair(length int) (*PublicKey, *PrivateKey)
- func GetSharesId(ss *ShareStruct2) *big.Int
- func Vss(secret *big.Int, ids []*big.Int, t int, n int) (*PolyGStruct, *PolyStruct, []*ShareStruct, error)
- func Vss2Init(secret *big.Int, t int) (*PolyStruct2, *PolyGStruct2, error)
- func ZkABVerify(A []*big.Int, B []*big.Int, V []*big.Int, R []*big.Int, zkABProof *ZkABProof) bool
- func ZkUVerify(uG []*big.Int, zkUProof *ZkUProof) bool
- type Commitment
- type MtAZK1Proof
- type MtAZK1Proof_nhh
- type MtAZK2Proof
- type MtAZK2Proof_nhh
- type MtAZK3Proof
- type MtAZK3Proof_nhh
- type NtildeH1H2
- type PolyGStruct
- type PolyGStruct2
- type PolyStruct
- type PolyStruct2
- type PrivateKey
- type PublicKey
- type ShareStruct
- type ShareStruct2
- type ZkABProof
- type ZkFactProof
- type ZkUProof
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrIdNoEqualN = errors.New("[ERROR]: the length of input ids is not equal to the share number n.")
var ErrShareNotPass = errors.New("[ERROR]: the set of shares contain invalid share.")
View Source
var ErrMessageTooLong = errors.New("[ERROR]: message is too long.")
Functions ¶
func GenRandomInt ¶
func GenRandomInt(length int)
func GenRandomSafePrime ¶
func GenRandomSafePrime(length int)
func GenerateKeyPair ¶
func GenerateKeyPair(length int) (*PublicKey, *PrivateKey)
func GetSharesId ¶
func GetSharesId(ss *ShareStruct2) *big.Int
func Vss ¶
func Vss(secret *big.Int, ids []*big.Int, t int, n int) (*PolyGStruct, *PolyStruct, []*ShareStruct, error)
func Vss2Init ¶
func Vss2Init(secret *big.Int, t int) (*PolyStruct2, *PolyGStruct2, error)
func ZkABVerify ¶
Types ¶
type Commitment ¶
func (*Commitment) Commit ¶
func (commitment *Commitment) Commit(secrets ...*big.Int) *Commitment
func (*Commitment) Verify ¶
func (commitment *Commitment) Verify() bool
type MtAZK1Proof ¶
func MtAZK1Prove ¶
func MtAZK1Prove(m *big.Int, r *big.Int, publicKey *PublicKey, zkFactProof *ZkFactProof) *MtAZK1Proof
func MtAZK1Prove(m *big.Int, r *big.Int, publicKey *paillier.PublicKey, zkFactProof *paillier.ZkFactProof) *MtAZK1Proof {
func (*MtAZK1Proof) MtAZK1Verify ¶
func (mtAZK1Proof *MtAZK1Proof) MtAZK1Verify(c *big.Int, publicKey *PublicKey, zkFactProof *ZkFactProof) bool
type MtAZK1Proof_nhh ¶
func MtAZK1Prove_nhh ¶
func MtAZK1Prove_nhh(m *big.Int, r *big.Int, publicKey *PublicKey, ntildeH1H2 *NtildeH1H2) *MtAZK1Proof_nhh
func (*MtAZK1Proof_nhh) MtAZK1Verify_nhh ¶
func (mtAZKProof *MtAZK1Proof_nhh) MtAZK1Verify_nhh(c *big.Int, publicKey *PublicKey, ntildeH1H2 *NtildeH1H2) bool
type MtAZK2Proof ¶
type MtAZK2Proof struct { Z *big.Int ZBar *big.Int T *big.Int V *big.Int W *big.Int S *big.Int S1 *big.Int S2 *big.Int T1 *big.Int T2 *big.Int }
func MtAZK2Prove ¶
func MtAZK2Prove(x *big.Int, y *big.Int, r *big.Int, c1 *big.Int, publicKey *PublicKey, zkFactProof *ZkFactProof) *MtAZK2Proof
func MtAZK2Prove(x *big.Int, y *big.Int, r *big.Int, c1 *big.Int, publicKey *paillier.PublicKey, zkFactProof *paillier.ZkFactProof) *MtAZK2Proof {
func (*MtAZK2Proof) MtAZK2Verify ¶
func (mtAZK2Proof *MtAZK2Proof) MtAZK2Verify(c1 *big.Int, c2 *big.Int, publicKey *PublicKey, zkFactProof *ZkFactProof) bool
func (mtAZK2Proof *MtAZK2Proof) MtAZK2Verify(c1 *big.Int, c2 *big.Int, publicKey *paillier.PublicKey, zkFactProof *paillier.ZkFactProof) bool {
type MtAZK2Proof_nhh ¶
type MtAZK2Proof_nhh struct { Z *big.Int ZBar *big.Int T *big.Int V *big.Int W *big.Int S *big.Int S1 *big.Int S2 *big.Int T1 *big.Int T2 *big.Int }
func MtAZK2Prove_nhh ¶
func (*MtAZK2Proof_nhh) MtAZK2Verify_nhh ¶
func (mtAZK2Proof *MtAZK2Proof_nhh) MtAZK2Verify_nhh(c1 *big.Int, c2 *big.Int, publicKey *PublicKey, ntildeH1H2 *NtildeH1H2) bool
type MtAZK3Proof ¶
type MtAZK3Proof struct { Ux *big.Int Uy *big.Int Z *big.Int ZBar *big.Int T *big.Int V *big.Int W *big.Int S *big.Int S1 *big.Int S2 *big.Int T1 *big.Int T2 *big.Int }
func MtAZK3Prove ¶
func (*MtAZK3Proof) MtAZK3Verify ¶
func (mtAZK3Proof *MtAZK3Proof) MtAZK3Verify(c1 *big.Int, c2 *big.Int, publicKey *PublicKey, zkFactProof *ZkFactProof) bool
type MtAZK3Proof_nhh ¶
type MtAZK3Proof_nhh struct { Ux *big.Int Uy *big.Int Z *big.Int ZBar *big.Int T *big.Int V *big.Int W *big.Int S *big.Int S1 *big.Int S2 *big.Int T1 *big.Int T2 *big.Int }
func MtAZK3Prove_nhh ¶
func (*MtAZK3Proof_nhh) MtAZK3Verify_nhh ¶
func (mtAZK3Proof *MtAZK3Proof_nhh) MtAZK3Verify_nhh(c1 *big.Int, c2 *big.Int, publicKey *PublicKey, ntildeH1H2 *NtildeH1H2) bool
type NtildeH1H2 ¶
func GenerateNtildeH1H2 ¶
func GenerateNtildeH1H2(length int) *NtildeH1H2
type PolyGStruct ¶
type PolyGStruct2 ¶
type PolyStruct ¶
type PolyStruct struct { PolyGStruct Poly []*big.Int // coefficient set }
type PolyStruct2 ¶
func (*PolyStruct2) Vss2 ¶
func (polyStruct *PolyStruct2) Vss2(ids []*big.Int) ([]*ShareStruct2, error)
type PrivateKey ¶
type PrivateKey struct { Length string PublicKey L *big.Int // (p-1)*(q-1) U *big.Int // L^-1 mod N }
func (*PrivateKey) ZkFactProve ¶
func (privateKey *PrivateKey) ZkFactProve() *ZkFactProof
type PublicKey ¶
type PublicKey struct { Length string N *big.Int // n = p*q, where p and q are prime G *big.Int // in practical, G = N + 1 N2 *big.Int // N2 = N * N }
func (*PublicKey) Encrypt ¶
func (publicKey *PublicKey) Encrypt(mBigInt *big.Int) (*big.Int, error) {
func (*PublicKey) ZkFactVerify ¶
func (publicKey *PublicKey) ZkFactVerify(zkFactProof *ZkFactProof) bool
type ShareStruct ¶
type ShareStruct struct {}
func (*ShareStruct) Verify ¶
func (share *ShareStruct) Verify(polyG *PolyGStruct) bool
type ShareStruct2 ¶
type ShareStruct2 struct {}
func (*ShareStruct2) Verify2 ¶
func (share *ShareStruct2) Verify2(polyG *PolyGStruct2) bool
type ZkFactProof ¶
Click to show internal directories.
Click to hide internal directories.