Struct c_kzg::KzgSettings
source · #[repr(C)]pub struct KzgSettings { /* private fields */ }
Expand description
Stores the setup and parameters needed for computing KZG proofs.
Implementations§
source§impl KZGSettings
impl KZGSettings
Holds the parameters of a kzg trusted setup ceremony.
sourcepub fn load_trusted_setup(
g1_bytes: &[[u8; 48]],
g2_bytes: &[[u8; 96]],
) -> Result<Self, Error>
pub fn load_trusted_setup( g1_bytes: &[[u8; 48]], g2_bytes: &[[u8; 96]], ) -> Result<Self, Error>
Initializes a trusted setup from FIELD_ELEMENTS_PER_BLOB
g1 points
and 65 g2 points in byte format.
sourcepub fn load_trusted_setup_file(file_path: &Path) -> Result<Self, Error>
pub fn load_trusted_setup_file(file_path: &Path) -> Result<Self, Error>
Loads the trusted setup parameters from a file. The file format is as follows:
FIELD_ELEMENTS_PER_BLOB 65 # This is fixed and is used for providing multiproofs up to 64 field elements. FIELD_ELEMENT_PER_BLOB g1 byte values 65 g2 byte values
sourcepub fn parse_kzg_trusted_setup(trusted_setup: &str) -> Result<Self, Error>
pub fn parse_kzg_trusted_setup(trusted_setup: &str) -> Result<Self, Error>
Parses the contents of a KZG trusted setup file into a KzgSettings.
sourcepub fn load_trusted_setup_file_inner(file_path: &CStr) -> Result<Self, Error>
pub fn load_trusted_setup_file_inner(file_path: &CStr) -> Result<Self, Error>
Loads the trusted setup parameters from a file.
Same as load_trusted_setup_file
.
Trait Implementations§
source§impl Debug for KZGSettings
impl Debug for KZGSettings
source§impl Drop for KZGSettings
impl Drop for KZGSettings
source§impl Hash for KZGSettings
impl Hash for KZGSettings
source§impl PartialEq for KZGSettings
impl PartialEq for KZGSettings
impl Eq for KZGSettings
impl Send for KZGSettings
impl StructuralPartialEq for KZGSettings
impl Sync for KZGSettings
Safety: The memory for roots_of_unity
and g1_values
and g2_values
are only freed on
calling free_trusted_setup
which only happens when we drop the struct.