rtlduino rtl8710af gcc base version

This commit is contained in:
RtlduinoMan 2016-09-12 17:16:56 +08:00
parent 7675bdb95f
commit 9c0c9edf61
2097 changed files with 779974 additions and 2 deletions

View file

@ -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;

View file

@ -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 */

View 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;
}