Generate a GREASE cipher suite value (RFC 8701).
()
| 137 | |
| 138 | /// Generate a GREASE cipher suite value (RFC 8701). |
| 139 | pub fn grease_cipher_suite() -> u16 { |
| 140 | const GREASE_VALUES: [u16; 8] = [ |
| 141 | 0x0A0A, 0x1A1A, 0x2A2A, 0x3A3A, 0x4A4A, 0x5A5A, 0x6A6A, 0x7A7A, |
| 142 | ]; |
| 143 | GREASE_VALUES[rand::random::<usize>() % GREASE_VALUES.len()] |
| 144 | } |