Skip to content

Commit c41b83e

Browse files
committed
Use Uint::is_odd() directly
1 parent 6d5e5e8 commit c41b83e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ed448-goldilocks/src/field/element.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{
99
use elliptic_curve::{
1010
array::Array,
1111
bigint::{
12-
NonZero, U448, U704,
12+
Integer, NonZero, U448, U704,
1313
consts::{U56, U84, U88},
1414
},
1515
group::cofactor::CofactorGroup,
@@ -258,8 +258,7 @@ impl FieldElement {
258258
pub const ZERO: Self = Self(ConstMontyType::new(&U448::ZERO));
259259

260260
pub fn is_negative(&self) -> Choice {
261-
let bytes = self.to_bytes();
262-
(bytes[0] & 1).into()
261+
self.0.retrieve().is_odd()
263262
}
264263

265264
/// Inverts a field element

0 commit comments

Comments
 (0)