You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gandiva's aes_encrypt / aes_decrypt (ARROW-14431) support only AES-ECB and operate on VARCHAR. ECB is deterministic and unauthenticated: identical plaintext blocks give identical ciphertext, there is no IV, and tampering goes undetected. VARCHAR is also a poor fit for ciphertext, which is arbitrary bytes.
This adds binary encrypt / decrypt functions with modern cipher modes:
encrypt(data, key, mode)
encrypt(data, key, mode, iv)
encrypt(data, key, mode, iv, aad) -- decrypt has the same overloads
GCM: caller-supplied nonce and optional AAD. Output is ciphertext || 16-byte tag; decrypt verifies the tag and errors on any key, IV, AAD or ciphertext mismatch.
IV and AAD are caller-managed and not embedded in the output. A NULL argument yields NULL. Failures are reported as Gandiva function errors with the OpenSSL diagnostic.
The registry functions aes_encrypt / aes_decrypt are unchanged. They stay ECB-only and are not recommended for new use.
Testing: all modes and key sizes, invalid key/IV/padding, GCM tag and AAD mismatch, block-aligned inputs, and known-answer vectors from the GCM specification (McGrew and Viega, test cases 4-6; 12-, 8- and 60-byte IVs).
Related: #50522 (output sizing in the current aes_encrypt stub; the new implementation sizes buffers independently of key length), #45693, #29995.
Activity
dmitry-chirkov-dremio commentedon Oct 14, 2026
take
apacheGH-53776: [C++][Gandiva] Add AES-ECB utilities with explicit pa…
apacheGH-53776: [C++][Gandiva] Add AES-CBC utilities
apacheGH-53776: [C++][Gandiva] Add AES-GCM utilities
apacheGH-53776: [C++][Gandiva] Add binary encrypt/decrypt functions
apacheGH-53776: [C++][Gandiva] Avoid memcpy from a null pointer for e…
apacheGH-53776: [C++][Gandiva] Add projector tests for encrypt/decrypt