drbg_cavs_data.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the OpenSSL license (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. /*
  10. * Known answer tests (KAT) for NIST SP800-90A DRBGs.
  11. */
  12. #include <stddef.h>
  13. #ifndef OSSL_TEST_DRBG_CAVS_DATA_H
  14. # define OSSL_TEST_DRBG_CAVS_DATA_H
  15. enum drbg_kat_type {
  16. NO_RESEED,
  17. PR_FALSE,
  18. PR_TRUE
  19. };
  20. enum drbg_df {
  21. USE_DF,
  22. NO_DF,
  23. NA
  24. };
  25. struct drbg_kat_no_reseed {
  26. size_t count;
  27. const unsigned char *entropyin;
  28. const unsigned char *nonce;
  29. const unsigned char *persstr;
  30. const unsigned char *addin1;
  31. const unsigned char *addin2;
  32. const unsigned char *retbytes;
  33. };
  34. struct drbg_kat_pr_false {
  35. size_t count;
  36. const unsigned char *entropyin;
  37. const unsigned char *nonce;
  38. const unsigned char *persstr;
  39. const unsigned char *entropyinreseed;
  40. const unsigned char *addinreseed;
  41. const unsigned char *addin1;
  42. const unsigned char *addin2;
  43. const unsigned char *retbytes;
  44. };
  45. struct drbg_kat_pr_true {
  46. size_t count;
  47. const unsigned char *entropyin;
  48. const unsigned char *nonce;
  49. const unsigned char *persstr;
  50. const unsigned char *entropyinpr1;
  51. const unsigned char *addin1;
  52. const unsigned char *entropyinpr2;
  53. const unsigned char *addin2;
  54. const unsigned char *retbytes;
  55. };
  56. struct drbg_kat {
  57. enum drbg_kat_type type;
  58. enum drbg_df df;
  59. int nid;
  60. size_t entropyinlen;
  61. size_t noncelen;
  62. size_t persstrlen;
  63. size_t addinlen;
  64. size_t retbyteslen;
  65. const void *t;
  66. };
  67. extern const struct drbg_kat *drbg_test[];
  68. extern const size_t drbg_test_nelem;
  69. #endif