diff --git a/halo2_proofs/src/helpers.rs b/halo2_proofs/src/helpers.rs index f58ec9b100..e8521aa7ff 100644 --- a/halo2_proofs/src/helpers.rs +++ b/halo2_proofs/src/helpers.rs @@ -48,6 +48,10 @@ pub fn field_to_bn(f: &F) -> BigUint { /// Input a big integer `bn`, compute a field element `f` /// such that `f == bn % F::MODULUS`. +/// Require: +/// - bn is less than 512 bits. +/// Return: +/// - bn mod F::MODULUS when bn > F::MODULUS pub fn bn_to_field(bn: &BigUint) -> F { let mut buf = bn.to_bytes_le(); buf.resize(64, 0u8); diff --git a/halo2_proofs/src/poly/kzg/commitment.rs b/halo2_proofs/src/poly/kzg/commitment.rs index 27d188aa5c..08665667b3 100644 --- a/halo2_proofs/src/poly/kzg/commitment.rs +++ b/halo2_proofs/src/poly/kzg/commitment.rs @@ -21,12 +21,12 @@ use super::msm::MSMKZG; /// These are the public parameters for the polynomial commitment scheme. #[derive(Debug, Clone)] pub struct ParamsKZG { - pub(crate) k: u32, + pub k: u32, pub n: u64, - pub(crate) g: Vec, + pub g: Vec, pub g_lagrange: Vec, - pub(crate) g2: E::G2Affine, - pub(crate) s_g2: E::G2Affine, + pub g2: E::G2Affine, + pub s_g2: E::G2Affine, } /// Umbrella commitment scheme construction for all KZG variants