1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2021 Marvell
5 #ifndef TEST_CRYPTODEV_SECURITY_IPSEC_TEST_VECTORS_H_
6 #define TEST_CRYPTODEV_SECURITY_IPSEC_TEST_VECTORS_H_
8 #include <rte_crypto.h>
9 #include <rte_security.h>
11 #include "test_cryptodev_security_ipsec.h"
16 * AES-GCM vectors are based on :
17 * https://datatracker.ietf.org/doc/html/draft-mcgrew-gcm-test-01
19 * Vectors are updated to have corrected L4 checksum and sequence number 1.
22 struct ipsec_test_data pkt_aes_128_gcm = {
25 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
26 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08
32 0x45, 0x00, 0x00, 0x3e, 0x69, 0x8f, 0x00, 0x00,
33 0x80, 0x11, 0x4d, 0xcc, 0xc0, 0xa8, 0x01, 0x02,
34 0xc0, 0xa8, 0x01, 0x01,
37 0x0a, 0x98, 0x00, 0x35, 0x00, 0x2a, 0x23, 0x43,
38 0xb2, 0xd0, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00,
39 0x00, 0x00, 0x00, 0x00, 0x03, 0x73, 0x69, 0x70,
40 0x09, 0x63, 0x79, 0x62, 0x65, 0x72, 0x63, 0x69,
41 0x74, 0x79, 0x02, 0x64, 0x6b, 0x00, 0x00, 0x01,
48 /* IP - outer header */
49 0x45, 0x00, 0x00, 0x74, 0x69, 0x8f, 0x00, 0x00,
50 0x80, 0x32, 0x4d, 0x75, 0xc0, 0xa8, 0x01, 0x02,
51 0xc0, 0xa8, 0x01, 0x01,
54 0x00, 0x00, 0xa5, 0xf8, 0x00, 0x00, 0x00, 0x01,
57 0xfa, 0xce, 0xdb, 0xad, 0xde, 0xca, 0xf8, 0x88,
60 0xde, 0xb2, 0x2c, 0xd9, 0xb0, 0x7c, 0x72, 0xc1,
61 0x6e, 0x3a, 0x65, 0xbe, 0xeb, 0x8d, 0xf3, 0x04,
62 0xa5, 0xa5, 0x89, 0x7d, 0x33, 0xae, 0x53, 0x0f,
63 0x1b, 0xa7, 0x6d, 0x5d, 0x11, 0x4d, 0x2a, 0x5c,
64 0x3d, 0xe8, 0x18, 0x27, 0xc1, 0x0e, 0x9a, 0x4f,
65 0x51, 0x33, 0x0d, 0x0e, 0xec, 0x41, 0x66, 0x42,
66 0xcf, 0xbb, 0x85, 0xa5, 0xb4, 0x7e, 0x48, 0xa4,
67 0xec, 0x3b, 0x9b, 0xa9, 0x5d, 0x91, 0x8b, 0xd4,
68 0x29, 0xc7, 0x37, 0x57, 0x9f, 0xf1, 0x9e, 0x58,
69 0xcf, 0xfc, 0x60, 0x7a, 0x3b, 0xce, 0x89, 0x94,
76 0xca, 0xfe, 0xba, 0xbe
83 0xfa, 0xce, 0xdb, 0xad, 0xde, 0xca, 0xf8, 0x88
90 .options.udp_encap = 0,
91 .options.copy_dscp = 0,
92 .options.copy_flabel = 0,
97 .direction = RTE_SECURITY_IPSEC_SA_DIR_EGRESS,
98 .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
99 .mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
100 .tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4,
110 .type = RTE_CRYPTO_SYM_XFORM_AEAD,
112 .op = RTE_CRYPTO_AEAD_OP_ENCRYPT,
113 .algo = RTE_CRYPTO_AEAD_AES_GCM,
116 .iv.offset = IV_OFFSET,
124 struct ipsec_test_data pkt_aes_192_gcm = {
127 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c,
128 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08,
129 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c
135 0x45, 0x00, 0x00, 0x28, 0xa4, 0xad, 0x40, 0x00,
136 0x40, 0x06, 0x78, 0x80, 0x0a, 0x01, 0x03, 0x8f,
137 0x0a, 0x01, 0x06, 0x12,
140 0x80, 0x23, 0x06, 0xb8, 0xcb, 0x71, 0x26, 0x02,
141 0xdd, 0x6b, 0xb0, 0x3e, 0x50, 0x10, 0x16, 0xd0,
142 0x75, 0x67, 0x00, 0x01
148 /* IP - outer header */
149 0x45, 0x00, 0x00, 0x60, 0x69, 0x8f, 0x00, 0x00,
150 0x80, 0x32, 0x4d, 0x89, 0xc0, 0xa8, 0x01, 0x02,
151 0xc0, 0xa8, 0x01, 0x01,
154 0x00, 0x00, 0xa5, 0xf8, 0x00, 0x00, 0x00, 0x01,
157 0xfa, 0xce, 0xdb, 0xad, 0xde, 0xca, 0xf8, 0x88,
160 0xa5, 0xb1, 0xf8, 0x06, 0x60, 0x29, 0xae, 0xa4,
161 0x0e, 0x59, 0x8b, 0x81, 0x22, 0xde, 0x02, 0x42,
162 0x09, 0x38, 0xb3, 0xab, 0x33, 0xf8, 0x28, 0xe6,
163 0x87, 0xb8, 0x85, 0x8b, 0x5b, 0xfb, 0xdb, 0xd0,
164 0x31, 0x5b, 0x27, 0x45, 0x21, 0x4b, 0xcc, 0x77,
165 0x82, 0xac, 0x91, 0x38, 0xf2, 0xbb, 0xbe, 0xe4,
166 0xcf, 0x03, 0x36, 0x89, 0xdd, 0x40, 0xd3, 0x6e,
167 0x54, 0x05, 0x22, 0x22,
173 0xca, 0xfe, 0xba, 0xbe
180 0xfa, 0xce, 0xdb, 0xad, 0xde, 0xca, 0xf8, 0x88
187 .options.udp_encap = 0,
188 .options.copy_dscp = 0,
189 .options.copy_flabel = 0,
190 .options.copy_df = 0,
191 .options.dec_ttl = 0,
194 .direction = RTE_SECURITY_IPSEC_SA_DIR_EGRESS,
195 .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
196 .mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
197 .tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4,
207 .type = RTE_CRYPTO_SYM_XFORM_AEAD,
209 .op = RTE_CRYPTO_AEAD_OP_ENCRYPT,
210 .algo = RTE_CRYPTO_AEAD_AES_GCM,
213 .iv.offset = IV_OFFSET,
221 struct ipsec_test_data pkt_aes_256_gcm = {
224 0xab, 0xbc, 0xcd, 0xde, 0xf0, 0x01, 0x12, 0x23,
225 0x34, 0x45, 0x56, 0x67, 0x78, 0x89, 0x9a, 0xab,
226 0xab, 0xbc, 0xcd, 0xde, 0xf0, 0x01, 0x12, 0x23,
227 0x34, 0x45, 0x56, 0x67, 0x78, 0x89, 0x9a, 0xab,
233 0x45, 0x00, 0x00, 0x30, 0x69, 0xa6, 0x40, 0x00,
234 0x80, 0x06, 0x26, 0x90, 0xc0, 0xa8, 0x01, 0x02,
235 0x93, 0x89, 0x15, 0x5e,
238 0x0a, 0x9e, 0x00, 0x8b, 0x2d, 0xc5, 0x7e, 0xe0,
239 0x00, 0x00, 0x00, 0x00, 0x70, 0x02, 0x40, 0x00,
240 0x20, 0xbf, 0x00, 0x00, 0x02, 0x04, 0x05, 0xb4,
241 0x01, 0x01, 0x04, 0x02,
247 /* IP - outer header */
248 0x45, 0x00, 0x00, 0x68, 0x69, 0x8f, 0x00, 0x00,
249 0x80, 0x32, 0x4d, 0x81, 0xc0, 0xa8, 0x01, 0x02,
250 0xc0, 0xa8, 0x01, 0x01,
253 0x4a, 0x2c, 0xbf, 0xe3, 0x00, 0x00, 0x00, 0x01,
256 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
259 0xff, 0x42, 0x5c, 0x9b, 0x72, 0x45, 0x99, 0xdf,
260 0x7a, 0x3b, 0xcd, 0x51, 0x01, 0x94, 0xe0, 0x0d,
261 0x6a, 0x78, 0x10, 0x7f, 0x1b, 0x0b, 0x1c, 0xbf,
262 0x06, 0xef, 0xae, 0x9d, 0x65, 0xa5, 0xd7, 0x63,
263 0x74, 0x8a, 0x63, 0x79, 0x85, 0x77, 0x1d, 0x34,
264 0x7f, 0x05, 0x45, 0x65, 0x9f, 0x14, 0xe9, 0x9d,
265 0xef, 0x84, 0x2d, 0x8b, 0x00, 0x14, 0x4a, 0x1f,
266 0xec, 0x6a, 0xdf, 0x0c, 0x9a, 0x92, 0x7f, 0xee,
267 0xa6, 0xc5, 0x11, 0x60,
273 0x11, 0x22, 0x33, 0x44
280 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08
287 .options.udp_encap = 0,
288 .options.copy_dscp = 0,
289 .options.copy_flabel = 0,
290 .options.copy_df = 0,
291 .options.dec_ttl = 0,
294 .direction = RTE_SECURITY_IPSEC_SA_DIR_EGRESS,
295 .proto = RTE_SECURITY_IPSEC_SA_PROTO_ESP,
296 .mode = RTE_SECURITY_IPSEC_SA_MODE_TUNNEL,
297 .tunnel.type = RTE_SECURITY_IPSEC_TUNNEL_IPV4,
307 .type = RTE_CRYPTO_SYM_XFORM_AEAD,
309 .op = RTE_CRYPTO_AEAD_OP_ENCRYPT,
310 .algo = RTE_CRYPTO_AEAD_AES_GCM,
313 .iv.offset = IV_OFFSET,
321 #endif /* TEST_CRYPTODEV_SECURITY_IPSEC_TEST_VECTORS_H_ */