renesas-rx64-hw-crypt.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* renesas-rx64-hw-crypt.h
  2. *
  3. * Contributed by Johnson Controls Tyco IP Holdings LLP.
  4. *
  5. * Use of this Software is subject to the GPLv2 License
  6. *
  7. * This file is part of wolfSSL.
  8. *
  9. * wolfSSL is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * wolfSSL is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  22. */
  23. #ifndef __RENESAS_RX64_HW_CRYPT_H__
  24. #define __RENESAS_RX64_HW_CRYPT_H__
  25. #include <renesas/security/sha/r_sha.h>
  26. #include <wolfssl/wolfcrypt/logging.h>
  27. #ifdef __cplusplus
  28. extern "C" {
  29. #endif
  30. int rx64_hw_Open(void);
  31. void rx64_hw_Close(void);
  32. int rx64_hw_lock(void);
  33. void rx64_hw_unlock(void);
  34. #if (!defined(NO_SHA) || defined(WOLFSSL_SHA224) || !defined(NO_SHA256))
  35. typedef enum
  36. {
  37. RX64_SHA1 = 0,
  38. RX64_SHA224 = 1,
  39. RX64_SHA256 = 2,
  40. NUM_RX64_SHA_TYPES = 3,
  41. } RX64_SHA_TYPE;
  42. typedef struct
  43. {
  44. byte* msg;
  45. void* heap;
  46. word32 used;
  47. word32 len;
  48. word32 sha_type;
  49. } wolfssl_RX64_HW_Hash;
  50. #if !defined(NO_SHA)
  51. typedef wolfssl_RX64_HW_Hash wc_Sha;
  52. #endif
  53. #if !defined(NO_SHA256)
  54. typedef wolfssl_RX64_HW_Hash wc_Sha256;
  55. #endif
  56. #if defined(WOLFSSL_SHA224)
  57. typedef wolfssl_RX64_HW_Hash wc_Sha224;
  58. #define WC_SHA224_TYPE_DEFINED
  59. #endif
  60. WOLFSSL_LOCAL int RX64_ShaCalc(byte* data, word32 len, byte* out, word32 sha_type);
  61. #endif /* !NO_SHA || WOLFSSL_SHA224 || !NO_SHA256 */
  62. #ifdef __cplusplus
  63. }
  64. #endif
  65. #endif /* __RENESAS_RX64_HW_CRYPT_H__ */