INNER CODE UNIT · Rust

den

ZcashFoundation/frost · frost-core/src/lib.rs:316

            den = den * (x_i.to_scalar() - x_j.to_scalar());
        } else {
            // Both signs inverted just to avoid requiring Neg (-*xj)
            num = num * x_j.to_scalar();
            den = den * (x_j.to_scalar() - x_i.to_scalar());
        }
    }
    if !x_i_found {
        return Err(Error::UnknownIdentifier);
    }

    Ok(
        num * <<C::Group as Group>::Field>::invert(&den)
            .map_err(|_| Error::DuplicatedIdentifier)?,
    )
}

/// Generates the lagrange coefficient for the i'th participant (for `signer_id`).

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…