core_crypto::prelude

Enum CiphersuiteName

#[repr(u16)]
pub enum CiphersuiteName { MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519 = 1, MLS_128_DHKEMP256_AES128GCM_SHA256_P256 = 2, MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519 = 3, MLS_256_DHKEMX448_AES256GCM_SHA512_Ed448 = 4, MLS_256_DHKEMP521_AES256GCM_SHA512_P521 = 5, MLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448 = 6, MLS_256_DHKEMP384_AES256GCM_SHA384_P384 = 7, }
Expand description

MLS ciphersuites.

Variants§

§

MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519 = 1

DH KEM x25519 | AES-GCM 128 | SHA2-256 | Ed25519

§

MLS_128_DHKEMP256_AES128GCM_SHA256_P256 = 2

DH KEM P256 | AES-GCM 128 | SHA2-256 | EcDSA P256

§

MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519 = 3

DH KEM x25519 | Chacha20Poly1305 | SHA2-256 | Ed25519

§

MLS_256_DHKEMX448_AES256GCM_SHA512_Ed448 = 4

DH KEM x448 | AES-GCM 256 | SHA2-512 | Ed448

§

MLS_256_DHKEMP521_AES256GCM_SHA512_P521 = 5

DH KEM P521 | AES-GCM 256 | SHA2-512 | EcDSA P521

§

MLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448 = 6

DH KEM x448 | Chacha20Poly1305 | SHA2-512 | Ed448

§

MLS_256_DHKEMP384_AES256GCM_SHA384_P384 = 7

DH KEM P384 | AES-GCM 256 | SHA2-384 | EcDSA P384

Implementations§

§

impl Ciphersuite

pub const fn hash_algorithm(&self) -> HashType

Get the [HashType] for this Ciphersuite

pub const fn signature_algorithm(&self) -> SignatureScheme

Get the [SignatureScheme] for this Ciphersuite.

pub const fn aead_algorithm(&self) -> AeadType

Get the [AeadType] for this Ciphersuite.

pub const fn hpke_kdf_algorithm(&self) -> HpkeKdfType

Get the [HpkeKdfType] for this Ciphersuite.

pub const fn hpke_kem_algorithm(&self) -> HpkeKemType

Get the [HpkeKemType] for this Ciphersuite.

pub const fn hpke_aead_algorithm(&self) -> HpkeAeadType

Get the [HpkeAeadType] for this Ciphersuite.

pub const fn hpke_config(&self) -> HpkeConfig

Get the [HpkeConfig] for this Ciphersuite.

pub const fn hash_length(&self) -> usize

Get the length of the used hash algorithm.

pub const fn mac_length(&self) -> usize

Get the length of the AEAD tag.

pub const fn aead_key_length(&self) -> usize

Returns the key size of the used AEAD.

pub const fn aead_nonce_length(&self) -> usize

Returns the length of the nonce of the AEAD.

Trait Implementations§

§

impl Clone for Ciphersuite

§

fn clone(&self) -> Ciphersuite

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Ciphersuite

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<'de> Deserialize<'de> for Ciphersuite

§

fn deserialize<__D>( __deserializer: __D, ) -> Result<Ciphersuite, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Deserialize for Ciphersuite

§

fn tls_deserialize<R>(bytes: &mut R) -> Result<Ciphersuite, Error>
where R: Read,

This function deserializes the bytes from the provided a std::io::Read and returns the populated struct. Read more
§

fn tls_deserialize_exact(bytes: impl AsRef<[u8]>) -> Result<Self, Error>
where Self: Sized,

This function deserializes the provided bytes and returns the populated struct. All bytes must be consumed. Read more
§

impl Display for Ciphersuite

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl From<Ciphersuite> for MlsCiphersuite

source§

fn from(value: Ciphersuite) -> Self

Converts to this type from the input type.
source§

impl From<MlsCiphersuite> for Ciphersuite

source§

fn from(ciphersuite: MlsCiphersuite) -> Self

Converts to this type from the input type.
§

impl Hash for Ciphersuite

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl Ord for Ciphersuite

§

fn cmp(&self, other: &Ciphersuite) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
§

impl PartialEq for Ciphersuite

§

fn eq(&self, other: &Ciphersuite) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for Ciphersuite

§

fn partial_cmp(&self, other: &Ciphersuite) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
§

impl Serialize for &Ciphersuite

§

fn tls_serialize<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Serialize self and write it to the writer. The function returns the number of bytes written to writer.
§

fn tls_serialize_detached(&self) -> Result<Vec<u8>, Error>

Serialize self and return it as a byte vector.
§

impl Serialize for Ciphersuite

§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Serialize for Ciphersuite

§

fn tls_serialize<W>(&self, writer: &mut W) -> Result<usize, Error>
where W: Write,

Serialize self and write it to the writer. The function returns the number of bytes written to writer.
§

fn tls_serialize_detached(&self) -> Result<Vec<u8>, Error>

Serialize self and return it as a byte vector.
§

impl Size for &Ciphersuite

§

impl Size for Ciphersuite

§

impl TryFrom<VerifiableCiphersuite> for Ciphersuite

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from( value: VerifiableCiphersuite, ) -> Result<Ciphersuite, <Ciphersuite as TryFrom<VerifiableCiphersuite>>::Error>

Performs the conversion.
§

impl TryFrom<u16> for Ciphersuite

§

type Error = Error

The type returned in the event of a conversion error.
§

fn try_from(v: u16) -> Result<Ciphersuite, <Ciphersuite as TryFrom<u16>>::Error>

Performs the conversion.
§

impl Copy for Ciphersuite

§

impl Eq for Ciphersuite

§

impl StructuralPartialEq for Ciphersuite

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T>

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self>

Get a clone of the Arc<> using a “borrowed” handle. Read more
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> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T