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

Holds the parameters of a kzg trusted setup ceremony.

source

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.

source

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

source

pub fn parse_kzg_trusted_setup(trusted_setup: &str) -> Result<Self, Error>

Parses the contents of a KZG trusted setup file into a KzgSettings.

source

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

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for KZGSettings

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Hash for KZGSettings

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq for KZGSettings

source§

fn eq(&self, other: &KZGSettings) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for KZGSettings

source§

impl Send for KZGSettings

source§

impl StructuralPartialEq for KZGSettings

source§

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.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.