MCPcopy Create free account
hub / github.com/docknetwork/crypto / create_P

Function create_P

compressed_sigma/src/partial_knowledge.rs:60–69  ·  view source on GitHub ↗

Create a random gamma and then P = gs * y + h * gamma

(
    rng: &mut R,
    y: &[G::ScalarField],
    gs: &[G],
    h: &G,
)

Source from the content-addressed store, hash-verified

58
59/// Create a random gamma and then P = gs * y + h * gamma
60fn create_P<R: RngCore, G: AffineRepr>(
61 rng: &mut R,
62 y: &[G::ScalarField],
63 gs: &[G],
64 h: &G,
65) -> (G::ScalarField, G) {
66 let gamma = G::ScalarField::rand(rng);
67 let P = G::Group::msm_unchecked(gs, &y) + h.mul_bigint(gamma.into_bigint());
68 (gamma, P.into_affine())
69}
70
71macro_rules! impl_homomorphism {
72 ($name: ident, $G: ident) => {

Calls 1

randFunction · 0.85

Tested by

no test coverage detected