pub struct SignedMessage<E: EngineBLS> {
pub message: Message,
pub publickey: PublicKey<E>,
pub signature: Signature<E>,
}
Expand description
Message with attached BLS signature
Fields§
§message: Message
§publickey: PublicKey<E>
§signature: Signature<E>
Implementations§
Source§impl<E: EngineBLS> SignedMessage<E>
impl<E: EngineBLS> SignedMessage<E>
Sourcepub fn vrf_hash<H: ExtendableOutput>(&self, h: &mut H)
pub fn vrf_hash<H: ExtendableOutput>(&self, h: &mut H)
Hash output from a BLS signature regarded as a VRF.
If you are not the signer then you must verify the VRF before calling this method.
If called with distinct contexts then outputs should be independent.
We incorporate both the input and output to provide the 2Hash-DH construction from Theorem 2 on page 32 in appendex C of “Ouroboros Praos: An adaptively-secure, semi-synchronous proof-of-stake blockchain” by Bernardo David, Peter Gazi, Aggelos Kiayias, and Alexander Russell.
Sourcepub fn make_bytes<Out: Default + AsMut<[u8]>>(&self, context: &[u8]) -> Out
pub fn make_bytes<Out: Default + AsMut<[u8]>>(&self, context: &[u8]) -> Out
Raw bytes output from a BLS signature regarded as a VRF.
If you are not the signer then you must verify the VRF before calling this method.
If called with distinct contexts then outputs should be independent.
Sourcepub fn make_chacharng(&self, context: &[u8]) -> ChaCha8Rng
pub fn make_chacharng(&self, context: &[u8]) -> ChaCha8Rng
VRF output converted into a ChaChaRng
.
If you are not the signer then you must verify the VRF before calling this method.
If called with distinct contexts then outputs should be independent.
Independent output streams are available via ChaChaRng::set_stream
too.
We incorporate both the input and output to provide the 2Hash-DH construction from Theorem 2 on page 32 in appendex C of “Ouroboros Praos: An adaptively-secure, semi-synchronous proof-of-stake blockchain” by Bernardo David, Peter Gazi, Aggelos Kiayias, and Alexander Russell.
Trait Implementations§
Source§impl<E: Clone + EngineBLS> Clone for SignedMessage<E>
impl<E: Clone + EngineBLS> Clone for SignedMessage<E>
Source§fn clone(&self) -> SignedMessage<E>
fn clone(&self) -> SignedMessage<E>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<E: EngineBLS> PartialEq for SignedMessage<E>
impl<E: EngineBLS> PartialEq for SignedMessage<E>
Source§impl<'a, E: EngineBLS> Signed for &'a SignedMessage<E>
impl<'a, E: EngineBLS> Signed for &'a SignedMessage<E>
type E = E
type M = Message
type PKG = PublicKey<E>
Source§type PKnM = Once<(Message, PublicKey<E>)>
type PKnM = Once<(Message, PublicKey<E>)>
Source§fn messages_and_publickeys(self) -> Self::PKnM
fn messages_and_publickeys(self) -> Self::PKnM
impl<E: EngineBLS> Eq for SignedMessage<E>
Auto Trait Implementations§
impl<E> Freeze for SignedMessage<E>
impl<E> RefUnwindSafe for SignedMessage<E>where
<E as EngineBLS>::PublicKeyGroup: RefUnwindSafe,
<E as EngineBLS>::SignatureGroup: RefUnwindSafe,
impl<E> Send for SignedMessage<E>
impl<E> Sync for SignedMessage<E>
impl<E> Unpin for SignedMessage<E>
impl<E> UnwindSafe for SignedMessage<E>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more