mirror of https://github.com/zcash/halo2.git
EccInstructions: introduce witness_scalar_var() instruction.
This commit is contained in:
parent
6d83db719e
commit
cbf3d6a7f6
|
@ -74,6 +74,13 @@ pub trait EccInstructions<C: CurveAffine>:
|
||||||
value: Option<C>,
|
value: Option<C>,
|
||||||
) -> Result<Self::NonIdentityPoint, Error>;
|
) -> 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.
|
/// Extracts the x-coordinate of a point.
|
||||||
fn extract_p<Point: Into<Self::Point> + Clone>(point: &Point) -> Self::X;
|
fn extract_p<Point: Into<Self::Point> + Clone>(point: &Point) -> Self::X;
|
||||||
|
|
||||||
|
|
|
@ -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 {
|
fn extract_p<Point: Into<Self::Point> + Clone>(point: &Point) -> Self::X {
|
||||||
let point: EccPoint = (point.clone()).into();
|
let point: EccPoint = (point.clone()).into();
|
||||||
point.x()
|
point.x()
|
||||||
|
|
Loading…
Reference in New Issue