pub enum PoSWProof<N: Network> {
NonHiding(N::PoSWProof),
Hiding(DeprecatedPoSWProof<N>),
}
Expand description
A wrapper enum for a PoSW proof.
Variants
NonHiding(N::PoSWProof)
Hiding(DeprecatedPoSWProof<N>)
Implementations
sourceimpl<N: Network> PoSWProof<N>
impl<N: Network> PoSWProof<N>
sourcepub fn new_hiding(proof: DeprecatedPoSWProof<N>) -> Self
pub fn new_hiding(proof: DeprecatedPoSWProof<N>) -> Self
Initializes a new instance of a hiding PoSW proof.
sourcepub fn to_proof_difficulty(&self) -> Result<u64>
pub fn to_proof_difficulty(&self) -> Result<u64>
Returns the proof difficulty, determined by double-hashing the proof bytes to a u64.
sourcepub fn verify(
&self,
verifying_key: &<<N as Network>::PoSWSNARK as SNARK>::VerifyingKey,
inputs: &[N::InnerScalarField]
) -> bool
pub fn verify(
&self,
verifying_key: &<<N as Network>::PoSWSNARK as SNARK>::VerifyingKey,
inputs: &[N::InnerScalarField]
) -> bool
Returns true
if the PoSW proof is valid.
Trait Implementations
sourceimpl<'de, N: Network> Deserialize<'de> for PoSWProof<N>
impl<'de, N: Network> Deserialize<'de> for PoSWProof<N>
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
sourceimpl<N: PartialEq + Network> PartialEq<PoSWProof<N>> for PoSWProof<N> where
N::PoSWProof: PartialEq,
impl<N: PartialEq + Network> PartialEq<PoSWProof<N>> for PoSWProof<N> where
N::PoSWProof: PartialEq,
impl<N: Eq + Network> Eq for PoSWProof<N> where
N::PoSWProof: Eq,
impl<N: Network> StructuralEq for PoSWProof<N>
impl<N: Network> StructuralPartialEq for PoSWProof<N>
Auto Trait Implementations
impl<N> RefUnwindSafe for PoSWProof<N> where
<<N as Network>::InnerCurve as PairingEngine>::G1Affine: RefUnwindSafe,
<N as Network>::InnerCurve: PairingEngine<Fq = <N as Network>::OuterScalarField> + PairingEngine<Fr = <N as Network>::InnerScalarField>,
<N as Network>::InnerScalarField: RefUnwindSafe,
<N as Network>::PoSWProof: RefUnwindSafe,
impl<N> Send for PoSWProof<N> where
<N as Network>::InnerCurve: PairingEngine<Fq = <N as Network>::OuterScalarField> + PairingEngine<Fr = <N as Network>::InnerScalarField>,
impl<N> Sync for PoSWProof<N> where
<N as Network>::InnerCurve: PairingEngine<Fq = <N as Network>::OuterScalarField> + PairingEngine<Fr = <N as Network>::InnerScalarField>,
impl<N> Unpin for PoSWProof<N> where
<<N as Network>::InnerCurve as PairingEngine>::G1Affine: Unpin,
<N as Network>::InnerCurve: PairingEngine<Fq = <N as Network>::OuterScalarField> + PairingEngine<Fr = <N as Network>::InnerScalarField>,
<N as Network>::InnerScalarField: Unpin,
<N as Network>::PoSWProof: Unpin,
impl<N> UnwindSafe for PoSWProof<N> where
<<N as Network>::InnerCurve as PairingEngine>::G1Affine: UnwindSafe,
<N as Network>::InnerCurve: PairingEngine<Fq = <N as Network>::OuterScalarField> + PairingEngine<Fr = <N as Network>::InnerScalarField>,
<N as Network>::InnerScalarField: UnwindSafe,
<N as Network>::PoSWProof: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more