Skip to content

Commit 220ea81

Browse files
committed
Use ConstMontyForm::invert() in place of pow()
1 parent 9732c75 commit 220ea81

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
@@ -265,10 +265,7 @@ impl FieldElement {
265265
/// Inverts a field element
266266
/// Previous chain length: 462, new length 460
267267
pub fn invert(&self) -> Self {
268-
const INV_EXP: U448 = U448::from_be_hex(
269-
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffffffffffffffffffffffffffffffffffffffffffffffffffffd",
270-
);
271-
Self(self.0.pow(&INV_EXP))
268+
Self(self.0.invert().unwrap_or(ConstMontyType::default()))
272269
}
273270

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

0 commit comments

Comments
 (0)