Skip to content

Commit 23b10ff

Browse files
committed
Use ConstMontyForm::invert() in place of pow()
1 parent 912d939 commit 23b10ff

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ed448-goldilocks/src/field/element.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,7 @@ impl FieldElement {
264264
/// Inverts a field element
265265
/// Previous chain length: 462, new length 460
266266
pub fn invert(&self) -> Self {
267-
const INV_EXP: U448 = U448::from_be_hex(
268-
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffd",
269-
);
270-
Self(self.0.pow(&INV_EXP))
267+
Self(self.0.invert().unwrap_or(ConstMontyType::default()))
271268
}
272269

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

0 commit comments

Comments
 (0)