pub type RingContext = RingContext<RING_SIZE>;
Expand description
Bandersnatch VRF RingContext
specialization for Sassafras using RING_SIZE
.
Aliased Type§
struct RingContext(/* private fields */);
Implementations
§impl<const R: usize> RingContext<R>
impl<const R: usize> RingContext<R>
pub fn new_testing() -> RingContext<R>
pub fn new_testing() -> RingContext<R>
Build an dummy instance for testing purposes.
pub fn max_keyset_size(&self) -> usize
pub fn max_keyset_size(&self) -> usize
Get the keyset max size.
pub fn prover(
&self,
public_keys: &[CryptoBytes<sp_core::::bandersnatch::Public::{constant#0}, (PublicTag, BandersnatchTag)>],
public_idx: usize,
) -> RingProver<<<BandersnatchSha512Ell2 as Suite>::Affine as AffineRepr>::BaseField, KZG<<BandersnatchSha512Ell2 as RingSuite>::Pairing>, <<BandersnatchSha512Ell2 as Suite>::Affine as AffineRepr>::Config>
pub fn prover( &self, public_keys: &[CryptoBytes<sp_core::::bandersnatch::Public::{constant#0}, (PublicTag, BandersnatchTag)>], public_idx: usize, ) -> RingProver<<<BandersnatchSha512Ell2 as Suite>::Affine as AffineRepr>::BaseField, KZG<<BandersnatchSha512Ell2 as RingSuite>::Pairing>, <<BandersnatchSha512Ell2 as Suite>::Affine as AffineRepr>::Config>
Get ring prover for the key at index public_idx
in the public_keys
set.
pub fn verifier(
&self,
public_keys: &[CryptoBytes<sp_core::::bandersnatch::Public::{constant#0}, (PublicTag, BandersnatchTag)>],
) -> RingVerifier<<<BandersnatchSha512Ell2 as Suite>::Affine as AffineRepr>::BaseField, KZG<<BandersnatchSha512Ell2 as RingSuite>::Pairing>, <<BandersnatchSha512Ell2 as Suite>::Affine as AffineRepr>::Config>
pub fn verifier( &self, public_keys: &[CryptoBytes<sp_core::::bandersnatch::Public::{constant#0}, (PublicTag, BandersnatchTag)>], ) -> RingVerifier<<<BandersnatchSha512Ell2 as Suite>::Affine as AffineRepr>::BaseField, KZG<<BandersnatchSha512Ell2 as RingSuite>::Pairing>, <<BandersnatchSha512Ell2 as Suite>::Affine as AffineRepr>::Config>
Get ring verifier for the public_keys
set.
pub fn verifier_key(
&self,
public_keys: &[CryptoBytes<sp_core::::bandersnatch::Public::{constant#0}, (PublicTag, BandersnatchTag)>],
) -> RingVerifierKey
pub fn verifier_key( &self, public_keys: &[CryptoBytes<sp_core::::bandersnatch::Public::{constant#0}, (PublicTag, BandersnatchTag)>], ) -> RingVerifierKey
Build RingVerifierKey
for lazy RingVerifier
construction.
pub fn verifier_no_context(
verifier_key: RingVerifierKey,
) -> RingVerifier<<<BandersnatchSha512Ell2 as Suite>::Affine as AffineRepr>::BaseField, KZG<<BandersnatchSha512Ell2 as RingSuite>::Pairing>, <<BandersnatchSha512Ell2 as Suite>::Affine as AffineRepr>::Config>
pub fn verifier_no_context( verifier_key: RingVerifierKey, ) -> RingVerifier<<<BandersnatchSha512Ell2 as Suite>::Affine as AffineRepr>::BaseField, KZG<<BandersnatchSha512Ell2 as RingSuite>::Pairing>, <<BandersnatchSha512Ell2 as Suite>::Affine as AffineRepr>::Config>
Constructs a RingVerifier
from a VerifierKey
without a RingContext
instance.
While this approach is computationally slightly less efficient than using a
pre-constructed RingContext
, as some parameters need to be computed on-the-fly, it
is beneficial in memory or storage constrained environments. This avoids the need to
retain the full RingContext
for ring signature verification. Instead, the
VerifierKey
contains only the essential information needed to verify ring proofs.