mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Impl is_odd for dfg::Scalar
This commit is contained in:
@@ -207,8 +207,8 @@ impl FieldElement {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_conditional_negate() {
|
fn test_conditional_negate() {
|
||||||
let one = FieldElement::one();
|
let one = FieldElement::one();
|
||||||
let true_choice = choice(true);
|
let true_choice = 1.into();
|
||||||
let false_choice = choice(false);
|
let false_choice = 0.into();
|
||||||
|
|
||||||
let mut var = one;
|
let mut var = one;
|
||||||
|
|
||||||
|
|||||||
@@ -244,7 +244,7 @@ impl PrimeField for Scalar {
|
|||||||
|
|
||||||
const S: u32 = 2;
|
const S: u32 = 2;
|
||||||
fn is_odd(&self) -> Choice {
|
fn is_odd(&self) -> Choice {
|
||||||
unimplemented!()
|
choice(self.to_le_bits()[0])
|
||||||
}
|
}
|
||||||
fn multiplicative_generator() -> Self {
|
fn multiplicative_generator() -> Self {
|
||||||
2u64.into()
|
2u64.into()
|
||||||
|
|||||||
Reference in New Issue
Block a user