Documentation ¶
Index ¶
- func CalcuateXi(shares map[int]*big.Int) *big.Int
- func CalculatePublicKey(verifyPoints []*ecc.Point) (publicKeyPoint *ecc.Point, err error)
- func CalculatePublicKeys(verifyPoints []*ecc.Point, allPartnerShares []*PartnerShares, threshold int) (publicKeysPoints []*ecc.Point, err error)
- func GetPolynomialForSecretShareGenerate(totalShareNumber, minimumShareNumber int) ([]*big.Int, error)
- func GetSpecifiedSecretShareByPolynomial(poly []*big.Int, index *big.Int) *big.Int
- func GetVerifyPointByPolynomial(poly []*big.Int) (*ecc.Point, error)
- func LocalPrivateKeyGenerate(shares []*big.Int) *ecdsa.PrivateKey
- func LocalPrivateSharesGather(allPartnerShares []*PartnerShares, localIndex int) []*big.Int
- func LocalSecretShareGenerateWithVerifyPoints(totalShareNumber, minimumShareNumber int) (shares map[int]*big.Int, points []*ecc.Point, err error)
- func PublicKeyGenerate(verifyPoints []*ecc.Point) (*ecdsa.PublicKey, error)
- func SecretShareLocalKeyGather(allPartnerShares []*PartnerShares, localIndex int) (shares map[int]*big.Int)
- func SecretShareLocalKeyGenerateWithVerifyPoints(totalShareNumber, minimumShareNumber int, secret []byte) (shares map[int]*big.Int, points []*ecc.Point, err error)
- func SecretShareVerifyPointsGather(allPartnerShares []*PartnerShares, threshold int) (points []*ecc.Point, err error)
- type PartnerPrivate
- type PartnerPublic
- type PartnerShares
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcuateXi ¶
测试用 从本地收集的所有碎片计算 自己的xi,这是一个关键秘密信息
func CalculatePublicKey ¶
测试用
func CalculatePublicKeys ¶
func CalculatePublicKeys(verifyPoints []*ecc.Point, allPartnerShares []*PartnerShares, threshold int) (publicKeysPoints []*ecc.Point, err error)
测试用
func GetPolynomialForSecretShareGenerate ¶
func GetPolynomialForSecretShareGenerate(totalShareNumber, minimumShareNumber int) ([]*big.Int, error)
为产生本地秘密的私钥碎片做准备,预先生成好一个目标多项式 minimumShareNumber可以理解为threshold
func GetSpecifiedSecretShareByPolynomial ¶
为产生本地秘密的私钥碎片做准备,通过目标多项式和节点index生成对应的碎片
func GetVerifyPointByPolynomial ¶
为产生本地秘密的私钥碎片做准备,通过目标多项式生成验证点
func LocalPrivateKeyGenerate ¶
func LocalPrivateKeyGenerate(shares []*big.Int) *ecdsa.PrivateKey
每个参与节点根据所收集的所有的与自己相关的碎片(自己的Index是X值,收集所有该X值对应的Y值), 来计算出自己的本地私钥xi(该X值对应的Y值之和),这是一个关键秘密信息 func LocalPrivateKeyGenerate(shares map[int]*big.Int) *ecdsa.PrivateKey {
func LocalPrivateSharesGather ¶
func LocalPrivateSharesGather(allPartnerShares []*PartnerShares, localIndex int) []*big.Int
测试用 从收集的所有碎片中保存与自己相关的密钥部分,并保存在本地
func LocalSecretShareGenerateWithVerifyPoints ¶
func LocalSecretShareGenerateWithVerifyPoints(totalShareNumber, minimumShareNumber int) (shares map[int]*big.Int, points []*ecc.Point, err error)
产生本地秘密的私钥碎片,可以把每个碎片理解为一个坐标点。 key: partner index,也就是x坐标, value: 实际数值,也就是y坐标 minimumShareNumber可以理解为threshold
func PublicKeyGenerate ¶
根据所有潜在节点发布的验证点集合中的第一个元素(也就是秘密值的验证点),计算出公钥
func SecretShareLocalKeyGather ¶
func SecretShareLocalKeyGather(allPartnerShares []*PartnerShares, localIndex int) (shares map[int]*big.Int)
测试用 从收集的所有碎片中保存与自己相关的密钥部分,并保存在本地
func SecretShareLocalKeyGenerateWithVerifyPoints ¶
func SecretShareLocalKeyGenerateWithVerifyPoints(totalShareNumber, minimumShareNumber int, secret []byte) (shares map[int]*big.Int, points []*ecc.Point, err error)
测试用 产生本地秘密的私钥碎片,可以把每个碎片理解为一个坐标点。 key: partner index,也就是x坐标, value: 实际数值,也就是y坐标 minimumShareNumber可以理解为threshold
func SecretShareVerifyPointsGather ¶
func SecretShareVerifyPointsGather(allPartnerShares []*PartnerShares, threshold int) (points []*ecc.Point, err error)
测试用 从收集的所有碎片中保存验证点部分,并保存在本地
Types ¶
type PartnerPrivate ¶
type PartnerPrivate struct { PublicInfo *PartnerPublic Xi *big.Int // contains filtered or unexported fields }