mirror of https://github.com/zcash/orchard.git
ecc::chip.rs: Make EccPoint.x, EccPoint.y private fields
Also add public getters x() and y(). Co-authored-by: Jack Grigg <jack@electriccoin.co> Co-authored-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
433791fcb0
commit
aff56e6763
|
@ -459,7 +459,7 @@ mod tests {
|
|||
// Test complete addition
|
||||
{
|
||||
super::chip::add::tests::test_add(
|
||||
chip.clone(),
|
||||
chip,
|
||||
layouter.namespace(|| "complete addition"),
|
||||
&zero,
|
||||
p_val,
|
||||
|
|
|
@ -22,9 +22,9 @@ pub(super) mod witness_point;
|
|||
#[derive(Clone, Debug)]
|
||||
pub struct EccPoint<C: CurveAffine> {
|
||||
/// x-coordinate
|
||||
pub x: CellValue<C::Base>,
|
||||
x: CellValue<C::Base>,
|
||||
/// y-coordinate
|
||||
pub y: CellValue<C::Base>,
|
||||
y: CellValue<C::Base>,
|
||||
}
|
||||
|
||||
impl<C: CurveAffine> EccPoint<C> {
|
||||
|
@ -41,6 +41,16 @@ impl<C: CurveAffine> EccPoint<C> {
|
|||
_ => None,
|
||||
}
|
||||
}
|
||||
/// The cell containing the affine short-Weierstrass x-coordinate,
|
||||
/// or 0 for the zero point.
|
||||
pub fn x(&self) -> CellValue<C::Base> {
|
||||
self.x
|
||||
}
|
||||
/// The cell containing the affine short-Weierstrass y-coordinate,
|
||||
/// or 0 for the zero point.
|
||||
pub fn y(&self) -> CellValue<C::Base> {
|
||||
self.y
|
||||
}
|
||||
}
|
||||
|
||||
/// Configuration for the ECC chip
|
||||
|
|
Loading…
Reference in New Issue