2525
2626namespace gandiva {
2727
28- int32_t EncryptModeDispatcher::encrypt (const char * plaintext, int32_t plaintext_len,
29- const char * key, int32_t key_len ,
30- const char * mode, int32_t mode_len,
31- const char * iv , int32_t iv_len ,
32- const char * fifth_argument, int32_t fifth_argument_len,
33- unsigned char * cipher) {
34- std::string mode_str = arrow::AsciiToUpper (std::string_view (mode, mode_len));
28+ int32_t EncryptModeDispatcher::encrypt (
29+ const char * plaintext, int32_t plaintext_len, const char * key,
30+ int32_t key_len, const char * mode, int32_t mode_len, const char * iv ,
31+ int32_t iv_len, const char * fifth_argument , int32_t fifth_argument_len ,
32+ unsigned char * cipher) {
33+ std::string mode_str =
34+ arrow::internal ::AsciiToUpper (std::string_view (mode, mode_len));
3535
3636 if (mode_str == " AES-ECB" ) {
3737 return aes_encrypt_ecb (plaintext, plaintext_len, key, key_len, cipher);
@@ -46,18 +46,18 @@ int32_t EncryptModeDispatcher::encrypt(const char* plaintext, int32_t plaintext_
4646 } else {
4747 std::ostringstream oss;
4848 oss << " Unsupported encryption mode: " << mode_str
49- << " . Supported modes: AES-ECB, AES-CBC-PKCS7, AES-CBC-NONE (AES-GCM coming soon) " ;
49+ << " . Supported modes: AES-ECB, AES-CBC-PKCS7, AES-CBC-NONE" ;
5050 throw std::runtime_error (oss.str ());
5151 }
5252}
5353
54- int32_t EncryptModeDispatcher::decrypt (const char * ciphertext, int32_t ciphertext_len,
55- const char * key, int32_t key_len ,
56- const char * mode, int32_t mode_len,
57- const char * iv , int32_t iv_len ,
58- const char * fifth_argument, int32_t fifth_argument_len,
59- unsigned char * plaintext) {
60- std::string mode_str = arrow::AsciiToUpper (std::string_view (mode, mode_len));
54+ int32_t EncryptModeDispatcher::decrypt (
55+ const char * ciphertext, int32_t ciphertext_len, const char * key,
56+ int32_t key_len, const char * mode, int32_t mode_len, const char * iv ,
57+ int32_t iv_len, const char * fifth_argument , int32_t fifth_argument_len ,
58+ unsigned char * plaintext) {
59+ std::string mode_str =
60+ arrow::internal ::AsciiToUpper (std::string_view (mode, mode_len));
6161
6262 if (mode_str == " AES-ECB" ) {
6363 return aes_decrypt_ecb (ciphertext, ciphertext_len, key, key_len, plaintext);
@@ -72,7 +72,7 @@ int32_t EncryptModeDispatcher::decrypt(const char* ciphertext, int32_t ciphertex
7272 } else {
7373 std::ostringstream oss;
7474 oss << " Unsupported decryption mode: " << mode_str
75- << " . Supported modes: AES-ECB, AES-CBC-PKCS7, AES-CBC-NONE (AES-GCM coming soon) " ;
75+ << " . Supported modes: AES-ECB, AES-CBC-PKCS7, AES-CBC-NONE" ;
7676 throw std::runtime_error (oss.str ());
7777 }
7878}
0 commit comments