選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
 
 
 
 
 
 

77 行
3.1 KiB

  1. /* Copyright (c) 2017, 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_FIPSMODULE_CAVP_TEST_UTIL_H
  15. #define OPENSSL_HEADER_CRYPTO_FIPSMODULE_CAVP_TEST_UTIL_H
  16. #include <stdlib.h>
  17. #include <string>
  18. #include <vector>
  19. #include <openssl/aead.h>
  20. #include <openssl/cipher.h>
  21. #include "../crypto/test/file_test.h"
  22. std::string EncodeHex(const uint8_t *in, size_t in_len);
  23. const EVP_CIPHER *GetCipher(const std::string &name);
  24. bool CipherOperation(const EVP_CIPHER *cipher, std::vector<uint8_t> *out,
  25. bool encrypt, const std::vector<uint8_t> &key,
  26. const std::vector<uint8_t> &iv,
  27. const std::vector<uint8_t> &in);
  28. bool AEADEncrypt(const EVP_AEAD *aead, std::vector<uint8_t> *ct,
  29. std::vector<uint8_t> *tag, size_t tag_len,
  30. const std::vector<uint8_t> &key,
  31. const std::vector<uint8_t> &pt,
  32. const std::vector<uint8_t> &aad,
  33. const std::vector<uint8_t> &iv);
  34. bool AEADDecrypt(const EVP_AEAD *aead, std::vector<uint8_t> *pt, size_t pt_len,
  35. const std::vector<uint8_t> &key,
  36. const std::vector<uint8_t> &aad,
  37. const std::vector<uint8_t> &ct,
  38. const std::vector<uint8_t> &tag,
  39. const std::vector<uint8_t> &iv);
  40. bssl::UniquePtr<BIGNUM> GetBIGNUM(FileTest *t, const char *attribute);
  41. int GetECGroupNIDFromInstruction(FileTest *t, const char **out_str = nullptr);
  42. const EVP_MD *GetDigestFromInstruction(FileTest *t);
  43. void EchoComment(const std::string& comment);
  44. int cavp_aes_gcm_test_main(int argc, char **argv);
  45. int cavp_aes_test_main(int argc, char **argv);
  46. int cavp_ctr_drbg_test_main(int argc, char **argv);
  47. int cavp_ecdsa2_keypair_test_main(int argc, char **argv);
  48. int cavp_ecdsa2_pkv_test_main(int argc, char **argv);
  49. int cavp_ecdsa2_siggen_test_main(int argc, char **argv);
  50. int cavp_ecdsa2_sigver_test_main(int argc, char **argv);
  51. int cavp_hmac_test_main(int argc, char **argv);
  52. int cavp_keywrap_test_main(int argc, char **argv);
  53. int cavp_rsa2_keygen_test_main(int argc, char **argv);
  54. int cavp_rsa2_siggen_test_main(int argc, char **argv);
  55. int cavp_rsa2_sigver_test_main(int argc, char **argv);
  56. int cavp_sha_monte_test_main(int argc, char **argv);
  57. int cavp_sha_test_main(int argc, char **argv);
  58. int cavp_tdes_test_main(int argc, char **argv);
  59. #endif // OPENSSL_HEADER_CRYPTO_FIPSMODULE_CAVP_TEST_UTIL_H