Struct penumbra_proof_params::LazyProvingKey
source · 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.