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