1#
2# Copyright 2001-2020 The OpenSSL Project Authors. All Rights Reserved.
3#
4# Licensed under the Apache License 2.0 (the "License").  You may not use
5# this file except in compliance with the License.  You can obtain a copy
6# in the file LICENSE in the source distribution or at
7# https://www.openssl.org/source/license.html
8
9# Tests start with one of these keywords
10#       Cipher Decrypt Derive Digest Encoding KDF MAC PBE
11#       PrivPubKeyPair Sign Verify VerifyRecover
12# and continue until a blank line. Lines starting with a pound sign are ignored.
13
14Title = AES OCB Test vectors
15
16Cipher = aes-128-ocb
17Key = 000102030405060708090A0B0C0D0E0F
18IV = 000102030405060708090A0B
19AAD =
20Tag = 197B9C3C441D3C83EAFB2BEF633B9182
21Plaintext =
22Ciphertext =
23
24Cipher = aes-128-ocb
25Key = 000102030405060708090A0B0C0D0E0F
26IV = 000102030405060708090A0B
27AAD = 0001020304050607
28Tag = 16DC76A46D47E1EAD537209E8A96D14E
29Plaintext = 0001020304050607
30Ciphertext = 92B657130A74B85A
31
32Cipher = aes-128-ocb
33Key = 000102030405060708090A0B0C0D0E0F
34IV = 000102030405060708090A0B
35AAD = 0001020304050607
36Tag = 98B91552C8C009185044E30A6EB2FE21
37Plaintext =
38Ciphertext =
39
40Cipher = aes-128-ocb
41Key = 000102030405060708090A0B0C0D0E0F
42IV = 000102030405060708090A0B
43AAD =
44Tag = 971EFFCAE19AD4716F88E87B871FBEED
45Plaintext = 0001020304050607
46Ciphertext = 92B657130A74B85A
47
48Cipher = aes-128-ocb
49Key = 000102030405060708090A0B0C0D0E0F
50IV = 000102030405060708090A0B
51AAD = 000102030405060708090A0B0C0D0E0F
52Tag = 776C9924D6723A1FC4524532AC3E5BEB
53Plaintext = 000102030405060708090A0B0C0D0E0F
54Ciphertext = BEA5E8798DBE7110031C144DA0B26122
55
56Cipher = aes-128-ocb
57Key = 000102030405060708090A0B0C0D0E0F
58IV = 000102030405060708090A0B
59AAD = 000102030405060708090A0B0C0D0E0F
60Tag = 7DDB8E6CEA6814866212509619B19CC6
61Plaintext =
62Ciphertext =
63
64Cipher = aes-128-ocb
65Key = 000102030405060708090A0B0C0D0E0F
66IV = 000102030405060708090A0B
67AAD =
68Tag = 13CC8B747807121A4CBB3E4BD6B456AF
69Plaintext = 000102030405060708090A0B0C0D0E0F
70Ciphertext = BEA5E8798DBE7110031C144DA0B26122
71
72Cipher = aes-128-ocb
73Key = 000102030405060708090A0B0C0D0E0F
74IV = 000102030405060708090A0B
75AAD = 000102030405060708090A0B0C0D0E0F1011121314151617
76Tag = 5FA94FC3F38820F1DC3F3D1FD4E55E1C
77Plaintext = 000102030405060708090A0B0C0D0E0F1011121314151617
78Ciphertext = BEA5E8798DBE7110031C144DA0B26122FCFCEE7A2A8D4D48
79
80Cipher = aes-128-ocb
81Key = 000102030405060708090A0B0C0D0E0F
82IV = 000102030405060708090A0B
83AAD = 000102030405060708090A0B0C0D0E0F1011121314151617
84Tag = 282026DA3068BC9FA118681D559F10F6
85Plaintext =
86Ciphertext =
87
88Cipher = aes-128-ocb
89Key = 000102030405060708090A0B0C0D0E0F
90IV = 000102030405060708090A0B
91AAD =
92Tag = 6EF2F52587FDA0ED97DC7EEDE241DF68
93Plaintext = 000102030405060708090A0B0C0D0E0F1011121314151617
94Ciphertext = BEA5E8798DBE7110031C144DA0B26122FCFCEE7A2A8D4D48
95
96Cipher = aes-128-ocb
97Key = 000102030405060708090A0B0C0D0E0F
98IV = 000102030405060708090A0B
99AAD = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
100Tag = B2A040DD3BD5164372D76D7BB6824240
101Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
102Ciphertext = BEA5E8798DBE7110031C144DA0B26122CEAAB9B05DF771A657149D53773463CB
103
104Cipher = aes-128-ocb
105Key = 000102030405060708090A0B0C0D0E0F
106IV = 000102030405060708090A0B
107AAD = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
108Tag = E1E072633BADE51A60E85951D9C42A1B
109Plaintext =
110Ciphertext =
111
112Cipher = aes-128-ocb
113Key = 000102030405060708090A0B0C0D0E0F
114IV = 000102030405060708090A0B
115AAD =
116Tag = 4A3BAE824465CFDAF8C41FC50C7DF9D9
117Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F
118Ciphertext = BEA5E8798DBE7110031C144DA0B26122CEAAB9B05DF771A657149D53773463CB
119
120Cipher = aes-128-ocb
121Key = 000102030405060708090A0B0C0D0E0F
122IV = 000102030405060708090A0B
123AAD = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
124Tag = 659C623211DEEA0DE30D2C381879F4C8
125Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
126Ciphertext = BEA5E8798DBE7110031C144DA0B26122CEAAB9B05DF771A657149D53773463CB68C65778B058A635
127
128Cipher = aes-128-ocb
129Key = 000102030405060708090A0B0C0D0E0F
130IV = 000102030405060708090A0B
131AAD = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
132Tag = 7AEB7A69A1687DD082CA27B0D9A37096
133Plaintext =
134Ciphertext =
135
136Cipher = aes-128-ocb
137Key = 000102030405060708090A0B0C0D0E0F
138IV = 000102030405060708090A0B
139AAD =
140Tag = 060C8467F4ABAB5E8B3C2067A2E115DC
141Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
142Ciphertext = BEA5E8798DBE7110031C144DA0B26122CEAAB9B05DF771A657149D53773463CB68C65778B058A635
143
144#AES OCB Non standard test vectors - generated from reference implementation
145Cipher = aes-128-ocb
146Key = 000102030405060708090A0B0C0D0E0F
147IV = 000102030405060708090A0B
148AAD = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
149Tag = 1b6c44f34e3abb3cbf8976e7
150Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
151Ciphertext = 09a4fd29de949d9a9aa9924248422097ad4883b4713e6c214ff6567ada08a96766fc4e2ee3e3a5a1
152
153Cipher = aes-128-ocb
154Key = 000102030405060708090A0B0C0D0E0F
155IV = 000102030405060708090A0B0C0D0E
156AAD = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
157Tag = 1ad62009901f40cba7cd7156f94a7324
158Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
159Ciphertext = 5e2fa7367ffbdb3938845cfd415fcc71ec79634eb31451609d27505f5e2978f43c44213d8fa441ee
160
161Cipher = aes-128-ocb
162Key = 000102030405060708090A0B0C0D0E0F
163IV = 000102030405060708090A0B
164AAD = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
165Tag = C203F98CE28F7DAD3F31C021
166Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F3031
167Ciphertext = 09A4FD29DE949D9A9AA9924248422097AD4883B4713E6C214FF6567ADA08A967B2176C12F110DD441B7CAA3A509B13C822D6
168
169Cipher = aes-128-ocb
170Key = 000102030405060708090A0B0C0D0E0F
171IV = 000102030405060708090A0B
172AAD = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
173Tag = 8346D7D47C5D893ED472F5AB
174Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F4041
175Ciphertext = 09A4FD29DE949D9A9AA9924248422097AD4883B4713E6C214FF6567ADA08A967B2176C12F110DD441B7CAA3A509B13C86A023AFCEE998BEE42028D44507B15F714FF
176
177Cipher = aes-128-ocb
178Key = 000102030405060708090A0B0C0D0E0F
179IV = 000102030405060708090A0B
180AAD = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
181Tag = 5822A9A70FDF55D29D2984A6
182Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F5051
183Ciphertext = 09A4FD29DE949D9A9AA9924248422097AD4883B4713E6C214FF6567ADA08A967B2176C12F110DD441B7CAA3A509B13C86A023AFCEE998BEE42028D44507B15F77C528A1DE6406B519BCEE8FCB8294170634D
184
185Cipher = aes-128-ocb
186Key = 000102030405060708090A0B0C0D0E0F
187IV = 000102030405060708090A0B
188AAD = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
189Tag = 81772B6741ABB4ECA9D2DEB2
190Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F6061
191Ciphertext = 09A4FD29DE949D9A9AA9924248422097AD4883B4713E6C214FF6567ADA08A967B2176C12F110DD441B7CAA3A509B13C86A023AFCEE998BEE42028D44507B15F77C528A1DE6406B519BCEE8FCB829417001E54E15A7576C4DF32366E0F439C7050FAA
192
193Cipher = aes-128-ocb
194Key = 000102030405060708090A0B0C0D0E0F
195IV = 000102030405060708090A0B
196AAD = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
197Tag = 3E52A01D068DE85456DB03B7
198Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071
199Ciphertext = 09A4FD29DE949D9A9AA9924248422097AD4883B4713E6C214FF6567ADA08A967B2176C12F110DD441B7CAA3A509B13C86A023AFCEE998BEE42028D44507B15F77C528A1DE6406B519BCEE8FCB829417001E54E15A7576C4DF32366E0F439C7051CB4824B8114E9A720CBC1CE0185B156B486
200
201Cipher = aes-128-ocb
202Key = 000102030405060708090A0B0C0D0E0F
203IV = 000102030405060708090A0B
204AAD = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F2021222324252627
205Tag = 3E52A01D068DE85456DB03B6
206Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071
207Ciphertext = 09A4FD29DE949D9A9AA9924248422097AD4883B4713E6C214FF6567ADA08A967B2176C12F110DD441B7CAA3A509B13C86A023AFCEE998BEE42028D44507B15F77C528A1DE6406B519BCEE8FCB829417001E54E15A7576C4DF32366E0F439C7051CB4824B8114E9A720CBC1CE0185B156B486
208Operation = DECRYPT
209Result = CIPHERFINAL_ERROR
210
211#Test vectors generated to validate aesni_ocb_encrypt on x86
212Cipher = aes-128-ocb
213Key = 000102030405060708090A0B0C0D0E0F
214IV = 000000000001020304050607
215Tag = C14DFF7D62A13C4A3422456207453190
216Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F
217Ciphertext = F5186C9CC3506386919B6FD9443956E05B203313F8AB35E916AB36932EBDDCD2945901BABE7CF29404929F322F954C916065FABF8F1E52F4BD7C538C0F96899519DBC6BC504D837D8EBD1436B45D33F528CB642FA2EB2C403FE604C12B819333
218
219Cipher = aes-128-ocb
220Key = 000102030405060708090A0B0C0D0E0F
221IV = 000000000001020304050607
222Tag = D47D84F6FF912C79B6A4223AB9BE2DB8
223Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F
224Ciphertext = F5186C9CC3506386919B6FD9443956E05B203313F8AB35E916AB36932EBDDCD2945901BABE7CF29404929F322F954C916065FABF8F1E52F4BD7C538C0F96899519DBC6BC504D837D8EBD1436B45D33F528CB642FA2EB2C403FE604C12B8193332374120A78A1171D23ED9E9CB1ADC204
225
226Cipher = aes-128-ocb
227Key = 000102030405060708090A0B0C0D0E0F
228IV = 000000000001020304050607
229Tag = 41970D13737B7BD1B5FBF49ED4412CA5
230Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071000102030405060708090A0B0C0D
231Ciphertext = F5186C9CC3506386919B6FD9443956E05B203313F8AB35E916AB36932EBDDCD2945901BABE7CF29404929F322F954C916065FABF8F1E52F4BD7C538C0F96899519DBC6BC504D837D8EBD1436B45D33F528CB642FA2EB2C403FE604C12B8193332374120A78A1171D23ED9E9CB1ADC20412C017AD0CA498827C768DDD99B26E91
232
233Cipher = aes-128-ocb
234Key = 000102030405060708090A0B0C0D0E0F
235IV = 000000000001020304050607
236Tag = BE0228651ED4E48A11BDED68D953F3A0
237Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D
238Ciphertext = F5186C9CC3506386919B6FD9443956E05B203313F8AB35E916AB36932EBDDCD2945901BABE7CF29404929F322F954C916065FABF8F1E52F4BD7C538C0F96899519DBC6BC504D837D8EBD1436B45D33F528CB642FA2EB2C403FE604C12B8193332374120A78A1171D23ED9E9CB1ADC20412C017AD0CA498827C768DDD99B26E91EDB8681700FF30366F07AEDE8CEACC1F
239
240Cipher = aes-128-ocb
241Key = 000102030405060708090A0B0C0D0E0F
242IV = 000000000001020304050607
243Tag = 17BC6E10B16E5FDC52836E7D589518C7
244Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D
245Ciphertext = F5186C9CC3506386919B6FD9443956E05B203313F8AB35E916AB36932EBDDCD2945901BABE7CF29404929F322F954C916065FABF8F1E52F4BD7C538C0F96899519DBC6BC504D837D8EBD1436B45D33F528CB642FA2EB2C403FE604C12B8193332374120A78A1171D23ED9E9CB1ADC20412C017AD0CA498827C768DDD99B26E91EDB8681700FF30366F07AEDE8CEACC1F39BE69B91BC808FA7A193F7EEA43137B
246
247Cipher = aes-128-ocb
248Key = 000102030405060708090A0B0C0D0E0F
249IV = 000000000001020304050607
250Tag = E84AAC18666116990A3A37B3A5FC55BD
251Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D
252Ciphertext = F5186C9CC3506386919B6FD9443956E05B203313F8AB35E916AB36932EBDDCD2945901BABE7CF29404929F322F954C916065FABF8F1E52F4BD7C538C0F96899519DBC6BC504D837D8EBD1436B45D33F528CB642FA2EB2C403FE604C12B8193332374120A78A1171D23ED9E9CB1ADC20412C017AD0CA498827C768DDD99B26E91EDB8681700FF30366F07AEDE8CEACC1F39BE69B91BC808FA7A193F7EEA43137B11CF99263D693AEBDF8ADE1A1D838DED
253
254Cipher = aes-128-ocb
255Key = 000102030405060708090A0B0C0D0E0F
256IV = 000000000001020304050607
257Tag = 3E5EA7EE064FE83B313E28D411E91EAD
258Plaintext = 000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D4E4F505152535455565758595A5B5C5D5E5F606162636465666768696A6B6C6D6E6F7071000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D
259Ciphertext = F5186C9CC3506386919B6FD9443956E05B203313F8AB35E916AB36932EBDDCD2945901BABE7CF29404929F322F954C916065FABF8F1E52F4BD7C538C0F96899519DBC6BC504D837D8EBD1436B45D33F528CB642FA2EB2C403FE604C12B8193332374120A78A1171D23ED9E9CB1ADC20412C017AD0CA498827C768DDD99B26E91EDB8681700FF30366F07AEDE8CEACC1F39BE69B91BC808FA7A193F7EEA43137B11CF99263D693AEBDF8ADE1A1D838DED48D9E09F452F8E6FBEB76A3DED47611C
260