Copy the inversions of 0 warning to the invert() method.

This commit is contained in:
Isis Lovecruft 2018-07-05 00:14:55 +00:00
parent 626e070896
commit faf8609246
Failed to extract signature

View file

@ -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()
}