pub struct Bls12381PublicKey(/* private fields */);Expand description
A bls12381 min-sig public key.
§BCS
The BCS serialized form for this type is defined by the following ABNF:
bls-public-key = %x60 96OCTECTDue to historical reasons, even though a min-sig Bls12381PublicKey has a fixed-length of 96,
Sui’s binary representation of a min-sig Bls12381PublicKey is prefixed with its length
meaning its serialized binary form (in bcs) is 97 bytes long vs a more compact 96 bytes.
Implementations§
Source§impl Bls12381PublicKey
impl Bls12381PublicKey
pub const fn new(bytes: [u8; 96]) -> Self
pub fn generate<R>(rng: R) -> Self
Available on crate feature
rand only.Sourcepub const fn into_inner(self) -> [u8; 96]
pub const fn into_inner(self) -> [u8; 96]
Return the underlying byte array of an Bls12381PublicKey.
pub const fn inner(&self) -> &[u8; 96]
pub const fn as_bytes(&self) -> &[u8] ⓘ
pub fn from_bytes<T: AsRef<[u8]>>(bytes: T) -> Result<Self, TryFromSliceError>
Trait Implementations§
Source§impl Arbitrary for Bls12381PublicKey
impl Arbitrary for Bls12381PublicKey
Source§type Parameters = ()
type Parameters = ()
The type of parameters that
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.Source§type Strategy = BoxedStrategy<Bls12381PublicKey>
type Strategy = BoxedStrategy<Bls12381PublicKey>
The type of
Strategy used to generate values of type Self.Source§fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
Source§impl AsRef<[u8]> for Bls12381PublicKey
impl AsRef<[u8]> for Bls12381PublicKey
Source§impl Clone for Bls12381PublicKey
impl Clone for Bls12381PublicKey
Source§fn clone(&self) -> Bls12381PublicKey
fn clone(&self) -> Bls12381PublicKey
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Bls12381PublicKey
impl Debug for Bls12381PublicKey
Source§impl<'de> Deserialize<'de> for Bls12381PublicKey
impl<'de> Deserialize<'de> for Bls12381PublicKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for Bls12381PublicKey
impl Display for Bls12381PublicKey
Source§impl From<Bls12381PublicKey> for [u8; 96]
impl From<Bls12381PublicKey> for [u8; 96]
Source§fn from(public_key: Bls12381PublicKey) -> Self
fn from(public_key: Bls12381PublicKey) -> Self
Converts to this type from the input type.
Source§impl FromStr for Bls12381PublicKey
impl FromStr for Bls12381PublicKey
Source§impl Hash for Bls12381PublicKey
impl Hash for Bls12381PublicKey
Source§impl Ord for Bls12381PublicKey
impl Ord for Bls12381PublicKey
Source§fn cmp(&self, other: &Bls12381PublicKey) -> Ordering
fn cmp(&self, other: &Bls12381PublicKey) -> Ordering
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
Source§impl PartialEq for Bls12381PublicKey
impl PartialEq for Bls12381PublicKey
Source§impl PartialOrd for Bls12381PublicKey
impl PartialOrd for Bls12381PublicKey
Source§impl Serialize for Bls12381PublicKey
impl Serialize for Bls12381PublicKey
impl Copy for Bls12381PublicKey
impl Eq for Bls12381PublicKey
impl StructuralPartialEq for Bls12381PublicKey
Auto Trait Implementations§
impl Freeze for Bls12381PublicKey
impl RefUnwindSafe for Bls12381PublicKey
impl Send for Bls12381PublicKey
impl Sync for Bls12381PublicKey
impl Unpin for Bls12381PublicKey
impl UnwindSafe for Bls12381PublicKey
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
Casts
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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