Skip to content

Commit

Permalink
Improve documentation in ec-divisors
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabaNerve committed Jan 30, 2025
1 parent 60fd9e2 commit 7875471
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crypto/divisors/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ pub struct ScalarDecomposition<F: Zeroize + PrimeFieldBits> {
impl<F: Zeroize + PrimeFieldBits> ScalarDecomposition<F> {
/// Decompose a non-zero scalar.
///
/// Returns `None` if the scalar is zero.
///
/// This function is constant time if the scalar is non-zero.
pub fn new(scalar: F) -> Option<Self> {
if bool::from(scalar.is_zero()) {
Expand Down Expand Up @@ -429,6 +431,8 @@ impl<F: Zeroize + PrimeFieldBits> ScalarDecomposition<F> {
/// The divisor will interpolate $-(s \cdot G)$ with $d_i$ instances of $2^i \cdot G$.
///
/// This function executes in constant time with regards to the scalar.
///
/// This function MAY panic if the generator is the point at infinity.
pub fn scalar_mul_divisor<C: Zeroize + DivisorCurve<Scalar = F>>(
&self,
mut generator: C,
Expand Down

0 comments on commit 7875471

Please sign in to comment.