#[non_exhaustive]pub enum CryptoMode {
Aes256Gcm,
XChaCha20Poly1305,
}
Expand description
Encryption schemes supportd by Discord.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Aes256Gcm
Discord’s currently preferred non-E2EE encryption scheme.
Packets are encrypted and decrypted using the AES256GCM
encryption scheme.
An additional random 4B suffix is used as the source of nonce bytes for the packet.
This nonce value increments by 1
with each packet.
Encrypted content begins after the RTP header and extensions, following the SRTP specification.
Nonce width of 4B (32b), at an extra 4B per packet (~0.2 kB/s).
XChaCha20Poly1305
A fallback non-E2EE encryption scheme.
Packets are encrypted and decrypted using the XChaCha20Poly1305
encryption scheme.
An additional random 4B suffix is used as the source of nonce bytes for the packet.
This nonce value increments by 1
with each packet.
Encrypted content begins after the RTP header and extensions, following the SRTP specification.
Nonce width of 4B (32b), at an extra 4B per packet (~0.2 kB/s).
Implementations§
Source§impl CryptoMode
impl CryptoMode
Sourcepub const fn to_request_str(self) -> &'static str
pub const fn to_request_str(self) -> &'static str
Returns the name of a mode as it will appear during negotiation.
Sourcepub const fn algorithm_nonce_size(self) -> usize
pub const fn algorithm_nonce_size(self) -> usize
Returns the nonce length in bytes required by algorithm.
Sourcepub const fn nonce_size(self) -> usize
pub const fn nonce_size(self) -> usize
Returns the number of bytes each nonce is stored as within a packet.
Sourcepub const fn payload_suffix_len(self) -> usize
pub const fn payload_suffix_len(self) -> usize
Returns the number of bytes occupied by the encryption scheme which fall after the payload.
Sourcepub const fn tag_suffix_len(self) -> usize
pub const fn tag_suffix_len(self) -> usize
Returns the number of bytes occupied by an encryption scheme’s tag which fall after the payload.
Sourcepub const fn payload_overhead(self) -> usize
pub const fn payload_overhead(self) -> usize
Calculates the number of additional bytes required compared to an unencrypted payload.
Trait Implementations§
Source§impl Clone for CryptoMode
impl Clone for CryptoMode
Source§fn clone(&self) -> CryptoMode
fn clone(&self) -> CryptoMode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CryptoMode
impl Debug for CryptoMode
Source§impl Default for CryptoMode
impl Default for CryptoMode
Source§fn default() -> CryptoMode
fn default() -> CryptoMode
Source§impl FromStr for CryptoMode
impl FromStr for CryptoMode
Source§impl Hash for CryptoMode
impl Hash for CryptoMode
Source§impl PartialEq for CryptoMode
impl PartialEq for CryptoMode
impl Copy for CryptoMode
impl Eq for CryptoMode
impl StructuralPartialEq for CryptoMode
Auto Trait Implementations§
impl Freeze for CryptoMode
impl RefUnwindSafe for CryptoMode
impl Send for CryptoMode
impl Sync for CryptoMode
impl Unpin for CryptoMode
impl UnwindSafe for CryptoMode
Blanket Implementations§
Source§impl<T> ArgumentConvert for Twhere
T: FromStr,
impl<T> ArgumentConvert for Twhere
T: FromStr,
Source§fn convert<'life0, 'async_trait>(
__arg0: impl CacheHttp + 'async_trait,
__arg1: Option<GuildId>,
__arg2: Option<ChannelId>,
s: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<T, <T as ArgumentConvert>::Err>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn convert<'life0, 'async_trait>(
__arg0: impl CacheHttp + 'async_trait,
__arg1: Option<GuildId>,
__arg2: Option<ChannelId>,
s: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<T, <T as ArgumentConvert>::Err>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
s
as a command parameter of this type.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<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CloneableStorage for T
impl<T> CloneableStorage for T
fn clone_storage(&self) -> Box<dyn CloneableStorage>
§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
§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
§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.