luat_soc_sdk_2024 V1.0
luat_crypto.h 文件参考
#include "luat_base.h"

浏览该文件的源代码.

结构体

struct  luat_crypt_stream_t
 
struct  luat_crypto_cipher_ctx
 

宏定义

#define LUAT_CRYPTO_AES_ECB   1
 
#define LUAT_CRYPTO_AES_CBC   2
 
#define LUAT_CRYPTO_AES_CTR   3
 
#define LUAT_CRYPTO_AES_CFB   4
 
#define LUAT_CRYPTO_AES_OFB   5
 
#define LUAT_CRYPTO_AES_PAD_ZERO   1
 
#define LUAT_CRYPTO_AES_PAD_5   2
 
#define LUAT_CRYPTO_AES_PAD_7   3
 

类型定义

typedef struct luat_crypto_cipher_ctx luat_crypto_cipher_ctx_t
 

函数

int luat_crypto_trng (char *buff, size_t len)
 生成随机数
 
int luat_crypto_md5_simple (const char *str, size_t str_size, void *out_ptr)
 计算md5值
 
int luat_crypto_hmac_md5_simple (const char *str, size_t str_size, const char *mac, size_t mac_size, void *out_ptr)
 计算hmac_md5值
 
int luat_crypto_sha1_simple (const char *str, size_t str_size, void *out_ptr)
 计算sha1值
 
int luat_crypto_hmac_sha1_simple (const char *str, size_t str_size, const char *mac, size_t mac_size, void *out_ptr)
 计算hmac_sha1值
 
int luat_crypto_sha256_simple (const char *str, size_t str_size, void *out_ptr)
 计算sha256值
 
int luat_crypto_hmac_sha256_simple (const char *str, size_t str_size, const char *mac, size_t mac_size, void *out_ptr)
 计算hmac_sha256值
 
int luat_crypto_sha512_simple (const char *str, size_t str_size, void *out_ptr)
 计算sha512值
 
int luat_crypto_hmac_sha512_simple (const char *str, size_t str_size, const char *mac, size_t mac_size, void *out_ptr)
 计算hmac_sha512值
 
int luat_crypto_base64_encode (unsigned char *dst, size_t dlen, size_t *olen, const unsigned char *src, size_t slen)
 BASE64加密
 
int luat_crypto_base64_decode (unsigned char *dst, size_t dlen, size_t *olen, const unsigned char *src, size_t slen)
 BASE64解密
 
int luat_crypto_cipher_list (const char **list, size_t *len)
 
int luat_crypto_cipher_suites (const char **list, size_t *len)
 
int luat_crypto_md (const char *md, const char *str, size_t str_size, void *out_ptr, const char *key, size_t key_len)
 
int luat_crypto_md_file (const char *md, void *out_ptr, const char *key, size_t key_len, const char *path)
 
int luat_crypto_md_init (const char *md, const char *key, luat_crypt_stream_t *stream)
 
int luat_crypto_md_update (const char *str, size_t str_size, luat_crypt_stream_t *stream)
 
int luat_crypto_md_finish (void *out_ptr, luat_crypt_stream_t *stream)
 
int luat_crypto_cipher_xxx (luat_crypto_cipher_ctx_t *cctx)
 

宏定义说明

◆ LUAT_CRYPTO_AES_CBC

#define LUAT_CRYPTO_AES_CBC   2

在文件 luat_crypto.h6 行定义.

◆ LUAT_CRYPTO_AES_CFB

#define LUAT_CRYPTO_AES_CFB   4

在文件 luat_crypto.h8 行定义.

◆ LUAT_CRYPTO_AES_CTR

#define LUAT_CRYPTO_AES_CTR   3

在文件 luat_crypto.h7 行定义.

◆ LUAT_CRYPTO_AES_ECB

#define LUAT_CRYPTO_AES_ECB   1

在文件 luat_crypto.h5 行定义.

◆ LUAT_CRYPTO_AES_OFB

#define LUAT_CRYPTO_AES_OFB   5

在文件 luat_crypto.h9 行定义.

◆ LUAT_CRYPTO_AES_PAD_5

#define LUAT_CRYPTO_AES_PAD_5   2

在文件 luat_crypto.h12 行定义.

◆ LUAT_CRYPTO_AES_PAD_7

#define LUAT_CRYPTO_AES_PAD_7   3

在文件 luat_crypto.h13 行定义.

◆ LUAT_CRYPTO_AES_PAD_ZERO

#define LUAT_CRYPTO_AES_PAD_ZERO   1

在文件 luat_crypto.h11 行定义.

类型定义说明

◆ luat_crypto_cipher_ctx_t

函数说明

◆ luat_crypto_cipher_list()

int luat_crypto_cipher_list ( const char ** list,
size_t * len )

◆ luat_crypto_cipher_suites()

int luat_crypto_cipher_suites ( const char ** list,
size_t * len )

◆ luat_crypto_cipher_xxx()

int luat_crypto_cipher_xxx ( luat_crypto_cipher_ctx_t * cctx)

◆ luat_crypto_md()

int luat_crypto_md ( const char * md,
const char * str,
size_t str_size,
void * out_ptr,
const char * key,
size_t key_len )

◆ luat_crypto_md_file()

int luat_crypto_md_file ( const char * md,
void * out_ptr,
const char * key,
size_t key_len,
const char * path )

◆ luat_crypto_md_finish()

int luat_crypto_md_finish ( void * out_ptr,
luat_crypt_stream_t * stream )

◆ luat_crypto_md_init()

int luat_crypto_md_init ( const char * md,
const char * key,
luat_crypt_stream_t * stream )

◆ luat_crypto_md_update()

int luat_crypto_md_update ( const char * str,
size_t str_size,
luat_crypt_stream_t * stream )