| 396 | } |
| 397 | |
| 398 | int GetKeyLenForMode(AES_CIPHER_MODE m) { |
| 399 | switch (m) { |
| 400 | case AES_CIPHER_MODE::AES_128_ECB: |
| 401 | case AES_CIPHER_MODE::AES_128_GCM: |
| 402 | return 16; |
| 403 | case AES_CIPHER_MODE::AES_256_ECB: |
| 404 | case AES_CIPHER_MODE::AES_256_GCM: |
| 405 | case AES_CIPHER_MODE::AES_256_CTR: |
| 406 | case AES_CIPHER_MODE::AES_256_CFB: |
| 407 | return 32; |
| 408 | default: |
| 409 | return -1; |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | Status ValidateModeAndKeyLength(AES_CIPHER_MODE m, int key_len) { |
| 414 | if (m == AES_CIPHER_MODE::INVALID) { |
no outgoing calls
no test coverage detected