MCPcopy Create free account
hub / github.com/apache/arrow / MakeCipherContext

Method MakeCipherContext

cpp/src/parquet/encryption/encryption_internal.cc:152–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150 : AesCryptoContext(alg_id, key_len, metadata, write_length) {}
151
152AesCryptoContext::CipherContext AesEncryptor::AesEncryptorImpl::MakeCipherContext()
153 const {
154 auto ctx = NewCipherContext();
155 if (kGcmMode == aes_mode_) {
156 // Init AES-GCM with specified key length
157 if (16 == key_length_) {
158 ENCRYPT_INIT(ctx.get(), EVP_aes_128_gcm());
159 } else if (24 == key_length_) {
160 ENCRYPT_INIT(ctx.get(), EVP_aes_192_gcm());
161 } else if (32 == key_length_) {
162 ENCRYPT_INIT(ctx.get(), EVP_aes_256_gcm());
163 }
164 } else {
165 // Init AES-CTR with specified key length
166 if (16 == key_length_) {
167 ENCRYPT_INIT(ctx.get(), EVP_aes_128_ctr());
168 } else if (24 == key_length_) {
169 ENCRYPT_INIT(ctx.get(), EVP_aes_192_ctr());
170 } else if (32 == key_length_) {
171 ENCRYPT_INIT(ctx.get(), EVP_aes_256_ctr());
172 }
173 }
174 return ctx;
175}
176
177int32_t AesEncryptor::AesEncryptorImpl::SignedFooterEncrypt(
178 std::span<const uint8_t> footer, std::span<const uint8_t> key,

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected