mirror of https://github.com/zcash/orchard.git
ecc::chip.rs: Add Point::from_coordinates_unchecked() API
Co-authored-by: Jack Grigg <jack@electriccoin.co>
This commit is contained in:
parent
0b6bd66714
commit
83eddd8857
|
@ -27,6 +27,17 @@ pub struct EccPoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl EccPoint {
|
impl EccPoint {
|
||||||
|
/// Constructs a point from its coordinates, without checking they are on the curve.
|
||||||
|
///
|
||||||
|
/// This is an internal API that we only use where we know we have a valid curve point
|
||||||
|
/// (specifically inside Sinsemilla).
|
||||||
|
pub(in crate::circuit::gadget) fn from_coordinates_unchecked(
|
||||||
|
x: CellValue<pallas::Base>,
|
||||||
|
y: CellValue<pallas::Base>,
|
||||||
|
) -> Self {
|
||||||
|
EccPoint { x, y }
|
||||||
|
}
|
||||||
|
|
||||||
/// Returns the value of this curve point, if known.
|
/// Returns the value of this curve point, if known.
|
||||||
pub fn point(&self) -> Option<pallas::Affine> {
|
pub fn point(&self) -> Option<pallas::Affine> {
|
||||||
match (self.x.value(), self.y.value()) {
|
match (self.x.value(), self.y.value()) {
|
||||||
|
|
Loading…
Reference in New Issue