pub struct LazyProvingKey { /* private fields */ }
Expand description
A wrapper around a proving key that can be lazily loaded.
One instance of this struct is created for each proving key.
The behavior of those instances is controlled by the bundled-proving-keys
feature. When the feature is enabled, the proving key data is bundled into
the binary at compile time, and the proving key is loaded from the bundled
data on first use. When the feature is not enabled, the proving key must be
loaded using try_load
prior to its first use.
The bundled-proving-keys
feature needs access to proving keys at build
time. When pulling the crate as a dependency, these may not be available.
To address this, the download-proving-keys
feature will download them from
the network at build time. All proving keys are checked against hardcoded hashes
to ensure they have not been tampered with.
Implementations§
Source§impl LazyProvingKey
impl LazyProvingKey
Sourcepub fn try_load(&self, bytes: &[u8]) -> Result<&ProvingKey<Bls12_377>>
pub fn try_load(&self, bytes: &[u8]) -> Result<&ProvingKey<Bls12_377>>
Attempt to load the proving key from the given bytes.
The provided bytes are validated against a hardcoded hash of the expected proving key, so passing the wrong proving key will fail.
If the proving key is already loaded, this method is a no-op.
Sourcepub fn try_load_unchecked(&self, bytes: &[u8]) -> Result<&ProvingKey<Bls12_377>>
pub fn try_load_unchecked(&self, bytes: &[u8]) -> Result<&ProvingKey<Bls12_377>>
Attempt to load the proving key from the given bytes.
This method bypasses the validation checks against the hardcoded hash of the expected proving key.
Trait Implementations§
Source§impl Debug for LazyProvingKey
impl Debug for LazyProvingKey
Source§impl Default for LazyProvingKey
impl Default for LazyProvingKey
Source§fn default() -> LazyProvingKey
fn default() -> LazyProvingKey
Auto Trait Implementations§
impl !Freeze for LazyProvingKey
impl RefUnwindSafe for LazyProvingKey
impl Send for LazyProvingKey
impl Sync for LazyProvingKey
impl Unpin for LazyProvingKey
impl UnwindSafe for LazyProvingKey
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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