Type Alias Public
pub type Public = CryptoBytes<sp_core::::bls::Public::{constant#0}, (PublicTag, (BlsTag, TinyBLS<Bls12<Config>, Config>))>;
Expand description
BLS12-381 public key.
Aliased Type§
struct Public(pub [u8; 144], _);
Fields§
§0: [u8; 144]
Implementations
§impl<T> CryptoBytes<32, T>
impl<T> CryptoBytes<32, T>
pub fn from_h256(x: H256) -> CryptoBytes<32, T>
pub fn from_h256(x: H256) -> CryptoBytes<32, T>
A new instance from an H256.
Trait Implementations§
Source§impl RuntimePublic for Public
impl RuntimePublic for Public
Source§fn sign<M: AsRef<[u8]>>(
&self,
_key_type: KeyTypeId,
_msg: &M,
) -> Option<Self::Signature>
fn sign<M: AsRef<[u8]>>( &self, _key_type: KeyTypeId, _msg: &M, ) -> Option<Self::Signature>
Dummy implementation. Returns None
.
Source§fn verify<M: AsRef<[u8]>>(&self, _msg: &M, _signature: &Self::Signature) -> bool
fn verify<M: AsRef<[u8]>>(&self, _msg: &M, _signature: &Self::Signature) -> bool
Dummy implementation. Returns false
.
Source§type Signature = CryptoBytes<sp_core::::bls::Signature::{constant#0}, (SignatureTag, (BlsTag, TinyBLS<Bls12<Config>, Config>))>
type Signature = CryptoBytes<sp_core::::bls::Signature::{constant#0}, (SignatureTag, (BlsTag, TinyBLS<Bls12<Config>, Config>))>
The signature that will be generated when signing with the corresponding private key.
§impl<const N: usize, T> ByteArray for CryptoBytes<N, T>
impl<const N: usize, T> ByteArray for CryptoBytes<N, T>
§fn from_slice(data: &[u8]) -> Result<Self, ()>
fn from_slice(data: &[u8]) -> Result<Self, ()>
A new instance from the given slice that should be
Self::LEN
bytes long.§fn to_raw_vec(&self) -> Vec<u8> ⓘ
fn to_raw_vec(&self) -> Vec<u8> ⓘ
Return a
Vec<u8>
filled with raw data.§impl<T> CryptoType for CryptoBytes<sp_core::::bls::Public::{constant#0}, (PublicTag, (BlsTag, T))>where
T: BlsBound,
impl<T> CryptoType for CryptoBytes<sp_core::::bls::Public::{constant#0}, (PublicTag, (BlsTag, T))>where
T: BlsBound,
§impl<const N: usize, SubTag> Debug for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
impl<const N: usize, SubTag> Debug for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
§impl<const N: usize, T> Decode for CryptoBytes<N, T>where
PhantomData<fn() -> T>: Decode,
impl<const N: usize, T> Decode for CryptoBytes<N, T>where
PhantomData<fn() -> T>: Decode,
§fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<CryptoBytes<N, T>, Error>where
__CodecInputEdqy: Input,
fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<CryptoBytes<N, T>, Error>where
__CodecInputEdqy: Input,
Attempt to deserialise the value from input.
§fn decode_into<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
dst_: &mut MaybeUninit<CryptoBytes<N, T>>,
) -> Result<DecodeFinished, Error>where
__CodecInputEdqy: Input,
fn decode_into<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
dst_: &mut MaybeUninit<CryptoBytes<N, T>>,
) -> Result<DecodeFinished, Error>where
__CodecInputEdqy: Input,
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
§fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
fn skip<I>(input: &mut I) -> Result<(), Error>where
I: Input,
Attempt to skip the encoded value from input. Read more
§fn encoded_fixed_size() -> Option<usize>
fn encoded_fixed_size() -> Option<usize>
Returns the fixed encoded size of the type. Read more
§impl<const N: usize, SubTag> Derive for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
impl<const N: usize, SubTag> Derive for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
§impl<'de, const N: usize, SubTag> Deserialize<'de> for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
impl<'de, const N: usize, SubTag> Deserialize<'de> for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
§fn deserialize<D>(
deserializer: D,
) -> Result<CryptoBytes<N, (PublicTag, SubTag)>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<CryptoBytes<N, (PublicTag, SubTag)>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<const N: usize, SubTag> Display for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
impl<const N: usize, SubTag> Display for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
§impl<const N: usize, T> Encode for CryptoBytes<N, T>where
PhantomData<fn() -> T>: Encode,
impl<const N: usize, T> Encode for CryptoBytes<N, T>where
PhantomData<fn() -> T>: Encode,
§fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)where
__CodecOutputEdqy: Output + ?Sized,
fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy,
)where
__CodecOutputEdqy: Output + ?Sized,
Convert self to a slice and append it to the destination.
§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Convert self to a slice and then invoke the given closure with it.
§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
§impl<const N: usize, T> FromEntropy for CryptoBytes<N, T>
impl<const N: usize, T> FromEntropy for CryptoBytes<N, T>
§fn from_entropy(input: &mut impl Input) -> Result<CryptoBytes<N, T>, Error>
fn from_entropy(input: &mut impl Input) -> Result<CryptoBytes<N, T>, Error>
Create a random value of
Self
given a stream of random bytes on input
. May only fail if
input
has an error.§impl<const N: usize, SubTag> FromStr for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
impl<const N: usize, SubTag> FromStr for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
§impl<const N: usize, T> MaxEncodedLen for CryptoBytes<N, T>where
PhantomData<fn() -> T>: MaxEncodedLen,
impl<const N: usize, T> MaxEncodedLen for CryptoBytes<N, T>where
PhantomData<fn() -> T>: MaxEncodedLen,
§fn max_encoded_len() -> usize
fn max_encoded_len() -> usize
Upper bound, in bytes, of the maximum encoded size of this item.
§impl<const N: usize, T> Ord for CryptoBytes<N, T>
impl<const N: usize, T> Ord for CryptoBytes<N, T>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
§impl<const N: usize, T> PartialOrd for CryptoBytes<N, T>
impl<const N: usize, T> PartialOrd for CryptoBytes<N, T>
§impl<const N: usize, SubTag> Serialize for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
impl<const N: usize, SubTag> Serialize for CryptoBytes<N, (PublicTag, SubTag)>where
CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,
§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl<const N: usize, T> UncheckedFrom<[u8; N]> for CryptoBytes<N, T>
impl<const N: usize, T> UncheckedFrom<[u8; N]> for CryptoBytes<N, T>
§fn unchecked_from(data: [u8; N]) -> CryptoBytes<N, T>
fn unchecked_from(data: [u8; N]) -> CryptoBytes<N, T>
Convert from an instance of
T
to Self. This is not guaranteed to be
whatever counts as a valid instance of T
and it’s up to the caller to
ensure that it makes sense.§impl<T> UncheckedFrom<H256> for CryptoBytes<32, T>
impl<T> UncheckedFrom<H256> for CryptoBytes<32, T>
§fn unchecked_from(x: H256) -> CryptoBytes<32, T>
fn unchecked_from(x: H256) -> CryptoBytes<32, T>
Convert from an instance of
T
to Self. This is not guaranteed to be
whatever counts as a valid instance of T
and it’s up to the caller to
ensure that it makes sense.