luat_crypto_air101.c 691 B

123456789101112131415161718192021222324252627
  1. #include "string.h"
  2. #include "wm_include.h"
  3. #include "wm_crypto_hard.h"
  4. #include "aes.h"
  5. #include "luat_base.h"
  6. #include "luat_crypto.h"
  7. #define LUAT_LOG_TAG "crypto"
  8. #include "luat_log.h"
  9. #include "FreeRTOS.h"
  10. #include "task.h"
  11. int luat_crypto_trng(char* buff, size_t len) {
  12. // tls_crypto_random_init(0, CRYPTO_RNG_SWITCH_32);
  13. // vTaskDelay(5);
  14. // tls_crypto_random_bytes_range(buff, len, 256);
  15. // tls_crypto_random_bytes_range(buff, len, 256);
  16. // tls_crypto_random_bytes_range(buff, len, 256);
  17. // tls_crypto_random_stop();
  18. // tls_crypto_trng(buff, len);
  19. extern int random_get_bytes(void *buf, size_t len);
  20. random_get_bytes(buff, len);
  21. return 0;
  22. }