mirror of
https://github.com/rtlduino/RTL8710AF_GCC.git
synced 2025-07-31 20:21:04 +00:00
rtlduino rtl8710af gcc base version
This commit is contained in:
parent
7675bdb95f
commit
9c0c9edf61
2097 changed files with 779974 additions and 2 deletions
|
|
@ -0,0 +1,10 @@
|
|||
#include <rom_ssl_ram_map.h>
|
||||
#include <section_config.h>
|
||||
|
||||
#ifndef SSL_RAM_MAP_SECTION
|
||||
#define SSL_RAM_MAP_SECTION
|
||||
#endif
|
||||
|
||||
/* RAM table referred by SSL ROM */
|
||||
SSL_RAM_MAP_SECTION
|
||||
struct _rom_ssl_ram_map rom_ssl_ram_map;
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
#ifndef ROM_SSL_RAM_MAP_H
|
||||
#define ROM_SSL_RAM_MAP_H
|
||||
|
||||
#include "basic_types.h"
|
||||
|
||||
struct _rom_ssl_ram_map {
|
||||
/* OS interface */
|
||||
void *(*ssl_malloc)(unsigned int sz);
|
||||
void (*ssl_free)(void *);
|
||||
int (*ssl_printf)(const char *, ...);
|
||||
|
||||
//AES HW CRYPTO
|
||||
int (*hw_crypto_aes_ecb_init)(const u8* key, const u32 keylen);
|
||||
int (*hw_crypto_aes_ecb_decrypt)(
|
||||
const u8* message, const u32 msglen,
|
||||
const u8* iv, const u32 ivlen,
|
||||
u8* pResult);
|
||||
int (*hw_crypto_aes_ecb_encrypt)(
|
||||
const u8* message, const u32 msglen,
|
||||
const u8* iv, const u32 ivlen,
|
||||
u8* pResult);
|
||||
int (*hw_crypto_aes_cbc_init)(const u8* key, const u32 keylen);
|
||||
int (*hw_crypto_aes_cbc_decrypt)(
|
||||
const u8* message, const u32 msglen,
|
||||
const u8* iv, const u32 ivlen,
|
||||
u8* pResult);
|
||||
int (*hw_crypto_aes_cbc_encrypt)(
|
||||
const u8* message, const u32 msglen,
|
||||
const u8* iv, const u32 ivlen,
|
||||
u8* pResult);
|
||||
|
||||
//DES HW CRYPTO
|
||||
int (*hw_crypto_des_cbc_init)(const u8* key, const u32 keylen);
|
||||
int (*hw_crypto_des_cbc_decrypt)(
|
||||
const u8* message, const u32 msglen,
|
||||
const u8* iv, const u32 ivlen,
|
||||
u8* pResult);
|
||||
int (*hw_crypto_des_cbc_encrypt)(
|
||||
const u8* message, const u32 msglen,
|
||||
const u8* iv, const u32 ivlen,
|
||||
u8* pResult);
|
||||
int (*hw_crypto_3des_cbc_init)(const u8* key, const u32 keylen);
|
||||
int (*hw_crypto_3des_cbc_decrypt)(
|
||||
const u8* message, const u32 msglen,
|
||||
const u8* iv, const u32 ivlen,
|
||||
u8* pResult);
|
||||
int (*hw_crypto_3des_cbc_encrypt)(
|
||||
const u8* message, const u32 msglen,
|
||||
const u8* iv, const u32 ivlen,
|
||||
u8* pResult);
|
||||
|
||||
/* Variables */
|
||||
u32 use_hw_crypto_func;
|
||||
};
|
||||
|
||||
extern struct _rom_ssl_ram_map rom_ssl_ram_map;
|
||||
|
||||
#endif /* ROM_SSL_RAM_MAP_H */
|
||||
74
component/common/network/ssl/ssl_ram_map/ssl_ram_map.c
Normal file
74
component/common/network/ssl/ssl_ram_map/ssl_ram_map.c
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
#include "rom_ssl_ram_map.h"
|
||||
#include <diag.h>
|
||||
|
||||
extern struct _rom_ssl_ram_map rom_ssl_ram_map;
|
||||
|
||||
//AES HW CRYPTO
|
||||
extern int rtl_crypto_aes_ecb_init(IN const u8* key, IN const u32 keylen);
|
||||
extern int rtl_crypto_aes_ecb_decrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
extern int rtl_crypto_aes_ecb_encrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
extern int rtl_crypto_aes_cbc_init(IN const u8* key, IN const u32 keylen);
|
||||
extern int rtl_crypto_aes_cbc_decrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
extern int rtl_crypto_aes_cbc_encrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
|
||||
//DES HW CRYPTO
|
||||
extern int rtl_crypto_des_cbc_init(IN const u8* key, IN const u32 keylen);
|
||||
extern int rtl_crypto_des_cbc_decrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
extern int rtl_crypto_des_cbc_encrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
extern int rtl_crypto_3des_cbc_init(IN const u8* key, IN const u32 keylen);
|
||||
extern int rtl_crypto_3des_cbc_decrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
extern int rtl_crypto_3des_cbc_encrypt(
|
||||
IN const u8* message, IN const u32 msglen,
|
||||
IN const u8* iv, IN const u32 ivlen,
|
||||
OUT u8* pResult);
|
||||
|
||||
int platform_set_malloc_free( void * (*malloc_func)( size_t ),
|
||||
void (*free_func)( void * ) )
|
||||
{
|
||||
/* OS interface */
|
||||
rom_ssl_ram_map.ssl_malloc = malloc_func;
|
||||
rom_ssl_ram_map.ssl_free = free_func;
|
||||
rom_ssl_ram_map.ssl_printf = (int (*)(char const *, ...))DiagPrintf;
|
||||
|
||||
//AES HW CRYPTO
|
||||
rom_ssl_ram_map.hw_crypto_aes_ecb_init = rtl_crypto_aes_ecb_init;
|
||||
rom_ssl_ram_map.hw_crypto_aes_ecb_decrypt = rtl_crypto_aes_ecb_decrypt;
|
||||
rom_ssl_ram_map.hw_crypto_aes_ecb_encrypt = rtl_crypto_aes_ecb_encrypt;
|
||||
rom_ssl_ram_map.hw_crypto_aes_cbc_init = rtl_crypto_aes_cbc_init;
|
||||
rom_ssl_ram_map.hw_crypto_aes_cbc_decrypt = rtl_crypto_aes_cbc_decrypt;
|
||||
rom_ssl_ram_map.hw_crypto_aes_cbc_encrypt = rtl_crypto_aes_cbc_encrypt;
|
||||
|
||||
//DES HW CRYPTO
|
||||
rom_ssl_ram_map.hw_crypto_des_cbc_init = rtl_crypto_des_cbc_init;
|
||||
rom_ssl_ram_map.hw_crypto_des_cbc_decrypt = rtl_crypto_des_cbc_decrypt;
|
||||
rom_ssl_ram_map.hw_crypto_des_cbc_encrypt = rtl_crypto_des_cbc_encrypt;
|
||||
rom_ssl_ram_map.hw_crypto_3des_cbc_init = rtl_crypto_3des_cbc_init;
|
||||
rom_ssl_ram_map.hw_crypto_3des_cbc_decrypt = rtl_crypto_3des_cbc_decrypt;
|
||||
rom_ssl_ram_map.hw_crypto_3des_cbc_encrypt = rtl_crypto_3des_cbc_encrypt;
|
||||
|
||||
/* Variables */
|
||||
rom_ssl_ram_map.use_hw_crypto_func = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue