mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-08 14:24:09 -05:00
show binary repr of -1 mod q
This commit is contained in:
@@ -4,6 +4,7 @@ q = 0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001
|
||||
modq = IntegersModP(q)
|
||||
|
||||
a = modq(-1)
|
||||
print("a:", hex(a.n))
|
||||
d = -(modq(10240)/modq(10241))
|
||||
params = (a, d)
|
||||
|
||||
|
||||
@@ -29,4 +29,12 @@ fn main() {
|
||||
])
|
||||
.unwrap();
|
||||
assert_eq!(Scalar::one(), one);
|
||||
|
||||
// Scalar stuff
|
||||
println!("-Scalar::one: {:?}", -Scalar::one());
|
||||
let bits = (-Scalar::one()).to_le_bits();
|
||||
for b in bits.iter() {
|
||||
print!("{}", if *b { 1 } else { 0 });
|
||||
}
|
||||
println!("");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user