diff --git a/crypto/divisors/src/lib.rs b/crypto/divisors/src/lib.rs index 24514021..8f6325da 100644 --- a/crypto/divisors/src/lib.rs +++ b/crypto/divisors/src/lib.rs @@ -278,6 +278,8 @@ pub struct ScalarDecomposition { impl ScalarDecomposition { /// 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 { if bool::from(scalar.is_zero()) { @@ -429,6 +431,8 @@ impl ScalarDecomposition { /// 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>( &self, mut generator: C,