diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-12-04 03:17:50 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2008-01-10 16:16:31 -0500 |
commit | 6160b289929c0b622e64aa36106d8e6e53fcd826 (patch) | |
tree | d8968b0e4aea9d9ef80459d344cd9f4a3e6221b2 /crypto | |
parent | 8df213d9b520a4b58b7a8f7f2200324d4e40363d (diff) |
[CRYPTO] gcm: Fix ICV handling
The crypto_aead convention for ICVs is to include it directly in the
output. If we decided to change this in future then we would make
the ICV (if the algorithm has an explicit one) available in the
request itself.
For now no algorithm needs this so this patch changes gcm to conform
to this convention. It also adjusts the tcrypt aead tests to take
this into account.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/gcm.c | 68 | ||||
-rw-r--r-- | crypto/tcrypt.c | 44 | ||||
-rw-r--r-- | crypto/tcrypt.h | 130 |
3 files changed, 113 insertions, 129 deletions
diff --git a/crypto/gcm.c b/crypto/gcm.c index 5681c7957b88..ed8a6261b346 100644 --- a/crypto/gcm.c +++ b/crypto/gcm.c | |||
@@ -36,6 +36,7 @@ struct crypto_gcm_ghash_ctx { | |||
36 | 36 | ||
37 | struct crypto_gcm_req_priv_ctx { | 37 | struct crypto_gcm_req_priv_ctx { |
38 | u8 auth_tag[16]; | 38 | u8 auth_tag[16]; |
39 | u8 iauth_tag[16]; | ||
39 | u8 counter[16]; | 40 | u8 counter[16]; |
40 | struct crypto_gcm_ghash_ctx ghash; | 41 | struct crypto_gcm_ghash_ctx ghash; |
41 | }; | 42 | }; |
@@ -89,6 +90,9 @@ static void crypto_gcm_ghash_update_sg(struct crypto_gcm_ghash_ctx *ctx, | |||
89 | u8 *src; | 90 | u8 *src; |
90 | int n; | 91 | int n; |
91 | 92 | ||
93 | if (!len) | ||
94 | return; | ||
95 | |||
92 | scatterwalk_start(&walk, sg); | 96 | scatterwalk_start(&walk, sg); |
93 | 97 | ||
94 | while (len) { | 98 | while (len) { |
@@ -211,9 +215,10 @@ static int crypto_gcm_setkey(struct crypto_aead *aead, const u8 *key, | |||
211 | } | 215 | } |
212 | 216 | ||
213 | static int crypto_gcm_init_crypt(struct ablkcipher_request *ablk_req, | 217 | static int crypto_gcm_init_crypt(struct ablkcipher_request *ablk_req, |
214 | struct aead_request *req, | 218 | struct aead_request *req, |
215 | void (*done)(struct crypto_async_request *, | 219 | unsigned int cryptlen, |
216 | int)) | 220 | void (*done)(struct crypto_async_request *, |
221 | int)) | ||
217 | { | 222 | { |
218 | struct crypto_aead *aead = crypto_aead_reqtfm(req); | 223 | struct crypto_aead *aead = crypto_aead_reqtfm(req); |
219 | struct crypto_gcm_ctx *ctx = crypto_aead_ctx(aead); | 224 | struct crypto_gcm_ctx *ctx = crypto_aead_ctx(aead); |
@@ -228,7 +233,7 @@ static int crypto_gcm_init_crypt(struct ablkcipher_request *ablk_req, | |||
228 | ablkcipher_request_set_callback(ablk_req, aead_request_flags(req), | 233 | ablkcipher_request_set_callback(ablk_req, aead_request_flags(req), |
229 | done, req); | 234 | done, req); |
230 | ablkcipher_request_set_crypt(ablk_req, req->src, req->dst, | 235 | ablkcipher_request_set_crypt(ablk_req, req->src, req->dst, |
231 | req->cryptlen, counter); | 236 | cryptlen, counter); |
232 | 237 | ||
233 | err = crypto_gcm_encrypt_counter(aead, auth_tag, 0, req->iv); | 238 | err = crypto_gcm_encrypt_counter(aead, auth_tag, 0, req->iv); |
234 | if (err) | 239 | if (err) |
@@ -239,18 +244,16 @@ static int crypto_gcm_init_crypt(struct ablkcipher_request *ablk_req, | |||
239 | 244 | ||
240 | crypto_gcm_ghash_init(ghash, flags, ctx->gf128); | 245 | crypto_gcm_ghash_init(ghash, flags, ctx->gf128); |
241 | 246 | ||
242 | if (req->assoclen) { | 247 | crypto_gcm_ghash_update_sg(ghash, req->assoc, req->assoclen); |
243 | crypto_gcm_ghash_update_sg(ghash, req->assoc, req->assoclen); | 248 | crypto_gcm_ghash_flush(ghash); |
244 | crypto_gcm_ghash_flush(ghash); | ||
245 | } | ||
246 | 249 | ||
247 | out: | 250 | out: |
248 | return err; | 251 | return err; |
249 | } | 252 | } |
250 | 253 | ||
251 | static void crypto_gcm_encrypt_done(struct crypto_async_request *areq, int err) | 254 | static int crypto_gcm_hash(struct aead_request *req) |
252 | { | 255 | { |
253 | struct aead_request *req = areq->data; | 256 | struct crypto_aead *aead = crypto_aead_reqtfm(req); |
254 | struct crypto_gcm_req_priv_ctx *pctx = aead_request_ctx(req); | 257 | struct crypto_gcm_req_priv_ctx *pctx = aead_request_ctx(req); |
255 | u8 *auth_tag = pctx->auth_tag; | 258 | u8 *auth_tag = pctx->auth_tag; |
256 | struct crypto_gcm_ghash_ctx *ghash = &pctx->ghash; | 259 | struct crypto_gcm_ghash_ctx *ghash = &pctx->ghash; |
@@ -259,18 +262,28 @@ static void crypto_gcm_encrypt_done(struct crypto_async_request *areq, int err) | |||
259 | crypto_gcm_ghash_final_xor(ghash, req->assoclen, req->cryptlen, | 262 | crypto_gcm_ghash_final_xor(ghash, req->assoclen, req->cryptlen, |
260 | auth_tag); | 263 | auth_tag); |
261 | 264 | ||
265 | scatterwalk_map_and_copy(auth_tag, req->dst, req->cryptlen, | ||
266 | crypto_aead_authsize(aead), 1); | ||
267 | return 0; | ||
268 | } | ||
269 | |||
270 | static void crypto_gcm_encrypt_done(struct crypto_async_request *areq, int err) | ||
271 | { | ||
272 | struct aead_request *req = areq->data; | ||
273 | |||
274 | if (!err) | ||
275 | err = crypto_gcm_hash(req); | ||
276 | |||
262 | aead_request_complete(req, err); | 277 | aead_request_complete(req, err); |
263 | } | 278 | } |
264 | 279 | ||
265 | static int crypto_gcm_encrypt(struct aead_request *req) | 280 | static int crypto_gcm_encrypt(struct aead_request *req) |
266 | { | 281 | { |
267 | struct ablkcipher_request abreq; | 282 | struct ablkcipher_request abreq; |
268 | struct crypto_gcm_req_priv_ctx *pctx = aead_request_ctx(req); | ||
269 | u8 *auth_tag = pctx->auth_tag; | ||
270 | struct crypto_gcm_ghash_ctx *ghash = &pctx->ghash; | ||
271 | int err = 0; | 283 | int err = 0; |
272 | 284 | ||
273 | err = crypto_gcm_init_crypt(&abreq, req, crypto_gcm_encrypt_done); | 285 | err = crypto_gcm_init_crypt(&abreq, req, req->cryptlen, |
286 | crypto_gcm_encrypt_done); | ||
274 | if (err) | 287 | if (err) |
275 | return err; | 288 | return err; |
276 | 289 | ||
@@ -278,14 +291,9 @@ static int crypto_gcm_encrypt(struct aead_request *req) | |||
278 | err = crypto_ablkcipher_encrypt(&abreq); | 291 | err = crypto_ablkcipher_encrypt(&abreq); |
279 | if (err) | 292 | if (err) |
280 | return err; | 293 | return err; |
281 | |||
282 | crypto_gcm_ghash_update_sg(ghash, req->dst, req->cryptlen); | ||
283 | } | 294 | } |
284 | 295 | ||
285 | crypto_gcm_ghash_final_xor(ghash, req->assoclen, req->cryptlen, | 296 | return crypto_gcm_hash(req); |
286 | auth_tag); | ||
287 | |||
288 | return err; | ||
289 | } | 297 | } |
290 | 298 | ||
291 | static void crypto_gcm_decrypt_done(struct crypto_async_request *areq, int err) | 299 | static void crypto_gcm_decrypt_done(struct crypto_async_request *areq, int err) |
@@ -296,25 +304,29 @@ static void crypto_gcm_decrypt_done(struct crypto_async_request *areq, int err) | |||
296 | static int crypto_gcm_decrypt(struct aead_request *req) | 304 | static int crypto_gcm_decrypt(struct aead_request *req) |
297 | { | 305 | { |
298 | struct ablkcipher_request abreq; | 306 | struct ablkcipher_request abreq; |
307 | struct crypto_aead *aead = crypto_aead_reqtfm(req); | ||
299 | struct crypto_gcm_req_priv_ctx *pctx = aead_request_ctx(req); | 308 | struct crypto_gcm_req_priv_ctx *pctx = aead_request_ctx(req); |
300 | u8 *auth_tag = pctx->auth_tag; | 309 | u8 *auth_tag = pctx->auth_tag; |
310 | u8 *iauth_tag = pctx->iauth_tag; | ||
301 | struct crypto_gcm_ghash_ctx *ghash = &pctx->ghash; | 311 | struct crypto_gcm_ghash_ctx *ghash = &pctx->ghash; |
302 | u8 tag[16]; | 312 | unsigned int cryptlen = req->cryptlen; |
313 | unsigned int authsize = crypto_aead_authsize(aead); | ||
303 | int err; | 314 | int err; |
304 | 315 | ||
305 | if (!req->cryptlen) | 316 | if (cryptlen < authsize) |
306 | return -EINVAL; | 317 | return -EINVAL; |
318 | cryptlen -= authsize; | ||
307 | 319 | ||
308 | memcpy(tag, auth_tag, 16); | 320 | err = crypto_gcm_init_crypt(&abreq, req, cryptlen, |
309 | err = crypto_gcm_init_crypt(&abreq, req, crypto_gcm_decrypt_done); | 321 | crypto_gcm_decrypt_done); |
310 | if (err) | 322 | if (err) |
311 | return err; | 323 | return err; |
312 | 324 | ||
313 | crypto_gcm_ghash_update_sg(ghash, req->src, req->cryptlen); | 325 | crypto_gcm_ghash_update_sg(ghash, req->src, cryptlen); |
314 | crypto_gcm_ghash_final_xor(ghash, req->assoclen, req->cryptlen, | 326 | crypto_gcm_ghash_final_xor(ghash, req->assoclen, cryptlen, auth_tag); |
315 | auth_tag); | ||
316 | 327 | ||
317 | if (memcmp(tag, auth_tag, 16)) | 328 | scatterwalk_map_and_copy(iauth_tag, req->src, cryptlen, authsize, 0); |
329 | if (memcmp(iauth_tag, auth_tag, authsize)) | ||
318 | return -EINVAL; | 330 | return -EINVAL; |
319 | 331 | ||
320 | return crypto_ablkcipher_decrypt(&abreq); | 332 | return crypto_ablkcipher_decrypt(&abreq); |
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index df93595c2c68..a6d4160c37f7 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
@@ -235,6 +235,7 @@ static void test_aead(char *algo, int enc, struct aead_testvec *template, | |||
235 | struct scatterlist asg[8]; | 235 | struct scatterlist asg[8]; |
236 | const char *e; | 236 | const char *e; |
237 | struct tcrypt_result result; | 237 | struct tcrypt_result result; |
238 | unsigned int authsize; | ||
238 | 239 | ||
239 | if (enc == ENCRYPT) | 240 | if (enc == ENCRYPT) |
240 | e = "encryption"; | 241 | e = "encryption"; |
@@ -265,6 +266,8 @@ static void test_aead(char *algo, int enc, struct aead_testvec *template, | |||
265 | return; | 266 | return; |
266 | } | 267 | } |
267 | 268 | ||
269 | authsize = crypto_aead_authsize(tfm); | ||
270 | |||
268 | req = aead_request_alloc(tfm, GFP_KERNEL); | 271 | req = aead_request_alloc(tfm, GFP_KERNEL); |
269 | if (!req) { | 272 | if (!req) { |
270 | printk(KERN_INFO "failed to allocate request for %s\n", algo); | 273 | printk(KERN_INFO "failed to allocate request for %s\n", algo); |
@@ -296,7 +299,7 @@ static void test_aead(char *algo, int enc, struct aead_testvec *template, | |||
296 | } | 299 | } |
297 | 300 | ||
298 | sg_init_one(&sg[0], aead_tv[i].input, | 301 | sg_init_one(&sg[0], aead_tv[i].input, |
299 | aead_tv[i].ilen); | 302 | aead_tv[i].ilen + (enc ? authsize : 0)); |
300 | 303 | ||
301 | sg_init_one(&asg[0], aead_tv[i].assoc, | 304 | sg_init_one(&asg[0], aead_tv[i].assoc, |
302 | aead_tv[i].alen); | 305 | aead_tv[i].alen); |
@@ -307,13 +310,9 @@ static void test_aead(char *algo, int enc, struct aead_testvec *template, | |||
307 | 310 | ||
308 | aead_request_set_assoc(req, asg, aead_tv[i].alen); | 311 | aead_request_set_assoc(req, asg, aead_tv[i].alen); |
309 | 312 | ||
310 | if (enc) { | 313 | ret = enc ? |
311 | ret = crypto_aead_encrypt(req); | 314 | crypto_aead_encrypt(req) : |
312 | } else { | 315 | crypto_aead_decrypt(req); |
313 | memcpy(req->__ctx, aead_tv[i].tag, | ||
314 | aead_tv[i].tlen); | ||
315 | ret = crypto_aead_decrypt(req); | ||
316 | } | ||
317 | 316 | ||
318 | switch (ret) { | 317 | switch (ret) { |
319 | case 0: | 318 | case 0: |
@@ -335,16 +334,10 @@ static void test_aead(char *algo, int enc, struct aead_testvec *template, | |||
335 | 334 | ||
336 | q = kmap(sg_page(&sg[0])) + sg[0].offset; | 335 | q = kmap(sg_page(&sg[0])) + sg[0].offset; |
337 | hexdump(q, aead_tv[i].rlen); | 336 | hexdump(q, aead_tv[i].rlen); |
338 | printk(KERN_INFO "auth tag: "); | ||
339 | hexdump((unsigned char *)req->__ctx, aead_tv[i].tlen); | ||
340 | 337 | ||
341 | printk(KERN_INFO "enc/dec: %s\n", | 338 | printk(KERN_INFO "enc/dec: %s\n", |
342 | memcmp(q, aead_tv[i].result, | 339 | memcmp(q, aead_tv[i].result, |
343 | aead_tv[i].rlen) ? "fail" : "pass"); | 340 | aead_tv[i].rlen) ? "fail" : "pass"); |
344 | |||
345 | printk(KERN_INFO "auth tag: %s\n", | ||
346 | memcmp(req->__ctx, aead_tv[i].tag, | ||
347 | aead_tv[i].tlen) ? "fail" : "pass"); | ||
348 | } | 341 | } |
349 | } | 342 | } |
350 | 343 | ||
@@ -381,6 +374,9 @@ static void test_aead(char *algo, int enc, struct aead_testvec *template, | |||
381 | aead_tv[i].tap[k]); | 374 | aead_tv[i].tap[k]); |
382 | } | 375 | } |
383 | 376 | ||
377 | if (enc) | ||
378 | sg[k - 1].length += authsize; | ||
379 | |||
384 | sg_init_table(asg, aead_tv[i].anp); | 380 | sg_init_table(asg, aead_tv[i].anp); |
385 | for (k = 0, temp = 0; k < aead_tv[i].anp; k++) { | 381 | for (k = 0, temp = 0; k < aead_tv[i].anp; k++) { |
386 | memcpy(&axbuf[IDX[k]], | 382 | memcpy(&axbuf[IDX[k]], |
@@ -397,13 +393,9 @@ static void test_aead(char *algo, int enc, struct aead_testvec *template, | |||
397 | 393 | ||
398 | aead_request_set_assoc(req, asg, aead_tv[i].alen); | 394 | aead_request_set_assoc(req, asg, aead_tv[i].alen); |
399 | 395 | ||
400 | if (enc) { | 396 | ret = enc ? |
401 | ret = crypto_aead_encrypt(req); | 397 | crypto_aead_encrypt(req) : |
402 | } else { | 398 | crypto_aead_decrypt(req); |
403 | memcpy(req->__ctx, aead_tv[i].tag, | ||
404 | aead_tv[i].tlen); | ||
405 | ret = crypto_aead_decrypt(req); | ||
406 | } | ||
407 | 399 | ||
408 | switch (ret) { | 400 | switch (ret) { |
409 | case 0: | 401 | case 0: |
@@ -429,17 +421,13 @@ static void test_aead(char *algo, int enc, struct aead_testvec *template, | |||
429 | hexdump(q, aead_tv[i].tap[k]); | 421 | hexdump(q, aead_tv[i].tap[k]); |
430 | printk(KERN_INFO "%s\n", | 422 | printk(KERN_INFO "%s\n", |
431 | memcmp(q, aead_tv[i].result + temp, | 423 | memcmp(q, aead_tv[i].result + temp, |
432 | aead_tv[i].tap[k]) ? | 424 | aead_tv[i].tap[k] - |
425 | (k < aead_tv[i].np - 1 || enc ? | ||
426 | 0 : authsize)) ? | ||
433 | "fail" : "pass"); | 427 | "fail" : "pass"); |
434 | 428 | ||
435 | temp += aead_tv[i].tap[k]; | 429 | temp += aead_tv[i].tap[k]; |
436 | } | 430 | } |
437 | printk(KERN_INFO "auth tag: "); | ||
438 | hexdump((unsigned char *)req->__ctx, aead_tv[i].tlen); | ||
439 | |||
440 | printk(KERN_INFO "auth tag: %s\n", | ||
441 | memcmp(req->__ctx, aead_tv[i].tag, | ||
442 | aead_tv[i].tlen) ? "fail" : "pass"); | ||
443 | } | 431 | } |
444 | } | 432 | } |
445 | 433 | ||
diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h index 05aba22ce6db..439e290f3bce 100644 --- a/crypto/tcrypt.h +++ b/crypto/tcrypt.h | |||
@@ -60,7 +60,6 @@ struct aead_testvec { | |||
60 | char input[512]; | 60 | char input[512]; |
61 | char assoc[512]; | 61 | char assoc[512]; |
62 | char result[512]; | 62 | char result[512]; |
63 | char tag[128]; | ||
64 | unsigned char tap[MAX_TAP]; | 63 | unsigned char tap[MAX_TAP]; |
65 | unsigned char atap[MAX_TAP]; | 64 | unsigned char atap[MAX_TAP]; |
66 | int np; | 65 | int np; |
@@ -71,7 +70,6 @@ struct aead_testvec { | |||
71 | unsigned short ilen; | 70 | unsigned short ilen; |
72 | unsigned short alen; | 71 | unsigned short alen; |
73 | unsigned short rlen; | 72 | unsigned short rlen; |
74 | unsigned short tlen; | ||
75 | }; | 73 | }; |
76 | 74 | ||
77 | struct cipher_speed { | 75 | struct cipher_speed { |
@@ -4682,18 +4680,17 @@ static struct cipher_testvec aes_ctr_dec_tv_template[] = { | |||
4682 | static struct aead_testvec aes_gcm_enc_tv_template[] = { | 4680 | static struct aead_testvec aes_gcm_enc_tv_template[] = { |
4683 | { /* From McGrew & Viega - http://citeseer.ist.psu.edu/656989.html */ | 4681 | { /* From McGrew & Viega - http://citeseer.ist.psu.edu/656989.html */ |
4684 | .klen = 16, | 4682 | .klen = 16, |
4685 | .tag = { 0x58, 0xe2, 0xfc, 0xce, 0xfa, 0x7e, 0x30, 0x61, | 4683 | .result = { 0x58, 0xe2, 0xfc, 0xce, 0xfa, 0x7e, 0x30, 0x61, |
4686 | 0x36, 0x7f, 0x1d, 0x57, 0xa4, 0xe7, 0x45, 0x5a }, | 4684 | 0x36, 0x7f, 0x1d, 0x57, 0xa4, 0xe7, 0x45, 0x5a }, |
4687 | .tlen = 16 | 4685 | .rlen = 16, |
4688 | }, { | 4686 | }, { |
4689 | .klen = 16, | 4687 | .klen = 16, |
4690 | .ilen = 16, | 4688 | .ilen = 16, |
4691 | .result = { 0x03, 0x88, 0xda, 0xce, 0x60, 0xb6, 0xa3, 0x92, | 4689 | .result = { 0x03, 0x88, 0xda, 0xce, 0x60, 0xb6, 0xa3, 0x92, |
4692 | 0xf3, 0x28, 0xc2, 0xb9, 0x71, 0xb2, 0xfe, 0x78 }, | 4690 | 0xf3, 0x28, 0xc2, 0xb9, 0x71, 0xb2, 0xfe, 0x78, |
4693 | .rlen = 16, | 4691 | 0xab, 0x6e, 0x47, 0xd4, 0x2c, 0xec, 0x13, 0xbd, |
4694 | .tag = { 0xab, 0x6e, 0x47, 0xd4, 0x2c, 0xec, 0x13, 0xbd, | ||
4695 | 0xf5, 0x3a, 0x67, 0xb2, 0x12, 0x57, 0xbd, 0xdf }, | 4692 | 0xf5, 0x3a, 0x67, 0xb2, 0x12, 0x57, 0xbd, 0xdf }, |
4696 | .tlen = 16 | 4693 | .rlen = 32, |
4697 | }, { | 4694 | }, { |
4698 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, | 4695 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, |
4699 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 }, | 4696 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 }, |
@@ -4716,11 +4713,10 @@ static struct aead_testvec aes_gcm_enc_tv_template[] = { | |||
4716 | 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c, | 4713 | 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c, |
4717 | 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05, | 4714 | 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05, |
4718 | 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97, | 4715 | 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97, |
4719 | 0x3d, 0x58, 0xe0, 0x91, 0x47, 0x3f, 0x59, 0x85 }, | 4716 | 0x3d, 0x58, 0xe0, 0x91, 0x47, 0x3f, 0x59, 0x85, |
4720 | .rlen = 64, | 4717 | 0x4d, 0x5c, 0x2a, 0xf3, 0x27, 0xcd, 0x64, 0xa6, |
4721 | .tag = { 0x4d, 0x5c, 0x2a, 0xf3, 0x27, 0xcd, 0x64, 0xa6, | ||
4722 | 0x2c, 0xf3, 0x5a, 0xbd, 0x2b, 0xa6, 0xfa, 0xb4 }, | 4718 | 0x2c, 0xf3, 0x5a, 0xbd, 0x2b, 0xa6, 0xfa, 0xb4 }, |
4723 | .tlen = 16 | 4719 | .rlen = 80, |
4724 | }, { | 4720 | }, { |
4725 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, | 4721 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, |
4726 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 }, | 4722 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 }, |
@@ -4747,25 +4743,23 @@ static struct aead_testvec aes_gcm_enc_tv_template[] = { | |||
4747 | 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c, | 4743 | 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c, |
4748 | 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05, | 4744 | 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05, |
4749 | 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97, | 4745 | 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97, |
4750 | 0x3d, 0x58, 0xe0, 0x91 }, | 4746 | 0x3d, 0x58, 0xe0, 0x91, |
4751 | .rlen = 60, | 4747 | 0x5b, 0xc9, 0x4f, 0xbc, 0x32, 0x21, 0xa5, 0xdb, |
4752 | .tag = { 0x5b, 0xc9, 0x4f, 0xbc, 0x32, 0x21, 0xa5, 0xdb, | ||
4753 | 0x94, 0xfa, 0xe9, 0x5a, 0xe7, 0x12, 0x1a, 0x47 }, | 4748 | 0x94, 0xfa, 0xe9, 0x5a, 0xe7, 0x12, 0x1a, 0x47 }, |
4754 | .tlen = 16 | 4749 | .rlen = 76, |
4755 | }, { | 4750 | }, { |
4756 | .klen = 24, | 4751 | .klen = 24, |
4757 | .tag = { 0xcd, 0x33, 0xb2, 0x8a, 0xc7, 0x73, 0xf7, 0x4b, | 4752 | .result = { 0xcd, 0x33, 0xb2, 0x8a, 0xc7, 0x73, 0xf7, 0x4b, |
4758 | 0xa0, 0x0e, 0xd1, 0xf3, 0x12, 0x57, 0x24, 0x35 }, | 4753 | 0xa0, 0x0e, 0xd1, 0xf3, 0x12, 0x57, 0x24, 0x35 }, |
4759 | .tlen = 16 | 4754 | .rlen = 16, |
4760 | }, { | 4755 | }, { |
4761 | .klen = 24, | 4756 | .klen = 24, |
4762 | .ilen = 16, | 4757 | .ilen = 16, |
4763 | .result = { 0x98, 0xe7, 0x24, 0x7c, 0x07, 0xf0, 0xfe, 0x41, | 4758 | .result = { 0x98, 0xe7, 0x24, 0x7c, 0x07, 0xf0, 0xfe, 0x41, |
4764 | 0x1c, 0x26, 0x7e, 0x43, 0x84, 0xb0, 0xf6, 0x00 }, | 4759 | 0x1c, 0x26, 0x7e, 0x43, 0x84, 0xb0, 0xf6, 0x00, |
4765 | .rlen = 16, | 4760 | 0x2f, 0xf5, 0x8d, 0x80, 0x03, 0x39, 0x27, 0xab, |
4766 | .tag = { 0x2f, 0xf5, 0x8d, 0x80, 0x03, 0x39, 0x27, 0xab, | ||
4767 | 0x8e, 0xf4, 0xd4, 0x58, 0x75, 0x14, 0xf0, 0xfb }, | 4761 | 0x8e, 0xf4, 0xd4, 0x58, 0x75, 0x14, 0xf0, 0xfb }, |
4768 | .tlen = 16 | 4762 | .rlen = 32, |
4769 | }, { | 4763 | }, { |
4770 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, | 4764 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, |
4771 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, | 4765 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, |
@@ -4789,11 +4783,10 @@ static struct aead_testvec aes_gcm_enc_tv_template[] = { | |||
4789 | 0x7d, 0x77, 0x3d, 0x00, 0xc1, 0x44, 0xc5, 0x25, | 4783 | 0x7d, 0x77, 0x3d, 0x00, 0xc1, 0x44, 0xc5, 0x25, |
4790 | 0xac, 0x61, 0x9d, 0x18, 0xc8, 0x4a, 0x3f, 0x47, | 4784 | 0xac, 0x61, 0x9d, 0x18, 0xc8, 0x4a, 0x3f, 0x47, |
4791 | 0x18, 0xe2, 0x44, 0x8b, 0x2f, 0xe3, 0x24, 0xd9, | 4785 | 0x18, 0xe2, 0x44, 0x8b, 0x2f, 0xe3, 0x24, 0xd9, |
4792 | 0xcc, 0xda, 0x27, 0x10, 0xac, 0xad, 0xe2, 0x56 }, | 4786 | 0xcc, 0xda, 0x27, 0x10, 0xac, 0xad, 0xe2, 0x56, |
4793 | .rlen = 64, | 4787 | 0x99, 0x24, 0xa7, 0xc8, 0x58, 0x73, 0x36, 0xbf, |
4794 | .tag = { 0x99, 0x24, 0xa7, 0xc8, 0x58, 0x73, 0x36, 0xbf, | ||
4795 | 0xb1, 0x18, 0x02, 0x4d, 0xb8, 0x67, 0x4a, 0x14 }, | 4788 | 0xb1, 0x18, 0x02, 0x4d, 0xb8, 0x67, 0x4a, 0x14 }, |
4796 | .tlen = 16 | 4789 | .rlen = 80, |
4797 | }, { | 4790 | }, { |
4798 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, | 4791 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, |
4799 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, | 4792 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, |
@@ -4821,20 +4814,19 @@ static struct aead_testvec aes_gcm_enc_tv_template[] = { | |||
4821 | 0x7d, 0x77, 0x3d, 0x00, 0xc1, 0x44, 0xc5, 0x25, | 4814 | 0x7d, 0x77, 0x3d, 0x00, 0xc1, 0x44, 0xc5, 0x25, |
4822 | 0xac, 0x61, 0x9d, 0x18, 0xc8, 0x4a, 0x3f, 0x47, | 4815 | 0xac, 0x61, 0x9d, 0x18, 0xc8, 0x4a, 0x3f, 0x47, |
4823 | 0x18, 0xe2, 0x44, 0x8b, 0x2f, 0xe3, 0x24, 0xd9, | 4816 | 0x18, 0xe2, 0x44, 0x8b, 0x2f, 0xe3, 0x24, 0xd9, |
4824 | 0xcc, 0xda, 0x27, 0x10 }, | 4817 | 0xcc, 0xda, 0x27, 0x10, |
4825 | .rlen = 60, | 4818 | 0x25, 0x19, 0x49, 0x8e, 0x80, 0xf1, 0x47, 0x8f, |
4826 | .tag = { 0x25, 0x19, 0x49, 0x8e, 0x80, 0xf1, 0x47, 0x8f, | ||
4827 | 0x37, 0xba, 0x55, 0xbd, 0x6d, 0x27, 0x61, 0x8c }, | 4819 | 0x37, 0xba, 0x55, 0xbd, 0x6d, 0x27, 0x61, 0x8c }, |
4828 | .tlen = 16, | 4820 | .rlen = 76, |
4829 | .np = 2, | 4821 | .np = 2, |
4830 | .tap = { 32, 28 }, | 4822 | .tap = { 32, 28 }, |
4831 | .anp = 2, | 4823 | .anp = 2, |
4832 | .atap = { 8, 12 } | 4824 | .atap = { 8, 12 } |
4833 | }, { | 4825 | }, { |
4834 | .klen = 32, | 4826 | .klen = 32, |
4835 | .tag = { 0x53, 0x0f, 0x8a, 0xfb, 0xc7, 0x45, 0x36, 0xb9, | 4827 | .result = { 0x53, 0x0f, 0x8a, 0xfb, 0xc7, 0x45, 0x36, 0xb9, |
4836 | 0xa9, 0x63, 0xb4, 0xf1, 0xc4, 0xcb, 0x73, 0x8b }, | 4828 | 0xa9, 0x63, 0xb4, 0xf1, 0xc4, 0xcb, 0x73, 0x8b }, |
4837 | .tlen = 16 | 4829 | .rlen = 16, |
4838 | } | 4830 | } |
4839 | }; | 4831 | }; |
4840 | 4832 | ||
@@ -4842,12 +4834,11 @@ static struct aead_testvec aes_gcm_dec_tv_template[] = { | |||
4842 | { /* From McGrew & Viega - http://citeseer.ist.psu.edu/656989.html */ | 4834 | { /* From McGrew & Viega - http://citeseer.ist.psu.edu/656989.html */ |
4843 | .klen = 32, | 4835 | .klen = 32, |
4844 | .input = { 0xce, 0xa7, 0x40, 0x3d, 0x4d, 0x60, 0x6b, 0x6e, | 4836 | .input = { 0xce, 0xa7, 0x40, 0x3d, 0x4d, 0x60, 0x6b, 0x6e, |
4845 | 0x07, 0x4e, 0xc5, 0xd3, 0xba, 0xf3, 0x9d, 0x18 }, | 4837 | 0x07, 0x4e, 0xc5, 0xd3, 0xba, 0xf3, 0x9d, 0x18, |
4846 | .ilen = 16, | 4838 | 0xd0, 0xd1, 0xc8, 0xa7, 0x99, 0x99, 0x6b, 0xf0, |
4847 | .rlen = 16, | ||
4848 | .tag = { 0xd0, 0xd1, 0xc8, 0xa7, 0x99, 0x99, 0x6b, 0xf0, | ||
4849 | 0x26, 0x5b, 0x98, 0xb5, 0xd4, 0x8a, 0xb9, 0x19 }, | 4839 | 0x26, 0x5b, 0x98, 0xb5, 0xd4, 0x8a, 0xb9, 0x19 }, |
4850 | .tlen = 16 | 4840 | .ilen = 32, |
4841 | .rlen = 16, | ||
4851 | }, { | 4842 | }, { |
4852 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, | 4843 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, |
4853 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, | 4844 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, |
@@ -4863,8 +4854,10 @@ static struct aead_testvec aes_gcm_dec_tv_template[] = { | |||
4863 | 0x8c, 0xb0, 0x8e, 0x48, 0x59, 0x0d, 0xbb, 0x3d, | 4854 | 0x8c, 0xb0, 0x8e, 0x48, 0x59, 0x0d, 0xbb, 0x3d, |
4864 | 0xa7, 0xb0, 0x8b, 0x10, 0x56, 0x82, 0x88, 0x38, | 4855 | 0xa7, 0xb0, 0x8b, 0x10, 0x56, 0x82, 0x88, 0x38, |
4865 | 0xc5, 0xf6, 0x1e, 0x63, 0x93, 0xba, 0x7a, 0x0a, | 4856 | 0xc5, 0xf6, 0x1e, 0x63, 0x93, 0xba, 0x7a, 0x0a, |
4866 | 0xbc, 0xc9, 0xf6, 0x62, 0x89, 0x80, 0x15, 0xad }, | 4857 | 0xbc, 0xc9, 0xf6, 0x62, 0x89, 0x80, 0x15, 0xad, |
4867 | .ilen = 64, | 4858 | 0xb0, 0x94, 0xda, 0xc5, 0xd9, 0x34, 0x71, 0xbd, |
4859 | 0xec, 0x1a, 0x50, 0x22, 0x70, 0xe3, 0xcc, 0x6c }, | ||
4860 | .ilen = 80, | ||
4868 | .result = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, | 4861 | .result = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, |
4869 | 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, | 4862 | 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, |
4870 | 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, | 4863 | 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, |
@@ -4874,9 +4867,6 @@ static struct aead_testvec aes_gcm_dec_tv_template[] = { | |||
4874 | 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, | 4867 | 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, |
4875 | 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 }, | 4868 | 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 }, |
4876 | .rlen = 64, | 4869 | .rlen = 64, |
4877 | .tag = { 0xb0, 0x94, 0xda, 0xc5, 0xd9, 0x34, 0x71, 0xbd, | ||
4878 | 0xec, 0x1a, 0x50, 0x22, 0x70, 0xe3, 0xcc, 0x6c }, | ||
4879 | .tlen = 16 | ||
4880 | }, { | 4870 | }, { |
4881 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, | 4871 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, |
4882 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, | 4872 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, |
@@ -4892,8 +4882,10 @@ static struct aead_testvec aes_gcm_dec_tv_template[] = { | |||
4892 | 0x8c, 0xb0, 0x8e, 0x48, 0x59, 0x0d, 0xbb, 0x3d, | 4882 | 0x8c, 0xb0, 0x8e, 0x48, 0x59, 0x0d, 0xbb, 0x3d, |
4893 | 0xa7, 0xb0, 0x8b, 0x10, 0x56, 0x82, 0x88, 0x38, | 4883 | 0xa7, 0xb0, 0x8b, 0x10, 0x56, 0x82, 0x88, 0x38, |
4894 | 0xc5, 0xf6, 0x1e, 0x63, 0x93, 0xba, 0x7a, 0x0a, | 4884 | 0xc5, 0xf6, 0x1e, 0x63, 0x93, 0xba, 0x7a, 0x0a, |
4895 | 0xbc, 0xc9, 0xf6, 0x62 }, | 4885 | 0xbc, 0xc9, 0xf6, 0x62, |
4896 | .ilen = 60, | 4886 | 0x76, 0xfc, 0x6e, 0xce, 0x0f, 0x4e, 0x17, 0x68, |
4887 | 0xcd, 0xdf, 0x88, 0x53, 0xbb, 0x2d, 0x55, 0x1b }, | ||
4888 | .ilen = 76, | ||
4897 | .assoc = { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, | 4889 | .assoc = { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, |
4898 | 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, | 4890 | 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, |
4899 | 0xab, 0xad, 0xda, 0xd2 }, | 4891 | 0xab, 0xad, 0xda, 0xd2 }, |
@@ -4907,11 +4899,8 @@ static struct aead_testvec aes_gcm_dec_tv_template[] = { | |||
4907 | 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, | 4899 | 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, |
4908 | 0xba, 0x63, 0x7b, 0x39 }, | 4900 | 0xba, 0x63, 0x7b, 0x39 }, |
4909 | .rlen = 60, | 4901 | .rlen = 60, |
4910 | .tag = { 0x76, 0xfc, 0x6e, 0xce, 0x0f, 0x4e, 0x17, 0x68, | ||
4911 | 0xcd, 0xdf, 0x88, 0x53, 0xbb, 0x2d, 0x55, 0x1b }, | ||
4912 | .tlen = 16, | ||
4913 | .np = 2, | 4902 | .np = 2, |
4914 | .tap = { 48, 12 }, | 4903 | .tap = { 48, 28 }, |
4915 | .anp = 3, | 4904 | .anp = 3, |
4916 | .atap = { 8, 8, 4 } | 4905 | .atap = { 8, 8, 4 } |
4917 | }, { | 4906 | }, { |
@@ -4927,8 +4916,10 @@ static struct aead_testvec aes_gcm_dec_tv_template[] = { | |||
4927 | 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c, | 4916 | 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c, |
4928 | 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05, | 4917 | 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05, |
4929 | 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97, | 4918 | 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97, |
4930 | 0x3d, 0x58, 0xe0, 0x91, 0x47, 0x3f, 0x59, 0x85 }, | 4919 | 0x3d, 0x58, 0xe0, 0x91, 0x47, 0x3f, 0x59, 0x85, |
4931 | .ilen = 64, | 4920 | 0x4d, 0x5c, 0x2a, 0xf3, 0x27, 0xcd, 0x64, 0xa6, |
4921 | 0x2c, 0xf3, 0x5a, 0xbd, 0x2b, 0xa6, 0xfa, 0xb4 }, | ||
4922 | .ilen = 80, | ||
4932 | .result = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, | 4923 | .result = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, |
4933 | 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, | 4924 | 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, |
4934 | 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, | 4925 | 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, |
@@ -4938,9 +4929,6 @@ static struct aead_testvec aes_gcm_dec_tv_template[] = { | |||
4938 | 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, | 4929 | 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, |
4939 | 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 }, | 4930 | 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 }, |
4940 | .rlen = 64, | 4931 | .rlen = 64, |
4941 | .tag = { 0x4d, 0x5c, 0x2a, 0xf3, 0x27, 0xcd, 0x64, 0xa6, | ||
4942 | 0x2c, 0xf3, 0x5a, 0xbd, 0x2b, 0xa6, 0xfa, 0xb4 }, | ||
4943 | .tlen = 16 | ||
4944 | }, { | 4932 | }, { |
4945 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, | 4933 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, |
4946 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 }, | 4934 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08 }, |
@@ -4954,8 +4942,10 @@ static struct aead_testvec aes_gcm_dec_tv_template[] = { | |||
4954 | 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c, | 4942 | 0x21, 0xd5, 0x14, 0xb2, 0x54, 0x66, 0x93, 0x1c, |
4955 | 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05, | 4943 | 0x7d, 0x8f, 0x6a, 0x5a, 0xac, 0x84, 0xaa, 0x05, |
4956 | 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97, | 4944 | 0x1b, 0xa3, 0x0b, 0x39, 0x6a, 0x0a, 0xac, 0x97, |
4957 | 0x3d, 0x58, 0xe0, 0x91 }, | 4945 | 0x3d, 0x58, 0xe0, 0x91, |
4958 | .ilen = 60, | 4946 | 0x5b, 0xc9, 0x4f, 0xbc, 0x32, 0x21, 0xa5, 0xdb, |
4947 | 0x94, 0xfa, 0xe9, 0x5a, 0xe7, 0x12, 0x1a, 0x47 }, | ||
4948 | .ilen = 76, | ||
4959 | .assoc = { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, | 4949 | .assoc = { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, |
4960 | 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, | 4950 | 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, |
4961 | 0xab, 0xad, 0xda, 0xd2 }, | 4951 | 0xab, 0xad, 0xda, 0xd2 }, |
@@ -4969,18 +4959,14 @@ static struct aead_testvec aes_gcm_dec_tv_template[] = { | |||
4969 | 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, | 4959 | 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, |
4970 | 0xba, 0x63, 0x7b, 0x39 }, | 4960 | 0xba, 0x63, 0x7b, 0x39 }, |
4971 | .rlen = 60, | 4961 | .rlen = 60, |
4972 | .tag = { 0x5b, 0xc9, 0x4f, 0xbc, 0x32, 0x21, 0xa5, 0xdb, | ||
4973 | 0x94, 0xfa, 0xe9, 0x5a, 0xe7, 0x12, 0x1a, 0x47 }, | ||
4974 | .tlen = 16 | ||
4975 | }, { | 4962 | }, { |
4976 | .klen = 24, | 4963 | .klen = 24, |
4977 | .input = { 0x98, 0xe7, 0x24, 0x7c, 0x07, 0xf0, 0xfe, 0x41, | 4964 | .input = { 0x98, 0xe7, 0x24, 0x7c, 0x07, 0xf0, 0xfe, 0x41, |
4978 | 0x1c, 0x26, 0x7e, 0x43, 0x84, 0xb0, 0xf6, 0x00 }, | 4965 | 0x1c, 0x26, 0x7e, 0x43, 0x84, 0xb0, 0xf6, 0x00, |
4979 | .ilen = 16, | 4966 | 0x2f, 0xf5, 0x8d, 0x80, 0x03, 0x39, 0x27, 0xab, |
4980 | .rlen = 16, | ||
4981 | .tag = { 0x2f, 0xf5, 0x8d, 0x80, 0x03, 0x39, 0x27, 0xab, | ||
4982 | 0x8e, 0xf4, 0xd4, 0x58, 0x75, 0x14, 0xf0, 0xfb }, | 4967 | 0x8e, 0xf4, 0xd4, 0x58, 0x75, 0x14, 0xf0, 0xfb }, |
4983 | .tlen = 16 | 4968 | .ilen = 32, |
4969 | .rlen = 16, | ||
4984 | }, { | 4970 | }, { |
4985 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, | 4971 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, |
4986 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, | 4972 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, |
@@ -4995,8 +4981,10 @@ static struct aead_testvec aes_gcm_dec_tv_template[] = { | |||
4995 | 0x7d, 0x77, 0x3d, 0x00, 0xc1, 0x44, 0xc5, 0x25, | 4981 | 0x7d, 0x77, 0x3d, 0x00, 0xc1, 0x44, 0xc5, 0x25, |
4996 | 0xac, 0x61, 0x9d, 0x18, 0xc8, 0x4a, 0x3f, 0x47, | 4982 | 0xac, 0x61, 0x9d, 0x18, 0xc8, 0x4a, 0x3f, 0x47, |
4997 | 0x18, 0xe2, 0x44, 0x8b, 0x2f, 0xe3, 0x24, 0xd9, | 4983 | 0x18, 0xe2, 0x44, 0x8b, 0x2f, 0xe3, 0x24, 0xd9, |
4998 | 0xcc, 0xda, 0x27, 0x10, 0xac, 0xad, 0xe2, 0x56 }, | 4984 | 0xcc, 0xda, 0x27, 0x10, 0xac, 0xad, 0xe2, 0x56, |
4999 | .ilen = 64, | 4985 | 0x99, 0x24, 0xa7, 0xc8, 0x58, 0x73, 0x36, 0xbf, |
4986 | 0xb1, 0x18, 0x02, 0x4d, 0xb8, 0x67, 0x4a, 0x14 }, | ||
4987 | .ilen = 80, | ||
5000 | .result = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, | 4988 | .result = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, |
5001 | 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, | 4989 | 0xa5, 0x59, 0x09, 0xc5, 0xaf, 0xf5, 0x26, 0x9a, |
5002 | 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, | 4990 | 0x86, 0xa7, 0xa9, 0x53, 0x15, 0x34, 0xf7, 0xda, |
@@ -5006,9 +4994,6 @@ static struct aead_testvec aes_gcm_dec_tv_template[] = { | |||
5006 | 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, | 4994 | 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, |
5007 | 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 }, | 4995 | 0xba, 0x63, 0x7b, 0x39, 0x1a, 0xaf, 0xd2, 0x55 }, |
5008 | .rlen = 64, | 4996 | .rlen = 64, |
5009 | .tag = { 0x99, 0x24, 0xa7, 0xc8, 0x58, 0x73, 0x36, 0xbf, | ||
5010 | 0xb1, 0x18, 0x02, 0x4d, 0xb8, 0x67, 0x4a, 0x14 }, | ||
5011 | .tlen = 16 | ||
5012 | }, { | 4997 | }, { |
5013 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, | 4998 | .key = { 0xfe, 0xff, 0xe9, 0x92, 0x86, 0x65, 0x73, 0x1c, |
5014 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, | 4999 | 0x6d, 0x6a, 0x8f, 0x94, 0x67, 0x30, 0x83, 0x08, |
@@ -5023,8 +5008,10 @@ static struct aead_testvec aes_gcm_dec_tv_template[] = { | |||
5023 | 0x7d, 0x77, 0x3d, 0x00, 0xc1, 0x44, 0xc5, 0x25, | 5008 | 0x7d, 0x77, 0x3d, 0x00, 0xc1, 0x44, 0xc5, 0x25, |
5024 | 0xac, 0x61, 0x9d, 0x18, 0xc8, 0x4a, 0x3f, 0x47, | 5009 | 0xac, 0x61, 0x9d, 0x18, 0xc8, 0x4a, 0x3f, 0x47, |
5025 | 0x18, 0xe2, 0x44, 0x8b, 0x2f, 0xe3, 0x24, 0xd9, | 5010 | 0x18, 0xe2, 0x44, 0x8b, 0x2f, 0xe3, 0x24, 0xd9, |
5026 | 0xcc, 0xda, 0x27, 0x10 }, | 5011 | 0xcc, 0xda, 0x27, 0x10, |
5027 | .ilen = 60, | 5012 | 0x25, 0x19, 0x49, 0x8e, 0x80, 0xf1, 0x47, 0x8f, |
5013 | 0x37, 0xba, 0x55, 0xbd, 0x6d, 0x27, 0x61, 0x8c }, | ||
5014 | .ilen = 76, | ||
5028 | .assoc = { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, | 5015 | .assoc = { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, |
5029 | 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, | 5016 | 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, |
5030 | 0xab, 0xad, 0xda, 0xd2 }, | 5017 | 0xab, 0xad, 0xda, 0xd2 }, |
@@ -5038,9 +5025,6 @@ static struct aead_testvec aes_gcm_dec_tv_template[] = { | |||
5038 | 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, | 5025 | 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, |
5039 | 0xba, 0x63, 0x7b, 0x39 }, | 5026 | 0xba, 0x63, 0x7b, 0x39 }, |
5040 | .rlen = 60, | 5027 | .rlen = 60, |
5041 | .tag = { 0x25, 0x19, 0x49, 0x8e, 0x80, 0xf1, 0x47, 0x8f, | ||
5042 | 0x37, 0xba, 0x55, 0xbd, 0x6d, 0x27, 0x61, 0x8c }, | ||
5043 | .tlen = 16 | ||
5044 | } | 5028 | } |
5045 | }; | 5029 | }; |
5046 | 5030 | ||