pub enum CipherMethod {
Aes128Gcm,
Aes192Gcm,
Aes256Gcm,
ChaCha20IetfPoly1305,
}Expand description
Supported Shadowsocks AEAD cipher methods.
Variants§
Implementations§
Source§impl CipherMethod
impl CipherMethod
Sourcepub fn parse_method(s: &str) -> Result<Self, ShadowsocksError>
pub fn parse_method(s: &str) -> Result<Self, ShadowsocksError>
Parse a method name string into a CipherMethod.
Sourcepub fn nonce_size(&self) -> usize
pub fn nonce_size(&self) -> usize
Nonce size in bytes.
Sourcepub fn derive_key(
&self,
password: &[u8],
salt: &[u8],
) -> Result<Vec<u8>, ShadowsocksError>
pub fn derive_key( &self, password: &[u8], salt: &[u8], ) -> Result<Vec<u8>, ShadowsocksError>
Derive an AEAD subkey from password and salt using HKDF-SHA1.
Uses EVP_BytesToKey(password) as IKM (matching OpenSSL/shadowsocks-rust),
truncated to key_size bytes, then HKDF-SHA1 with info=“ss-subkey” per SIP003.
Trait Implementations§
Source§impl Clone for CipherMethod
impl Clone for CipherMethod
Source§fn clone(&self) -> CipherMethod
fn clone(&self) -> CipherMethod
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CipherMethod
Source§impl Debug for CipherMethod
impl Debug for CipherMethod
Source§impl Display for CipherMethod
impl Display for CipherMethod
impl Eq for CipherMethod
Source§impl PartialEq for CipherMethod
impl PartialEq for CipherMethod
impl StructuralPartialEq for CipherMethod
Auto Trait Implementations§
impl Freeze for CipherMethod
impl RefUnwindSafe for CipherMethod
impl Send for CipherMethod
impl Sync for CipherMethod
impl Unpin for CipherMethod
impl UnsafeUnpin for CipherMethod
impl UnwindSafe for CipherMethod
Blanket Implementations§
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
Mutably borrows from an owned value. Read more