mirror of https://github.com/zcash/halo2.git
Address review comments
This commit is contained in:
parent
17b66e1c6a
commit
ce6e59bdb8
|
@ -240,11 +240,11 @@ impl<C: CurveAffine> FixedBase<C> for OrchardFixedBase<C> {
|
|||
let z_for_single_y = |y: C::Base, z: u64| {
|
||||
let sum_y_is_square: bool = (y + C::Base::from_u64(z)).sqrt().is_some().into();
|
||||
let sum_neg_y_is_square: bool = (-y + C::Base::from_u64(z)).sqrt().is_some().into();
|
||||
(sum_y_is_square && !sum_neg_y_is_square) as usize
|
||||
sum_y_is_square && !sum_neg_y_is_square
|
||||
};
|
||||
|
||||
for z in 0..(1000 * (1 << (2 * H))) {
|
||||
if ys.iter().map(|y| z_for_single_y(*y, z)).sum::<usize>() == H {
|
||||
if ys.iter().all(|y| z_for_single_y(*y, z)) {
|
||||
return Some(z);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3735,21 +3735,23 @@ mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
// #[test]
|
||||
// fn z() {
|
||||
// let base = super::generator::<pallas::Affine>();
|
||||
// match base {
|
||||
// OrchardFixedBases::CommitIvkR(inner) => inner.test_z(&Z, &U, NUM_WINDOWS),
|
||||
// _ => unreachable!(),
|
||||
// }
|
||||
// }
|
||||
#[test]
|
||||
fn z() {
|
||||
let base = super::generator::<pallas::Affine>();
|
||||
match base {
|
||||
OrchardFixedBases::CommitIvkR(inner) => inner.test_z(&Z, &U, NUM_WINDOWS),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
// #[test]
|
||||
// fn z_short() {
|
||||
// let base = super::generator::<pallas::Affine>();
|
||||
// match base {
|
||||
// OrchardFixedBases::CommitIvkR(inner) => inner.test_z(&Z_SHORT, &U_SHORT, NUM_WINDOWS_SHORT),
|
||||
// _ => unreachable!(),
|
||||
// }
|
||||
// }
|
||||
#[test]
|
||||
fn z_short() {
|
||||
let base = super::generator::<pallas::Affine>();
|
||||
match base {
|
||||
OrchardFixedBases::CommitIvkR(inner) => {
|
||||
inner.test_z(&Z_SHORT, &U_SHORT, NUM_WINDOWS_SHORT)
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3733,21 +3733,23 @@ mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
// #[test]
|
||||
// fn z() {
|
||||
// let base = super::generator::<pallas::Affine>();
|
||||
// match base {
|
||||
// OrchardFixedBases::NullifierK(inner) => inner.test_z(&Z, &U, NUM_WINDOWS),
|
||||
// _ => unreachable!(),
|
||||
// }
|
||||
// }
|
||||
#[test]
|
||||
fn z() {
|
||||
let base = super::generator::<pallas::Affine>();
|
||||
match base {
|
||||
OrchardFixedBases::NullifierK(inner) => inner.test_z(&Z, &U, NUM_WINDOWS),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
// #[test]
|
||||
// fn z_short() {
|
||||
// let base = super::generator::<pallas::Affine>();
|
||||
// match base {
|
||||
// OrchardFixedBases::NullifierK(inner) => inner.test_z(&Z_SHORT, &U_SHORT, NUM_WINDOWS_SHORT),
|
||||
// _ => unreachable!(),
|
||||
// }
|
||||
// }
|
||||
#[test]
|
||||
fn z_short() {
|
||||
let base = super::generator::<pallas::Affine>();
|
||||
match base {
|
||||
OrchardFixedBases::NullifierK(inner) => {
|
||||
inner.test_z(&Z_SHORT, &U_SHORT, NUM_WINDOWS_SHORT)
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3735,21 +3735,23 @@ mod tests {
|
|||
}
|
||||
}
|
||||
|
||||
// #[test]
|
||||
// fn z() {
|
||||
// let base = super::generator::<pallas::Affine>();
|
||||
// match base {
|
||||
// OrchardFixedBases::ValueCommitR(inner) => inner.test_z(&Z, &U, NUM_WINDOWS),
|
||||
// _ => unreachable!(),
|
||||
// }
|
||||
// }
|
||||
#[test]
|
||||
fn z() {
|
||||
let base = super::generator::<pallas::Affine>();
|
||||
match base {
|
||||
OrchardFixedBases::ValueCommitR(inner) => inner.test_z(&Z, &U, NUM_WINDOWS),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
// #[test]
|
||||
// fn z_short() {
|
||||
// let base = super::generator::<pallas::Affine>();
|
||||
// match base {
|
||||
// OrchardFixedBases::ValueCommitR(inner) => inner.test_z(&Z_SHORT, &U_SHORT, NUM_WINDOWS_SHORT),
|
||||
// _ => unreachable!(),
|
||||
// }
|
||||
// }
|
||||
#[test]
|
||||
fn z_short() {
|
||||
let base = super::generator::<pallas::Affine>();
|
||||
match base {
|
||||
OrchardFixedBases::ValueCommitR(inner) => {
|
||||
inner.test_z(&Z_SHORT, &U_SHORT, NUM_WINDOWS_SHORT)
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue