sec_crypto_rng.h 918 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (C) 2017-2020 Alibaba Group Holding Limited
  3. */
  4. /******************************************************************************
  5. * @file seccrypt_rng.h
  6. * @brief Header File for RNG
  7. * @version V1.0
  8. * @date 20. Jul 2020
  9. * @model rng
  10. ******************************************************************************/
  11. #ifndef _SC_RNG_H_
  12. #define _SC_RNG_H_
  13. #include <stdint.h>
  14. #include "sec_crypto_errcode.h"
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /**
  19. \brief Get data from the TRNG engine
  20. \param[out] data Pointer to buffer with data get from TRNG
  21. \param[in] num Number of data items in bytes
  22. \return error code
  23. */
  24. uint32_t sc_rng_get_multi_byte(uint8_t *data, uint32_t num);
  25. /**
  26. \brief Get data from the TRNG engine
  27. \return error code
  28. */
  29. uint32_t sc_rng_get_single_word(uint32_t *data);
  30. #ifdef __cplusplus
  31. }
  32. #endif
  33. #endif /* _DRV_TRNG_H_ */