be/src/exprs/function/function_encryption.cpp
Line | Count | Source |
1 | | // Licensed to the Apache Software Foundation (ASF) under one |
2 | | // or more contributor license agreements. See the NOTICE file |
3 | | // distributed with this work for additional information |
4 | | // regarding copyright ownership. The ASF licenses this file |
5 | | // to you under the Apache License, Version 2.0 (the |
6 | | // "License"); you may not use this file except in compliance |
7 | | // with the License. You may obtain a copy of the License at |
8 | | // |
9 | | // http://www.apache.org/licenses/LICENSE-2.0 |
10 | | // |
11 | | // Unless required by applicable law or agreed to in writing, |
12 | | // software distributed under the License is distributed on an |
13 | | // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
14 | | // KIND, either express or implied. See the License for the |
15 | | // specific language governing permissions and limitations |
16 | | // under the License. |
17 | | |
18 | | #include <algorithm> |
19 | | #include <cstddef> |
20 | | #include <cstdint> |
21 | | #include <memory> |
22 | | #include <string> |
23 | | #include <string_view> |
24 | | #include <utility> |
25 | | #include <vector> |
26 | | |
27 | | #include "common/cast_set.h" |
28 | | #include "common/status.h" |
29 | | #include "core/assert_cast.h" |
30 | | #include "core/block/block.h" |
31 | | #include "core/column/column.h" |
32 | | #include "core/column/column_nullable.h" |
33 | | #include "core/column/column_string.h" |
34 | | #include "core/column/column_vector.h" |
35 | | #include "core/data_type/data_type.h" |
36 | | #include "core/data_type/data_type_nullable.h" |
37 | | #include "core/data_type/data_type_string.h" |
38 | | #include "core/string_ref.h" |
39 | | #include "exec/common/stringop_substring.h" |
40 | | #include "exec/common/util.hpp" |
41 | | #include "exprs/function/function.h" |
42 | | #include "exprs/function/simple_function_factory.h" |
43 | | #include "util/encryption_util.h" |
44 | | |
45 | | namespace doris { |
46 | | #include "common/compile_check_begin.h" |
47 | | class FunctionContext; |
48 | | } // namespace doris |
49 | | |
50 | | namespace doris { |
51 | | |
52 | | inline StringCaseUnorderedMap<EncryptionMode> aes_mode_map { |
53 | | {"AES_128_ECB", EncryptionMode::AES_128_ECB}, |
54 | | {"AES_192_ECB", EncryptionMode::AES_192_ECB}, |
55 | | {"AES_256_ECB", EncryptionMode::AES_256_ECB}, |
56 | | {"AES_128_CBC", EncryptionMode::AES_128_CBC}, |
57 | | {"AES_192_CBC", EncryptionMode::AES_192_CBC}, |
58 | | {"AES_256_CBC", EncryptionMode::AES_256_CBC}, |
59 | | {"AES_128_CFB", EncryptionMode::AES_128_CFB}, |
60 | | {"AES_192_CFB", EncryptionMode::AES_192_CFB}, |
61 | | {"AES_256_CFB", EncryptionMode::AES_256_CFB}, |
62 | | {"AES_128_CFB1", EncryptionMode::AES_128_CFB1}, |
63 | | {"AES_192_CFB1", EncryptionMode::AES_192_CFB1}, |
64 | | {"AES_256_CFB1", EncryptionMode::AES_256_CFB1}, |
65 | | {"AES_128_CFB8", EncryptionMode::AES_128_CFB8}, |
66 | | {"AES_192_CFB8", EncryptionMode::AES_192_CFB8}, |
67 | | {"AES_256_CFB8", EncryptionMode::AES_256_CFB8}, |
68 | | {"AES_128_CFB128", EncryptionMode::AES_128_CFB128}, |
69 | | {"AES_192_CFB128", EncryptionMode::AES_192_CFB128}, |
70 | | {"AES_256_CFB128", EncryptionMode::AES_256_CFB128}, |
71 | | {"AES_128_CTR", EncryptionMode::AES_128_CTR}, |
72 | | {"AES_192_CTR", EncryptionMode::AES_192_CTR}, |
73 | | {"AES_256_CTR", EncryptionMode::AES_256_CTR}, |
74 | | {"AES_128_OFB", EncryptionMode::AES_128_OFB}, |
75 | | {"AES_192_OFB", EncryptionMode::AES_192_OFB}, |
76 | | {"AES_256_OFB", EncryptionMode::AES_256_OFB}, |
77 | | {"AES_128_GCM", EncryptionMode::AES_128_GCM}, |
78 | | {"AES_192_GCM", EncryptionMode::AES_192_GCM}, |
79 | | {"AES_256_GCM", EncryptionMode::AES_256_GCM}}; |
80 | | inline StringCaseUnorderedMap<EncryptionMode> sm4_mode_map { |
81 | | {"SM4_128_ECB", EncryptionMode::SM4_128_ECB}, |
82 | | {"SM4_128_CBC", EncryptionMode::SM4_128_CBC}, |
83 | | {"SM4_128_CFB128", EncryptionMode::SM4_128_CFB128}, |
84 | | {"SM4_128_OFB", EncryptionMode::SM4_128_OFB}, |
85 | | {"SM4_128_CTR", EncryptionMode::SM4_128_CTR}}; |
86 | | template <typename Impl, typename FunctionName> |
87 | | class FunctionEncryptionAndDecrypt : public IFunction { |
88 | | public: |
89 | | static constexpr auto name = FunctionName::name; |
90 | | |
91 | 10 | String get_name() const override { return name; }_ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1EEENS_14SM4EncryptNameEE8get_nameB5cxx11Ev Line | Count | Source | 91 | 1 | String get_name() const override { return name; } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0EEENS_14SM4DecryptNameEE8get_nameB5cxx11Ev Line | Count | Source | 91 | 1 | String get_name() const override { return name; } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1EEENS_14AESEncryptNameEE8get_nameB5cxx11Ev Line | Count | Source | 91 | 1 | String get_name() const override { return name; } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0EEENS_14AESDecryptNameEE8get_nameB5cxx11Ev Line | Count | Source | 91 | 1 | String get_name() const override { return name; } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1ELb1ELi4EEENS_14SM4EncryptNameEE8get_nameB5cxx11Ev Line | Count | Source | 91 | 1 | String get_name() const override { return name; } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0ELb1ELi4EEENS_14SM4DecryptNameEE8get_nameB5cxx11Ev Line | Count | Source | 91 | 1 | String get_name() const override { return name; } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1ELb0ELi4EEENS_14AESEncryptNameEE8get_nameB5cxx11Ev Line | Count | Source | 91 | 1 | String get_name() const override { return name; } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0ELb0ELi4EEENS_14AESDecryptNameEE8get_nameB5cxx11Ev Line | Count | Source | 91 | 1 | String get_name() const override { return name; } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE24ELb1ELb0ELi5EEENS_14AESEncryptNameEE8get_nameB5cxx11Ev Line | Count | Source | 91 | 1 | String get_name() const override { return name; } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE24ELb0ELb0ELi5EEENS_14AESDecryptNameEE8get_nameB5cxx11Ev Line | Count | Source | 91 | 1 | String get_name() const override { return name; } |
|
92 | | |
93 | 704 | static FunctionPtr create() { return std::make_shared<FunctionEncryptionAndDecrypt>(); }_ZN5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1EEENS_14SM4EncryptNameEE6createEv Line | Count | Source | 93 | 2 | static FunctionPtr create() { return std::make_shared<FunctionEncryptionAndDecrypt>(); } |
_ZN5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0EEENS_14SM4DecryptNameEE6createEv Line | Count | Source | 93 | 2 | static FunctionPtr create() { return std::make_shared<FunctionEncryptionAndDecrypt>(); } |
_ZN5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1EEENS_14AESEncryptNameEE6createEv Line | Count | Source | 93 | 52 | static FunctionPtr create() { return std::make_shared<FunctionEncryptionAndDecrypt>(); } |
_ZN5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0EEENS_14AESDecryptNameEE6createEv Line | Count | Source | 93 | 45 | static FunctionPtr create() { return std::make_shared<FunctionEncryptionAndDecrypt>(); } |
_ZN5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1ELb1ELi4EEENS_14SM4EncryptNameEE6createEv Line | Count | Source | 93 | 214 | static FunctionPtr create() { return std::make_shared<FunctionEncryptionAndDecrypt>(); } |
_ZN5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0ELb1ELi4EEENS_14SM4DecryptNameEE6createEv Line | Count | Source | 93 | 184 | static FunctionPtr create() { return std::make_shared<FunctionEncryptionAndDecrypt>(); } |
_ZN5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1ELb0ELi4EEENS_14AESEncryptNameEE6createEv Line | Count | Source | 93 | 108 | static FunctionPtr create() { return std::make_shared<FunctionEncryptionAndDecrypt>(); } |
_ZN5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0ELb0ELi4EEENS_14AESDecryptNameEE6createEv Line | Count | Source | 93 | 93 | static FunctionPtr create() { return std::make_shared<FunctionEncryptionAndDecrypt>(); } |
_ZN5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE24ELb1ELb0ELi5EEENS_14AESEncryptNameEE6createEv Line | Count | Source | 93 | 2 | static FunctionPtr create() { return std::make_shared<FunctionEncryptionAndDecrypt>(); } |
_ZN5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE24ELb0ELb0ELi5EEENS_14AESDecryptNameEE6createEv Line | Count | Source | 93 | 2 | static FunctionPtr create() { return std::make_shared<FunctionEncryptionAndDecrypt>(); } |
|
94 | | |
95 | 684 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { |
96 | 684 | return make_nullable(std::make_shared<DataTypeString>()); |
97 | 684 | } Unexecuted instantiation: _ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1EEENS_14SM4EncryptNameEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISB_EE Unexecuted instantiation: _ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0EEENS_14SM4DecryptNameEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISB_EE _ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1EEENS_14AESEncryptNameEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISB_EE Line | Count | Source | 95 | 50 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 96 | 50 | return make_nullable(std::make_shared<DataTypeString>()); | 97 | 50 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0EEENS_14AESDecryptNameEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISB_EE Line | Count | Source | 95 | 43 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 96 | 43 | return make_nullable(std::make_shared<DataTypeString>()); | 97 | 43 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1ELb1ELi4EEENS_14SM4EncryptNameEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISB_EE Line | Count | Source | 95 | 212 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 96 | 212 | return make_nullable(std::make_shared<DataTypeString>()); | 97 | 212 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0ELb1ELi4EEENS_14SM4DecryptNameEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISB_EE Line | Count | Source | 95 | 182 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 96 | 182 | return make_nullable(std::make_shared<DataTypeString>()); | 97 | 182 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1ELb0ELi4EEENS_14AESEncryptNameEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISB_EE Line | Count | Source | 95 | 106 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 96 | 106 | return make_nullable(std::make_shared<DataTypeString>()); | 97 | 106 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0ELb0ELi4EEENS_14AESDecryptNameEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISB_EE Line | Count | Source | 95 | 91 | DataTypePtr get_return_type_impl(const DataTypes& arguments) const override { | 96 | 91 | return make_nullable(std::make_shared<DataTypeString>()); | 97 | 91 | } |
Unexecuted instantiation: _ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE24ELb1ELb0ELi5EEENS_14AESEncryptNameEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISB_EE Unexecuted instantiation: _ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE24ELb0ELb0ELi5EEENS_14AESDecryptNameEE20get_return_type_implERKSt6vectorISt10shared_ptrIKNS_9IDataTypeEESaISB_EE |
98 | | |
99 | 694 | DataTypes get_variadic_argument_types_impl() const override { |
100 | 694 | return Impl::get_variadic_argument_types_impl(); |
101 | 694 | } _ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1EEENS_14SM4EncryptNameEE32get_variadic_argument_types_implEv Line | Count | Source | 99 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 100 | 1 | return Impl::get_variadic_argument_types_impl(); | 101 | 1 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0EEENS_14SM4DecryptNameEE32get_variadic_argument_types_implEv Line | Count | Source | 99 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 100 | 1 | return Impl::get_variadic_argument_types_impl(); | 101 | 1 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1EEENS_14AESEncryptNameEE32get_variadic_argument_types_implEv Line | Count | Source | 99 | 51 | DataTypes get_variadic_argument_types_impl() const override { | 100 | 51 | return Impl::get_variadic_argument_types_impl(); | 101 | 51 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0EEENS_14AESDecryptNameEE32get_variadic_argument_types_implEv Line | Count | Source | 99 | 44 | DataTypes get_variadic_argument_types_impl() const override { | 100 | 44 | return Impl::get_variadic_argument_types_impl(); | 101 | 44 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1ELb1ELi4EEENS_14SM4EncryptNameEE32get_variadic_argument_types_implEv Line | Count | Source | 99 | 213 | DataTypes get_variadic_argument_types_impl() const override { | 100 | 213 | return Impl::get_variadic_argument_types_impl(); | 101 | 213 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0ELb1ELi4EEENS_14SM4DecryptNameEE32get_variadic_argument_types_implEv Line | Count | Source | 99 | 183 | DataTypes get_variadic_argument_types_impl() const override { | 100 | 183 | return Impl::get_variadic_argument_types_impl(); | 101 | 183 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1ELb0ELi4EEENS_14AESEncryptNameEE32get_variadic_argument_types_implEv Line | Count | Source | 99 | 107 | DataTypes get_variadic_argument_types_impl() const override { | 100 | 107 | return Impl::get_variadic_argument_types_impl(); | 101 | 107 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0ELb0ELi4EEENS_14AESDecryptNameEE32get_variadic_argument_types_implEv Line | Count | Source | 99 | 92 | DataTypes get_variadic_argument_types_impl() const override { | 100 | 92 | return Impl::get_variadic_argument_types_impl(); | 101 | 92 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE24ELb1ELb0ELi5EEENS_14AESEncryptNameEE32get_variadic_argument_types_implEv Line | Count | Source | 99 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 100 | 1 | return Impl::get_variadic_argument_types_impl(); | 101 | 1 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE24ELb0ELb0ELi5EEENS_14AESDecryptNameEE32get_variadic_argument_types_implEv Line | Count | Source | 99 | 1 | DataTypes get_variadic_argument_types_impl() const override { | 100 | 1 | return Impl::get_variadic_argument_types_impl(); | 101 | 1 | } |
|
102 | | |
103 | 684 | size_t get_number_of_arguments() const override { |
104 | 684 | return get_variadic_argument_types_impl().size(); |
105 | 684 | } Unexecuted instantiation: _ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1EEENS_14SM4EncryptNameEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0EEENS_14SM4DecryptNameEE23get_number_of_argumentsEv _ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1EEENS_14AESEncryptNameEE23get_number_of_argumentsEv Line | Count | Source | 103 | 50 | size_t get_number_of_arguments() const override { | 104 | 50 | return get_variadic_argument_types_impl().size(); | 105 | 50 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0EEENS_14AESDecryptNameEE23get_number_of_argumentsEv Line | Count | Source | 103 | 43 | size_t get_number_of_arguments() const override { | 104 | 43 | return get_variadic_argument_types_impl().size(); | 105 | 43 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1ELb1ELi4EEENS_14SM4EncryptNameEE23get_number_of_argumentsEv Line | Count | Source | 103 | 212 | size_t get_number_of_arguments() const override { | 104 | 212 | return get_variadic_argument_types_impl().size(); | 105 | 212 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0ELb1ELi4EEENS_14SM4DecryptNameEE23get_number_of_argumentsEv Line | Count | Source | 103 | 182 | size_t get_number_of_arguments() const override { | 104 | 182 | return get_variadic_argument_types_impl().size(); | 105 | 182 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1ELb0ELi4EEENS_14AESEncryptNameEE23get_number_of_argumentsEv Line | Count | Source | 103 | 106 | size_t get_number_of_arguments() const override { | 104 | 106 | return get_variadic_argument_types_impl().size(); | 105 | 106 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0ELb0ELi4EEENS_14AESDecryptNameEE23get_number_of_argumentsEv Line | Count | Source | 103 | 91 | size_t get_number_of_arguments() const override { | 104 | 91 | return get_variadic_argument_types_impl().size(); | 105 | 91 | } |
Unexecuted instantiation: _ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE24ELb1ELb0ELi5EEENS_14AESEncryptNameEE23get_number_of_argumentsEv Unexecuted instantiation: _ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE24ELb0ELb0ELi5EEENS_14AESDecryptNameEE23get_number_of_argumentsEv |
106 | | |
107 | | Status execute_impl(FunctionContext* context, Block& block, const ColumnNumbers& arguments, |
108 | 580 | uint32_t result, size_t input_rows_count) const override { |
109 | 580 | return Impl::execute_impl_inner(context, block, arguments, result, input_rows_count); |
110 | 580 | } Unexecuted instantiation: _ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1EEENS_14SM4EncryptNameEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0EEENS_14SM4DecryptNameEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm _ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1EEENS_14AESEncryptNameEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 108 | 43 | uint32_t result, size_t input_rows_count) const override { | 109 | 43 | return Impl::execute_impl_inner(context, block, arguments, result, input_rows_count); | 110 | 43 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0EEENS_14AESDecryptNameEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 108 | 36 | uint32_t result, size_t input_rows_count) const override { | 109 | 36 | return Impl::execute_impl_inner(context, block, arguments, result, input_rows_count); | 110 | 36 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1ELb1ELi4EEENS_14SM4EncryptNameEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 108 | 182 | uint32_t result, size_t input_rows_count) const override { | 109 | 182 | return Impl::execute_impl_inner(context, block, arguments, result, input_rows_count); | 110 | 182 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0ELb1ELi4EEENS_14SM4DecryptNameEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 108 | 152 | uint32_t result, size_t input_rows_count) const override { | 109 | 152 | return Impl::execute_impl_inner(context, block, arguments, result, input_rows_count); | 110 | 152 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1ELb0ELi4EEENS_14AESEncryptNameEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 108 | 91 | uint32_t result, size_t input_rows_count) const override { | 109 | 91 | return Impl::execute_impl_inner(context, block, arguments, result, input_rows_count); | 110 | 91 | } |
_ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0ELb0ELi4EEENS_14AESDecryptNameEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 108 | 76 | uint32_t result, size_t input_rows_count) const override { | 109 | 76 | return Impl::execute_impl_inner(context, block, arguments, result, input_rows_count); | 110 | 76 | } |
Unexecuted instantiation: _ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE24ELb1ELb0ELi5EEENS_14AESEncryptNameEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZNK5doris28FunctionEncryptionAndDecryptINS_29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE24ELb0ELb0ELi5EEENS_14AESDecryptNameEE12execute_implEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm |
111 | | }; |
112 | | |
113 | | template <typename Impl, bool is_encrypt> |
114 | | void execute_result_vector(std::vector<const ColumnString::Offsets*>& offsets_list, |
115 | | std::vector<const ColumnString::Chars*>& chars_list, size_t i, |
116 | | EncryptionMode& encryption_mode, const char* iv_raw, int iv_length, |
117 | | ColumnString::Chars& result_data, ColumnString::Offsets& result_offset, |
118 | 580 | NullMap& null_map, const char* aad, int aad_length) { |
119 | 580 | int src_size = (*offsets_list[0])[i] - (*offsets_list[0])[i - 1]; |
120 | 580 | const auto* src_raw = |
121 | 580 | reinterpret_cast<const char*>(&(*chars_list[0])[(*offsets_list[0])[i - 1]]); |
122 | 580 | int key_size = (*offsets_list[1])[i] - (*offsets_list[1])[i - 1]; |
123 | 580 | const auto* key_raw = |
124 | 580 | reinterpret_cast<const char*>(&(*chars_list[1])[(*offsets_list[1])[i - 1]]); |
125 | 580 | execute_result<Impl, is_encrypt>(src_raw, src_size, key_raw, key_size, i, encryption_mode, |
126 | 580 | iv_raw, iv_length, result_data, result_offset, null_map, aad, |
127 | 580 | aad_length); |
128 | 580 | } _ZN5doris21execute_result_vectorINS_11EncryptImplELb1EEEvRSt6vectorIPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEESaIS9_EERS2_IPKNS3_IhLm4096ES6_Lm16ELm15EEESaISF_EEmRNS_14EncryptionModeEPKciRSD_RS7_SN_SM_i Line | Count | Source | 118 | 316 | NullMap& null_map, const char* aad, int aad_length) { | 119 | 316 | int src_size = (*offsets_list[0])[i] - (*offsets_list[0])[i - 1]; | 120 | 316 | const auto* src_raw = | 121 | 316 | reinterpret_cast<const char*>(&(*chars_list[0])[(*offsets_list[0])[i - 1]]); | 122 | 316 | int key_size = (*offsets_list[1])[i] - (*offsets_list[1])[i - 1]; | 123 | 316 | const auto* key_raw = | 124 | 316 | reinterpret_cast<const char*>(&(*chars_list[1])[(*offsets_list[1])[i - 1]]); | 125 | 316 | execute_result<Impl, is_encrypt>(src_raw, src_size, key_raw, key_size, i, encryption_mode, | 126 | 316 | iv_raw, iv_length, result_data, result_offset, null_map, aad, | 127 | 316 | aad_length); | 128 | 316 | } |
_ZN5doris21execute_result_vectorINS_11DecryptImplELb0EEEvRSt6vectorIPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEESaIS9_EERS2_IPKNS3_IhLm4096ES6_Lm16ELm15EEESaISF_EEmRNS_14EncryptionModeEPKciRSD_RS7_SN_SM_i Line | Count | Source | 118 | 264 | NullMap& null_map, const char* aad, int aad_length) { | 119 | 264 | int src_size = (*offsets_list[0])[i] - (*offsets_list[0])[i - 1]; | 120 | 264 | const auto* src_raw = | 121 | 264 | reinterpret_cast<const char*>(&(*chars_list[0])[(*offsets_list[0])[i - 1]]); | 122 | 264 | int key_size = (*offsets_list[1])[i] - (*offsets_list[1])[i - 1]; | 123 | 264 | const auto* key_raw = | 124 | 264 | reinterpret_cast<const char*>(&(*chars_list[1])[(*offsets_list[1])[i - 1]]); | 125 | 264 | execute_result<Impl, is_encrypt>(src_raw, src_size, key_raw, key_size, i, encryption_mode, | 126 | 264 | iv_raw, iv_length, result_data, result_offset, null_map, aad, | 127 | 264 | aad_length); | 128 | 264 | } |
|
129 | | |
130 | | template <typename Impl, bool is_encrypt> |
131 | | void execute_result_const(const ColumnString::Offsets* offsets_column, |
132 | | const ColumnString::Chars* chars_column, StringRef key_arg, size_t i, |
133 | | EncryptionMode& encryption_mode, const char* iv_raw, size_t iv_length, |
134 | | ColumnString::Chars& result_data, ColumnString::Offsets& result_offset, |
135 | 44 | NullMap& null_map, const char* aad, size_t aad_length) { |
136 | 44 | int src_size = (*offsets_column)[i] - (*offsets_column)[i - 1]; |
137 | 44 | const auto* src_raw = reinterpret_cast<const char*>(&(*chars_column)[(*offsets_column)[i - 1]]); |
138 | 44 | execute_result<Impl, is_encrypt>(src_raw, src_size, key_arg.data, key_arg.size, i, |
139 | 44 | encryption_mode, iv_raw, iv_length, result_data, result_offset, |
140 | 44 | null_map, aad, aad_length); |
141 | 44 | } _ZN5doris20execute_result_constINS_11EncryptImplELb1EEEvPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEEPKNS2_IhLm4096ES5_Lm16ELm15EEENS_9StringRefEmRNS_14EncryptionModeEPKcmRS9_RS6_SH_SG_m Line | Count | Source | 135 | 24 | NullMap& null_map, const char* aad, size_t aad_length) { | 136 | 24 | int src_size = (*offsets_column)[i] - (*offsets_column)[i - 1]; | 137 | 24 | const auto* src_raw = reinterpret_cast<const char*>(&(*chars_column)[(*offsets_column)[i - 1]]); | 138 | 24 | execute_result<Impl, is_encrypt>(src_raw, src_size, key_arg.data, key_arg.size, i, | 139 | 24 | encryption_mode, iv_raw, iv_length, result_data, result_offset, | 140 | 24 | null_map, aad, aad_length); | 141 | 24 | } |
_ZN5doris20execute_result_constINS_11DecryptImplELb0EEEvPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEEPKNS2_IhLm4096ES5_Lm16ELm15EEENS_9StringRefEmRNS_14EncryptionModeEPKcmRS9_RS6_SH_SG_m Line | Count | Source | 135 | 20 | NullMap& null_map, const char* aad, size_t aad_length) { | 136 | 20 | int src_size = (*offsets_column)[i] - (*offsets_column)[i - 1]; | 137 | 20 | const auto* src_raw = reinterpret_cast<const char*>(&(*chars_column)[(*offsets_column)[i - 1]]); | 138 | 20 | execute_result<Impl, is_encrypt>(src_raw, src_size, key_arg.data, key_arg.size, i, | 139 | 20 | encryption_mode, iv_raw, iv_length, result_data, result_offset, | 140 | 20 | null_map, aad, aad_length); | 141 | 20 | } |
|
142 | | |
143 | | template <typename Impl, bool is_encrypt> |
144 | | void execute_result(const char* src_raw, size_t src_size, const char* key_raw, size_t key_size, |
145 | | size_t i, EncryptionMode& encryption_mode, const char* iv_raw, size_t iv_length, |
146 | | ColumnString::Chars& result_data, ColumnString::Offsets& result_offset, |
147 | 624 | NullMap& null_map, const char* aad, size_t aad_length) { |
148 | 624 | auto cipher_len = src_size; |
149 | 624 | if constexpr (is_encrypt) { |
150 | 340 | cipher_len += 16; |
151 | | // for output AEAD tag |
152 | 340 | if (EncryptionUtil::is_gcm_mode(encryption_mode)) { |
153 | 0 | cipher_len += EncryptionUtil::GCM_TAG_SIZE; |
154 | 0 | } |
155 | 340 | } |
156 | 624 | std::unique_ptr<char[]> p; |
157 | 624 | p.reset(new char[cipher_len]); |
158 | 624 | int ret_code = 0; |
159 | | |
160 | 624 | ret_code = Impl::execute_impl(encryption_mode, (unsigned char*)src_raw, src_size, |
161 | 624 | (unsigned char*)key_raw, key_size, iv_raw, iv_length, true, |
162 | 624 | (unsigned char*)p.get(), (unsigned char*)aad, aad_length); |
163 | | |
164 | 624 | if (ret_code < 0) { |
165 | 2 | StringOP::push_null_string(i, result_data, result_offset, null_map); |
166 | 622 | } else { |
167 | 622 | StringOP::push_value_string(std::string_view(p.get(), ret_code), i, result_data, |
168 | 622 | result_offset); |
169 | 622 | } |
170 | 624 | } _ZN5doris14execute_resultINS_11EncryptImplELb1EEEvPKcmS3_mmRNS_14EncryptionModeES3_mRNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEERNS6_IjLm4096ES9_Lm16ELm15EEESB_S3_m Line | Count | Source | 147 | 340 | NullMap& null_map, const char* aad, size_t aad_length) { | 148 | 340 | auto cipher_len = src_size; | 149 | 340 | if constexpr (is_encrypt) { | 150 | 340 | cipher_len += 16; | 151 | | // for output AEAD tag | 152 | 340 | if (EncryptionUtil::is_gcm_mode(encryption_mode)) { | 153 | 0 | cipher_len += EncryptionUtil::GCM_TAG_SIZE; | 154 | 0 | } | 155 | 340 | } | 156 | 340 | std::unique_ptr<char[]> p; | 157 | 340 | p.reset(new char[cipher_len]); | 158 | 340 | int ret_code = 0; | 159 | | | 160 | 340 | ret_code = Impl::execute_impl(encryption_mode, (unsigned char*)src_raw, src_size, | 161 | 340 | (unsigned char*)key_raw, key_size, iv_raw, iv_length, true, | 162 | 340 | (unsigned char*)p.get(), (unsigned char*)aad, aad_length); | 163 | | | 164 | 340 | if (ret_code < 0) { | 165 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 166 | 340 | } else { | 167 | 340 | StringOP::push_value_string(std::string_view(p.get(), ret_code), i, result_data, | 168 | 340 | result_offset); | 169 | 340 | } | 170 | 340 | } |
_ZN5doris14execute_resultINS_11DecryptImplELb0EEEvPKcmS3_mmRNS_14EncryptionModeES3_mRNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEERNS6_IjLm4096ES9_Lm16ELm15EEESB_S3_m Line | Count | Source | 147 | 284 | NullMap& null_map, const char* aad, size_t aad_length) { | 148 | 284 | auto cipher_len = src_size; | 149 | | if constexpr (is_encrypt) { | 150 | | cipher_len += 16; | 151 | | // for output AEAD tag | 152 | | if (EncryptionUtil::is_gcm_mode(encryption_mode)) { | 153 | | cipher_len += EncryptionUtil::GCM_TAG_SIZE; | 154 | | } | 155 | | } | 156 | 284 | std::unique_ptr<char[]> p; | 157 | 284 | p.reset(new char[cipher_len]); | 158 | 284 | int ret_code = 0; | 159 | | | 160 | 284 | ret_code = Impl::execute_impl(encryption_mode, (unsigned char*)src_raw, src_size, | 161 | 284 | (unsigned char*)key_raw, key_size, iv_raw, iv_length, true, | 162 | 284 | (unsigned char*)p.get(), (unsigned char*)aad, aad_length); | 163 | | | 164 | 284 | if (ret_code < 0) { | 165 | 2 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 166 | 282 | } else { | 167 | 282 | StringOP::push_value_string(std::string_view(p.get(), ret_code), i, result_data, | 168 | 282 | result_offset); | 169 | 282 | } | 170 | 284 | } |
|
171 | | |
172 | | template <typename Impl, EncryptionMode mode, bool is_encrypt> |
173 | | struct EncryptionAndDecryptTwoImpl { |
174 | 97 | static DataTypes get_variadic_argument_types_impl() { |
175 | 97 | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), |
176 | 97 | std::make_shared<DataTypeString>()}; |
177 | 97 | } _ZN5doris27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1EE32get_variadic_argument_types_implEv Line | Count | Source | 174 | 1 | static DataTypes get_variadic_argument_types_impl() { | 175 | 1 | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 176 | 1 | std::make_shared<DataTypeString>()}; | 177 | 1 | } |
_ZN5doris27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0EE32get_variadic_argument_types_implEv Line | Count | Source | 174 | 1 | static DataTypes get_variadic_argument_types_impl() { | 175 | 1 | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 176 | 1 | std::make_shared<DataTypeString>()}; | 177 | 1 | } |
_ZN5doris27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1EE32get_variadic_argument_types_implEv Line | Count | Source | 174 | 51 | static DataTypes get_variadic_argument_types_impl() { | 175 | 51 | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 176 | 51 | std::make_shared<DataTypeString>()}; | 177 | 51 | } |
_ZN5doris27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0EE32get_variadic_argument_types_implEv Line | Count | Source | 174 | 44 | static DataTypes get_variadic_argument_types_impl() { | 175 | 44 | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 176 | 44 | std::make_shared<DataTypeString>()}; | 177 | 44 | } |
|
178 | | |
179 | | static Status execute_impl_inner(FunctionContext* context, Block& block, |
180 | | const ColumnNumbers& arguments, uint32_t result, |
181 | 79 | size_t input_rows_count) { |
182 | 79 | auto result_column = ColumnString::create(); |
183 | 79 | auto result_null_map_column = ColumnUInt8::create(input_rows_count, 0); |
184 | 79 | DCHECK_EQ(3, arguments.size()); |
185 | 79 | const size_t argument_size = 3; |
186 | 79 | bool col_const[argument_size]; |
187 | 79 | ColumnPtr argument_columns[argument_size]; |
188 | 316 | for (int i = 0; i < argument_size; ++i) { |
189 | 237 | col_const[i] = is_column_const(*block.get_by_position(arguments[i]).column); |
190 | 237 | } |
191 | 79 | argument_columns[0] = col_const[0] ? static_cast<const ColumnConst&>( |
192 | 33 | *block.get_by_position(arguments[0]).column) |
193 | 33 | .convert_to_full_column() |
194 | 79 | : block.get_by_position(arguments[0]).column; |
195 | | |
196 | 79 | default_preprocess_parameter_columns(argument_columns, col_const, {1, 2}, block, arguments); |
197 | | |
198 | 79 | auto& result_data = result_column->get_chars(); |
199 | 79 | auto& result_offset = result_column->get_offsets(); |
200 | 79 | result_offset.resize(input_rows_count); |
201 | | |
202 | 79 | if (col_const[1] && col_const[2]) { |
203 | 11 | vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()), |
204 | 11 | argument_columns[1]->get_data_at(0), argument_columns[2]->get_data_at(0), |
205 | 11 | input_rows_count, result_data, result_offset, |
206 | 11 | result_null_map_column->get_data()); |
207 | 68 | } else { |
208 | 68 | std::vector<const ColumnString::Offsets*> offsets_list(argument_size); |
209 | 68 | std::vector<const ColumnString::Chars*> chars_list(argument_size); |
210 | 272 | for (size_t i = 0; i < argument_size; ++i) { |
211 | 204 | const auto* col_str = assert_cast<const ColumnString*>(argument_columns[i].get()); |
212 | 204 | offsets_list[i] = &col_str->get_offsets(); |
213 | 204 | chars_list[i] = &col_str->get_chars(); |
214 | 204 | } |
215 | 68 | vector_vector(offsets_list, chars_list, input_rows_count, result_data, result_offset, |
216 | 68 | result_null_map_column->get_data()); |
217 | 68 | } |
218 | 79 | block.get_by_position(result).column = |
219 | 79 | ColumnNullable::create(std::move(result_column), std::move(result_null_map_column)); |
220 | 79 | return Status::OK(); |
221 | 79 | } Unexecuted instantiation: _ZN5doris27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1EE18execute_impl_innerEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0EE18execute_impl_innerEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm _ZN5doris27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1EE18execute_impl_innerEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 181 | 43 | size_t input_rows_count) { | 182 | 43 | auto result_column = ColumnString::create(); | 183 | 43 | auto result_null_map_column = ColumnUInt8::create(input_rows_count, 0); | 184 | 43 | DCHECK_EQ(3, arguments.size()); | 185 | 43 | const size_t argument_size = 3; | 186 | 43 | bool col_const[argument_size]; | 187 | 43 | ColumnPtr argument_columns[argument_size]; | 188 | 172 | for (int i = 0; i < argument_size; ++i) { | 189 | 129 | col_const[i] = is_column_const(*block.get_by_position(arguments[i]).column); | 190 | 129 | } | 191 | 43 | argument_columns[0] = col_const[0] ? static_cast<const ColumnConst&>( | 192 | 18 | *block.get_by_position(arguments[0]).column) | 193 | 18 | .convert_to_full_column() | 194 | 43 | : block.get_by_position(arguments[0]).column; | 195 | | | 196 | 43 | default_preprocess_parameter_columns(argument_columns, col_const, {1, 2}, block, arguments); | 197 | | | 198 | 43 | auto& result_data = result_column->get_chars(); | 199 | 43 | auto& result_offset = result_column->get_offsets(); | 200 | 43 | result_offset.resize(input_rows_count); | 201 | | | 202 | 43 | if (col_const[1] && col_const[2]) { | 203 | 6 | vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()), | 204 | 6 | argument_columns[1]->get_data_at(0), argument_columns[2]->get_data_at(0), | 205 | 6 | input_rows_count, result_data, result_offset, | 206 | 6 | result_null_map_column->get_data()); | 207 | 37 | } else { | 208 | 37 | std::vector<const ColumnString::Offsets*> offsets_list(argument_size); | 209 | 37 | std::vector<const ColumnString::Chars*> chars_list(argument_size); | 210 | 148 | for (size_t i = 0; i < argument_size; ++i) { | 211 | 111 | const auto* col_str = assert_cast<const ColumnString*>(argument_columns[i].get()); | 212 | 111 | offsets_list[i] = &col_str->get_offsets(); | 213 | 111 | chars_list[i] = &col_str->get_chars(); | 214 | 111 | } | 215 | 37 | vector_vector(offsets_list, chars_list, input_rows_count, result_data, result_offset, | 216 | 37 | result_null_map_column->get_data()); | 217 | 37 | } | 218 | 43 | block.get_by_position(result).column = | 219 | 43 | ColumnNullable::create(std::move(result_column), std::move(result_null_map_column)); | 220 | 43 | return Status::OK(); | 221 | 43 | } |
_ZN5doris27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0EE18execute_impl_innerEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 181 | 36 | size_t input_rows_count) { | 182 | 36 | auto result_column = ColumnString::create(); | 183 | 36 | auto result_null_map_column = ColumnUInt8::create(input_rows_count, 0); | 184 | 36 | DCHECK_EQ(3, arguments.size()); | 185 | 36 | const size_t argument_size = 3; | 186 | 36 | bool col_const[argument_size]; | 187 | 36 | ColumnPtr argument_columns[argument_size]; | 188 | 144 | for (int i = 0; i < argument_size; ++i) { | 189 | 108 | col_const[i] = is_column_const(*block.get_by_position(arguments[i]).column); | 190 | 108 | } | 191 | 36 | argument_columns[0] = col_const[0] ? static_cast<const ColumnConst&>( | 192 | 15 | *block.get_by_position(arguments[0]).column) | 193 | 15 | .convert_to_full_column() | 194 | 36 | : block.get_by_position(arguments[0]).column; | 195 | | | 196 | 36 | default_preprocess_parameter_columns(argument_columns, col_const, {1, 2}, block, arguments); | 197 | | | 198 | 36 | auto& result_data = result_column->get_chars(); | 199 | 36 | auto& result_offset = result_column->get_offsets(); | 200 | 36 | result_offset.resize(input_rows_count); | 201 | | | 202 | 36 | if (col_const[1] && col_const[2]) { | 203 | 5 | vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()), | 204 | 5 | argument_columns[1]->get_data_at(0), argument_columns[2]->get_data_at(0), | 205 | 5 | input_rows_count, result_data, result_offset, | 206 | 5 | result_null_map_column->get_data()); | 207 | 31 | } else { | 208 | 31 | std::vector<const ColumnString::Offsets*> offsets_list(argument_size); | 209 | 31 | std::vector<const ColumnString::Chars*> chars_list(argument_size); | 210 | 124 | for (size_t i = 0; i < argument_size; ++i) { | 211 | 93 | const auto* col_str = assert_cast<const ColumnString*>(argument_columns[i].get()); | 212 | 93 | offsets_list[i] = &col_str->get_offsets(); | 213 | 93 | chars_list[i] = &col_str->get_chars(); | 214 | 93 | } | 215 | 31 | vector_vector(offsets_list, chars_list, input_rows_count, result_data, result_offset, | 216 | 31 | result_null_map_column->get_data()); | 217 | 31 | } | 218 | 36 | block.get_by_position(result).column = | 219 | 36 | ColumnNullable::create(std::move(result_column), std::move(result_null_map_column)); | 220 | 36 | return Status::OK(); | 221 | 36 | } |
|
222 | | |
223 | | static void vector_const(const ColumnString* column, StringRef key_arg, StringRef mode_arg, |
224 | | size_t input_rows_count, ColumnString::Chars& result_data, |
225 | 11 | ColumnString::Offsets& result_offset, NullMap& null_map) { |
226 | 11 | EncryptionMode encryption_mode = mode; |
227 | 11 | std::string mode_str(mode_arg.data, mode_arg.size); |
228 | 11 | bool all_insert_null = false; |
229 | 11 | if (mode_arg.size != 0) { |
230 | 11 | if (!aes_mode_map.contains(mode_str)) { |
231 | 0 | all_insert_null = true; |
232 | 11 | } else { |
233 | 11 | encryption_mode = aes_mode_map.at(mode_str); |
234 | 11 | } |
235 | 11 | } |
236 | 11 | const ColumnString::Offsets* offsets_column = &column->get_offsets(); |
237 | 11 | const ColumnString::Chars* chars_column = &column->get_chars(); |
238 | 22 | for (int i = 0; i < input_rows_count; ++i) { |
239 | 11 | if (all_insert_null || null_map[i]) { |
240 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); |
241 | 0 | continue; |
242 | 0 | } |
243 | 11 | execute_result_const<Impl, is_encrypt>(offsets_column, chars_column, key_arg, i, |
244 | 11 | encryption_mode, nullptr, 0, result_data, |
245 | 11 | result_offset, null_map, nullptr, 0); |
246 | 11 | } |
247 | 11 | } Unexecuted instantiation: _ZN5doris27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1EE12vector_constEPKNS_9ColumnStrIjEENS_9StringRefES8_mRNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEERNS9_IjLm4096ESC_Lm16ELm15EEESE_ Unexecuted instantiation: _ZN5doris27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0EE12vector_constEPKNS_9ColumnStrIjEENS_9StringRefES8_mRNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEERNS9_IjLm4096ESC_Lm16ELm15EEESE_ _ZN5doris27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1EE12vector_constEPKNS_9ColumnStrIjEENS_9StringRefES8_mRNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEERNS9_IjLm4096ESC_Lm16ELm15EEESE_ Line | Count | Source | 225 | 6 | ColumnString::Offsets& result_offset, NullMap& null_map) { | 226 | 6 | EncryptionMode encryption_mode = mode; | 227 | 6 | std::string mode_str(mode_arg.data, mode_arg.size); | 228 | 6 | bool all_insert_null = false; | 229 | 6 | if (mode_arg.size != 0) { | 230 | 6 | if (!aes_mode_map.contains(mode_str)) { | 231 | 0 | all_insert_null = true; | 232 | 6 | } else { | 233 | 6 | encryption_mode = aes_mode_map.at(mode_str); | 234 | 6 | } | 235 | 6 | } | 236 | 6 | const ColumnString::Offsets* offsets_column = &column->get_offsets(); | 237 | 6 | const ColumnString::Chars* chars_column = &column->get_chars(); | 238 | 12 | for (int i = 0; i < input_rows_count; ++i) { | 239 | 6 | if (all_insert_null || null_map[i]) { | 240 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 241 | 0 | continue; | 242 | 0 | } | 243 | 6 | execute_result_const<Impl, is_encrypt>(offsets_column, chars_column, key_arg, i, | 244 | 6 | encryption_mode, nullptr, 0, result_data, | 245 | 6 | result_offset, null_map, nullptr, 0); | 246 | 6 | } | 247 | 6 | } |
_ZN5doris27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0EE12vector_constEPKNS_9ColumnStrIjEENS_9StringRefES8_mRNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEERNS9_IjLm4096ESC_Lm16ELm15EEESE_ Line | Count | Source | 225 | 5 | ColumnString::Offsets& result_offset, NullMap& null_map) { | 226 | 5 | EncryptionMode encryption_mode = mode; | 227 | 5 | std::string mode_str(mode_arg.data, mode_arg.size); | 228 | 5 | bool all_insert_null = false; | 229 | 5 | if (mode_arg.size != 0) { | 230 | 5 | if (!aes_mode_map.contains(mode_str)) { | 231 | 0 | all_insert_null = true; | 232 | 5 | } else { | 233 | 5 | encryption_mode = aes_mode_map.at(mode_str); | 234 | 5 | } | 235 | 5 | } | 236 | 5 | const ColumnString::Offsets* offsets_column = &column->get_offsets(); | 237 | 5 | const ColumnString::Chars* chars_column = &column->get_chars(); | 238 | 10 | for (int i = 0; i < input_rows_count; ++i) { | 239 | 5 | if (all_insert_null || null_map[i]) { | 240 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 241 | 0 | continue; | 242 | 0 | } | 243 | 5 | execute_result_const<Impl, is_encrypt>(offsets_column, chars_column, key_arg, i, | 244 | 5 | encryption_mode, nullptr, 0, result_data, | 245 | 5 | result_offset, null_map, nullptr, 0); | 246 | 5 | } | 247 | 5 | } |
|
248 | | |
249 | | static void vector_vector(std::vector<const ColumnString::Offsets*>& offsets_list, |
250 | | std::vector<const ColumnString::Chars*>& chars_list, |
251 | | size_t input_rows_count, ColumnString::Chars& result_data, |
252 | 68 | ColumnString::Offsets& result_offset, NullMap& null_map) { |
253 | 147 | for (int i = 0; i < input_rows_count; ++i) { |
254 | 79 | if (null_map[i]) { |
255 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); |
256 | 0 | continue; |
257 | 0 | } |
258 | 79 | EncryptionMode encryption_mode = mode; |
259 | 79 | int mode_size = (*offsets_list[2])[i] - (*offsets_list[2])[i - 1]; |
260 | 79 | const auto* mode_raw = |
261 | 79 | reinterpret_cast<const char*>(&(*chars_list[2])[(*offsets_list[2])[i - 1]]); |
262 | 79 | if (mode_size != 0) { |
263 | 79 | std::string mode_str(mode_raw, mode_size); |
264 | 79 | if (aes_mode_map.count(mode_str) == 0) { |
265 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); |
266 | 0 | continue; |
267 | 0 | } |
268 | 79 | encryption_mode = aes_mode_map.at(mode_str); |
269 | 79 | } |
270 | 79 | execute_result_vector<Impl, is_encrypt>(offsets_list, chars_list, i, encryption_mode, |
271 | 79 | nullptr, 0, result_data, result_offset, |
272 | 79 | null_map, nullptr, 0); |
273 | 79 | } |
274 | 68 | } Unexecuted instantiation: _ZN5doris27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1EE13vector_vectorERSt6vectorIPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEESaISB_EERS4_IPKNS5_IhLm4096ES8_Lm16ELm15EEESaISH_EEmRSF_RS9_SL_ Unexecuted instantiation: _ZN5doris27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0EE13vector_vectorERSt6vectorIPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEESaISB_EERS4_IPKNS5_IhLm4096ES8_Lm16ELm15EEESaISH_EEmRSF_RS9_SL_ _ZN5doris27EncryptionAndDecryptTwoImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1EE13vector_vectorERSt6vectorIPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEESaISB_EERS4_IPKNS5_IhLm4096ES8_Lm16ELm15EEESaISH_EEmRSF_RS9_SL_ Line | Count | Source | 252 | 37 | ColumnString::Offsets& result_offset, NullMap& null_map) { | 253 | 80 | for (int i = 0; i < input_rows_count; ++i) { | 254 | 43 | if (null_map[i]) { | 255 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 256 | 0 | continue; | 257 | 0 | } | 258 | 43 | EncryptionMode encryption_mode = mode; | 259 | 43 | int mode_size = (*offsets_list[2])[i] - (*offsets_list[2])[i - 1]; | 260 | 43 | const auto* mode_raw = | 261 | 43 | reinterpret_cast<const char*>(&(*chars_list[2])[(*offsets_list[2])[i - 1]]); | 262 | 43 | if (mode_size != 0) { | 263 | 43 | std::string mode_str(mode_raw, mode_size); | 264 | 43 | if (aes_mode_map.count(mode_str) == 0) { | 265 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 266 | 0 | continue; | 267 | 0 | } | 268 | 43 | encryption_mode = aes_mode_map.at(mode_str); | 269 | 43 | } | 270 | 43 | execute_result_vector<Impl, is_encrypt>(offsets_list, chars_list, i, encryption_mode, | 271 | 43 | nullptr, 0, result_data, result_offset, | 272 | 43 | null_map, nullptr, 0); | 273 | 43 | } | 274 | 37 | } |
_ZN5doris27EncryptionAndDecryptTwoImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0EE13vector_vectorERSt6vectorIPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEESaISB_EERS4_IPKNS5_IhLm4096ES8_Lm16ELm15EEESaISH_EEmRSF_RS9_SL_ Line | Count | Source | 252 | 31 | ColumnString::Offsets& result_offset, NullMap& null_map) { | 253 | 67 | for (int i = 0; i < input_rows_count; ++i) { | 254 | 36 | if (null_map[i]) { | 255 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 256 | 0 | continue; | 257 | 0 | } | 258 | 36 | EncryptionMode encryption_mode = mode; | 259 | 36 | int mode_size = (*offsets_list[2])[i] - (*offsets_list[2])[i - 1]; | 260 | 36 | const auto* mode_raw = | 261 | 36 | reinterpret_cast<const char*>(&(*chars_list[2])[(*offsets_list[2])[i - 1]]); | 262 | 36 | if (mode_size != 0) { | 263 | 36 | std::string mode_str(mode_raw, mode_size); | 264 | 36 | if (aes_mode_map.count(mode_str) == 0) { | 265 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 266 | 0 | continue; | 267 | 0 | } | 268 | 36 | encryption_mode = aes_mode_map.at(mode_str); | 269 | 36 | } | 270 | 36 | execute_result_vector<Impl, is_encrypt>(offsets_list, chars_list, i, encryption_mode, | 271 | 36 | nullptr, 0, result_data, result_offset, | 272 | 36 | null_map, nullptr, 0); | 273 | 36 | } | 274 | 31 | } |
|
275 | | }; |
276 | | |
277 | | template <typename Impl, EncryptionMode mode, bool is_encrypt, bool is_sm_mode, int arg_num = 4> |
278 | | struct EncryptionAndDecryptMultiImpl { |
279 | 597 | static DataTypes get_variadic_argument_types_impl() { |
280 | 597 | if constexpr (arg_num == 5) { |
281 | 2 | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), |
282 | 2 | std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), |
283 | 2 | std::make_shared<DataTypeString>()}; |
284 | 595 | } else { |
285 | 595 | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), |
286 | 595 | std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>()}; |
287 | 595 | } |
288 | 597 | } _ZN5doris29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1ELb1ELi4EE32get_variadic_argument_types_implEv Line | Count | Source | 279 | 213 | static DataTypes get_variadic_argument_types_impl() { | 280 | | if constexpr (arg_num == 5) { | 281 | | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 282 | | std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 283 | | std::make_shared<DataTypeString>()}; | 284 | 213 | } else { | 285 | 213 | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 286 | 213 | std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>()}; | 287 | 213 | } | 288 | 213 | } |
_ZN5doris29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0ELb1ELi4EE32get_variadic_argument_types_implEv Line | Count | Source | 279 | 183 | static DataTypes get_variadic_argument_types_impl() { | 280 | | if constexpr (arg_num == 5) { | 281 | | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 282 | | std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 283 | | std::make_shared<DataTypeString>()}; | 284 | 183 | } else { | 285 | 183 | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 286 | 183 | std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>()}; | 287 | 183 | } | 288 | 183 | } |
_ZN5doris29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1ELb0ELi4EE32get_variadic_argument_types_implEv Line | Count | Source | 279 | 107 | static DataTypes get_variadic_argument_types_impl() { | 280 | | if constexpr (arg_num == 5) { | 281 | | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 282 | | std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 283 | | std::make_shared<DataTypeString>()}; | 284 | 107 | } else { | 285 | 107 | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 286 | 107 | std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>()}; | 287 | 107 | } | 288 | 107 | } |
_ZN5doris29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0ELb0ELi4EE32get_variadic_argument_types_implEv Line | Count | Source | 279 | 92 | static DataTypes get_variadic_argument_types_impl() { | 280 | | if constexpr (arg_num == 5) { | 281 | | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 282 | | std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 283 | | std::make_shared<DataTypeString>()}; | 284 | 92 | } else { | 285 | 92 | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 286 | 92 | std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>()}; | 287 | 92 | } | 288 | 92 | } |
_ZN5doris29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE24ELb1ELb0ELi5EE32get_variadic_argument_types_implEv Line | Count | Source | 279 | 1 | static DataTypes get_variadic_argument_types_impl() { | 280 | 1 | if constexpr (arg_num == 5) { | 281 | 1 | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 282 | 1 | std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 283 | 1 | std::make_shared<DataTypeString>()}; | 284 | | } else { | 285 | | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 286 | | std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>()}; | 287 | | } | 288 | 1 | } |
_ZN5doris29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE24ELb0ELb0ELi5EE32get_variadic_argument_types_implEv Line | Count | Source | 279 | 1 | static DataTypes get_variadic_argument_types_impl() { | 280 | 1 | if constexpr (arg_num == 5) { | 281 | 1 | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 282 | 1 | std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 283 | 1 | std::make_shared<DataTypeString>()}; | 284 | | } else { | 285 | | return {std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>(), | 286 | | std::make_shared<DataTypeString>(), std::make_shared<DataTypeString>()}; | 287 | | } | 288 | 1 | } |
|
289 | | |
290 | | static Status execute_impl_inner(FunctionContext* context, Block& block, |
291 | | const ColumnNumbers& arguments, uint32_t result, |
292 | 501 | size_t input_rows_count) { |
293 | 501 | auto result_column = ColumnString::create(); |
294 | 501 | auto result_null_map_column = ColumnUInt8::create(input_rows_count, 0); |
295 | 501 | DCHECK_EQ(arguments.size(), arg_num); |
296 | 501 | const size_t argument_size = arg_num; |
297 | 501 | bool col_const[argument_size]; |
298 | 501 | ColumnPtr argument_columns[argument_size]; |
299 | 2.50k | for (int i = 0; i < argument_size; ++i) { |
300 | 2.00k | col_const[i] = is_column_const(*block.get_by_position(arguments[i]).column); |
301 | 2.00k | } |
302 | 501 | argument_columns[0] = col_const[0] ? static_cast<const ColumnConst&>( |
303 | 231 | *block.get_by_position(arguments[0]).column) |
304 | 231 | .convert_to_full_column() |
305 | 501 | : block.get_by_position(arguments[0]).column; |
306 | | |
307 | 501 | if constexpr (arg_num == 5) { |
308 | 0 | default_preprocess_parameter_columns(argument_columns, col_const, {1, 2, 3, 4}, block, |
309 | 0 | arguments); |
310 | 501 | } else { |
311 | 501 | default_preprocess_parameter_columns(argument_columns, col_const, {1, 2, 3}, block, |
312 | 501 | arguments); |
313 | 501 | } |
314 | | |
315 | 501 | auto& result_data = result_column->get_chars(); |
316 | 501 | auto& result_offset = result_column->get_offsets(); |
317 | 501 | result_offset.resize(input_rows_count); |
318 | | |
319 | 501 | if ((arg_num == 5) && col_const[1] && col_const[2] && col_const[3] && col_const[4]) { |
320 | 0 | vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()), |
321 | 0 | argument_columns[1]->get_data_at(0), argument_columns[2]->get_data_at(0), |
322 | 0 | argument_columns[3]->get_data_at(0), input_rows_count, result_data, |
323 | 0 | result_offset, result_null_map_column->get_data(), |
324 | 0 | argument_columns[4]->get_data_at(0)); |
325 | 501 | } else if ((arg_num == 4) && col_const[1] && col_const[2] && col_const[3]) { |
326 | 33 | vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()), |
327 | 33 | argument_columns[1]->get_data_at(0), argument_columns[2]->get_data_at(0), |
328 | 33 | argument_columns[3]->get_data_at(0), input_rows_count, result_data, |
329 | 33 | result_offset, result_null_map_column->get_data(), StringRef()); |
330 | 468 | } else { |
331 | 468 | std::vector<const ColumnString::Offsets*> offsets_list(argument_size); |
332 | 468 | std::vector<const ColumnString::Chars*> chars_list(argument_size); |
333 | 2.34k | for (size_t i = 0; i < argument_size; ++i) { |
334 | 1.87k | const auto* col_str = assert_cast<const ColumnString*>(argument_columns[i].get()); |
335 | 1.87k | offsets_list[i] = &col_str->get_offsets(); |
336 | 1.87k | chars_list[i] = &col_str->get_chars(); |
337 | 1.87k | } |
338 | 468 | vector_vector(offsets_list, chars_list, input_rows_count, result_data, result_offset, |
339 | 468 | result_null_map_column->get_data()); |
340 | 468 | } |
341 | 501 | block.get_by_position(result).column = |
342 | 501 | ColumnNullable::create(std::move(result_column), std::move(result_null_map_column)); |
343 | 501 | return Status::OK(); |
344 | 501 | } _ZN5doris29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1ELb1ELi4EE18execute_impl_innerEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 292 | 182 | size_t input_rows_count) { | 293 | 182 | auto result_column = ColumnString::create(); | 294 | 182 | auto result_null_map_column = ColumnUInt8::create(input_rows_count, 0); | 295 | 182 | DCHECK_EQ(arguments.size(), arg_num); | 296 | 182 | const size_t argument_size = arg_num; | 297 | 182 | bool col_const[argument_size]; | 298 | 182 | ColumnPtr argument_columns[argument_size]; | 299 | 910 | for (int i = 0; i < argument_size; ++i) { | 300 | 728 | col_const[i] = is_column_const(*block.get_by_position(arguments[i]).column); | 301 | 728 | } | 302 | 182 | argument_columns[0] = col_const[0] ? static_cast<const ColumnConst&>( | 303 | 84 | *block.get_by_position(arguments[0]).column) | 304 | 84 | .convert_to_full_column() | 305 | 182 | : block.get_by_position(arguments[0]).column; | 306 | | | 307 | | if constexpr (arg_num == 5) { | 308 | | default_preprocess_parameter_columns(argument_columns, col_const, {1, 2, 3, 4}, block, | 309 | | arguments); | 310 | 182 | } else { | 311 | 182 | default_preprocess_parameter_columns(argument_columns, col_const, {1, 2, 3}, block, | 312 | 182 | arguments); | 313 | 182 | } | 314 | | | 315 | 182 | auto& result_data = result_column->get_chars(); | 316 | 182 | auto& result_offset = result_column->get_offsets(); | 317 | 182 | result_offset.resize(input_rows_count); | 318 | | | 319 | 182 | if ((arg_num == 5) && col_const[1] && col_const[2] && col_const[3] && col_const[4]) { | 320 | 0 | vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()), | 321 | 0 | argument_columns[1]->get_data_at(0), argument_columns[2]->get_data_at(0), | 322 | 0 | argument_columns[3]->get_data_at(0), input_rows_count, result_data, | 323 | 0 | result_offset, result_null_map_column->get_data(), | 324 | 0 | argument_columns[4]->get_data_at(0)); | 325 | 182 | } else if ((arg_num == 4) && col_const[1] && col_const[2] && col_const[3]) { | 326 | 12 | vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()), | 327 | 12 | argument_columns[1]->get_data_at(0), argument_columns[2]->get_data_at(0), | 328 | 12 | argument_columns[3]->get_data_at(0), input_rows_count, result_data, | 329 | 12 | result_offset, result_null_map_column->get_data(), StringRef()); | 330 | 170 | } else { | 331 | 170 | std::vector<const ColumnString::Offsets*> offsets_list(argument_size); | 332 | 170 | std::vector<const ColumnString::Chars*> chars_list(argument_size); | 333 | 850 | for (size_t i = 0; i < argument_size; ++i) { | 334 | 680 | const auto* col_str = assert_cast<const ColumnString*>(argument_columns[i].get()); | 335 | 680 | offsets_list[i] = &col_str->get_offsets(); | 336 | 680 | chars_list[i] = &col_str->get_chars(); | 337 | 680 | } | 338 | 170 | vector_vector(offsets_list, chars_list, input_rows_count, result_data, result_offset, | 339 | 170 | result_null_map_column->get_data()); | 340 | 170 | } | 341 | 182 | block.get_by_position(result).column = | 342 | 182 | ColumnNullable::create(std::move(result_column), std::move(result_null_map_column)); | 343 | 182 | return Status::OK(); | 344 | 182 | } |
_ZN5doris29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0ELb1ELi4EE18execute_impl_innerEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 292 | 152 | size_t input_rows_count) { | 293 | 152 | auto result_column = ColumnString::create(); | 294 | 152 | auto result_null_map_column = ColumnUInt8::create(input_rows_count, 0); | 295 | 152 | DCHECK_EQ(arguments.size(), arg_num); | 296 | 152 | const size_t argument_size = arg_num; | 297 | 152 | bool col_const[argument_size]; | 298 | 152 | ColumnPtr argument_columns[argument_size]; | 299 | 760 | for (int i = 0; i < argument_size; ++i) { | 300 | 608 | col_const[i] = is_column_const(*block.get_by_position(arguments[i]).column); | 301 | 608 | } | 302 | 152 | argument_columns[0] = col_const[0] ? static_cast<const ColumnConst&>( | 303 | 70 | *block.get_by_position(arguments[0]).column) | 304 | 70 | .convert_to_full_column() | 305 | 152 | : block.get_by_position(arguments[0]).column; | 306 | | | 307 | | if constexpr (arg_num == 5) { | 308 | | default_preprocess_parameter_columns(argument_columns, col_const, {1, 2, 3, 4}, block, | 309 | | arguments); | 310 | 152 | } else { | 311 | 152 | default_preprocess_parameter_columns(argument_columns, col_const, {1, 2, 3}, block, | 312 | 152 | arguments); | 313 | 152 | } | 314 | | | 315 | 152 | auto& result_data = result_column->get_chars(); | 316 | 152 | auto& result_offset = result_column->get_offsets(); | 317 | 152 | result_offset.resize(input_rows_count); | 318 | | | 319 | 152 | if ((arg_num == 5) && col_const[1] && col_const[2] && col_const[3] && col_const[4]) { | 320 | 0 | vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()), | 321 | 0 | argument_columns[1]->get_data_at(0), argument_columns[2]->get_data_at(0), | 322 | 0 | argument_columns[3]->get_data_at(0), input_rows_count, result_data, | 323 | 0 | result_offset, result_null_map_column->get_data(), | 324 | 0 | argument_columns[4]->get_data_at(0)); | 325 | 152 | } else if ((arg_num == 4) && col_const[1] && col_const[2] && col_const[3]) { | 326 | 10 | vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()), | 327 | 10 | argument_columns[1]->get_data_at(0), argument_columns[2]->get_data_at(0), | 328 | 10 | argument_columns[3]->get_data_at(0), input_rows_count, result_data, | 329 | 10 | result_offset, result_null_map_column->get_data(), StringRef()); | 330 | 142 | } else { | 331 | 142 | std::vector<const ColumnString::Offsets*> offsets_list(argument_size); | 332 | 142 | std::vector<const ColumnString::Chars*> chars_list(argument_size); | 333 | 710 | for (size_t i = 0; i < argument_size; ++i) { | 334 | 568 | const auto* col_str = assert_cast<const ColumnString*>(argument_columns[i].get()); | 335 | 568 | offsets_list[i] = &col_str->get_offsets(); | 336 | 568 | chars_list[i] = &col_str->get_chars(); | 337 | 568 | } | 338 | 142 | vector_vector(offsets_list, chars_list, input_rows_count, result_data, result_offset, | 339 | 142 | result_null_map_column->get_data()); | 340 | 142 | } | 341 | 152 | block.get_by_position(result).column = | 342 | 152 | ColumnNullable::create(std::move(result_column), std::move(result_null_map_column)); | 343 | 152 | return Status::OK(); | 344 | 152 | } |
_ZN5doris29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1ELb0ELi4EE18execute_impl_innerEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 292 | 91 | size_t input_rows_count) { | 293 | 91 | auto result_column = ColumnString::create(); | 294 | 91 | auto result_null_map_column = ColumnUInt8::create(input_rows_count, 0); | 295 | 91 | DCHECK_EQ(arguments.size(), arg_num); | 296 | 91 | const size_t argument_size = arg_num; | 297 | 91 | bool col_const[argument_size]; | 298 | 91 | ColumnPtr argument_columns[argument_size]; | 299 | 455 | for (int i = 0; i < argument_size; ++i) { | 300 | 364 | col_const[i] = is_column_const(*block.get_by_position(arguments[i]).column); | 301 | 364 | } | 302 | 91 | argument_columns[0] = col_const[0] ? static_cast<const ColumnConst&>( | 303 | 42 | *block.get_by_position(arguments[0]).column) | 304 | 42 | .convert_to_full_column() | 305 | 91 | : block.get_by_position(arguments[0]).column; | 306 | | | 307 | | if constexpr (arg_num == 5) { | 308 | | default_preprocess_parameter_columns(argument_columns, col_const, {1, 2, 3, 4}, block, | 309 | | arguments); | 310 | 91 | } else { | 311 | 91 | default_preprocess_parameter_columns(argument_columns, col_const, {1, 2, 3}, block, | 312 | 91 | arguments); | 313 | 91 | } | 314 | | | 315 | 91 | auto& result_data = result_column->get_chars(); | 316 | 91 | auto& result_offset = result_column->get_offsets(); | 317 | 91 | result_offset.resize(input_rows_count); | 318 | | | 319 | 91 | if ((arg_num == 5) && col_const[1] && col_const[2] && col_const[3] && col_const[4]) { | 320 | 0 | vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()), | 321 | 0 | argument_columns[1]->get_data_at(0), argument_columns[2]->get_data_at(0), | 322 | 0 | argument_columns[3]->get_data_at(0), input_rows_count, result_data, | 323 | 0 | result_offset, result_null_map_column->get_data(), | 324 | 0 | argument_columns[4]->get_data_at(0)); | 325 | 91 | } else if ((arg_num == 4) && col_const[1] && col_const[2] && col_const[3]) { | 326 | 6 | vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()), | 327 | 6 | argument_columns[1]->get_data_at(0), argument_columns[2]->get_data_at(0), | 328 | 6 | argument_columns[3]->get_data_at(0), input_rows_count, result_data, | 329 | 6 | result_offset, result_null_map_column->get_data(), StringRef()); | 330 | 85 | } else { | 331 | 85 | std::vector<const ColumnString::Offsets*> offsets_list(argument_size); | 332 | 85 | std::vector<const ColumnString::Chars*> chars_list(argument_size); | 333 | 425 | for (size_t i = 0; i < argument_size; ++i) { | 334 | 340 | const auto* col_str = assert_cast<const ColumnString*>(argument_columns[i].get()); | 335 | 340 | offsets_list[i] = &col_str->get_offsets(); | 336 | 340 | chars_list[i] = &col_str->get_chars(); | 337 | 340 | } | 338 | 85 | vector_vector(offsets_list, chars_list, input_rows_count, result_data, result_offset, | 339 | 85 | result_null_map_column->get_data()); | 340 | 85 | } | 341 | 91 | block.get_by_position(result).column = | 342 | 91 | ColumnNullable::create(std::move(result_column), std::move(result_null_map_column)); | 343 | 91 | return Status::OK(); | 344 | 91 | } |
_ZN5doris29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0ELb0ELi4EE18execute_impl_innerEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Line | Count | Source | 292 | 76 | size_t input_rows_count) { | 293 | 76 | auto result_column = ColumnString::create(); | 294 | 76 | auto result_null_map_column = ColumnUInt8::create(input_rows_count, 0); | 295 | 76 | DCHECK_EQ(arguments.size(), arg_num); | 296 | 76 | const size_t argument_size = arg_num; | 297 | 76 | bool col_const[argument_size]; | 298 | 76 | ColumnPtr argument_columns[argument_size]; | 299 | 380 | for (int i = 0; i < argument_size; ++i) { | 300 | 304 | col_const[i] = is_column_const(*block.get_by_position(arguments[i]).column); | 301 | 304 | } | 302 | 76 | argument_columns[0] = col_const[0] ? static_cast<const ColumnConst&>( | 303 | 35 | *block.get_by_position(arguments[0]).column) | 304 | 35 | .convert_to_full_column() | 305 | 76 | : block.get_by_position(arguments[0]).column; | 306 | | | 307 | | if constexpr (arg_num == 5) { | 308 | | default_preprocess_parameter_columns(argument_columns, col_const, {1, 2, 3, 4}, block, | 309 | | arguments); | 310 | 76 | } else { | 311 | 76 | default_preprocess_parameter_columns(argument_columns, col_const, {1, 2, 3}, block, | 312 | 76 | arguments); | 313 | 76 | } | 314 | | | 315 | 76 | auto& result_data = result_column->get_chars(); | 316 | 76 | auto& result_offset = result_column->get_offsets(); | 317 | 76 | result_offset.resize(input_rows_count); | 318 | | | 319 | 76 | if ((arg_num == 5) && col_const[1] && col_const[2] && col_const[3] && col_const[4]) { | 320 | 0 | vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()), | 321 | 0 | argument_columns[1]->get_data_at(0), argument_columns[2]->get_data_at(0), | 322 | 0 | argument_columns[3]->get_data_at(0), input_rows_count, result_data, | 323 | 0 | result_offset, result_null_map_column->get_data(), | 324 | 0 | argument_columns[4]->get_data_at(0)); | 325 | 76 | } else if ((arg_num == 4) && col_const[1] && col_const[2] && col_const[3]) { | 326 | 5 | vector_const(assert_cast<const ColumnString*>(argument_columns[0].get()), | 327 | 5 | argument_columns[1]->get_data_at(0), argument_columns[2]->get_data_at(0), | 328 | 5 | argument_columns[3]->get_data_at(0), input_rows_count, result_data, | 329 | 5 | result_offset, result_null_map_column->get_data(), StringRef()); | 330 | 71 | } else { | 331 | 71 | std::vector<const ColumnString::Offsets*> offsets_list(argument_size); | 332 | 71 | std::vector<const ColumnString::Chars*> chars_list(argument_size); | 333 | 355 | for (size_t i = 0; i < argument_size; ++i) { | 334 | 284 | const auto* col_str = assert_cast<const ColumnString*>(argument_columns[i].get()); | 335 | 284 | offsets_list[i] = &col_str->get_offsets(); | 336 | 284 | chars_list[i] = &col_str->get_chars(); | 337 | 284 | } | 338 | 71 | vector_vector(offsets_list, chars_list, input_rows_count, result_data, result_offset, | 339 | 71 | result_null_map_column->get_data()); | 340 | 71 | } | 341 | 76 | block.get_by_position(result).column = | 342 | 76 | ColumnNullable::create(std::move(result_column), std::move(result_null_map_column)); | 343 | 76 | return Status::OK(); | 344 | 76 | } |
Unexecuted instantiation: _ZN5doris29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE24ELb1ELb0ELi5EE18execute_impl_innerEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm Unexecuted instantiation: _ZN5doris29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE24ELb0ELb0ELi5EE18execute_impl_innerEPNS_15FunctionContextERNS_5BlockERKSt6vectorIjSaIjEEjm |
345 | | |
346 | | static void vector_const(const ColumnString* column, StringRef key_arg, StringRef iv_arg, |
347 | | StringRef mode_arg, size_t input_rows_count, |
348 | | ColumnString::Chars& result_data, ColumnString::Offsets& result_offset, |
349 | 33 | NullMap& null_map, StringRef aad_arg) { |
350 | 33 | EncryptionMode encryption_mode = mode; |
351 | 33 | bool all_insert_null = false; |
352 | 33 | if (mode_arg.size != 0) { |
353 | 33 | std::string mode_str(mode_arg.data, mode_arg.size); |
354 | 33 | if constexpr (is_sm_mode) { |
355 | 22 | if (sm4_mode_map.count(mode_str) == 0) { |
356 | 0 | all_insert_null = true; |
357 | 22 | } else { |
358 | 22 | encryption_mode = sm4_mode_map.at(mode_str); |
359 | 22 | } |
360 | 22 | } else { |
361 | 11 | if (aes_mode_map.count(mode_str) == 0) { |
362 | 0 | all_insert_null = true; |
363 | 11 | } else { |
364 | 11 | encryption_mode = aes_mode_map.at(mode_str); |
365 | 11 | } |
366 | 11 | } |
367 | 33 | } |
368 | | |
369 | 33 | const ColumnString::Offsets* offsets_column = &column->get_offsets(); |
370 | 33 | const ColumnString::Chars* chars_column = &column->get_chars(); |
371 | 66 | for (int i = 0; i < input_rows_count; ++i) { |
372 | 33 | if (all_insert_null || null_map[i]) { |
373 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); |
374 | 0 | continue; |
375 | 0 | } |
376 | 33 | execute_result_const<Impl, is_encrypt>( |
377 | 33 | offsets_column, chars_column, key_arg, i, encryption_mode, iv_arg.data, |
378 | 33 | iv_arg.size, result_data, result_offset, null_map, aad_arg.data, aad_arg.size); |
379 | 33 | } |
380 | 33 | } _ZN5doris29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1ELb1ELi4EE12vector_constEPKNS_9ColumnStrIjEENS_9StringRefES8_S8_mRNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEERNS9_IjLm4096ESC_Lm16ELm15EEESE_S8_ Line | Count | Source | 349 | 12 | NullMap& null_map, StringRef aad_arg) { | 350 | 12 | EncryptionMode encryption_mode = mode; | 351 | 12 | bool all_insert_null = false; | 352 | 12 | if (mode_arg.size != 0) { | 353 | 12 | std::string mode_str(mode_arg.data, mode_arg.size); | 354 | 12 | if constexpr (is_sm_mode) { | 355 | 12 | if (sm4_mode_map.count(mode_str) == 0) { | 356 | 0 | all_insert_null = true; | 357 | 12 | } else { | 358 | 12 | encryption_mode = sm4_mode_map.at(mode_str); | 359 | 12 | } | 360 | | } else { | 361 | | if (aes_mode_map.count(mode_str) == 0) { | 362 | | all_insert_null = true; | 363 | | } else { | 364 | | encryption_mode = aes_mode_map.at(mode_str); | 365 | | } | 366 | | } | 367 | 12 | } | 368 | | | 369 | 12 | const ColumnString::Offsets* offsets_column = &column->get_offsets(); | 370 | 12 | const ColumnString::Chars* chars_column = &column->get_chars(); | 371 | 24 | for (int i = 0; i < input_rows_count; ++i) { | 372 | 12 | if (all_insert_null || null_map[i]) { | 373 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 374 | 0 | continue; | 375 | 0 | } | 376 | 12 | execute_result_const<Impl, is_encrypt>( | 377 | 12 | offsets_column, chars_column, key_arg, i, encryption_mode, iv_arg.data, | 378 | 12 | iv_arg.size, result_data, result_offset, null_map, aad_arg.data, aad_arg.size); | 379 | 12 | } | 380 | 12 | } |
_ZN5doris29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0ELb1ELi4EE12vector_constEPKNS_9ColumnStrIjEENS_9StringRefES8_S8_mRNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEERNS9_IjLm4096ESC_Lm16ELm15EEESE_S8_ Line | Count | Source | 349 | 10 | NullMap& null_map, StringRef aad_arg) { | 350 | 10 | EncryptionMode encryption_mode = mode; | 351 | 10 | bool all_insert_null = false; | 352 | 10 | if (mode_arg.size != 0) { | 353 | 10 | std::string mode_str(mode_arg.data, mode_arg.size); | 354 | 10 | if constexpr (is_sm_mode) { | 355 | 10 | if (sm4_mode_map.count(mode_str) == 0) { | 356 | 0 | all_insert_null = true; | 357 | 10 | } else { | 358 | 10 | encryption_mode = sm4_mode_map.at(mode_str); | 359 | 10 | } | 360 | | } else { | 361 | | if (aes_mode_map.count(mode_str) == 0) { | 362 | | all_insert_null = true; | 363 | | } else { | 364 | | encryption_mode = aes_mode_map.at(mode_str); | 365 | | } | 366 | | } | 367 | 10 | } | 368 | | | 369 | 10 | const ColumnString::Offsets* offsets_column = &column->get_offsets(); | 370 | 10 | const ColumnString::Chars* chars_column = &column->get_chars(); | 371 | 20 | for (int i = 0; i < input_rows_count; ++i) { | 372 | 10 | if (all_insert_null || null_map[i]) { | 373 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 374 | 0 | continue; | 375 | 0 | } | 376 | 10 | execute_result_const<Impl, is_encrypt>( | 377 | 10 | offsets_column, chars_column, key_arg, i, encryption_mode, iv_arg.data, | 378 | 10 | iv_arg.size, result_data, result_offset, null_map, aad_arg.data, aad_arg.size); | 379 | 10 | } | 380 | 10 | } |
_ZN5doris29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1ELb0ELi4EE12vector_constEPKNS_9ColumnStrIjEENS_9StringRefES8_S8_mRNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEERNS9_IjLm4096ESC_Lm16ELm15EEESE_S8_ Line | Count | Source | 349 | 6 | NullMap& null_map, StringRef aad_arg) { | 350 | 6 | EncryptionMode encryption_mode = mode; | 351 | 6 | bool all_insert_null = false; | 352 | 6 | if (mode_arg.size != 0) { | 353 | 6 | std::string mode_str(mode_arg.data, mode_arg.size); | 354 | | if constexpr (is_sm_mode) { | 355 | | if (sm4_mode_map.count(mode_str) == 0) { | 356 | | all_insert_null = true; | 357 | | } else { | 358 | | encryption_mode = sm4_mode_map.at(mode_str); | 359 | | } | 360 | 6 | } else { | 361 | 6 | if (aes_mode_map.count(mode_str) == 0) { | 362 | 0 | all_insert_null = true; | 363 | 6 | } else { | 364 | 6 | encryption_mode = aes_mode_map.at(mode_str); | 365 | 6 | } | 366 | 6 | } | 367 | 6 | } | 368 | | | 369 | 6 | const ColumnString::Offsets* offsets_column = &column->get_offsets(); | 370 | 6 | const ColumnString::Chars* chars_column = &column->get_chars(); | 371 | 12 | for (int i = 0; i < input_rows_count; ++i) { | 372 | 6 | if (all_insert_null || null_map[i]) { | 373 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 374 | 0 | continue; | 375 | 0 | } | 376 | 6 | execute_result_const<Impl, is_encrypt>( | 377 | 6 | offsets_column, chars_column, key_arg, i, encryption_mode, iv_arg.data, | 378 | 6 | iv_arg.size, result_data, result_offset, null_map, aad_arg.data, aad_arg.size); | 379 | 6 | } | 380 | 6 | } |
_ZN5doris29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0ELb0ELi4EE12vector_constEPKNS_9ColumnStrIjEENS_9StringRefES8_S8_mRNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEERNS9_IjLm4096ESC_Lm16ELm15EEESE_S8_ Line | Count | Source | 349 | 5 | NullMap& null_map, StringRef aad_arg) { | 350 | 5 | EncryptionMode encryption_mode = mode; | 351 | 5 | bool all_insert_null = false; | 352 | 5 | if (mode_arg.size != 0) { | 353 | 5 | std::string mode_str(mode_arg.data, mode_arg.size); | 354 | | if constexpr (is_sm_mode) { | 355 | | if (sm4_mode_map.count(mode_str) == 0) { | 356 | | all_insert_null = true; | 357 | | } else { | 358 | | encryption_mode = sm4_mode_map.at(mode_str); | 359 | | } | 360 | 5 | } else { | 361 | 5 | if (aes_mode_map.count(mode_str) == 0) { | 362 | 0 | all_insert_null = true; | 363 | 5 | } else { | 364 | 5 | encryption_mode = aes_mode_map.at(mode_str); | 365 | 5 | } | 366 | 5 | } | 367 | 5 | } | 368 | | | 369 | 5 | const ColumnString::Offsets* offsets_column = &column->get_offsets(); | 370 | 5 | const ColumnString::Chars* chars_column = &column->get_chars(); | 371 | 10 | for (int i = 0; i < input_rows_count; ++i) { | 372 | 5 | if (all_insert_null || null_map[i]) { | 373 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 374 | 0 | continue; | 375 | 0 | } | 376 | 5 | execute_result_const<Impl, is_encrypt>( | 377 | 5 | offsets_column, chars_column, key_arg, i, encryption_mode, iv_arg.data, | 378 | 5 | iv_arg.size, result_data, result_offset, null_map, aad_arg.data, aad_arg.size); | 379 | 5 | } | 380 | 5 | } |
Unexecuted instantiation: _ZN5doris29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE24ELb1ELb0ELi5EE12vector_constEPKNS_9ColumnStrIjEENS_9StringRefES8_S8_mRNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEERNS9_IjLm4096ESC_Lm16ELm15EEESE_S8_ Unexecuted instantiation: _ZN5doris29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE24ELb0ELb0ELi5EE12vector_constEPKNS_9ColumnStrIjEENS_9StringRefES8_S8_mRNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEERNS9_IjLm4096ESC_Lm16ELm15EEESE_S8_ |
381 | | |
382 | | static void vector_vector(std::vector<const ColumnString::Offsets*>& offsets_list, |
383 | | std::vector<const ColumnString::Chars*>& chars_list, |
384 | | size_t input_rows_count, ColumnString::Chars& result_data, |
385 | 468 | ColumnString::Offsets& result_offset, NullMap& null_map) { |
386 | 969 | for (int i = 0; i < input_rows_count; ++i) { |
387 | 501 | if (null_map[i]) { |
388 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); |
389 | 0 | continue; |
390 | 0 | } |
391 | | |
392 | 501 | EncryptionMode encryption_mode = mode; |
393 | 501 | int mode_size = (*offsets_list[3])[i] - (*offsets_list[3])[i - 1]; |
394 | 501 | int iv_size = (*offsets_list[2])[i] - (*offsets_list[2])[i - 1]; |
395 | 501 | const auto* mode_raw = |
396 | 501 | reinterpret_cast<const char*>(&(*chars_list[3])[(*offsets_list[3])[i - 1]]); |
397 | 501 | const auto* iv_raw = |
398 | 501 | reinterpret_cast<const char*>(&(*chars_list[2])[(*offsets_list[2])[i - 1]]); |
399 | 501 | if (mode_size != 0) { |
400 | 501 | std::string mode_str(mode_raw, mode_size); |
401 | 501 | if constexpr (is_sm_mode) { |
402 | 334 | if (sm4_mode_map.count(mode_str) == 0) { |
403 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); |
404 | 0 | continue; |
405 | 0 | } |
406 | 334 | encryption_mode = sm4_mode_map.at(mode_str); |
407 | 334 | } else { |
408 | 167 | if (aes_mode_map.count(mode_str) == 0) { |
409 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); |
410 | 0 | continue; |
411 | 0 | } |
412 | 167 | encryption_mode = aes_mode_map.at(mode_str); |
413 | 167 | } |
414 | 501 | } |
415 | | |
416 | 0 | int aad_size = 0; |
417 | 501 | const char* aad = nullptr; |
418 | 501 | if constexpr (arg_num == 5) { |
419 | 0 | aad_size = (*offsets_list[4])[i] - (*offsets_list[4])[i - 1]; |
420 | 0 | aad = reinterpret_cast<const char*>(&(*chars_list[4])[(*offsets_list[4])[i - 1]]); |
421 | 0 | } |
422 | | |
423 | 501 | execute_result_vector<Impl, is_encrypt>(offsets_list, chars_list, i, encryption_mode, |
424 | 501 | iv_raw, iv_size, result_data, result_offset, |
425 | 501 | null_map, aad, aad_size); |
426 | 501 | } |
427 | 468 | } _ZN5doris29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE27ELb1ELb1ELi4EE13vector_vectorERSt6vectorIPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEESaISB_EERS4_IPKNS5_IhLm4096ES8_Lm16ELm15EEESaISH_EEmRSF_RS9_SL_ Line | Count | Source | 385 | 170 | ColumnString::Offsets& result_offset, NullMap& null_map) { | 386 | 352 | for (int i = 0; i < input_rows_count; ++i) { | 387 | 182 | if (null_map[i]) { | 388 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 389 | 0 | continue; | 390 | 0 | } | 391 | | | 392 | 182 | EncryptionMode encryption_mode = mode; | 393 | 182 | int mode_size = (*offsets_list[3])[i] - (*offsets_list[3])[i - 1]; | 394 | 182 | int iv_size = (*offsets_list[2])[i] - (*offsets_list[2])[i - 1]; | 395 | 182 | const auto* mode_raw = | 396 | 182 | reinterpret_cast<const char*>(&(*chars_list[3])[(*offsets_list[3])[i - 1]]); | 397 | 182 | const auto* iv_raw = | 398 | 182 | reinterpret_cast<const char*>(&(*chars_list[2])[(*offsets_list[2])[i - 1]]); | 399 | 182 | if (mode_size != 0) { | 400 | 182 | std::string mode_str(mode_raw, mode_size); | 401 | 182 | if constexpr (is_sm_mode) { | 402 | 182 | if (sm4_mode_map.count(mode_str) == 0) { | 403 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 404 | 0 | continue; | 405 | 0 | } | 406 | 182 | encryption_mode = sm4_mode_map.at(mode_str); | 407 | | } else { | 408 | | if (aes_mode_map.count(mode_str) == 0) { | 409 | | StringOP::push_null_string(i, result_data, result_offset, null_map); | 410 | | continue; | 411 | | } | 412 | | encryption_mode = aes_mode_map.at(mode_str); | 413 | | } | 414 | 182 | } | 415 | | | 416 | 0 | int aad_size = 0; | 417 | 182 | const char* aad = nullptr; | 418 | | if constexpr (arg_num == 5) { | 419 | | aad_size = (*offsets_list[4])[i] - (*offsets_list[4])[i - 1]; | 420 | | aad = reinterpret_cast<const char*>(&(*chars_list[4])[(*offsets_list[4])[i - 1]]); | 421 | | } | 422 | | | 423 | 182 | execute_result_vector<Impl, is_encrypt>(offsets_list, chars_list, i, encryption_mode, | 424 | 182 | iv_raw, iv_size, result_data, result_offset, | 425 | 182 | null_map, aad, aad_size); | 426 | 182 | } | 427 | 170 | } |
_ZN5doris29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE27ELb0ELb1ELi4EE13vector_vectorERSt6vectorIPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEESaISB_EERS4_IPKNS5_IhLm4096ES8_Lm16ELm15EEESaISH_EEmRSF_RS9_SL_ Line | Count | Source | 385 | 142 | ColumnString::Offsets& result_offset, NullMap& null_map) { | 386 | 294 | for (int i = 0; i < input_rows_count; ++i) { | 387 | 152 | if (null_map[i]) { | 388 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 389 | 0 | continue; | 390 | 0 | } | 391 | | | 392 | 152 | EncryptionMode encryption_mode = mode; | 393 | 152 | int mode_size = (*offsets_list[3])[i] - (*offsets_list[3])[i - 1]; | 394 | 152 | int iv_size = (*offsets_list[2])[i] - (*offsets_list[2])[i - 1]; | 395 | 152 | const auto* mode_raw = | 396 | 152 | reinterpret_cast<const char*>(&(*chars_list[3])[(*offsets_list[3])[i - 1]]); | 397 | 152 | const auto* iv_raw = | 398 | 152 | reinterpret_cast<const char*>(&(*chars_list[2])[(*offsets_list[2])[i - 1]]); | 399 | 152 | if (mode_size != 0) { | 400 | 152 | std::string mode_str(mode_raw, mode_size); | 401 | 152 | if constexpr (is_sm_mode) { | 402 | 152 | if (sm4_mode_map.count(mode_str) == 0) { | 403 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 404 | 0 | continue; | 405 | 0 | } | 406 | 152 | encryption_mode = sm4_mode_map.at(mode_str); | 407 | | } else { | 408 | | if (aes_mode_map.count(mode_str) == 0) { | 409 | | StringOP::push_null_string(i, result_data, result_offset, null_map); | 410 | | continue; | 411 | | } | 412 | | encryption_mode = aes_mode_map.at(mode_str); | 413 | | } | 414 | 152 | } | 415 | | | 416 | 0 | int aad_size = 0; | 417 | 152 | const char* aad = nullptr; | 418 | | if constexpr (arg_num == 5) { | 419 | | aad_size = (*offsets_list[4])[i] - (*offsets_list[4])[i - 1]; | 420 | | aad = reinterpret_cast<const char*>(&(*chars_list[4])[(*offsets_list[4])[i - 1]]); | 421 | | } | 422 | | | 423 | 152 | execute_result_vector<Impl, is_encrypt>(offsets_list, chars_list, i, encryption_mode, | 424 | 152 | iv_raw, iv_size, result_data, result_offset, | 425 | 152 | null_map, aad, aad_size); | 426 | 152 | } | 427 | 142 | } |
_ZN5doris29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE0ELb1ELb0ELi4EE13vector_vectorERSt6vectorIPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEESaISB_EERS4_IPKNS5_IhLm4096ES8_Lm16ELm15EEESaISH_EEmRSF_RS9_SL_ Line | Count | Source | 385 | 85 | ColumnString::Offsets& result_offset, NullMap& null_map) { | 386 | 176 | for (int i = 0; i < input_rows_count; ++i) { | 387 | 91 | if (null_map[i]) { | 388 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 389 | 0 | continue; | 390 | 0 | } | 391 | | | 392 | 91 | EncryptionMode encryption_mode = mode; | 393 | 91 | int mode_size = (*offsets_list[3])[i] - (*offsets_list[3])[i - 1]; | 394 | 91 | int iv_size = (*offsets_list[2])[i] - (*offsets_list[2])[i - 1]; | 395 | 91 | const auto* mode_raw = | 396 | 91 | reinterpret_cast<const char*>(&(*chars_list[3])[(*offsets_list[3])[i - 1]]); | 397 | 91 | const auto* iv_raw = | 398 | 91 | reinterpret_cast<const char*>(&(*chars_list[2])[(*offsets_list[2])[i - 1]]); | 399 | 91 | if (mode_size != 0) { | 400 | 91 | std::string mode_str(mode_raw, mode_size); | 401 | | if constexpr (is_sm_mode) { | 402 | | if (sm4_mode_map.count(mode_str) == 0) { | 403 | | StringOP::push_null_string(i, result_data, result_offset, null_map); | 404 | | continue; | 405 | | } | 406 | | encryption_mode = sm4_mode_map.at(mode_str); | 407 | 91 | } else { | 408 | 91 | if (aes_mode_map.count(mode_str) == 0) { | 409 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 410 | 0 | continue; | 411 | 0 | } | 412 | 91 | encryption_mode = aes_mode_map.at(mode_str); | 413 | 91 | } | 414 | 91 | } | 415 | | | 416 | 0 | int aad_size = 0; | 417 | 91 | const char* aad = nullptr; | 418 | | if constexpr (arg_num == 5) { | 419 | | aad_size = (*offsets_list[4])[i] - (*offsets_list[4])[i - 1]; | 420 | | aad = reinterpret_cast<const char*>(&(*chars_list[4])[(*offsets_list[4])[i - 1]]); | 421 | | } | 422 | | | 423 | 91 | execute_result_vector<Impl, is_encrypt>(offsets_list, chars_list, i, encryption_mode, | 424 | 91 | iv_raw, iv_size, result_data, result_offset, | 425 | 91 | null_map, aad, aad_size); | 426 | 91 | } | 427 | 85 | } |
_ZN5doris29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE0ELb0ELb0ELi4EE13vector_vectorERSt6vectorIPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEESaISB_EERS4_IPKNS5_IhLm4096ES8_Lm16ELm15EEESaISH_EEmRSF_RS9_SL_ Line | Count | Source | 385 | 71 | ColumnString::Offsets& result_offset, NullMap& null_map) { | 386 | 147 | for (int i = 0; i < input_rows_count; ++i) { | 387 | 76 | if (null_map[i]) { | 388 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 389 | 0 | continue; | 390 | 0 | } | 391 | | | 392 | 76 | EncryptionMode encryption_mode = mode; | 393 | 76 | int mode_size = (*offsets_list[3])[i] - (*offsets_list[3])[i - 1]; | 394 | 76 | int iv_size = (*offsets_list[2])[i] - (*offsets_list[2])[i - 1]; | 395 | 76 | const auto* mode_raw = | 396 | 76 | reinterpret_cast<const char*>(&(*chars_list[3])[(*offsets_list[3])[i - 1]]); | 397 | 76 | const auto* iv_raw = | 398 | 76 | reinterpret_cast<const char*>(&(*chars_list[2])[(*offsets_list[2])[i - 1]]); | 399 | 76 | if (mode_size != 0) { | 400 | 76 | std::string mode_str(mode_raw, mode_size); | 401 | | if constexpr (is_sm_mode) { | 402 | | if (sm4_mode_map.count(mode_str) == 0) { | 403 | | StringOP::push_null_string(i, result_data, result_offset, null_map); | 404 | | continue; | 405 | | } | 406 | | encryption_mode = sm4_mode_map.at(mode_str); | 407 | 76 | } else { | 408 | 76 | if (aes_mode_map.count(mode_str) == 0) { | 409 | 0 | StringOP::push_null_string(i, result_data, result_offset, null_map); | 410 | 0 | continue; | 411 | 0 | } | 412 | 76 | encryption_mode = aes_mode_map.at(mode_str); | 413 | 76 | } | 414 | 76 | } | 415 | | | 416 | 0 | int aad_size = 0; | 417 | 76 | const char* aad = nullptr; | 418 | | if constexpr (arg_num == 5) { | 419 | | aad_size = (*offsets_list[4])[i] - (*offsets_list[4])[i - 1]; | 420 | | aad = reinterpret_cast<const char*>(&(*chars_list[4])[(*offsets_list[4])[i - 1]]); | 421 | | } | 422 | | | 423 | 76 | execute_result_vector<Impl, is_encrypt>(offsets_list, chars_list, i, encryption_mode, | 424 | 76 | iv_raw, iv_size, result_data, result_offset, | 425 | 76 | null_map, aad, aad_size); | 426 | 76 | } | 427 | 71 | } |
Unexecuted instantiation: _ZN5doris29EncryptionAndDecryptMultiImplINS_11EncryptImplELNS_14EncryptionModeE24ELb1ELb0ELi5EE13vector_vectorERSt6vectorIPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEESaISB_EERS4_IPKNS5_IhLm4096ES8_Lm16ELm15EEESaISH_EEmRSF_RS9_SL_ Unexecuted instantiation: _ZN5doris29EncryptionAndDecryptMultiImplINS_11DecryptImplELNS_14EncryptionModeE24ELb0ELb0ELi5EE13vector_vectorERSt6vectorIPKNS_8PODArrayIjLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb0EEELm16ELm15EEESaISB_EERS4_IPKNS5_IhLm4096ES8_Lm16ELm15EEESaISH_EEmRSF_RS9_SL_ |
428 | | }; |
429 | | |
430 | | struct EncryptImpl { |
431 | | static int execute_impl(EncryptionMode mode, const unsigned char* source, size_t source_length, |
432 | | const unsigned char* key, size_t key_length, const char* iv, |
433 | | size_t iv_length, bool padding, unsigned char* encrypt, |
434 | 340 | const unsigned char* aad, size_t aad_length) { |
435 | | // now the openssl only support int, so here we need to cast size_t to uint32_t |
436 | 340 | return EncryptionUtil::encrypt(mode, source, cast_set<uint32_t>(source_length), key, |
437 | 340 | cast_set<uint32_t>(key_length), iv, cast_set<int>(iv_length), |
438 | 340 | true, encrypt, aad, cast_set<uint32_t>(aad_length)); |
439 | 340 | } |
440 | | }; |
441 | | |
442 | | struct DecryptImpl { |
443 | | static int execute_impl(EncryptionMode mode, const unsigned char* source, size_t source_length, |
444 | | const unsigned char* key, size_t key_length, const char* iv, |
445 | | size_t iv_length, bool padding, unsigned char* encrypt, |
446 | 284 | const unsigned char* aad, size_t aad_length) { |
447 | 284 | return EncryptionUtil::decrypt(mode, source, cast_set<uint32_t>(source_length), key, |
448 | 284 | cast_set<uint32_t>(key_length), iv, cast_set<int>(iv_length), |
449 | 284 | true, encrypt, aad, cast_set<uint32_t>(aad_length)); |
450 | 284 | } |
451 | | }; |
452 | | |
453 | | struct SM4EncryptName { |
454 | | static constexpr auto name = "sm4_encrypt"; |
455 | | }; |
456 | | |
457 | | struct SM4DecryptName { |
458 | | static constexpr auto name = "sm4_decrypt"; |
459 | | }; |
460 | | |
461 | | struct AESEncryptName { |
462 | | static constexpr auto name = "aes_encrypt"; |
463 | | }; |
464 | | |
465 | | struct AESDecryptName { |
466 | | static constexpr auto name = "aes_decrypt"; |
467 | | }; |
468 | | |
469 | 1 | void register_function_encryption(SimpleFunctionFactory& factory) { |
470 | 1 | factory.register_function<FunctionEncryptionAndDecrypt< |
471 | 1 | EncryptionAndDecryptTwoImpl<EncryptImpl, EncryptionMode::SM4_128_ECB, true>, |
472 | 1 | SM4EncryptName>>(); |
473 | 1 | factory.register_function<FunctionEncryptionAndDecrypt< |
474 | 1 | EncryptionAndDecryptTwoImpl<DecryptImpl, EncryptionMode::SM4_128_ECB, false>, |
475 | 1 | SM4DecryptName>>(); |
476 | 1 | factory.register_function<FunctionEncryptionAndDecrypt< |
477 | 1 | EncryptionAndDecryptTwoImpl<EncryptImpl, EncryptionMode::AES_128_ECB, true>, |
478 | 1 | AESEncryptName>>(); |
479 | 1 | factory.register_function<FunctionEncryptionAndDecrypt< |
480 | 1 | EncryptionAndDecryptTwoImpl<DecryptImpl, EncryptionMode::AES_128_ECB, false>, |
481 | 1 | AESDecryptName>>(); |
482 | | |
483 | 1 | factory.register_function<FunctionEncryptionAndDecrypt< |
484 | 1 | EncryptionAndDecryptMultiImpl<EncryptImpl, EncryptionMode::SM4_128_ECB, true, true>, |
485 | 1 | SM4EncryptName>>(); |
486 | 1 | factory.register_function<FunctionEncryptionAndDecrypt< |
487 | 1 | EncryptionAndDecryptMultiImpl<DecryptImpl, EncryptionMode::SM4_128_ECB, false, true>, |
488 | 1 | SM4DecryptName>>(); |
489 | 1 | factory.register_function<FunctionEncryptionAndDecrypt< |
490 | 1 | EncryptionAndDecryptMultiImpl<EncryptImpl, EncryptionMode::AES_128_ECB, true, false>, |
491 | 1 | AESEncryptName>>(); |
492 | 1 | factory.register_function<FunctionEncryptionAndDecrypt< |
493 | 1 | EncryptionAndDecryptMultiImpl<DecryptImpl, EncryptionMode::AES_128_ECB, false, false>, |
494 | 1 | AESDecryptName>>(); |
495 | | |
496 | 1 | factory.register_function<FunctionEncryptionAndDecrypt< |
497 | 1 | EncryptionAndDecryptMultiImpl<EncryptImpl, EncryptionMode::AES_128_GCM, true, false, 5>, |
498 | 1 | AESEncryptName>>(); |
499 | 1 | factory.register_function<FunctionEncryptionAndDecrypt< |
500 | 1 | EncryptionAndDecryptMultiImpl<DecryptImpl, EncryptionMode::AES_128_GCM, false, false, |
501 | 1 | 5>, |
502 | 1 | AESDecryptName>>(); |
503 | 1 | } |
504 | | |
505 | | } // namespace doris |