mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-22 19:49:22 +00:00
Impl is_odd for dfg::Scalar
This commit is contained in:
parent
faa43b6874
commit
a59bbe7635
3 changed files with 4 additions and 4 deletions
|
@ -207,8 +207,8 @@ impl FieldElement {
|
|||
#[test]
|
||||
fn test_conditional_negate() {
|
||||
let one = FieldElement::one();
|
||||
let true_choice = choice(true);
|
||||
let false_choice = choice(false);
|
||||
let true_choice = 1.into();
|
||||
let false_choice = 0.into();
|
||||
|
||||
let mut var = one;
|
||||
|
||||
|
|
|
@ -244,7 +244,7 @@ impl PrimeField for Scalar {
|
|||
|
||||
const S: u32 = 2;
|
||||
fn is_odd(&self) -> Choice {
|
||||
unimplemented!()
|
||||
choice(self.to_le_bits()[0])
|
||||
}
|
||||
fn multiplicative_generator() -> Self {
|
||||
2u64.into()
|
||||
|
|
|
@ -22,7 +22,7 @@ ff = "0.12"
|
|||
group = "0.12"
|
||||
|
||||
generic-array = "0.14"
|
||||
crypto-bigint = {version = "0.4", features = ["zeroize"] }
|
||||
crypto-bigint = { version = "0.4", features = ["zeroize"] }
|
||||
|
||||
dalek-ff-group = { path = "../dalek-ff-group", version = "^0.1.2" }
|
||||
|
||||
|
|
Loading…
Reference in a new issue