(
rng: &mut R,
point: &Affine<P>,
comm_key: &PedersenCommitmentKey<Affine<C>>,
)
| 49 | |
| 50 | impl<C: SWPoint> PointCommitmentWithOpening<C> { |
| 51 | pub fn new<R: RngCore, P: SWPoint>( |
| 52 | rng: &mut R, |
| 53 | point: &Affine<P>, |
| 54 | comm_key: &PedersenCommitmentKey<Affine<C>>, |
| 55 | ) -> Result<Self, Error> { |
| 56 | let r_x = C::ScalarField::rand(rng); |
| 57 | let r_y = C::ScalarField::rand(rng); |
| 58 | Self::new_given_randomness(point, r_x, r_y, comm_key) |
| 59 | } |
| 60 | |
| 61 | /// `r_x` and `r_y` are randomness in the Pedersen commitments to x and y coordinates respectively |
| 62 | pub fn new_given_randomness<P: SWPoint>( |