MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_cipher_key_bits

Function get_cipher_key_bits

crates/stdlib/src/ssl/compat.rs:2281–2289  ·  view source on GitHub ↗

Get cipher key size in bits from cipher suite name Returns: - 256 for AES-256 and ChaCha20 - 128 for AES-128 - 0 for unknown ciphers

(cipher_name: &str)

Source from the content-addressed store, hash-verified

2279/// - 128 for AES-128
2280/// - 0 for unknown ciphers
2281pub(super) fn get_cipher_key_bits(cipher_name: &str) -> i32 {
2282 if cipher_name.contains("256") || cipher_name.contains("CHACHA20") {
2283 256
2284 } else if cipher_name.contains("128") {
2285 128
2286 } else {
2287 0
2288 }
2289}
2290
2291/// Get encryption algorithm description from cipher name
2292///

Callers 1

extract_cipher_infoFunction · 0.85

Calls 1

containsMethod · 0.45

Tested by

no test coverage detected