We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ConstMontyForm::invert()
pow()
1 parent 9732c75 commit 220ea81Copy full SHA for 220ea81
ed448-goldilocks/src/field/element.rs
@@ -265,10 +265,7 @@ impl FieldElement {
265
/// Inverts a field element
266
/// Previous chain length: 462, new length 460
267
pub fn invert(&self) -> Self {
268
- const INV_EXP: U448 = U448::from_be_hex(
269
- "fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffd",
270
- );
271
- Self(self.0.pow(&INV_EXP))
+ Self(self.0.invert().unwrap_or(ConstMontyType::default()))
272
}
273
274
pub fn square(&self) -> Self {
0 commit comments