halo2_base::utils::fs

Function read_or_create_srs

Source
pub fn read_or_create_srs<'a, C: CurveAffine, P: ParamsProver<'a, C>>(
    k: u32,
    setup: impl Fn(u32) -> P,
) -> P
Expand description

Attempts to read the srs from a file found in ./params/kzg_bn254_{k}.srs or {dir}/kzg_bn254_{k}.srs if PARAMS_DIR env var is specified, creates a file it if it does not exist.

  • k: degree that expresses the size of circuit (i.e., 2^k is the number of rows in the circuit)
  • setup: a function that creates the srs