mirror of https://github.com/zcash/halo2.git
Fix y-coordinate recovery in NoteCommit tests
This commit is contained in:
parent
3f506a0129
commit
620e227854
|
@ -1584,7 +1584,7 @@ mod tests {
|
|||
let g_d = self.gd_x.zip(self.gd_y_lsb).map(|(x, y_lsb)| {
|
||||
// Calculate y = (x^3 + 5).sqrt()
|
||||
let mut y = (x.square() * x + pallas::Affine::b()).sqrt().unwrap();
|
||||
if y.is_odd() && y_lsb == pallas::Base::zero() {
|
||||
if y.is_odd() ^ y_lsb.is_odd() {
|
||||
y = -y;
|
||||
}
|
||||
pallas::Affine::from_xy(x, y).unwrap()
|
||||
|
@ -1598,7 +1598,7 @@ mod tests {
|
|||
let pk_d = self.pkd_x.zip(self.pkd_y_lsb).map(|(x, y_lsb)| {
|
||||
// Calculate y = (x^3 + 5).sqrt()
|
||||
let mut y = (x.square() * x + pallas::Affine::b()).sqrt().unwrap();
|
||||
if y.is_odd() && y_lsb == pallas::Base::zero() {
|
||||
if y.is_odd() ^ y_lsb.is_odd() {
|
||||
y = -y;
|
||||
}
|
||||
pallas::Affine::from_xy(x, y).unwrap()
|
||||
|
|
Loading…
Reference in New Issue