blob: a7da490695cc78b357f6f14d82d1871faeb6dedb [file] [log] [blame]
Alex Gaynorf312a5c2013-08-10 15:23:38 -04001# Licensed under the Apache License, Version 2.0 (the "License");
2# you may not use this file except in compliance with the License.
3# You may obtain a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS,
9# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
10# implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
Alex Gaynorab53bc52013-11-12 09:37:59 -080014import os
Donald Stufft9e1a48b2013-08-09 00:32:30 -040015import textwrap
16
Alex Gaynor2b3f9422013-12-24 21:55:24 -080017import pretend
18
Paul Kehrer79c16e92013-10-18 17:44:36 -050019import pytest
20
Alex Gaynorafdddca2013-10-21 21:00:20 -070021from .utils import (
Paul Kehrerf7f6a9f2013-11-11 20:43:52 -060022 load_nist_vectors, load_vectors_from_file, load_cryptrec_vectors,
Paul Kehrer5a8fdf82013-12-26 20:13:45 -060023 load_openssl_vectors, load_hash_vectors, check_for_iface,
Paul Kehrerc421e632014-01-18 09:22:21 -060024 check_backend_support, select_backends
Alex Gaynorafdddca2013-10-21 21:00:20 -070025)
Donald Stufft9e1a48b2013-08-09 00:32:30 -040026
27
Alex Gaynor2b3f9422013-12-24 21:55:24 -080028class FakeInterface(object):
29 pass
30
31
Paul Kehrerc421e632014-01-18 09:22:21 -060032def test_select_one_backend():
Paul Kehrer34c075e2014-01-13 21:52:08 -050033 b1 = pretend.stub(name="b1")
34 b2 = pretend.stub(name="b2")
35 b3 = pretend.stub(name="b3")
36 backends = [b1, b2, b3]
37 name = "b2"
Paul Kehrerc421e632014-01-18 09:22:21 -060038 select_backends(name, backends)
Paul Kehrer34c075e2014-01-13 21:52:08 -050039 assert len(backends) == 1
40 assert backends[0] == b2
41
42
Paul Kehrerc421e632014-01-18 09:22:21 -060043def test_select_no_backend():
Paul Kehrer34c075e2014-01-13 21:52:08 -050044 b1 = pretend.stub(name="b1")
45 b2 = pretend.stub(name="b2")
46 b3 = pretend.stub(name="b3")
47 backends = [b1, b2, b3]
48 name = "back!"
49 with pytest.raises(ValueError):
Paul Kehrerc421e632014-01-18 09:22:21 -060050 select_backends(name, backends)
51
52
53def test_select_backends_none():
54 b1 = pretend.stub(name="b1")
55 b2 = pretend.stub(name="b2")
56 b3 = pretend.stub(name="b3")
57 backends = [b1, b2, b3]
58 name = None
59 select_backends(name, backends)
60 assert len(backends) == 3
61
62
63def test_select_two_backends():
64 b1 = pretend.stub(name="b1")
65 b2 = pretend.stub(name="b2")
66 b3 = pretend.stub(name="b3")
67 backends = [b1, b2, b3]
68 name = "b2 ,b1 "
69 select_backends(name, backends)
70 assert len(backends) == 2
71 assert backends == [b1, b2]
Paul Kehrer34c075e2014-01-13 21:52:08 -050072
73
Alex Gaynor2b3f9422013-12-24 21:55:24 -080074def test_check_for_iface():
75 item = pretend.stub(keywords=["fake_name"], funcargs={"backend": True})
76 with pytest.raises(pytest.skip.Exception) as exc_info:
77 check_for_iface("fake_name", FakeInterface, item)
78 assert exc_info.value.args[0] == "True backend does not support fake_name"
79
80 item = pretend.stub(
81 keywords=["fake_name"],
82 funcargs={"backend": FakeInterface()}
83 )
84 check_for_iface("fake_name", FakeInterface, item)
85
86
Paul Kehrer60fc8da2013-12-26 20:19:34 -060087def test_check_backend_support_skip():
Paul Kehrer5a8fdf82013-12-26 20:13:45 -060088 supported = pretend.stub(
89 kwargs={"only_if": lambda backend: False, "skip_message": "Nope"}
90 )
91 item = pretend.stub(keywords={"supported": supported},
92 funcargs={"backend": True})
93 with pytest.raises(pytest.skip.Exception) as exc_info:
Paul Kehrer60fc8da2013-12-26 20:19:34 -060094 check_backend_support(item)
Paul Kehrerf03334e2014-01-02 23:16:14 -060095 assert exc_info.value.args[0] == "Nope (True)"
Paul Kehrer5a8fdf82013-12-26 20:13:45 -060096
97
Paul Kehrer60fc8da2013-12-26 20:19:34 -060098def test_check_backend_support_no_skip():
Paul Kehrer5a8fdf82013-12-26 20:13:45 -060099 supported = pretend.stub(
100 kwargs={"only_if": lambda backend: True, "skip_message": "Nope"}
101 )
102 item = pretend.stub(keywords={"supported": supported},
103 funcargs={"backend": True})
Paul Kehrer60fc8da2013-12-26 20:19:34 -0600104 assert check_backend_support(item) is None
Paul Kehrer5a8fdf82013-12-26 20:13:45 -0600105
106
Paul Kehrer60fc8da2013-12-26 20:19:34 -0600107def test_check_backend_support_no_backend():
Paul Kehrer5a8fdf82013-12-26 20:13:45 -0600108 supported = pretend.stub(
109 kwargs={"only_if": "notalambda", "skip_message": "Nope"}
110 )
111 item = pretend.stub(keywords={"supported": supported},
112 funcargs={})
Paul Kehrerec495502013-12-27 15:51:40 -0600113 with pytest.raises(ValueError):
Paul Kehrer60fc8da2013-12-26 20:19:34 -0600114 check_backend_support(item)
Paul Kehrer5a8fdf82013-12-26 20:13:45 -0600115
116
Alex Gaynorcf5fb332013-11-11 15:39:52 -0800117def test_load_nist_vectors():
Donald Stufft9e1a48b2013-08-09 00:32:30 -0400118 vector_data = textwrap.dedent("""
119 # CAVS 11.1
120 # Config info for aes_values
121 # AESVS GFSbox test data for CBC
122 # State : Encrypt and Decrypt
123 # Key Length : 128
124 # Generated on Fri Apr 22 15:11:33 2011
125
126 [ENCRYPT]
127
128 COUNT = 0
129 KEY = 00000000000000000000000000000000
130 IV = 00000000000000000000000000000000
131 PLAINTEXT = f34481ec3cc627bacd5dc3fb08f273e6
132 CIPHERTEXT = 0336763e966d92595a567cc9ce537f5e
133
134 COUNT = 1
135 KEY = 00000000000000000000000000000000
136 IV = 00000000000000000000000000000000
137 PLAINTEXT = 9798c4640bad75c7c3227db910174e72
138 CIPHERTEXT = a9a1631bf4996954ebc093957b234589
139
140 [DECRYPT]
141
142 COUNT = 0
143 KEY = 00000000000000000000000000000000
144 IV = 00000000000000000000000000000000
145 CIPHERTEXT = 0336763e966d92595a567cc9ce537f5e
146 PLAINTEXT = f34481ec3cc627bacd5dc3fb08f273e6
147
148 COUNT = 1
149 KEY = 00000000000000000000000000000000
150 IV = 00000000000000000000000000000000
151 CIPHERTEXT = a9a1631bf4996954ebc093957b234589
152 PLAINTEXT = 9798c4640bad75c7c3227db910174e72
153 """).splitlines()
154
Alex Gaynord3ce7032013-11-11 14:46:20 -0800155 assert load_nist_vectors(vector_data) == [
156 {
157 "key": b"00000000000000000000000000000000",
158 "iv": b"00000000000000000000000000000000",
159 "plaintext": b"f34481ec3cc627bacd5dc3fb08f273e6",
160 "ciphertext": b"0336763e966d92595a567cc9ce537f5e",
161 },
162 {
163 "key": b"00000000000000000000000000000000",
164 "iv": b"00000000000000000000000000000000",
165 "plaintext": b"9798c4640bad75c7c3227db910174e72",
166 "ciphertext": b"a9a1631bf4996954ebc093957b234589",
167 },
Alex Gaynor1fe70b12013-10-16 11:59:17 -0700168 {
169 "key": b"00000000000000000000000000000000",
170 "iv": b"00000000000000000000000000000000",
171 "plaintext": b"f34481ec3cc627bacd5dc3fb08f273e6",
172 "ciphertext": b"0336763e966d92595a567cc9ce537f5e",
173 },
174 {
175 "key": b"00000000000000000000000000000000",
176 "iv": b"00000000000000000000000000000000",
177 "plaintext": b"9798c4640bad75c7c3227db910174e72",
178 "ciphertext": b"a9a1631bf4996954ebc093957b234589",
179 },
Donald Stufft9e1a48b2013-08-09 00:32:30 -0400180 ]
181
182
Paul Kehrer1951bf62013-09-15 12:05:43 -0500183def test_load_cryptrec_vectors():
184 vector_data = textwrap.dedent("""
185 # Vectors taken from http://info.isl.ntt.co.jp/crypt/eng/camellia/
186 # Download is t_camelia.txt
187
188 # Camellia with 128-bit key
189
190 K No.001 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
191
192 P No.001 : 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
193 C No.001 : 07 92 3A 39 EB 0A 81 7D 1C 4D 87 BD B8 2D 1F 1C
194
195 P No.002 : 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
196 C No.002 : 48 CD 64 19 80 96 72 D2 34 92 60 D8 9A 08 D3 D3
197
198 K No.002 : 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
199
200 P No.001 : 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
201 C No.001 : 07 92 3A 39 EB 0A 81 7D 1C 4D 87 BD B8 2D 1F 1C
202 """).splitlines()
203
204 assert load_cryptrec_vectors(vector_data) == [
Alex Gaynor1fe70b12013-10-16 11:59:17 -0700205 {
206 "key": b"00000000000000000000000000000000",
207 "plaintext": b"80000000000000000000000000000000",
208 "ciphertext": b"07923A39EB0A817D1C4D87BDB82D1F1C",
209 },
210 {
211 "key": b"00000000000000000000000000000000",
212 "plaintext": b"40000000000000000000000000000000",
213 "ciphertext": b"48CD6419809672D2349260D89A08D3D3",
214 },
215 {
216 "key": b"10000000000000000000000000000000",
217 "plaintext": b"80000000000000000000000000000000",
218 "ciphertext": b"07923A39EB0A817D1C4D87BDB82D1F1C",
219 },
Paul Kehrer1951bf62013-09-15 12:05:43 -0500220 ]
221
222
Donald Stufft3359d7e2013-10-19 19:33:06 -0400223def test_load_cryptrec_vectors_invalid():
224 vector_data = textwrap.dedent("""
225 # Vectors taken from http://info.isl.ntt.co.jp/crypt/eng/camellia/
226 # Download is t_camelia.txt
227
228 # Camellia with 128-bit key
229
230 E No.001 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
231 """).splitlines()
232
233 with pytest.raises(ValueError):
234 load_cryptrec_vectors(vector_data)
235
236
Paul Kehrer6b99a1b2013-09-24 16:50:21 -0500237def test_load_openssl_vectors():
Paul Kehrer05d72142013-09-15 14:03:15 -0500238 vector_data = textwrap.dedent(
239 """
240 # We don't support CFB{1,8}-CAMELLIAxxx.{En,De}crypt
241 # For all CFB128 encrypts and decrypts, the transformed sequence is
242 # CAMELLIA-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec
243 # CFB128-CAMELLIA128.Encrypt
244 """
245 "CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:"
246 "000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:"
247 "14F7646187817EB586599146B82BD719:1\n"
248 "CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:"
249 "14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:"
250 "A53D28BB82DF741103EA4F921A44880B:1\n\n"
251 "# CFB128-CAMELLIA128.Decrypt\n"
252 "CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:"
253 "000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:"
254 "14F7646187817EB586599146B82BD719:0\n"
255 "CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:"
256 "14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:"
257 "A53D28BB82DF741103EA4F921A44880B:0"
258 ).splitlines()
Paul Kehrer1951bf62013-09-15 12:05:43 -0500259
Paul Kehrer6b99a1b2013-09-24 16:50:21 -0500260 assert load_openssl_vectors(vector_data) == [
Alex Gaynor016eed12013-10-16 14:16:04 -0700261 {
262 "key": b"2B7E151628AED2A6ABF7158809CF4F3C",
263 "iv": b"000102030405060708090A0B0C0D0E0F",
264 "plaintext": b"6BC1BEE22E409F96E93D7E117393172A",
265 "ciphertext": b"14F7646187817EB586599146B82BD719",
266 },
267 {
268 "key": b"2B7E151628AED2A6ABF7158809CF4F3C",
269 "iv": b"14F7646187817EB586599146B82BD719",
270 "plaintext": b"AE2D8A571E03AC9C9EB76FAC45AF8E51",
271 "ciphertext": b"A53D28BB82DF741103EA4F921A44880B",
272 },
273 {
274 "key": b"2B7E151628AED2A6ABF7158809CF4F3C",
275 "iv": b"000102030405060708090A0B0C0D0E0F",
276 "plaintext": b"6BC1BEE22E409F96E93D7E117393172A",
277 "ciphertext": b"14F7646187817EB586599146B82BD719",
278 },
279 {
280 "key": b"2B7E151628AED2A6ABF7158809CF4F3C",
281 "iv": b"14F7646187817EB586599146B82BD719",
282 "plaintext": b"AE2D8A571E03AC9C9EB76FAC45AF8E51",
283 "ciphertext": b"A53D28BB82DF741103EA4F921A44880B",
284 },
Paul Kehrer1951bf62013-09-15 12:05:43 -0500285 ]
286
287
Paul Kehrer69e06522013-10-18 17:28:39 -0500288def test_load_hash_vectors():
289 vector_data = textwrap.dedent("""
290
291 # http://tools.ietf.org/html/rfc1321
Paul Kehrer87cd0db2013-10-18 18:01:26 -0500292 [irrelevant]
Paul Kehrer69e06522013-10-18 17:28:39 -0500293
294 Len = 0
295 Msg = 00
296 MD = d41d8cd98f00b204e9800998ecf8427e
297
298 Len = 8
299 Msg = 61
300 MD = 0cc175b9c0f1b6a831c399e269772661
301
302 Len = 24
303 Msg = 616263
304 MD = 900150983cd24fb0d6963f7d28e17f72
305
306 Len = 112
307 Msg = 6d65737361676520646967657374
308 MD = f96b697d7cb7938d525a2f31aaf161d0
309 """).splitlines()
310 assert load_hash_vectors(vector_data) == [
Paul Kehrer79c16e92013-10-18 17:44:36 -0500311 (b"", "d41d8cd98f00b204e9800998ecf8427e"),
312 (b"61", "0cc175b9c0f1b6a831c399e269772661"),
313 (b"616263", "900150983cd24fb0d6963f7d28e17f72"),
314 (b"6d65737361676520646967657374", "f96b697d7cb7938d525a2f31aaf161d0"),
Paul Kehrer69e06522013-10-18 17:28:39 -0500315 ]
316
317
Paul Kehrer0317b042013-10-28 17:34:27 -0500318def test_load_hmac_vectors():
319 vector_data = textwrap.dedent("""
320Len = 224
321# "Jefe"
322Key = 4a656665
323# "what do ya want for nothing?"
324Msg = 7768617420646f2079612077616e7420666f72206e6f7468696e673f
325MD = 750c783e6ab0b503eaa86e310a5db738
326 """).splitlines()
327 assert load_hash_vectors(vector_data) == [
328 (b"7768617420646f2079612077616e7420666f72206e6f7468696e673f",
329 "750c783e6ab0b503eaa86e310a5db738",
330 b"4a656665"),
331 ]
332
333
Paul Kehrer69e06522013-10-18 17:28:39 -0500334def test_load_hash_vectors_bad_data():
335 vector_data = textwrap.dedent("""
336 # http://tools.ietf.org/html/rfc1321
337
338 Len = 0
339 Msg = 00
340 UNKNOWN=Hello World
341 """).splitlines()
342 with pytest.raises(ValueError):
343 load_hash_vectors(vector_data)
344
Alex Gaynor41172ab2013-11-12 10:00:42 -0800345
Alex Gaynorab53bc52013-11-12 09:37:59 -0800346def test_load_vectors_from_file():
347 vectors = load_vectors_from_file(
348 os.path.join("ciphers", "Blowfish", "bf-cfb.txt"),
349 load_nist_vectors,
Paul Kehrer2b758672013-10-30 09:01:38 -0500350 )
Alex Gaynorab53bc52013-11-12 09:37:59 -0800351 assert vectors == [
352 {
Alex Gaynorc2f45d52013-11-12 09:50:25 -0800353 "key": b"0123456789ABCDEFF0E1D2C3B4A59687",
354 "iv": b"FEDCBA9876543210",
Alex Gaynorab53bc52013-11-12 09:37:59 -0800355 "plaintext": (
Alex Gaynorc2f45d52013-11-12 09:50:25 -0800356 b"37363534333231204E6F77206973207468652074696D6520666F722000"
Alex Gaynorab53bc52013-11-12 09:37:59 -0800357 ),
358 "ciphertext": (
Alex Gaynorc2f45d52013-11-12 09:50:25 -0800359 b"E73214A2822139CAF26ECF6D2EB9E76E3DA3DE04D1517200519D57A6C3"
Alex Gaynorab53bc52013-11-12 09:37:59 -0800360 ),
361 }
362 ]
Paul Kehrera43b6692013-11-12 15:35:49 -0600363
364
365def test_load_nist_gcm_vectors():
366 vector_data = textwrap.dedent("""
367 [Keylen = 128]
368 [IVlen = 96]
369 [PTlen = 0]
370 [AADlen = 0]
371 [Taglen = 128]
372
373 Count = 0
374 Key = 11754cd72aec309bf52f7687212e8957
375 IV = 3c819d9a9bed087615030b65
376 PT =
377 AAD =
378 CT =
379 Tag = 250327c674aaf477aef2675748cf6971
380
381 Count = 1
382 Key = 272f16edb81a7abbea887357a58c1917
383 IV = 794ec588176c703d3d2a7a07
384 PT =
385 AAD =
386 CT =
387 Tag = b6e6f197168f5049aeda32dafbdaeb
388
389 Count = 2
390 Key = a49a5e26a2f8cb63d05546c2a62f5343
391 IV = 907763b19b9b4ab6bd4f0281
392 CT =
393 AAD =
394 Tag = a2be08210d8c470a8df6e8fbd79ec5cf
395 FAIL
396
397 Count = 3
398 Key = 5c1155084cc0ede76b3bc22e9f7574ef
399 IV = 9549e4ba69a61cad7856efc1
400 PT = d1448fa852b84408e2dad8381f363de7
401 AAD = e98e9d9c618e46fef32660976f854ee3
402 CT = f78b60ca125218493bea1c50a2e12ef4
403 Tag = d72da7f5c6cf0bca7242c71835809449
404
405 [Keylen = 128]
406 [IVlen = 96]
407 [PTlen = 0]
408 [AADlen = 0]
409 [Taglen = 120]
410
411 Count = 0
412 Key = eac258e99c55e6ae8ef1da26640613d7
413 IV = 4e8df20faaf2c8eebe922902
414 CT =
415 AAD =
416 Tag = e39aeaebe86aa309a4d062d6274339
417 PT =
418
419 Count = 1
420 Key = 3726cf02fcc6b8639a5497652c94350d
421 IV = 55fef82cde693ce76efcc193
422 CT =
423 AAD =
424 Tag = 3d68111a81ed22d2ef5bccac4fc27f
425 FAIL
426
427 Count = 2
428 Key = f202299d5fd74f03b12d2119a6c4c038
429 IV = eec51e7958c3f20a1bb71815
430 CT =
431 AAD =
432 Tag = a81886b3fb26e51fca87b267e1e157
433 FAIL
434
435 Count = 3
436 Key = fd52925f39546b4c55ffb6b20c59898c
437 IV = f5cf3227444afd905a5f6dba
438 CT =
439 AAD =
440 Tag = 1665b0f1a0b456e1664cfd3de08ccd
441 PT =
Paul Kehrerc985dbb2013-11-18 14:11:55 -0600442
443 [Keylen = 128]
444 [IVlen = 8]
445 [PTlen = 104]
446 [AADlen = 0]
447 [Taglen = 128]
448
449 Count = 0
450 Key = 58fab7632bcf10d2bcee58520bf37414
451 IV = 3c
452 CT = 15c4db4cbb451211179d57017f
453 AAD =
454 Tag = eae841d4355feeb3f786bc86625f1e5b
455 FAIL
Paul Kehrera43b6692013-11-12 15:35:49 -0600456 """).splitlines()
457 assert load_nist_vectors(vector_data) == [
458 {'aad': b'',
Paul Kehrer749ac5b2013-11-18 18:12:41 -0600459 'pt': b'',
460 'iv': b'3c819d9a9bed087615030b65',
461 'tag': b'250327c674aaf477aef2675748cf6971',
462 'key': b'11754cd72aec309bf52f7687212e8957',
463 'ct': b''},
464 {'aad': b'',
465 'pt': b'',
466 'iv': b'794ec588176c703d3d2a7a07',
467 'tag': b'b6e6f197168f5049aeda32dafbdaeb',
468 'key': b'272f16edb81a7abbea887357a58c1917',
469 'ct': b''},
470 {'aad': b'',
471 'iv': b'907763b19b9b4ab6bd4f0281',
472 'tag': b'a2be08210d8c470a8df6e8fbd79ec5cf',
473 'key': b'a49a5e26a2f8cb63d05546c2a62f5343',
474 'ct': b'',
Paul Kehrerc985dbb2013-11-18 14:11:55 -0600475 'fail': True},
Paul Kehrer749ac5b2013-11-18 18:12:41 -0600476 {'aad': b'e98e9d9c618e46fef32660976f854ee3',
477 'pt': b'd1448fa852b84408e2dad8381f363de7',
478 'iv': b'9549e4ba69a61cad7856efc1',
479 'tag': b'd72da7f5c6cf0bca7242c71835809449',
480 'key': b'5c1155084cc0ede76b3bc22e9f7574ef',
481 'ct': b'f78b60ca125218493bea1c50a2e12ef4'},
Paul Kehrerc985dbb2013-11-18 14:11:55 -0600482 {'aad': b'',
Paul Kehrera43b6692013-11-12 15:35:49 -0600483 'pt': b'',
484 'iv': b'4e8df20faaf2c8eebe922902',
485 'tag': b'e39aeaebe86aa309a4d062d6274339',
486 'key': b'eac258e99c55e6ae8ef1da26640613d7',
487 'ct': b''},
488 {'aad': b'',
489 'iv': b'55fef82cde693ce76efcc193',
490 'tag': b'3d68111a81ed22d2ef5bccac4fc27f',
491 'key': b'3726cf02fcc6b8639a5497652c94350d',
492 'ct': b'',
493 'fail': True},
494 {'aad': b'',
495 'iv': b'eec51e7958c3f20a1bb71815',
496 'tag': b'a81886b3fb26e51fca87b267e1e157',
497 'key': b'f202299d5fd74f03b12d2119a6c4c038',
498 'ct': b'',
499 'fail': True},
500 {'aad': b'',
501 'pt': b'',
502 'iv': b'f5cf3227444afd905a5f6dba',
503 'tag': b'1665b0f1a0b456e1664cfd3de08ccd',
504 'key': b'fd52925f39546b4c55ffb6b20c59898c',
505 'ct': b''},
506 {'aad': b'',
Paul Kehrer749ac5b2013-11-18 18:12:41 -0600507 'iv': b'3c',
508 'tag': b'eae841d4355feeb3f786bc86625f1e5b',
509 'key': b'58fab7632bcf10d2bcee58520bf37414',
510 'ct': b'15c4db4cbb451211179d57017f',
Paul Kehrera43b6692013-11-12 15:35:49 -0600511 'fail': True},
Paul Kehrera43b6692013-11-12 15:35:49 -0600512 ]