From faf860924626ec084db0f5ef64737890bdbac4a0 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Thu, 5 Jul 2018 00:14:55 +0000 Subject: [PATCH] Copy the inversions of 0 warning to the invert() method. --- src/scalar.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/scalar.rs b/src/scalar.rs index 1004f57..7e23699 100644 --- a/src/scalar.rs +++ b/src/scalar.rs @@ -525,6 +525,16 @@ impl Scalar { } /// Compute the multiplicative inverse of this scalar. + /// + /// # Warning + /// + /// All input `Scalars` **MUST** be nonzero. If you cannot + /// *prove* that this is the case, you **SHOULD NOT USE THIS + /// FUNCTION**. + /// + /// # Returns + /// + /// The multiplicative inverse of the this `Scalar`. pub fn invert(&self) -> Scalar { self.unpack().invert().pack() }