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.