Skip to content

Commit ff17407

Browse files
authored
Use ConstMontyForm::invert() in place of pow() (#1332)
1 parent b633546 commit ff17407

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
@@ -332,12 +332,8 @@ impl FieldElement {
332332
}
333333

334334
/// Inverts a field element
335-
/// Previous chain length: 462, new length 460
336335
pub fn invert(&self) -> Self {
337-
const INV_EXP: U448 = U448::from_be_hex(
338-
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffd",
339-
);
340-
Self(self.0.pow(&INV_EXP))
336+
Self(self.0.invert().unwrap_or(ConstMontyType::default()))
341337
}
342338

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

0 commit comments

Comments
 (0)