You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

51 line
1.9 KiB

  1. /* Copyright (c) 2018, Google Inc.
  2. *
  3. * Permission to use, copy, modify, and/or distribute this software for any
  4. * purpose with or without fee is hereby granted, provided that the above
  5. * copyright notice and this permission notice appear in all copies.
  6. *
  7. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  8. * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  9. * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
  10. * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  11. * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  12. * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  13. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
  14. #ifndef OPENSSL_HEADER_CRYPTO_TEST_WYCHEPROOF_UTIL_H
  15. #define OPENSSL_HEADER_CRYPTO_TEST_WYCHEPROOF_UTIL_H
  16. #include <openssl/base.h>
  17. // This header contains convenience functions for Wycheproof tests.
  18. class FileTest;
  19. enum class WycheproofResult {
  20. kValid,
  21. kInvalid,
  22. kAcceptable,
  23. };
  24. // GetWycheproofResult sets |*out| to the parsed "result" key of |t|.
  25. bool GetWycheproofResult(FileTest *t, WycheproofResult *out);
  26. // GetWycheproofDigest returns a digest function using the Wycheproof name, or
  27. // nullptr on error.
  28. const EVP_MD *GetWycheproofDigest(FileTest *t, const char *key,
  29. bool instruction);
  30. // GetWycheproofCurve returns a curve using the Wycheproof name, or nullptr on
  31. // error.
  32. bssl::UniquePtr<EC_GROUP> GetWycheproofCurve(FileTest *t, const char *key,
  33. bool instruction);
  34. // GetWycheproofBIGNUM returns a BIGNUM in the Wycheproof format, or nullptr on
  35. // error.
  36. bssl::UniquePtr<BIGNUM> GetWycheproofBIGNUM(FileTest *t, const char *key,
  37. bool instruction);
  38. #endif // OPENSSL_HEADER_CRYPTO_TEST_WYCHEPROOF_UTIL_H