referrerpolicy=no-referrer-when-downgrade
sp_application_crypto::bls381

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>

pub fn from_h256(x: H256) -> CryptoBytes<32, T>

A new instance from an H256.

§

impl<T> CryptoBytes<64, T>

pub fn from_h512(x: H512) -> CryptoBytes<64, T>

A new instance from an H512.

§

impl<const N: usize, T> CryptoBytes<N, T>

pub fn from_raw(inner: [u8; N]) -> CryptoBytes<N, T>

Construct from raw array.

pub fn to_raw(self) -> [u8; N]

Construct from raw array.

pub fn as_array_ref(&self) -> &[u8; N]

Return a slice filled with raw data.

Trait Implementations§

Source§

impl From<Public> for Public

Source§

fn from(outer: Public) -> Self

Converts to this type from the input type.
Source§

impl RuntimePublic for Public

Source§

fn all(_key_type: KeyTypeId) -> Vec<Self>

Dummy implementation. Returns an empty vector.

Source§

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

Dummy implementation. Returns false.

Source§

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.
Source§

fn generate_pair(key_type: KeyTypeId, seed: Option<Vec<u8>>) -> Self

Generate a public/private pair for the given key type with an optional seed and store it in the keystore. Read more
Source§

fn to_raw_vec(&self) -> Vec<u8>

Returns Self as raw vec.
§

impl<const N: usize, T> AsMut<[u8]> for CryptoBytes<N, T>

§

fn as_mut(&mut self) -> &mut [u8]

Converts this type into a mutable reference of the (usually inferred) input type.
§

impl<const N: usize, T> AsMut<[u8; N]> for CryptoBytes<N, T>

§

fn as_mut(&mut self) -> &mut [u8; N]

Converts this type into a mutable reference of the (usually inferred) input type.
§

impl<const N: usize, T> AsRef<[u8]> for CryptoBytes<N, T>

§

fn as_ref(&self) -> &[u8]

Converts this type into a shared reference of the (usually inferred) input type.
§

impl<const N: usize, T> AsRef<[u8; N]> for CryptoBytes<N, T>

§

fn as_ref(&self) -> &[u8; N]

Converts this type into a shared reference of the (usually inferred) input type.
§

impl<const N: usize, T> ByteArray for CryptoBytes<N, T>

§

const LEN: usize = N

The “length” of the values of this type, which is always the same.
§

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>

Return a Vec<u8> filled with raw data.
§

fn as_slice(&self) -> &[u8]

Return a slice filled with raw data.
§

impl<const N: usize, T> Clone for CryptoBytes<N, T>

§

fn clone(&self) -> CryptoBytes<N, T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T> CryptoType for CryptoBytes<sp_core::::bls::Public::{constant#0}, (PublicTag, (BlsTag, T))>
where T: BlsBound,

§

type Pair = Pair<T>

The pair key type of this crypto.
§

impl<const N: usize, SubTag> Debug for CryptoBytes<N, (PublicTag, SubTag)>
where CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

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,

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,

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,

Attempt to skip the encoded value from input. Read more
§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
§

impl<const N: usize, T> Default for CryptoBytes<N, T>

§

fn default() -> CryptoBytes<N, T>

Returns the “default value” for a type. Read more
§

impl<const N: usize, T> Deref for CryptoBytes<N, T>

§

type Target = [u8]

The resulting type after dereferencing.
§

fn deref(&self) -> &<CryptoBytes<N, T> as Deref>::Target

Dereferences the value.
§

impl<const N: usize, SubTag> Derive for CryptoBytes<N, (PublicTag, SubTag)>
where CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,

§

fn derive<Iter>(&self, _path: Iter) -> Option<Self>
where Iter: Iterator<Item = DeriveJunction>,

Derive a child key from a series of given junctions. Read more
§

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>,

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,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<const N: usize, T> Encode for CryptoBytes<N, T>
where PhantomData<fn() -> T>: Encode,

§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
§

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 encode(&self) -> Vec<u8>

Convert self to an owned vector.
§

fn using_encoded<R, F>(&self, f: F) -> R
where F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
§

impl<const N: usize, T> From<[u8; N]> for CryptoBytes<N, T>

§

fn from(value: [u8; N]) -> CryptoBytes<N, T>

Converts to this type from the input type.
§

impl<const N: usize, T> FromEntropy for CryptoBytes<N, T>

§

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,

§

type Err = PublicError

The associated error which can be returned from parsing.
§

fn from_str( s: &str, ) -> Result<CryptoBytes<N, (PublicTag, SubTag)>, <CryptoBytes<N, (PublicTag, SubTag)> as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl<const N: usize, T> Hash for CryptoBytes<N, T>

§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<const N: usize, T> MaxEncodedLen for CryptoBytes<N, T>
where PhantomData<fn() -> T>: MaxEncodedLen,

§

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>

§

fn cmp(&self, other: &CryptoBytes<N, T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl<const N: usize, T> PartialEq for CryptoBytes<N, T>

§

fn eq(&self, other: &CryptoBytes<N, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl<const N: usize, T> PartialOrd for CryptoBytes<N, T>

§

fn partial_cmp(&self, other: &CryptoBytes<N, T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

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,

Serialize this value into the given Serde serializer. Read more
§

impl<const N: usize, T> TryFrom<&[u8]> for CryptoBytes<N, T>

§

type Error = ()

The type returned in the event of a conversion error.
§

fn try_from( data: &[u8], ) -> Result<CryptoBytes<N, T>, <CryptoBytes<N, T> as TryFrom<&[u8]>>::Error>

Performs the conversion.
§

impl<const N: usize, T> TypeInfo for CryptoBytes<N, T>

§

type Identity = [u8; N]

The type identifying for which type info is provided. Read more
§

fn type_info() -> Type

Returns the static type identifier for Self.
§

impl<const N: usize, T> UncheckedFrom<[u8; N]> for 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>

§

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.
§

impl<const N: usize, T> Copy for CryptoBytes<N, T>

§

impl<const N: usize, T> DecodeWithMemTracking for CryptoBytes<N, T>
where PhantomData<fn() -> T>: DecodeWithMemTracking,

§

impl<const N: usize, T> EncodeLike for CryptoBytes<N, T>
where PhantomData<fn() -> T>: Encode,

§

impl<const N: usize, T> Eq for CryptoBytes<N, T>

§

impl<const N: usize, SubTag> Public for CryptoBytes<N, (PublicTag, SubTag)>
where CryptoBytes<N, (PublicTag, SubTag)>: CryptoType,