Struct sp_application_crypto::bandersnatch::vrf::VrfSignData
source · pub struct VrfSignData {
pub vrf_inputs: BoundedVec<VrfInput, ConstU32<sp_core::::bandersnatch::vrf::VrfIosVec::{constant#0}>>,
pub transcript: Transcript,
}
Expand description
A Fiat-Shamir transcript and a sequence of VrfInput
s ready to be signed.
The transcript
will be used as messages for the Fiat-Shamir
transform part of the scheme. This data keeps the signature secure
but doesn’t contribute to the actual VRF output. If unsure just give
it a unique label depending on the actual usage of the signing data.
The vrf_inputs
is a sequence of VrfInput
s to be signed and which
are used to construct the VrfOutput
s in the signature.
Fields§
§vrf_inputs: BoundedVec<VrfInput, ConstU32<sp_core::::bandersnatch::vrf::VrfIosVec::{constant#0}>>
VRF inputs to be signed.
transcript: Transcript
Associated Fiat-Shamir transcript.
Implementations§
source§impl VrfSignData
impl VrfSignData
sourcepub fn new(
label: &'static [u8],
transcript_data: impl IntoIterator<Item = impl AsRef<[u8]>>,
vrf_inputs: impl IntoIterator<Item = VrfInput>
) -> Result<VrfSignData, ()>
pub fn new( label: &'static [u8], transcript_data: impl IntoIterator<Item = impl AsRef<[u8]>>, vrf_inputs: impl IntoIterator<Item = VrfInput> ) -> Result<VrfSignData, ()>
Construct a new data to be signed.
The transcript_data
is used to construct the Fiat-Shamir Transcript
.
Fails if the vrf_inputs
yields more elements than MAX_VRF_IOS
Refer to the VrfSignData
for more details about the usage of
transcript_data
and vrf_inputs
sourcepub fn new_unchecked(
label: &'static [u8],
transcript_data: impl IntoIterator<Item = impl AsRef<[u8]>>,
vrf_inputs: impl IntoIterator<Item = VrfInput>
) -> VrfSignData
pub fn new_unchecked( label: &'static [u8], transcript_data: impl IntoIterator<Item = impl AsRef<[u8]>>, vrf_inputs: impl IntoIterator<Item = VrfInput> ) -> VrfSignData
Construct a new data to be signed.
The transcript_data
is used to construct the Fiat-Shamir Transcript
.
At most the first MAX_VRF_IOS
elements of vrf_inputs
are used.
Refer to the VrfSignData
for more details about the usage of
transcript_data
and vrf_inputs
sourcepub fn push_transcript_data(&mut self, data: &[u8])
pub fn push_transcript_data(&mut self, data: &[u8])
Append a raw message to the transcript.
Trait Implementations§
source§impl Clone for VrfSignData
impl Clone for VrfSignData
source§fn clone(&self) -> VrfSignData
fn clone(&self) -> VrfSignData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for VrfSignData
impl Send for VrfSignData
impl Sync for VrfSignData
impl Unpin for VrfSignData
impl UnwindSafe for VrfSignData
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.