diff --git a/crates/bellman/src/kate_commitment/mod.rs b/crates/bellman/src/kate_commitment/mod.rs index b304b86..4d0ed71 100644 --- a/crates/bellman/src/kate_commitment/mod.rs +++ b/crates/bellman/src/kate_commitment/mod.rs @@ -16,13 +16,30 @@ impl CrsType for CrsForMonomialForm {} impl CrsType for CrsForLagrangeForm {} impl CrsType for CrsForLagrangeFormOnCoset {} -pub struct Crs { +pub struct Crs { + #[cfg(feature = "allocator")] + pub g1_bases: Arc>, + #[cfg(not(feature = "allocator"))] pub g1_bases: Arc>, + #[cfg(feature = "allocator")] + pub g2_monomial_bases: Arc>, + #[cfg(not(feature = "allocator"))] pub g2_monomial_bases: Arc>, _marker: std::marker::PhantomData, } +#[cfg(feature = "allocator")] +impl Crs { + pub fn new_in(g1_bases: Vec, g2_monomial_bases: Vec) -> Self { + Self { + g1_bases: Arc::new(g1_bases), + g2_monomial_bases: Arc::new(g2_monomial_bases), + _marker: std::marker::PhantomData, + } + } +} + use crate::byteorder::BigEndian; use crate::byteorder::ReadBytesExt; use crate::byteorder::WriteBytesExt;