mirror of https://github.com/zcash/halo2.git
Test that we can't witness the identity as a NonIdentityPoint
This commit is contained in:
parent
ebfd919abc
commit
d0056d9050
|
@ -495,7 +495,7 @@ where
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use group::{Curve, Group};
|
use group::{prime::PrimeCurveAffine, Curve, Group};
|
||||||
|
|
||||||
use halo2::{
|
use halo2::{
|
||||||
circuit::{Layouter, SimpleFloorPlanner},
|
circuit::{Layouter, SimpleFloorPlanner},
|
||||||
|
@ -586,6 +586,22 @@ mod tests {
|
||||||
// Make sure P and Q are not the same point.
|
// Make sure P and Q are not the same point.
|
||||||
assert_ne!(p_val, q_val);
|
assert_ne!(p_val, q_val);
|
||||||
|
|
||||||
|
// Test that we can witness the identity as a point, but not as a non-identity point.
|
||||||
|
{
|
||||||
|
let _ = super::Point::new(
|
||||||
|
chip.clone(),
|
||||||
|
layouter.namespace(|| "identity"),
|
||||||
|
Some(pallas::Affine::identity()),
|
||||||
|
)?;
|
||||||
|
|
||||||
|
super::NonIdentityPoint::new(
|
||||||
|
chip.clone(),
|
||||||
|
layouter.namespace(|| "identity"),
|
||||||
|
Some(pallas::Affine::identity()),
|
||||||
|
)
|
||||||
|
.expect_err("Trying to witness the identity should return an error");
|
||||||
|
}
|
||||||
|
|
||||||
// Test witness non-identity point
|
// Test witness non-identity point
|
||||||
{
|
{
|
||||||
super::chip::witness_point::tests::test_witness_non_id(
|
super::chip::witness_point::tests::test_witness_non_id(
|
||||||
|
|
Loading…
Reference in New Issue