MCPcopy Create free account
hub / github.com/BitVM/BitVM / extract_public_params

Function extract_public_params

bitvm/src/chunk/api_runtime_utils.rs:198–220  ·  view source on GitHub ↗
(vk: &ark_groth16::VerifyingKey<Bn254>)

Source from the content-addressed store, hash-verified

196 }
197
198 fn extract_public_params(vk: &ark_groth16::VerifyingKey<Bn254>) -> PublicParams {
199 let mut msm_gs = vk.gamma_abc_g1.clone(); // vk.vk_pubs[0]
200 msm_gs.reverse();
201 let vky0 = msm_gs.pop().unwrap();
202
203 let (q3, q2, q1) = (
204 vk.gamma_g2.into_group().neg().into_affine(),
205 vk.delta_g2.into_group().neg().into_affine(),
206 -vk.beta_g2,
207 );
208
209 let pairing = BnAffinePairing;
210 let fixed_acc = pairing.multi_miller_loop_affine([vk.alpha_g1], [q1]).0;
211
212 let pubs: PublicParams = PublicParams {
213 q2,
214 q3,
215 fixed_acc: fixed_acc.c1 / fixed_acc.c0,
216 ks_vks: msm_gs.clone(),
217 vky0,
218 };
219 pubs
220 }
221
222 let states = utils_deserialize_assertions(assertions);
223

Callers 1

Calls 3

cloneMethod · 0.80
negMethod · 0.45

Tested by

no test coverage detected