pub struct X25519Kem;Expand description
X25519 as a DHKEM (RFC 9180 §4.1): Encap picks a fresh ephemeral key, the
ciphertext is the ephemeral public key, and the shared secret is the X25519
DH output. The ephemeral key gives this leg forward secrecy.
Trait Implementations§
Source§impl KemComponent for X25519Kem
impl KemComponent for X25519Kem
Source§fn generate_recipient_keypair(&self) -> Result<(Zeroizing<Vec<u8>>, Vec<u8>)>
fn generate_recipient_keypair(&self) -> Result<(Zeroizing<Vec<u8>>, Vec<u8>)>
Generate a recipient keypair, returning
(decap_key_bytes, encap_key_bytes).Source§fn encapsulate(
&self,
recipient_ek: &[u8],
) -> Result<(Vec<u8>, Zeroizing<Vec<u8>>)>
fn encapsulate( &self, recipient_ek: &[u8], ) -> Result<(Vec<u8>, Zeroizing<Vec<u8>>)>
Encapsulate to
recipient_ek, returning (ciphertext, shared_secret).Source§fn decapsulate(&self, decap_key: &[u8], ct: &[u8]) -> Result<Zeroizing<Vec<u8>>>
fn decapsulate(&self, decap_key: &[u8], ct: &[u8]) -> Result<Zeroizing<Vec<u8>>>
Decapsulate
ct with decap_key, returning the shared secret.Source§fn seed_len(&self) -> usize
fn seed_len(&self) -> usize
Byte length of the deterministic seed consumed by
KemComponent::recipient_from_seed.Source§fn recipient_from_seed(
&self,
seed: &[u8],
) -> Result<(Zeroizing<Vec<u8>>, Vec<u8>)>
fn recipient_from_seed( &self, seed: &[u8], ) -> Result<(Zeroizing<Vec<u8>>, Vec<u8>)>
Deterministically derive a recipient keypair from
seed (length
KemComponent::seed_len), returning (decap_key_bytes, encap_key_bytes).
Stable identity keys (e.g. #mesh-kem) use this so they survive restarts,
unlike the OsRng KemComponent::generate_recipient_keypair.Auto Trait Implementations§
impl Freeze for X25519Kem
impl RefUnwindSafe for X25519Kem
impl Send for X25519Kem
impl Sync for X25519Kem
impl Unpin for X25519Kem
impl UnsafeUnpin for X25519Kem
impl UnwindSafe for X25519Kem
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
Mutably borrows from an owned value. Read more
§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>
Converts
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>
Converts
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more