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.
Empty
Empty placeholder — used before acceptance / during construction.
Implementations§
Source§impl Signature
impl Signature
Sourcepub const fn from_bytes(bytes: [u8; 64]) -> Signature
pub const fn from_bytes(bytes: [u8; 64]) -> Signature
Create an Ed25519 signature from raw bytes.
Sourcepub 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
pub fn as_bytes(&self) -> &[u8; 64]
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.
Sourcepub fn ed25519_bytes(&self) -> Option<&[u8; 64]>
pub fn ed25519_bytes(&self) -> Option<&[u8; 64]>
Return Ed25519 bytes if this is an Ed25519 or Hybrid signature.
Sourcepub fn ed25519_component_is_zero(&self) -> bool
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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Signature
impl<'de> Deserialize<'de> for Signature
Source§fn deserialize<D>(
deserializer: D,
) -> Result<Signature, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<Signature, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
impl Eq for Signature
Source§impl Serialize for Signature
impl Serialize for Signature
Source§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,
impl StructuralPartialEq for Signature
Auto Trait Implementations§
impl Freeze for Signature
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnsafeUnpin for Signature
impl UnwindSafe for Signature
Blanket Implementations§
Source§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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