evpkdf_x942.txt 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #
  2. # Copyright 2001-2021 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. # Tests start with one of these keywords
  9. # Cipher Decrypt Derive Digest Encoding KDF MAC PBE
  10. # PrivPubKeyPair Sign Verify VerifyRecover
  11. # and continue until a blank line. Lines starting with a pound sign are ignored.
  12. Title = X9.42 KDF tests (RFC3565 2.3.2 Examples)
  13. KDF = X942KDF
  14. Ctrl.digest = digest:SHA1
  15. Ctrl.hexsecret = hexsecret:000102030405060708090a0b0c0d0e0f10111213
  16. Ctrl.cekalg = cekalg:id-aes128-wrap
  17. Output = d6d6b094c1027a7de6e3117294a35364
  18. KDF = X942KDF
  19. Ctrl.digest = digest:SHA1
  20. Ctrl.hexkey = hexkey:000102030405060708090a0b0c0d0e0f10111213
  21. Ctrl.cekalg = cekalg:id-aes256-wrap
  22. Ctrl.hexukm = hexukm:0123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba9876543201
  23. Output = 8890585C4E281A5C1167CAA530BED59B3230D893CBA8F922BD1B56A0
  24. Title = X9.42 KDF tests (generated tests to test different options)
  25. KDF = X942KDF
  26. Ctrl.digest = digest:SHA1
  27. Ctrl.hexsecret = hexsecret:000102030405060708090a0b0c0d0e0f10111213
  28. Ctrl.cekalg = cekalg:id-aes256-wrap
  29. Ctrl.hexpartyu-info = hexpartyu-info:0123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba9876543201
  30. Output = 8890585C4E281A5C1167CAA530BED59B3230D893CBA8F922BD1B56A0
  31. KDF = X942KDF
  32. Ctrl.digest = digest:SHA1
  33. Ctrl.hexsecret = hexsecret:000102030405060708090a0b0c0d0e0f10111213
  34. Ctrl.cekalg = cekalg:id-aes256-wrap
  35. Ctrl.hexpartyu-info = hexpartyu-info:0123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba9876543201
  36. Ctrl.use-keybits = use-keybits:0
  37. Output = 54bd5dbc1fa4c42c951f6fa51ec59e202b8c622bdb179fb2dd691ffb
  38. KDF = X942KDF
  39. Ctrl.digest = digest:SHA1
  40. Ctrl.hexsecret = hexsecret:000102030405060708090a0b0c0d0e0f10111213
  41. Ctrl.cekalg = cekalg:id-aes256-wrap
  42. Ctrl.hexpartyv-info = hexpartyv-info:0123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba9876543201
  43. Ctrl.use-keybits = use-keybits:0
  44. Output = 76d566e948ca9ae61bcd4ce076f0bd5fe6789b5b0f288977235ecb12
  45. KDF = X942KDF
  46. Ctrl.digest = digest:SHA1
  47. Ctrl.hexsecret = hexsecret:000102030405060708090a0b0c0d0e0f10111213
  48. Ctrl.cekalg = cekalg:id-aes256-wrap
  49. Ctrl.hexsupp-pubinfo = hexsupp-pubinfo:0123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba9876543201
  50. Output = ff368c7addb27d7599f8d49bc8d7fbf804540f119491ea419792c82c
  51. KDF = X942KDF
  52. Ctrl.digest = digest:SHA1
  53. Ctrl.hexsecret = hexsecret:000102030405060708090a0b0c0d0e0f10111213
  54. Ctrl.cekalg = cekalg:id-aes256-wrap
  55. Ctrl.hexsupp-privinfo = hexsupp-privinfo:0123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba98765432010123456789abcdeffedcba9876543201
  56. Output = 6b68b7affe5efc15e77df56e3dd639b22aa39f12eb0685b33fb39c57
  57. KDF = X942KDF
  58. Ctrl.digest = digest:SHA1
  59. Ctrl.hexsecret = hexsecret:000102030405060708090a0b0c0d0e0f10111213
  60. Ctrl.cekalg = cekalg:id-aes256-wrap
  61. Ctrl.hexpartyu-info = hexpartyu-info:0123456789abcdef
  62. Ctrl.hexpartyv-info = hexpartyv-info:fedcba9876543210
  63. Ctrl.hexsupp-pubinfo = hexsupp-pubinfo:12345678
  64. Ctrl.hexsupp-privinfo = hexsupp-privinfo:87654321
  65. Output = 2c5c1f028c6d1fc9ba752e41fdb9edb2ea936f1b2449f214acd56d31
  66. Title = X9.42 KDF tests (ACVP test vectors)
  67. KDF = X942KDF-ASN1
  68. Ctrl.digest = digest:SHA256
  69. Ctrl.hexsecret = hexsecret:6B
  70. Ctrl.use-keybits = use-keybits:0
  71. Ctrl.cekalg = cekalg:id-aes128-wrap
  72. Ctrl.hexacvp-info = hexacvp-info:a020299D468D60BC6A257E0B6523D691A3FC1602453B35F308C762FBBAC6069A88BCa12080D49BFE5BE01C7D56489AB017663C22B8CBB34C3174D1D71F00CB7505AC759Aa2203C21A5EA5988562C007986E0503D039E7231D9F152FE72A231A1FD98C59BCA6Aa320FD47477542989B51E4A0845DFABD6EEAA465F69B3D75349B2520051782C7F3FC
  73. Output = C2E6A0978C24AF3932F478583ADBFB5F57D491822592EAD3C538875F46EB057A
  74. # Negative tests
  75. # Fail if both acvp and ukm values are specified.
  76. KDF = X942KDF-ASN1
  77. Ctrl.digest = digest:SHA256
  78. Ctrl.hexsecret = hexsecret:6B
  79. Ctrl.use-keybits = use-keybits:0
  80. Ctrl.cekalg = cekalg:id-aes128-wrap
  81. Ctrl.hexacvp-info = hexacvp-info:a020299D468D60BC6A257E0B6523D691A3FC1602453B35F308C762FBBAC6069A88BCa12080D49BFE5BE01C7D56489AB017663C22B8CBB34C3174D1D71F00CB7505AC759Aa2203C21A5EA5988562C007986E0503D039E7231D9F152FE72A231A1FD98C59BCA6Aa320FD47477542989B51E4A0845DFABD6EEAA465F69B3D75349B2520051782C7F3FC
  82. Ctrl.hexukm = hexukm:012345
  83. Output = C2E6A0978C24AF3932F478583ADBFB5F57D491822592EAD3C538875F46EB057A
  84. Result = KDF_DERIVE_ERROR