pub struct HybridVerifyingKey { /* private fields */ }Expand description
A hybrid public verifying key. Published in the device directory.
Implementations§
Source§impl HybridVerifyingKey
impl HybridVerifyingKey
Sourcepub fn classical_algorithm(&self) -> ClassicalAlgorithm
pub fn classical_algorithm(&self) -> ClassicalAlgorithm
The classical algorithm this key’s classical half is encoded for.
Sourcepub fn verify(&self, msg: &[u8], sig: &HybridSignature) -> bool
pub fn verify(&self, msg: &[u8], sig: &HybridSignature) -> bool
Verify sig over msg. Returns true only if both halves verify. The classical
half dispatches on this key’s declared algorithm: a signature whose classical half is a
different algorithm than the key (an Ed25519 sig against a P-256 key, or vice versa)
never verifies.
Sourcepub fn to_bytes(&self) -> Vec<u8> ⓘ
pub fn to_bytes(&self) -> Vec<u8> ⓘ
Raw bytes: the classical public key (Ed25519 = 32, P-256 = 33) followed by the ML-DSA-65 public key (1952). The classical-half length is what distinguishes the two algorithms on decode, so an Ed25519 key round-trips to the exact same bytes it always has.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, CryptoError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, CryptoError>
Reconstruct from the classical ‖ ml byte layout produced by to_bytes.
The ML-DSA-65 half is the fixed-length 1952-byte suffix; the classical prefix is 32 bytes
(Ed25519) or 33 bytes (compressed SEC1 P-256), which selects the algorithm.
Trait Implementations§
Source§impl Clone for HybridVerifyingKey
impl Clone for HybridVerifyingKey
Source§fn clone(&self) -> HybridVerifyingKey
fn clone(&self) -> HybridVerifyingKey
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HybridVerifyingKey
impl Debug for HybridVerifyingKey
Source§impl<'de> Deserialize<'de> for HybridVerifyingKey
impl<'de> Deserialize<'de> for HybridVerifyingKey
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
impl Eq for HybridVerifyingKey
Source§impl PartialEq for HybridVerifyingKey
impl PartialEq for HybridVerifyingKey
Auto Trait Implementations§
impl Freeze for HybridVerifyingKey
impl RefUnwindSafe for HybridVerifyingKey
impl Send for HybridVerifyingKey
impl Sync for HybridVerifyingKey
impl Unpin for HybridVerifyingKey
impl UnsafeUnpin for HybridVerifyingKey
impl UnwindSafe for HybridVerifyingKey
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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