From 78754718faa21f0a5751fbd30c9495d7f7f5c2b1 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Wed, 29 Jan 2025 20:11:28 -0500 Subject: [PATCH] Improve documentation in ec-divisors --- crypto/divisors/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) 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,