|
8 | 8 | * |
9 | 9 | */ |
10 | 10 |
|
11 | | -#include "lib/security/ciphering_engine_generic.h" |
12 | 11 | #include "lib/security/ciphering_engine_nea1.h" |
13 | 12 | #include "lib/security/ciphering_engine_nea2.h" |
14 | 13 | #include "lib/security/ciphering_engine_nea3.h" |
@@ -165,72 +164,6 @@ TEST_P(fxt_nea3, ciphering_engine_nea3) |
165 | 164 | EXPECT_EQ(result.buf.value(), ciphertext); |
166 | 165 | } |
167 | 166 |
|
168 | | -TEST_P(fxt_nea1, ciphering_engine_generic_nea1) |
169 | | -{ |
170 | | - nea_test_set param = GetParam(); |
171 | | - |
172 | | - // Pack hex strings into srsran types |
173 | | - sec_128_key key = make_sec_128_key(param.key_cstr); |
174 | | - auto dir = static_cast<security_direction>(param.direction); |
175 | | - byte_buffer plaintext = make_byte_buffer(param.plaintext_cstr).value(); |
176 | | - byte_buffer ciphertext = make_byte_buffer(param.ciphertext_cstr).value(); |
177 | | - |
178 | | - // Create ciphering engine |
179 | | - std::unique_ptr<ciphering_engine> nea = |
180 | | - std::make_unique<ciphering_engine_generic>(key, param.bearer, dir, ciphering_algorithm::nea1); |
181 | | - |
182 | | - // Apply ciphering and compare results |
183 | | - security_result result = nea->apply_ciphering(plaintext.deep_copy().value(), 0, param.count); |
184 | | - ASSERT_TRUE(result.buf.has_value()); |
185 | | - ASSERT_TRUE(trim_tail_to_bitlength(result.buf.value(), param.length)); |
186 | | - EXPECT_EQ(result.buf.value(), ciphertext); |
187 | | - EXPECT_EQ(result.count, param.count); |
188 | | -} |
189 | | - |
190 | | -TEST_P(fxt_nea2, ciphering_engine_generic_nea2) |
191 | | -{ |
192 | | - nea_test_set param = GetParam(); |
193 | | - |
194 | | - // Pack hex strings into srsran types |
195 | | - sec_128_key key = make_sec_128_key(param.key_cstr); |
196 | | - auto dir = static_cast<security_direction>(param.direction); |
197 | | - byte_buffer plaintext = make_byte_buffer(param.plaintext_cstr).value(); |
198 | | - byte_buffer ciphertext = make_byte_buffer(param.ciphertext_cstr).value(); |
199 | | - |
200 | | - // Create ciphering engine |
201 | | - std::unique_ptr<ciphering_engine> nea = |
202 | | - std::make_unique<ciphering_engine_generic>(key, param.bearer, dir, ciphering_algorithm::nea2); |
203 | | - |
204 | | - // Apply ciphering and compare results |
205 | | - security_result result = nea->apply_ciphering(plaintext.deep_copy().value(), 0, param.count); |
206 | | - ASSERT_TRUE(result.buf.has_value()); |
207 | | - ASSERT_TRUE(trim_tail_to_bitlength(result.buf.value(), param.length)); |
208 | | - EXPECT_EQ(result.buf.value(), ciphertext); |
209 | | - EXPECT_EQ(result.count, param.count); |
210 | | -} |
211 | | - |
212 | | -TEST_P(fxt_nea3, ciphering_engine_generic_nea3) |
213 | | -{ |
214 | | - nea_test_set param = GetParam(); |
215 | | - |
216 | | - // Pack hex strings into srsran types |
217 | | - sec_128_key key = make_sec_128_key(param.key_cstr); |
218 | | - auto dir = static_cast<security_direction>(param.direction); |
219 | | - byte_buffer plaintext = make_byte_buffer(param.plaintext_cstr).value(); |
220 | | - byte_buffer ciphertext = make_byte_buffer(param.ciphertext_cstr).value(); |
221 | | - |
222 | | - // Create ciphering engine |
223 | | - std::unique_ptr<ciphering_engine> nea = |
224 | | - std::make_unique<ciphering_engine_generic>(key, param.bearer, dir, ciphering_algorithm::nea3); |
225 | | - |
226 | | - // Apply ciphering and compare results |
227 | | - security_result result = nea->apply_ciphering(plaintext.deep_copy().value(), 0, param.count); |
228 | | - ASSERT_TRUE(result.buf.has_value()); |
229 | | - ASSERT_TRUE(trim_tail_to_bitlength(result.buf.value(), param.length)); |
230 | | - EXPECT_EQ(result.buf.value(), ciphertext); |
231 | | - EXPECT_EQ(result.count, param.count); |
232 | | -} |
233 | | - |
234 | 167 | ////////////////////////////////////////////////////////// |
235 | 168 | // Finally, instantiate all testcases for each test set // |
236 | 169 | ////////////////////////////////////////////////////////// |
|
0 commit comments