INNER CODE UNIT · Rust
new_verification_key_unchecked
arkworks-rs/groth16 · src/constraints.rs:196
fn new_verification_key_unchecked<T: Borrow<VerifyingKey<E>>>(
cs: impl Into<Namespace<BasePrimeField<E>>>,
f: impl FnOnce() -> Result<T, SynthesisError>,
mode: AllocationMode,
) -> Result<Self::VerifyingKeyVar, SynthesisError> {
let ns = cs.into();
let cs = ns.cs();
f().and_then(|vk| {
let vk = vk.borrow();
let alpha_g1 = P::G1Var::new_variable_omit_prime_order_check(
ark_relations::ns!(cs, "alpha_g1"),
|| Ok(vk.alpha_g1.into_group()),
mode,
)?;
let beta_g2 = P::G2Var::new_variable_omit_prime_order_check(
ark_relations::ns!(cs, "beta_g2"),
|| Ok(vk.beta_g2.into_group()),
mode,