52410 : version(version_p), cipher(cipher_p) {
52411 switch (version) {
52412 case Version::V0_0:
52413
52414
52415 nonce_len = MainHeader::AES_NONCE_LEN_DEPRECATED;
52416 nonce = unique_ptr<data_t[]>(
new data_t[nonce_len]());
52417 break;
52418 case Version::V0_1:
52419 if (cipher == CipherType::CTR) {
52420
52421
52422 nonce_len = MainHeader::AES_IV_LEN;
52423 nonce = unique_ptr<data_t[]>(
new data_t[nonce_len]());
52424 break;
52425 }
52426
52427 DUCKDB_EXPLICIT_FALLTHROUGH;
52428 case Version::NONE:
52430 nonce = unique_ptr<data_t[]>(
new data_t[nonce_len]());
52431 break;
52432 default:
52433 throw InvalidConfigurationException("Encryption version not recognized!");
52434 }
52435
52436#ifdef DEBUG
52437
52438 for (idx_t i = 0; i < nonce_len; i++) {
52439 if (nonce[i] != 0) {
52440 throw InvalidInputException("Nonce is not correctly zero-initialized!");
52441 }
52442 }
52443#endif
52444}
static constexpr uint64_t AES_NONCE_LEN
Nonce, IV (nonce + counter) and tag length.
Definition duckdb.hpp:9769
uint8_t data_t
data pointers
Definition duckdb.hpp:246