bnb-chain / tss-lib

Threshold Signature Scheme, for ECDSA and EDDSA
MIT License
790 stars 271 forks source link

Do not normalize IDs of Shamir's Secret Sharing #155

Closed pdyraga closed 2 years ago

pdyraga commented 2 years ago

We need to ensure that:

The first two are guarded in CheckIndexes function by:

vMod := new(big.Int).Mod(v, ec.Params().N)
if vMod.Cmp(zero) == 0 {
return nil, errors.New("party index should not be 0")
}

The last one is guarded by:

vModStr := vMod.String()
if _, ok := visited[vModStr]; ok {
return nil, fmt.Errorf("duplicate indexes %s", vModStr)
}
visited[vModStr] = struct{}{}

CheckIndexes was additionally normalizing identifiers mod elliptic curve order. This was not really needed and could cause problems during signing.

ackratos commented 2 years ago

thank you very much