Skip to content

Commit 502ef51

Browse files
committed
Use ConstMontyForm::invert() in place of pow()
1 parent 42c74d4 commit 502ef51

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ed448-goldilocks/src/field/element.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,8 @@ impl FieldElement {
263263
}
264264

265265
/// Inverts a field element
266-
/// Previous chain length: 462, new length 460
267266
pub fn invert(&self) -> Self {
268-
const INV_EXP: U448 = U448::from_be_hex(
269-
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffd",
270-
);
271-
Self(self.0.pow(&INV_EXP))
267+
Self(self.0.invert().unwrap_or(ConstMontyType::default()))
272268
}
273269

274270
pub fn square(&self) -> Self {

0 commit comments

Comments
 (0)