luat_crypto.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef LUAT_CRYPTO_H
  2. #define LUAT_CRYPTO_H
  3. #include "luat_base.h"
  4. #define LUAT_CRYPTO_AES_ECB 1
  5. #define LUAT_CRYPTO_AES_CBC 2
  6. #define LUAT_CRYPTO_AES_CTR 3
  7. #define LUAT_CRYPTO_AES_CFB 4
  8. #define LUAT_CRYPTO_AES_OFB 5
  9. #define LUAT_CRYPTO_AES_PAD_ZERO 1
  10. #define LUAT_CRYPTO_AES_PAD_5 2
  11. #define LUAT_CRYPTO_AES_PAD_7 3
  12. int luat_crypto_trng(char* buff, size_t len);
  13. int luat_crypto_md5_simple(const char* str, size_t str_size, void* out_ptr);
  14. int luat_crypto_hmac_md5_simple(const char* str, size_t str_size, const char* mac, size_t mac_size, void* out_ptr);
  15. int luat_crypto_sha1_simple(const char* str, size_t str_size, void* out_ptr);
  16. int luat_crypto_hmac_sha1_simple(const char* str, size_t str_size, const char* mac, size_t mac_size, void* out_ptr);
  17. int luat_crypto_sha256_simple(const char* str, size_t str_size, void* out_ptr);
  18. int luat_crypto_hmac_sha256_simple(const char* str, size_t str_size, const char* mac, size_t mac_size, void* out_ptr) ;
  19. int luat_crypto_sha512_simple(const char* str, size_t str_size, void* out_ptr) ;
  20. int luat_crypto_hmac_sha512_simple(const char* str, size_t str_size, const char* mac, size_t mac_size, void* out_ptr) ;
  21. int luat_crypto_cipher_list(const char** list, size_t* len);
  22. int luat_crypto_cipher_suites(const char** list, size_t* len);
  23. int luat_crypto_md(const char* md, const char* str, size_t str_size, void* out_ptr, const char* key, size_t key_len);
  24. int luat_crypto_md_file(const char* md, void* out_ptr, const char* key, size_t key_len, const char* path);
  25. #endif