MCPcopy Create free account
hub / github.com/apache/impala / ValidateModeAndKeyLength

Function ValidateModeAndKeyLength

be/src/util/openssl-util.cc:413–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

411}
412
413Status ValidateModeAndKeyLength(AES_CIPHER_MODE m, int key_len) {
414 if (m == AES_CIPHER_MODE::INVALID) {
415 return Status("Invalid AES mode specified.");
416 }
417
418 int expected_key_len = GetKeyLenForMode(m);
419 DCHECK_GT(expected_key_len, 0);
420 if (key_len != expected_key_len) {
421 return Status("Mismatch between mode and key length.");
422 }
423
424 return Status::OK();
425}
426
427Status EncryptionKey::InitializeRandom(int iv_len, AES_CIPHER_MODE m) {
428 mode_ = m;

Callers 1

InitializeFieldsMethod · 0.85

Calls 3

GetKeyLenForModeFunction · 0.85
OKFunction · 0.85
StatusClass · 0.70

Tested by

no test coverage detected