[][src]Struct store::Signature

pub struct Signature { /* fields omitted */ }

A single BLS signature.

This struct is a wrapper upon a base type and provides helper functions (e.g., SSZ serialization).

Methods

impl Signature[src]

pub fn new(msg: &[u8], domain: u64, sk: &SecretKey) -> Signature[src]

Instantiate a new Signature from a message and a SecretKey.

pub fn new_hashed(
    x_real_hashed: &[u8],
    x_imaginary_hashed: &[u8],
    sk: &SecretKey
) -> Signature
[src]

Instantiate a new Signature from a message and a SecretKey, where the message has already been hashed.

pub fn verify(&self, msg: &[u8], domain: u64, pk: &PublicKey) -> bool[src]

Verify the Signature against a PublicKey.

pub fn verify_hashed(
    &self,
    x_real_hashed: &[u8],
    x_imaginary_hashed: &[u8],
    pk: &PublicKey
) -> bool
[src]

Verify the Signature against a PublicKey, where the message has already been hashed.

pub fn as_raw(&self) -> &Signature[src]

Returns the underlying signature.

pub fn empty_signature() -> Signature[src]

Returns a new empty signature.

pub fn as_bytes(&self) -> Vec<u8>[src]

pub fn from_bytes(bytes: &[u8]) -> Result<Signature, DecodeError>[src]

pub fn is_empty(&self) -> bool[src]

Trait Implementations

impl TestRandom for Signature[src]

impl Debug for Signature[src]

impl Clone for Signature[src]

impl Decode for Signature[src]

impl Eq for Signature[src]

impl From<Signature> for SignatureBytes[src]

impl TreeHash for Signature[src]

impl<'_> TryInto<Signature> for &'_ SignatureBytes[src]

type Error = DecodeError

The type returned in the event of a conversion error.

impl<'de> Deserialize<'de> for Signature[src]

fn deserialize<D>(
    deserializer: D
) -> Result<Signature, <D as Deserializer<'de>>::Error> where
    D: Deserializer<'de>, 
[src]

Serde serialization is compliant the Ethereum YAML test format.

impl Encode for Signature[src]

impl Serialize for Signature[src]

fn serialize<S>(
    &self,
    serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
    S: Serializer
[src]

Serde serialization is compliant the Ethereum YAML test format.

impl PartialEq<Signature> for Signature[src]

Auto Trait Implementations

impl Send for Signature

impl Unpin for Signature

impl Sync for Signature

impl UnwindSafe for Signature

impl RefUnwindSafe for Signature

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized