Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 10, 2021

Commits on Dec 8, 2021

  1. Do not normalize IDs of Shamir's Secret Sharing

    We need to ensure that:
    - all indexes are non-zero,
    - all indexes are non-zero modulo the curve order,
    - all indexes are unique modulo the curve order.
    
    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.
    pdyraga committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    2718fca View commit details
    Browse the repository at this point in the history