sheave_core/handshake/
encryption_algorithm.rs1#[repr(u8)]
16#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
17pub enum EncryptionAlgorithm {
18 #[default]
19 NotEncrypted = 3,
20 DiffieHellman = 6,
21 Xtea = 8,
22 Blowfish = 9,
23 Other = 0xff
24}
25
26impl From<u8> for EncryptionAlgorithm {
27 fn from(encryption_algorithm: u8) -> Self {
28 use EncryptionAlgorithm::*;
29
30 match encryption_algorithm {
31 3 => NotEncrypted,
32 6 => DiffieHellman,
33 8 => Xtea,
34 9 => Blowfish,
35 _ => Other
36 }
37 }
38}
39
40impl From<EncryptionAlgorithm> for u8 {
41 fn from(encryption_algorithm: EncryptionAlgorithm) -> Self {
42 encryption_algorithm as u8
43 }
44}