Skip to main content

CipherKind

Enum CipherKind 

Source
pub enum CipherKind {
Show 49 variants NONE, SS_TABLE, SS_RC4_MD5, AES_128_CTR, AES_192_CTR, AES_256_CTR, AES_128_CFB1, AES_128_CFB8, AES_128_CFB128, AES_192_CFB1, AES_192_CFB8, AES_192_CFB128, AES_256_CFB1, AES_256_CFB8, AES_256_CFB128, AES_128_OFB, AES_192_OFB, AES_256_OFB, CAMELLIA_128_CTR, CAMELLIA_192_CTR, CAMELLIA_256_CTR, CAMELLIA_128_CFB1, CAMELLIA_128_CFB8, CAMELLIA_128_CFB128, CAMELLIA_192_CFB1, CAMELLIA_192_CFB8, CAMELLIA_192_CFB128, CAMELLIA_256_CFB1, CAMELLIA_256_CFB8, CAMELLIA_256_CFB128, CAMELLIA_128_OFB, CAMELLIA_192_OFB, CAMELLIA_256_OFB, RC4, CHACHA20, AES_128_GCM, AES_256_GCM, AES_128_CCM, AES_256_CCM, AES_128_GCM_SIV, AES_256_GCM_SIV, CHACHA20_POLY1305, XCHACHA20_POLY1305, SM4_GCM, SM4_CCM, AEAD2022_BLAKE3_AES_128_GCM, AEAD2022_BLAKE3_AES_256_GCM, AEAD2022_BLAKE3_CHACHA20_POLY1305, AEAD2022_BLAKE3_CHACHA8_POLY1305,
}
Expand description

ShadowSocks cipher type

Variants§

§

NONE

§

SS_TABLE

Available on crate feature v1-stream only.
§

SS_RC4_MD5

Available on crate feature v1-stream only.
§

AES_128_CTR

Available on crate feature v1-stream only.
§

AES_192_CTR

Available on crate feature v1-stream only.
§

AES_256_CTR

Available on crate feature v1-stream only.
§

AES_128_CFB1

Available on crate feature v1-stream only.
§

AES_128_CFB8

Available on crate feature v1-stream only.
§

AES_128_CFB128

Available on crate feature v1-stream only.
§

AES_192_CFB1

Available on crate feature v1-stream only.
§

AES_192_CFB8

Available on crate feature v1-stream only.
§

AES_192_CFB128

Available on crate feature v1-stream only.
§

AES_256_CFB1

Available on crate feature v1-stream only.
§

AES_256_CFB8

Available on crate feature v1-stream only.
§

AES_256_CFB128

Available on crate feature v1-stream only.
§

AES_128_OFB

Available on crate feature v1-stream only.
§

AES_192_OFB

Available on crate feature v1-stream only.
§

AES_256_OFB

Available on crate feature v1-stream only.
§

CAMELLIA_128_CTR

Available on crate feature v1-stream only.
§

CAMELLIA_192_CTR

Available on crate feature v1-stream only.
§

CAMELLIA_256_CTR

Available on crate feature v1-stream only.
§

CAMELLIA_128_CFB1

Available on crate feature v1-stream only.
§

CAMELLIA_128_CFB8

Available on crate feature v1-stream only.
§

CAMELLIA_128_CFB128

Available on crate feature v1-stream only.
§

CAMELLIA_192_CFB1

Available on crate feature v1-stream only.
§

CAMELLIA_192_CFB8

Available on crate feature v1-stream only.
§

CAMELLIA_192_CFB128

Available on crate feature v1-stream only.
§

CAMELLIA_256_CFB1

Available on crate feature v1-stream only.
§

CAMELLIA_256_CFB8

Available on crate feature v1-stream only.
§

CAMELLIA_256_CFB128

Available on crate feature v1-stream only.
§

CAMELLIA_128_OFB

Available on crate feature v1-stream only.
§

CAMELLIA_192_OFB

Available on crate feature v1-stream only.
§

CAMELLIA_256_OFB

Available on crate feature v1-stream only.
§

RC4

Available on crate feature v1-stream only.
§

CHACHA20

Available on crate feature v1-stream only.
§

AES_128_GCM

Available on crate feature v1-aead only.

AEAD_AES_128_GCM

§

AES_256_GCM

Available on crate feature v1-aead only.

AEAD_AES_256_GCM

§

AES_128_CCM

Available on crate feature v1-aead-extra only.

AEAD_AES_128_CCM

§

AES_256_CCM

Available on crate feature v1-aead-extra only.

AEAD_AES_256_CCM

§

AES_128_GCM_SIV

Available on crate feature v1-aead-extra only.

AEAD_AES_128_GCM_SIV

§

AES_256_GCM_SIV

Available on crate feature v1-aead-extra only.

AEAD_AES_256_GCM_SIV

§

CHACHA20_POLY1305

Available on crate feature v1-aead only.

AEAD_CHACHA20_POLY1305

§

XCHACHA20_POLY1305

Available on crate feature v1-aead-extra only.

AEAD_XCHACHA20_POLY1305

§

SM4_GCM

Available on crate feature v1-aead-extra only.

SM4_GCM

§

SM4_CCM

Available on crate feature v1-aead-extra only.

SM4_GCM

§

AEAD2022_BLAKE3_AES_128_GCM

Available on crate feature v2 only.

2022-blake3-aes-128-gcm

§

AEAD2022_BLAKE3_AES_256_GCM

Available on crate feature v2 only.

2022-blake3-aes-128-gcm

§

AEAD2022_BLAKE3_CHACHA20_POLY1305

Available on crate feature v2 only.

2022-blake3-chacha20-poly1305

§

AEAD2022_BLAKE3_CHACHA8_POLY1305

Available on crate feature v2-extra only.

2022-blake3-chacha8-poly1305

Implementations§

Source§

impl CipherKind

Source

pub fn category(&self) -> CipherCategory

The category of the cipher

Source

pub fn is_none(&self) -> bool

Check if the current cipher is NONE

Source

pub fn is_stream(&self) -> bool

Available on crate feature v1-stream only.

Check if the current cipher is a stream cipher

Source

pub fn is_aead(&self) -> bool

Available on crate feature v1-aead only.

Check if the current cipher is an AEAD cipher

Source

pub fn is_aead_2022(&self) -> bool

Available on crate feature v2 only.
Source

pub fn key_len(&self) -> usize

Key length of the cipher

Source

pub fn iv_len(&self) -> usize

Available on crate feature v1-stream only.

Stream Cipher’s initializer vector length

Source

pub fn tag_len(&self) -> usize

Available on crate features v1-aead or v2 only.

AEAD Cipher’s TAG length

Source

pub fn salt_len(&self) -> usize

Available on crate features v1-aead or v2 only.

AEAD Cipher’s SALT length

Source

pub fn nonce_len(&self) -> usize

Available on crate feature v2 only.

AEAD Cipher’s nonce length

Trait Implementations§

Source§

impl Clone for CipherKind

Source§

fn clone(&self) -> CipherKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for CipherKind

Source§

impl Debug for CipherKind

Source§

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

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

impl Display for CipherKind

Source§

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

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

impl Eq for CipherKind

Source§

impl FromStr for CipherKind

Source§

type Err = ParseCipherKindError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, ParseCipherKindError>

Parses a string s to return a value of this type. Read more
Source§

impl Hash for CipherKind

Source§

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

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

impl PartialEq for CipherKind

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CipherKind

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> 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§

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 = !

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.