pub struct SP1PublicValues { /* private fields */ }Expand description
Public values for the prover.
Implementations§
Source§impl SP1PublicValues
impl SP1PublicValues
pub fn raw(&self) -> String
pub fn as_slice(&self) -> &[u8] ⓘ
pub fn to_vec(&self) -> Vec<u8> ⓘ
Sourcepub fn read<T: Serialize + DeserializeOwned>(&mut self) -> T
pub fn read<T: Serialize + DeserializeOwned>(&mut self) -> T
Read a value from the buffer.
Sourcepub fn read_slice(&mut self, slice: &mut [u8])
pub fn read_slice(&mut self, slice: &mut [u8])
Read a slice of bytes from the buffer.
Sourcepub fn write_slice(&mut self, slice: &[u8])
pub fn write_slice(&mut self, slice: &[u8])
Write a slice of bytes to the buffer.
Sourcepub fn blake3_hash(&self) -> Vec<u8> ⓘ
pub fn blake3_hash(&self) -> Vec<u8> ⓘ
Hash the public values using Blake3.
Sourcepub fn hash_bn254(&self) -> BigUint
pub fn hash_bn254(&self) -> BigUint
Hash the public values using SHA256, mask the top 3 bits and return a BigUint.
Matches the implementation of hashPublicValues in the Solidity verifier.
sha256(publicValues) & bytes32(uint256((1 << 253) - 1));Trait Implementations§
Source§impl AsRef<[u8]> for SP1PublicValues
impl AsRef<[u8]> for SP1PublicValues
Source§impl Clone for SP1PublicValues
impl Clone for SP1PublicValues
Source§fn clone(&self) -> SP1PublicValues
fn clone(&self) -> SP1PublicValues
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SP1PublicValues
impl Debug for SP1PublicValues
Source§impl Default for SP1PublicValues
impl Default for SP1PublicValues
Source§fn default() -> SP1PublicValues
fn default() -> SP1PublicValues
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SP1PublicValues
impl<'de> Deserialize<'de> for SP1PublicValues
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SP1PublicValues
impl RefUnwindSafe for SP1PublicValues
impl Send for SP1PublicValues
impl Sync for SP1PublicValues
impl Unpin for SP1PublicValues
impl UnwindSafe for SP1PublicValues
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 moreSource§impl<T> ToHex for T
impl<T> ToHex for T
Source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Lower case
letters are used (e.g. f9b4ca)Source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self into the result. Upper case
letters are used (e.g. F9B4CA)