Struct RustCryptoBackend

Source
pub struct RustCryptoBackend;

Implementations§

Source§

impl RustCryptoBackend

Source

pub const X25519_KEY_SIZE: usize = 32usize

Source

pub fn new_secret_key_into( &self, rng: &mut (impl RngCore + CryptoRng), secret_key: &mut [u8; 32], )

Source

pub fn new_secret_key(&self, rng: &mut (impl RngCore + CryptoRng)) -> [u8; 32]

Source

pub fn public_key(&self, secret_key: &[u8; 32]) -> [u8; 32]

Trait Implementations§

Source§

impl CryptoBackend for RustCryptoBackend

Source§

type InitialCrypto = BuiltinTransportCrypto<ChaChaPoly, Blake2s>

Backend’s InitialCrypto implementation.
Source§

type NoiseHandshake = HandshakeState<AnyAead, AnyHash>

Backend’s NoiseHandshake implementation.
Source§

type TransportCrypto = BuiltinTransportCrypto<AnyAead, AnyHash>

Backend’s TransportCrypto implementation.
Source§

type TransportRekey = AskChain<AnyHash>

Backend’s TransportRekey implementation.
Source§

fn protocol_supported(&self, noise_protocol: &str) -> bool

Returns true if the backend’s NoiseHandshake supports noise_protocol.
Source§

fn initial_crypto(&self) -> Self::InitialCrypto

Returns InitialCrypto. Read more
Source§

fn new_handshake(&self) -> Result<Self::NoiseHandshake, CryptoError>

Returns a new, uninitialized NoiseHandshake or an error if the backend is not properly configured.
Source§

fn transport_crypto( &self, handshake: &Self::NoiseHandshake, ) -> Result<Self::TransportCrypto, CryptoError>

Returns TransportCrypto for the handshake’s selected AEAD and hash algorithm. Read more
Source§

fn export_1rtt_rekey( &self, handshake: &mut Self::NoiseHandshake, rekey: &mut Self::TransportRekey, ) -> Result<(), CryptoError>

Extract the 1-RTT rekey chain from a finished handshake.

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> 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, 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<B> SyncCryptoBackend for B
where B: CryptoBackend + Send + Sync + 'static, <B as CryptoBackend>::InitialCrypto: Send + Sync + 'static, <B as CryptoBackend>::NoiseHandshake: Send + Sync + 'static, <B as CryptoBackend>::TransportCrypto: Send + Sync + 'static, <B as CryptoBackend>::TransportRekey: Send + Sync + 'static,