blob: 8ecb33f90a90530d0d4a99757d98546f84c56a65 [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 Kehreraed9e172014-01-19 12:09:27 -060038 selected_backends = select_backends(name, backends)
39 assert len(selected_backends) == 1
40 assert selected_backends[0] == b2
Paul Kehrer34c075e2014-01-13 21:52:08 -050041
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
Paul Kehreraed9e172014-01-19 12:09:27 -060059 selected_backends = select_backends(name, backends)
60 assert len(selected_backends) == 3
Paul Kehrerc421e632014-01-18 09:22:21 -060061
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 "
Paul Kehreraed9e172014-01-19 12:09:27 -060069 selected_backends = select_backends(name, backends)
70 assert len(selected_backends) == 2
71 assert selected_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 Kehrer6fb1a5a2014-01-29 13:44:07 -0600183def test_load_nist_vectors_with_null_chars():
184 vector_data = textwrap.dedent("""
185 COUNT = 0
186 KEY = thing\\0withnulls
187
188 COUNT = 1
189 KEY = 00000000000000000000000000000000
190 """).splitlines()
191
192 assert load_nist_vectors(vector_data) == [
193 {
194 "key": b"thing\x00withnulls",
195 },
196 {
197 "key": b"00000000000000000000000000000000",
198 },
199 ]
200
201
Paul Kehrer1951bf62013-09-15 12:05:43 -0500202def test_load_cryptrec_vectors():
203 vector_data = textwrap.dedent("""
204 # Vectors taken from http://info.isl.ntt.co.jp/crypt/eng/camellia/
205 # Download is t_camelia.txt
206
207 # Camellia with 128-bit key
208
209 K No.001 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
210
211 P No.001 : 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
212 C No.001 : 07 92 3A 39 EB 0A 81 7D 1C 4D 87 BD B8 2D 1F 1C
213
214 P No.002 : 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
215 C No.002 : 48 CD 64 19 80 96 72 D2 34 92 60 D8 9A 08 D3 D3
216
217 K No.002 : 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
218
219 P No.001 : 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
220 C No.001 : 07 92 3A 39 EB 0A 81 7D 1C 4D 87 BD B8 2D 1F 1C
221 """).splitlines()
222
223 assert load_cryptrec_vectors(vector_data) == [
Alex Gaynor1fe70b12013-10-16 11:59:17 -0700224 {
225 "key": b"00000000000000000000000000000000",
226 "plaintext": b"80000000000000000000000000000000",
227 "ciphertext": b"07923A39EB0A817D1C4D87BDB82D1F1C",
228 },
229 {
230 "key": b"00000000000000000000000000000000",
231 "plaintext": b"40000000000000000000000000000000",
232 "ciphertext": b"48CD6419809672D2349260D89A08D3D3",
233 },
234 {
235 "key": b"10000000000000000000000000000000",
236 "plaintext": b"80000000000000000000000000000000",
237 "ciphertext": b"07923A39EB0A817D1C4D87BDB82D1F1C",
238 },
Paul Kehrer1951bf62013-09-15 12:05:43 -0500239 ]
240
241
Donald Stufft3359d7e2013-10-19 19:33:06 -0400242def test_load_cryptrec_vectors_invalid():
243 vector_data = textwrap.dedent("""
244 # Vectors taken from http://info.isl.ntt.co.jp/crypt/eng/camellia/
245 # Download is t_camelia.txt
246
247 # Camellia with 128-bit key
248
249 E No.001 : 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
250 """).splitlines()
251
252 with pytest.raises(ValueError):
253 load_cryptrec_vectors(vector_data)
254
255
Paul Kehrer6b99a1b2013-09-24 16:50:21 -0500256def test_load_openssl_vectors():
Paul Kehrer05d72142013-09-15 14:03:15 -0500257 vector_data = textwrap.dedent(
258 """
259 # We don't support CFB{1,8}-CAMELLIAxxx.{En,De}crypt
260 # For all CFB128 encrypts and decrypts, the transformed sequence is
261 # CAMELLIA-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec
262 # CFB128-CAMELLIA128.Encrypt
263 """
264 "CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:"
265 "000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:"
266 "14F7646187817EB586599146B82BD719:1\n"
267 "CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:"
268 "14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:"
269 "A53D28BB82DF741103EA4F921A44880B:1\n\n"
270 "# CFB128-CAMELLIA128.Decrypt\n"
271 "CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:"
272 "000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:"
273 "14F7646187817EB586599146B82BD719:0\n"
274 "CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:"
275 "14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:"
276 "A53D28BB82DF741103EA4F921A44880B:0"
277 ).splitlines()
Paul Kehrer1951bf62013-09-15 12:05:43 -0500278
Paul Kehrer6b99a1b2013-09-24 16:50:21 -0500279 assert load_openssl_vectors(vector_data) == [
Alex Gaynor016eed12013-10-16 14:16:04 -0700280 {
281 "key": b"2B7E151628AED2A6ABF7158809CF4F3C",
282 "iv": b"000102030405060708090A0B0C0D0E0F",
283 "plaintext": b"6BC1BEE22E409F96E93D7E117393172A",
284 "ciphertext": b"14F7646187817EB586599146B82BD719",
285 },
286 {
287 "key": b"2B7E151628AED2A6ABF7158809CF4F3C",
288 "iv": b"14F7646187817EB586599146B82BD719",
289 "plaintext": b"AE2D8A571E03AC9C9EB76FAC45AF8E51",
290 "ciphertext": b"A53D28BB82DF741103EA4F921A44880B",
291 },
292 {
293 "key": b"2B7E151628AED2A6ABF7158809CF4F3C",
294 "iv": b"000102030405060708090A0B0C0D0E0F",
295 "plaintext": b"6BC1BEE22E409F96E93D7E117393172A",
296 "ciphertext": b"14F7646187817EB586599146B82BD719",
297 },
298 {
299 "key": b"2B7E151628AED2A6ABF7158809CF4F3C",
300 "iv": b"14F7646187817EB586599146B82BD719",
301 "plaintext": b"AE2D8A571E03AC9C9EB76FAC45AF8E51",
302 "ciphertext": b"A53D28BB82DF741103EA4F921A44880B",
303 },
Paul Kehrer1951bf62013-09-15 12:05:43 -0500304 ]
305
306
Paul Kehrer69e06522013-10-18 17:28:39 -0500307def test_load_hash_vectors():
308 vector_data = textwrap.dedent("""
309
310 # http://tools.ietf.org/html/rfc1321
Paul Kehrer87cd0db2013-10-18 18:01:26 -0500311 [irrelevant]
Paul Kehrer69e06522013-10-18 17:28:39 -0500312
313 Len = 0
314 Msg = 00
315 MD = d41d8cd98f00b204e9800998ecf8427e
316
317 Len = 8
318 Msg = 61
319 MD = 0cc175b9c0f1b6a831c399e269772661
320
321 Len = 24
322 Msg = 616263
323 MD = 900150983cd24fb0d6963f7d28e17f72
324
325 Len = 112
326 Msg = 6d65737361676520646967657374
327 MD = f96b697d7cb7938d525a2f31aaf161d0
328 """).splitlines()
329 assert load_hash_vectors(vector_data) == [
Paul Kehrer79c16e92013-10-18 17:44:36 -0500330 (b"", "d41d8cd98f00b204e9800998ecf8427e"),
331 (b"61", "0cc175b9c0f1b6a831c399e269772661"),
332 (b"616263", "900150983cd24fb0d6963f7d28e17f72"),
333 (b"6d65737361676520646967657374", "f96b697d7cb7938d525a2f31aaf161d0"),
Paul Kehrer69e06522013-10-18 17:28:39 -0500334 ]
335
336
Paul Kehrer0317b042013-10-28 17:34:27 -0500337def test_load_hmac_vectors():
338 vector_data = textwrap.dedent("""
339Len = 224
340# "Jefe"
341Key = 4a656665
342# "what do ya want for nothing?"
343Msg = 7768617420646f2079612077616e7420666f72206e6f7468696e673f
344MD = 750c783e6ab0b503eaa86e310a5db738
345 """).splitlines()
346 assert load_hash_vectors(vector_data) == [
347 (b"7768617420646f2079612077616e7420666f72206e6f7468696e673f",
348 "750c783e6ab0b503eaa86e310a5db738",
349 b"4a656665"),
350 ]
351
352
Paul Kehrer69e06522013-10-18 17:28:39 -0500353def test_load_hash_vectors_bad_data():
354 vector_data = textwrap.dedent("""
355 # http://tools.ietf.org/html/rfc1321
356
357 Len = 0
358 Msg = 00
359 UNKNOWN=Hello World
360 """).splitlines()
361 with pytest.raises(ValueError):
362 load_hash_vectors(vector_data)
363
Alex Gaynor41172ab2013-11-12 10:00:42 -0800364
Alex Gaynorab53bc52013-11-12 09:37:59 -0800365def test_load_vectors_from_file():
366 vectors = load_vectors_from_file(
367 os.path.join("ciphers", "Blowfish", "bf-cfb.txt"),
368 load_nist_vectors,
Paul Kehrer2b758672013-10-30 09:01:38 -0500369 )
Alex Gaynorab53bc52013-11-12 09:37:59 -0800370 assert vectors == [
371 {
Alex Gaynorc2f45d52013-11-12 09:50:25 -0800372 "key": b"0123456789ABCDEFF0E1D2C3B4A59687",
373 "iv": b"FEDCBA9876543210",
Alex Gaynorab53bc52013-11-12 09:37:59 -0800374 "plaintext": (
Alex Gaynorc2f45d52013-11-12 09:50:25 -0800375 b"37363534333231204E6F77206973207468652074696D6520666F722000"
Alex Gaynorab53bc52013-11-12 09:37:59 -0800376 ),
377 "ciphertext": (
Alex Gaynorc2f45d52013-11-12 09:50:25 -0800378 b"E73214A2822139CAF26ECF6D2EB9E76E3DA3DE04D1517200519D57A6C3"
Alex Gaynorab53bc52013-11-12 09:37:59 -0800379 ),
380 }
381 ]
Paul Kehrera43b6692013-11-12 15:35:49 -0600382
383
384def test_load_nist_gcm_vectors():
385 vector_data = textwrap.dedent("""
386 [Keylen = 128]
387 [IVlen = 96]
388 [PTlen = 0]
389 [AADlen = 0]
390 [Taglen = 128]
391
392 Count = 0
393 Key = 11754cd72aec309bf52f7687212e8957
394 IV = 3c819d9a9bed087615030b65
395 PT =
396 AAD =
397 CT =
398 Tag = 250327c674aaf477aef2675748cf6971
399
400 Count = 1
401 Key = 272f16edb81a7abbea887357a58c1917
402 IV = 794ec588176c703d3d2a7a07
403 PT =
404 AAD =
405 CT =
406 Tag = b6e6f197168f5049aeda32dafbdaeb
407
408 Count = 2
409 Key = a49a5e26a2f8cb63d05546c2a62f5343
410 IV = 907763b19b9b4ab6bd4f0281
411 CT =
412 AAD =
413 Tag = a2be08210d8c470a8df6e8fbd79ec5cf
414 FAIL
415
416 Count = 3
417 Key = 5c1155084cc0ede76b3bc22e9f7574ef
418 IV = 9549e4ba69a61cad7856efc1
419 PT = d1448fa852b84408e2dad8381f363de7
420 AAD = e98e9d9c618e46fef32660976f854ee3
421 CT = f78b60ca125218493bea1c50a2e12ef4
422 Tag = d72da7f5c6cf0bca7242c71835809449
423
424 [Keylen = 128]
425 [IVlen = 96]
426 [PTlen = 0]
427 [AADlen = 0]
428 [Taglen = 120]
429
430 Count = 0
431 Key = eac258e99c55e6ae8ef1da26640613d7
432 IV = 4e8df20faaf2c8eebe922902
433 CT =
434 AAD =
435 Tag = e39aeaebe86aa309a4d062d6274339
436 PT =
437
438 Count = 1
439 Key = 3726cf02fcc6b8639a5497652c94350d
440 IV = 55fef82cde693ce76efcc193
441 CT =
442 AAD =
443 Tag = 3d68111a81ed22d2ef5bccac4fc27f
444 FAIL
445
446 Count = 2
447 Key = f202299d5fd74f03b12d2119a6c4c038
448 IV = eec51e7958c3f20a1bb71815
449 CT =
450 AAD =
451 Tag = a81886b3fb26e51fca87b267e1e157
452 FAIL
453
454 Count = 3
455 Key = fd52925f39546b4c55ffb6b20c59898c
456 IV = f5cf3227444afd905a5f6dba
457 CT =
458 AAD =
459 Tag = 1665b0f1a0b456e1664cfd3de08ccd
460 PT =
Paul Kehrerc985dbb2013-11-18 14:11:55 -0600461
462 [Keylen = 128]
463 [IVlen = 8]
464 [PTlen = 104]
465 [AADlen = 0]
466 [Taglen = 128]
467
468 Count = 0
469 Key = 58fab7632bcf10d2bcee58520bf37414
470 IV = 3c
471 CT = 15c4db4cbb451211179d57017f
472 AAD =
473 Tag = eae841d4355feeb3f786bc86625f1e5b
474 FAIL
Paul Kehrera43b6692013-11-12 15:35:49 -0600475 """).splitlines()
476 assert load_nist_vectors(vector_data) == [
477 {'aad': b'',
Paul Kehrer749ac5b2013-11-18 18:12:41 -0600478 'pt': b'',
479 'iv': b'3c819d9a9bed087615030b65',
480 'tag': b'250327c674aaf477aef2675748cf6971',
481 'key': b'11754cd72aec309bf52f7687212e8957',
482 'ct': b''},
483 {'aad': b'',
484 'pt': b'',
485 'iv': b'794ec588176c703d3d2a7a07',
486 'tag': b'b6e6f197168f5049aeda32dafbdaeb',
487 'key': b'272f16edb81a7abbea887357a58c1917',
488 'ct': b''},
489 {'aad': b'',
490 'iv': b'907763b19b9b4ab6bd4f0281',
491 'tag': b'a2be08210d8c470a8df6e8fbd79ec5cf',
492 'key': b'a49a5e26a2f8cb63d05546c2a62f5343',
493 'ct': b'',
Paul Kehrerc985dbb2013-11-18 14:11:55 -0600494 'fail': True},
Paul Kehrer749ac5b2013-11-18 18:12:41 -0600495 {'aad': b'e98e9d9c618e46fef32660976f854ee3',
496 'pt': b'd1448fa852b84408e2dad8381f363de7',
497 'iv': b'9549e4ba69a61cad7856efc1',
498 'tag': b'd72da7f5c6cf0bca7242c71835809449',
499 'key': b'5c1155084cc0ede76b3bc22e9f7574ef',
500 'ct': b'f78b60ca125218493bea1c50a2e12ef4'},
Paul Kehrerc985dbb2013-11-18 14:11:55 -0600501 {'aad': b'',
Paul Kehrera43b6692013-11-12 15:35:49 -0600502 'pt': b'',
503 'iv': b'4e8df20faaf2c8eebe922902',
504 'tag': b'e39aeaebe86aa309a4d062d6274339',
505 'key': b'eac258e99c55e6ae8ef1da26640613d7',
506 'ct': b''},
507 {'aad': b'',
508 'iv': b'55fef82cde693ce76efcc193',
509 'tag': b'3d68111a81ed22d2ef5bccac4fc27f',
510 'key': b'3726cf02fcc6b8639a5497652c94350d',
511 'ct': b'',
512 'fail': True},
513 {'aad': b'',
514 'iv': b'eec51e7958c3f20a1bb71815',
515 'tag': b'a81886b3fb26e51fca87b267e1e157',
516 'key': b'f202299d5fd74f03b12d2119a6c4c038',
517 'ct': b'',
518 'fail': True},
519 {'aad': b'',
520 'pt': b'',
521 'iv': b'f5cf3227444afd905a5f6dba',
522 'tag': b'1665b0f1a0b456e1664cfd3de08ccd',
523 'key': b'fd52925f39546b4c55ffb6b20c59898c',
524 'ct': b''},
525 {'aad': b'',
Paul Kehrer749ac5b2013-11-18 18:12:41 -0600526 'iv': b'3c',
527 'tag': b'eae841d4355feeb3f786bc86625f1e5b',
528 'key': b'58fab7632bcf10d2bcee58520bf37414',
529 'ct': b'15c4db4cbb451211179d57017f',
Paul Kehrera43b6692013-11-12 15:35:49 -0600530 'fail': True},
Paul Kehrera43b6692013-11-12 15:35:49 -0600531 ]