Documentation
¶
Index ¶
- Variables
- func Combine(shares []*ShareStruct) (*big.Int, error)
- func GenerateKeyPair(length int) (*PublicKey, *PrivateKey)
- func GetSharesId(ss *ShareStruct) *big.Int
- func Vss(secret *big.Int, ids []*big.Int, t int, n int) (*PolyGStruct, *PolyStruct, []*ShareStruct, error)
- func ZkUVerify(uG []*big.Int, zkUProof *ZkUProof) bool
- type Commitment
- type MtAZK1Proof
- type MtAZK2Proof
- type PolyGStruct
- type PolyStruct
- type PrivateKey
- type PublicKey
- type ShareStruct
- type ZkFactProof
- type ZkUProof
Constants ¶
This section is empty.
Variables ¶
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.")
var ErrMessageTooLong = errors.New("[ERROR]: message is too long.")
Functions ¶
func GenerateKeyPair ¶
func GenerateKeyPair(length int) (*PublicKey, *PrivateKey)
func GetSharesId ¶
func GetSharesId(ss *ShareStruct) *big.Int
func Vss ¶
func Vss(secret *big.Int, ids []*big.Int, t int, n int) (*PolyGStruct, *PolyStruct, []*ShareStruct, error)
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
func (mtAZK1Proof *MtAZK1Proof) MtAZK1Verify(c *big.Int, publicKey *paillier.PublicKey, zkFactProof *paillier.ZkFactProof) 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 PolyGStruct ¶
type PolyStruct ¶
type PolyStruct struct { PolyGStruct Poly []*big.Int // coefficient set }
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