1e1051a39Sopenharmony_ci#
2e1051a39Sopenharmony_ci# Copyright 2001-2021 The OpenSSL Project Authors. All Rights Reserved.
3e1051a39Sopenharmony_ci#
4e1051a39Sopenharmony_ci# Licensed under the Apache License 2.0 (the "License").  You may not use
5e1051a39Sopenharmony_ci# this file except in compliance with the License.  You can obtain a copy
6e1051a39Sopenharmony_ci# in the file LICENSE in the source distribution or at
7e1051a39Sopenharmony_ci# https://www.openssl.org/source/license.html
8e1051a39Sopenharmony_ci
9e1051a39Sopenharmony_ci# Tests start with one of these keywords
10e1051a39Sopenharmony_ci#       Cipher Decrypt Derive Digest Encoding KDF MAC PBE
11e1051a39Sopenharmony_ci#       PrivPubKeyPair Sign Verify VerifyRecover
12e1051a39Sopenharmony_ci# and continue until a blank line. Lines starting with a pound sign are ignored.
13e1051a39Sopenharmony_ci
14e1051a39Sopenharmony_ciTitle = X9.42 KDF tests (RFC3565 2.3.2 Examples)
15e1051a39Sopenharmony_ci
16e1051a39Sopenharmony_ciKDF = X942KDF
17e1051a39Sopenharmony_ciCtrl.digest = digest:SHA1
18e1051a39Sopenharmony_ciCtrl.hexsecret = hexsecret:000102030405060708090a0b0c0d0e0f10111213
19e1051a39Sopenharmony_ciCtrl.cekalg = cekalg:id-aes128-wrap
20e1051a39Sopenharmony_ciOutput = d6d6b094c1027a7de6e3117294a35364
21e1051a39Sopenharmony_ci
22e1051a39Sopenharmony_ciKDF = X942KDF
23e1051a39Sopenharmony_ciCtrl.digest = digest:SHA1
24e1051a39Sopenharmony_ciCtrl.hexkey = hexkey:000102030405060708090a0b0c0d0e0f10111213
25e1051a39Sopenharmony_ciCtrl.cekalg = cekalg:id-aes256-wrap
26e1051a39Sopenharmony_ciCtrl.hexukm = hexukm:0123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba9876543201
27e1051a39Sopenharmony_ciOutput = 8890585C4E281A5C1167CAA530BED59B3230D893CBA8F922BD1B56A0
28e1051a39Sopenharmony_ci
29e1051a39Sopenharmony_ciTitle = X9.42 KDF tests (generated tests to test different options)
30e1051a39Sopenharmony_ci
31e1051a39Sopenharmony_ciKDF = X942KDF
32e1051a39Sopenharmony_ciCtrl.digest = digest:SHA1
33e1051a39Sopenharmony_ciCtrl.hexsecret = hexsecret:000102030405060708090a0b0c0d0e0f10111213
34e1051a39Sopenharmony_ciCtrl.cekalg = cekalg:id-aes256-wrap
35e1051a39Sopenharmony_ciCtrl.hexpartyu-info = hexpartyu-info:0123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba9876543201
36e1051a39Sopenharmony_ciOutput = 8890585C4E281A5C1167CAA530BED59B3230D893CBA8F922BD1B56A0
37e1051a39Sopenharmony_ci
38e1051a39Sopenharmony_ciKDF = X942KDF
39e1051a39Sopenharmony_ciCtrl.digest = digest:SHA1
40e1051a39Sopenharmony_ciCtrl.hexsecret = hexsecret:000102030405060708090a0b0c0d0e0f10111213
41e1051a39Sopenharmony_ciCtrl.cekalg = cekalg:id-aes256-wrap
42e1051a39Sopenharmony_ciCtrl.hexpartyu-info = hexpartyu-info:0123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba9876543201
43e1051a39Sopenharmony_ciCtrl.use-keybits = use-keybits:0
44e1051a39Sopenharmony_ciOutput = 54bd5dbc1fa4c42c951f6fa51ec59e202b8c622bdb179fb2dd691ffb
45e1051a39Sopenharmony_ci
46e1051a39Sopenharmony_ciKDF = X942KDF
47e1051a39Sopenharmony_ciCtrl.digest = digest:SHA1
48e1051a39Sopenharmony_ciCtrl.hexsecret = hexsecret:000102030405060708090a0b0c0d0e0f10111213
49e1051a39Sopenharmony_ciCtrl.cekalg = cekalg:id-aes256-wrap
50e1051a39Sopenharmony_ciCtrl.hexpartyv-info = hexpartyv-info:0123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba9876543201
51e1051a39Sopenharmony_ciCtrl.use-keybits = use-keybits:0
52e1051a39Sopenharmony_ciOutput = 76d566e948ca9ae61bcd4ce076f0bd5fe6789b5b0f288977235ecb12
53e1051a39Sopenharmony_ci
54e1051a39Sopenharmony_ciKDF = X942KDF
55e1051a39Sopenharmony_ciCtrl.digest = digest:SHA1
56e1051a39Sopenharmony_ciCtrl.hexsecret = hexsecret:000102030405060708090a0b0c0d0e0f10111213
57e1051a39Sopenharmony_ciCtrl.cekalg = cekalg:id-aes256-wrap
58e1051a39Sopenharmony_ciCtrl.hexsupp-pubinfo = hexsupp-pubinfo:0123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba9876543201
59e1051a39Sopenharmony_ciOutput = ff368c7addb27d7599f8d49bc8d7fbf804540f119491ea419792c82c
60e1051a39Sopenharmony_ci
61e1051a39Sopenharmony_ciKDF = X942KDF
62e1051a39Sopenharmony_ciCtrl.digest = digest:SHA1
63e1051a39Sopenharmony_ciCtrl.hexsecret = hexsecret:000102030405060708090a0b0c0d0e0f10111213
64e1051a39Sopenharmony_ciCtrl.cekalg = cekalg:id-aes256-wrap
65e1051a39Sopenharmony_ciCtrl.hexsupp-privinfo = hexsupp-privinfo:0123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba9876543201
66e1051a39Sopenharmony_ciOutput = 6b68b7affe5efc15e77df56e3dd639b22aa39f12eb0685b33fb39c57
67e1051a39Sopenharmony_ci
68e1051a39Sopenharmony_ciKDF = X942KDF
69e1051a39Sopenharmony_ciCtrl.digest = digest:SHA1
70e1051a39Sopenharmony_ciCtrl.hexsecret = hexsecret:000102030405060708090a0b0c0d0e0f10111213
71e1051a39Sopenharmony_ciCtrl.cekalg = cekalg:id-aes256-wrap
72e1051a39Sopenharmony_ciCtrl.hexpartyu-info = hexpartyu-info:0123456789abcdef
73e1051a39Sopenharmony_ciCtrl.hexpartyv-info = hexpartyv-info:fedcba9876543210
74e1051a39Sopenharmony_ciCtrl.hexsupp-pubinfo = hexsupp-pubinfo:12345678
75e1051a39Sopenharmony_ciCtrl.hexsupp-privinfo = hexsupp-privinfo:87654321
76e1051a39Sopenharmony_ciOutput = 2c5c1f028c6d1fc9ba752e41fdb9edb2ea936f1b2449f214acd56d31
77e1051a39Sopenharmony_ci
78e1051a39Sopenharmony_ciTitle = X9.42 KDF tests (ACVP test vectors)
79e1051a39Sopenharmony_ci
80e1051a39Sopenharmony_ciKDF = X942KDF-ASN1
81e1051a39Sopenharmony_ciCtrl.digest = digest:SHA256
82e1051a39Sopenharmony_ciCtrl.hexsecret = hexsecret:6B
83e1051a39Sopenharmony_ciCtrl.use-keybits = use-keybits:0
84e1051a39Sopenharmony_ciCtrl.cekalg = cekalg:id-aes128-wrap
85e1051a39Sopenharmony_ciCtrl.hexacvp-info = hexacvp-info:a020299D468D60BC6A257E0B6523D691A3FC1602453B35F308C762FBBAC6069A88BCa12080D49BFE5BE01C7D56489AB017663C22B8CBB34C3174D1D71F00CB7505AC759Aa2203C21A5EA5988562C007986E0503D039E7231D9F152FE72A231A1FD98C59BCA6Aa320FD47477542989B51E4A0845DFABD6EEAA465F69B3D75349B2520051782C7F3FC
86e1051a39Sopenharmony_ciOutput = C2E6A0978C24AF3932F478583ADBFB5F57D491822592EAD3C538875F46EB057A
87e1051a39Sopenharmony_ci
88e1051a39Sopenharmony_ci# Negative tests
89e1051a39Sopenharmony_ci
90e1051a39Sopenharmony_ci# Fail if both acvp and ukm values are specified.
91e1051a39Sopenharmony_ciKDF = X942KDF-ASN1
92e1051a39Sopenharmony_ciCtrl.digest = digest:SHA256
93e1051a39Sopenharmony_ciCtrl.hexsecret = hexsecret:6B
94e1051a39Sopenharmony_ciCtrl.use-keybits = use-keybits:0
95e1051a39Sopenharmony_ciCtrl.cekalg = cekalg:id-aes128-wrap
96e1051a39Sopenharmony_ciCtrl.hexacvp-info = hexacvp-info:a020299D468D60BC6A257E0B6523D691A3FC1602453B35F308C762FBBAC6069A88BCa12080D49BFE5BE01C7D56489AB017663C22B8CBB34C3174D1D71F00CB7505AC759Aa2203C21A5EA5988562C007986E0503D039E7231D9F152FE72A231A1FD98C59BCA6Aa320FD47477542989B51E4A0845DFABD6EEAA465F69B3D75349B2520051782C7F3FC
97e1051a39Sopenharmony_ciCtrl.hexukm = hexukm:012345
98e1051a39Sopenharmony_ciOutput = C2E6A0978C24AF3932F478583ADBFB5F57D491822592EAD3C538875F46EB057A
99e1051a39Sopenharmony_ciResult = KDF_DERIVE_ERROR
100