EccInstructions: introduce witness_scalar_var() instruction.

This commit is contained in:
therealyingtong 2022-03-22 12:35:29 +08:00
parent 6d83db719e
commit cbf3d6a7f6
2 changed files with 16 additions and 0 deletions

View File

@ -74,6 +74,13 @@ pub trait EccInstructions<C: CurveAffine>:
value: Option<C>,
) -> Result<Self::NonIdentityPoint, Error>;
/// Witnesses a full-width scalar to be used in variable-base multiplication.
fn witness_scalar_var(
&self,
layouter: &mut impl Layouter<C::Base>,
value: Option<C::Scalar>,
) -> Result<Self::ScalarVar, Error>;
/// Extracts the x-coordinate of a point.
fn extract_p<Point: Into<Self::Point> + Clone>(point: &Point) -> Self::X;

View File

@ -435,6 +435,15 @@ where
)
}
fn witness_scalar_var(
&self,
_layouter: &mut impl Layouter<pallas::Base>,
_value: Option<pallas::Scalar>,
) -> Result<Self::ScalarVar, Error> {
// This is unimplemented for halo2_gadgets v0.1.0.
todo!()
}
fn extract_p<Point: Into<Self::Point> + Clone>(point: &Point) -> Self::X {
let point: EccPoint = (point.clone()).into();
point.x()