Skip to main content

Signature

Enum Signature 

Source
pub enum Signature {
    Ed25519([u8; 64]),
    PostQuantum(Vec<u8>),
    Hybrid {
        classical: [u8; 64],
        pq: Vec<u8>,
    },
    Empty,
}

Variants§

§

Ed25519([u8; 64])

Classical Ed25519 signature (64 bytes).

§

PostQuantum(Vec<u8>)

Post-quantum signature (variable length, e.g. Dilithium).

§

Hybrid

Hybrid: classical Ed25519 + post-quantum signature.

Fields

§classical: [u8; 64]
§pq: Vec<u8>
§

Empty

Empty placeholder — used before acceptance / during construction.

Implementations§

Source§

impl Signature

Source

pub const EMPTY: Signature = Self::Empty

The empty signature placeholder.

Source

pub const fn from_bytes(bytes: [u8; 64]) -> Signature

Create an Ed25519 signature from raw bytes.

Source

pub fn as_bytes(&self) -> &[u8; 64]

👎Deprecated since 0.1.0-beta:

use ed25519_bytes() for fallible Ed25519-compatible access or to_bytes() for algorithm-agnostic serialization

Return the inner bytes for legacy Ed25519 signatures.

§Panics

Panics if called on non-Ed25519 variants. Use Self::ed25519_bytes for fallible Ed25519-compatible access or Self::to_bytes for algorithm-agnostic byte serialization.

Source

pub fn ed25519_bytes(&self) -> Option<&[u8; 64]>

Return Ed25519 bytes if this is an Ed25519 or Hybrid signature.

Source

pub fn ed25519_component_is_zero(&self) -> bool

Return true when the Ed25519-compatible component is the all-zero sentinel.

This preserves the explicit null-signature guard without relying on Self::as_bytes, which is intentionally Ed25519-only.

Source

pub fn to_bytes(&self) -> Vec<u8>

Return all signature bytes as a slice (algorithm-agnostic).

Source

pub const fn empty() -> Signature

Create an empty (placeholder) signature.

Source

pub fn is_empty(&self) -> bool

Check if this signature is the empty placeholder.

Source

pub fn algorithm(&self) -> &'static str

Returns the algorithm variant name.

Trait Implementations§

Source§

impl Clone for Signature

Source§

fn clone(&self) -> Signature

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Signature

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Signature

Source§

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

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Signature

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Signature

Source§

impl PartialEq for Signature

Source§

fn eq(&self, other: &Signature) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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.
Source§

impl Serialize for Signature

Source§

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

impl StructuralPartialEq for Signature

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

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

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V