pub struct CommitKey { /* private fields */ }Expand description
CommitKey is used to commit to a polynomial which is bounded by the max_degree.
Implementations§
Source§impl CommitKey
impl CommitKey
Sourcepub fn to_raw_var_bytes(&self) -> Vec<u8> ⓘ
pub fn to_raw_var_bytes(&self) -> Vec<u8> ⓘ
Serialize the CommitKey into bytes.
This operation is designed to store the raw representation of the
contents of the CommitKey. Therefore, the size of the bytes outputed
by this function is expected to be the double than the one that
CommitKey::to_bytes.
§Note
This function should be used when we want to serialize the CommitKey
allowing a really fast deserialization later.
This functions output should not be used by the regular
CommitKey::from_bytes fn.
Sourcepub unsafe fn from_slice_unchecked(bytes: &[u8]) -> Self
pub unsafe fn from_slice_unchecked(bytes: &[u8]) -> Self
Deserialize CommitKey from a set of bytes created by
CommitKey::to_raw_var_bytes.
The bytes source is expected to be trusted and no check will be performed reggarding the points security
§Safety
This function will not produce any memory errors but can deal to the generation of invalid or unsafe points/keys. To make sure this does not happen, the inputed bytes must match the ones that were generated by the encoding functions of this lib.
Sourcepub fn from_slice(bytes: &[u8]) -> Result<CommitKey, Error>
pub fn from_slice(bytes: &[u8]) -> Result<CommitKey, Error>
Deserialise a slice of bytes into a CommitKey struct performing
security and consistency checks for each point that the bytes
contain.
§Note
This function can be really slow if the CommitKey has a certain
degree/size. If the bytes come from a trusted source such as a local
file, we recommend to use CommitKey::from_slice_unchecked and
CommitKey::to_raw_var_bytes.
Trait Implementations§
Source§impl Decode for CommitKey
impl Decode for CommitKey
Source§impl<'de> Deserialize<'de> for CommitKey
impl<'de> Deserialize<'de> for CommitKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Encode for CommitKey
impl Encode for CommitKey
Source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )
Source§fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
Source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
Source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
impl EncodeLike for CommitKey
impl StructuralPartialEq for CommitKey
Auto Trait Implementations§
impl Freeze for CommitKey
impl RefUnwindSafe for CommitKey
impl Send for CommitKey
impl Sync for CommitKey
impl Unpin for CommitKey
impl UnwindSafe for CommitKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more