mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 16:47:57 +00:00
Bandersnatch: ring-context generic over domain size (#2581)
Serialized length is now statically computed depending on the domain size. Opens the primitive to more generic usages not related to Sassafras expectations Address one point of https://github.com/paritytech/polkadot-sdk/issues/2364
This commit is contained in:
@@ -23,10 +23,16 @@ use sp_consensus_slots::Slot;
|
||||
use sp_std::vec::Vec;
|
||||
|
||||
pub use sp_core::bandersnatch::{
|
||||
ring_vrf::{RingContext, RingProver, RingVerifier, RingVerifierData, RingVrfSignature},
|
||||
ring_vrf::{RingProver, RingVerifier, RingVerifierData, RingVrfSignature},
|
||||
vrf::{VrfInput, VrfOutput, VrfSignData, VrfSignature},
|
||||
};
|
||||
|
||||
/// Ring VRF domain size for Sassafras consensus.
|
||||
pub const RING_VRF_DOMAIN_SIZE: u32 = 2048;
|
||||
|
||||
/// Bandersnatch VRF [`RingContext`] specialization for Sassafras using [`RING_VRF_DOMAIN_SIZE`].
|
||||
pub type RingContext = sp_core::bandersnatch::ring_vrf::RingContext<RING_VRF_DOMAIN_SIZE>;
|
||||
|
||||
fn vrf_input_from_data(
|
||||
domain: &[u8],
|
||||
data: impl IntoIterator<Item = impl AsRef<[u8]>>,
|
||||
|
||||
Reference in New Issue
Block a user