Struct mls_rs::CipherSuite

source ·
pub struct CipherSuite(/* private fields */);
Expand description

Wrapper type representing a ciphersuite identifier along with default values defined by the MLS RFC. Custom ciphersuites can be defined using a custom CryptoProvider.

§Default Ciphersuites

Note: KEM values are defined by the HPKE standard (RFC 9180).

IDKEMAEADHash FunctionSignature Scheme
1DHKEMX25519AES 128SHA 256Ed25519
2DHKEMP256AES 128SHA 256P256
3DHKEMX25519ChaCha20Poly1305SHA 256Ed25519
4DHKEMX448AES 256SHA 512Ed448
5DHKEMP521AES 256SHA 512P521
6DHKEMX448ChaCha20Poly1305SHA 512Ed448
7DHKEMP384AES 256SHA 512P384

Implementations§

source§

impl CipherSuite

source

pub const CURVE25519_AES128: CipherSuite = _

MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519

source

pub const P256_AES128: CipherSuite = _

MLS_128_DHKEMP256_AES128GCM_SHA256_P256

source

pub const CURVE25519_CHACHA: CipherSuite = _

MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519

source

pub const CURVE448_AES256: CipherSuite = _

MLS_256_DHKEMX448_AES256GCM_SHA512_Ed448

source

pub const P521_AES256: CipherSuite = _

MLS_256_DHKEMP521_AES256GCM_SHA512_P521

source

pub const CURVE448_CHACHA: CipherSuite = _

MLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448

source

pub const P384_AES256: CipherSuite = _

MLS_256_DHKEMP384_AES256GCM_SHA384_P384

source

pub const fn new(value: u16) -> CipherSuite

Ciphersuite from a raw value.

source

pub const fn raw_value(&self) -> u16

Raw numerical value wrapped value.

source

pub fn all() -> impl Iterator<Item = CipherSuite>

An iterator over all of the default MLS ciphersuites.

Methods from Deref<Target = u16>§

1.43.0 · source

pub const MIN: u16 = 0u16

1.43.0 · source

pub const MAX: u16 = 65_535u16

1.53.0 · source

pub const BITS: u32 = 16u32

Trait Implementations§

source§

impl Clone for CipherSuite

source§

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

impl Debug for CipherSuite

source§

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

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

impl Deref for CipherSuite

§

type Target = u16

The resulting type after dereferencing.
source§

fn deref(&self) -> &<CipherSuite as Deref>::Target

Dereferences the value.
source§

impl From<CipherSuite> for u16

source§

fn from(val: CipherSuite) -> u16

Converts to this type from the input type.
source§

impl From<u16> for CipherSuite

source§

fn from(value: u16) -> CipherSuite

Converts to this type from the input type.
source§

impl MlsDecode for CipherSuite

source§

fn mls_decode(reader: &mut &[u8]) -> Result<CipherSuite, Error>

source§

impl MlsEncode for CipherSuite

source§

fn mls_encode(&self, writer: &mut Vec<u8>) -> Result<(), Error>

source§

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

source§

impl MlsSize for CipherSuite

source§

impl Ord for CipherSuite

source§

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 + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for CipherSuite

source§

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

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

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

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

impl PartialOrd for CipherSuite

source§

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

This method 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

This method 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

This method 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

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

impl Copy for CipherSuite

source§

impl Eq for CipherSuite

source§

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

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.

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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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.