sha1_alt.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright (c) 2023 HPMicro
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. *
  6. */
  7. #ifndef SHA1_ALT_H
  8. #define SHA1_ALT_H
  9. #if !defined(MBEDTLS_CONFIG_FILE)
  10. #include "mbedtls/config.h"
  11. #else
  12. #include MBEDTLS_CONFIG_FILE
  13. #endif
  14. #include "hpm_common.h"
  15. #include "hpm_sdp_drv.h"
  16. #include "hpm_romapi.h"
  17. #include "sha_common.h"
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. #if defined(MBEDTLS_SHA1_ALT)
  22. /**
  23. * \brief The SHA-1 context structure.
  24. *
  25. * \warning SHA-1 is considered a weak message digest and its use
  26. * constitutes a security risk. We recommend considering
  27. * stronger message digests instead.
  28. *
  29. */
  30. typedef struct mbedtls_sha1_context
  31. {
  32. uint32_t total[2]; /*!< The number of Bytes processed. */
  33. uint32_t state[5]; /*!< The intermediate digest state. */
  34. unsigned char buffer[64]; /*!< The data block being processed. */
  35. }
  36. mbedtls_sha1_context;
  37. #endif /* defined(MBEDTLS_SHA1_ALT) */
  38. #ifdef __cplusplus
  39. }
  40. #endif
  41. #endif /* SHA1_ALT_H */