mirror of
https://github.com/saymrwulf/betrusted-curve25519-dalek-source.git
synced 2026-09-08 21:00:38 +00:00
Copy the inversions of 0 warning to the invert() method.
This commit is contained in:
parent
626e070896
commit
faf8609246
1 changed files with 10 additions and 0 deletions
|
|
@ -525,6 +525,16 @@ impl Scalar {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Compute the multiplicative inverse of this 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 {
|
pub fn invert(&self) -> Scalar {
|
||||||
self.unpack().invert().pack()
|
self.unpack().invert().pack()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue