21#ifndef __RENESAS_TSIP_CRYPT_H__
22#define __RENESAS_TSIP_CRYPT_H__
24#if defined(WOLFSSL_RENESAS_TSIP_IAREWRX)
25 #include "r_bsp/mcu/all/r_rx_compiler.h"
26 #include "r_bsp/platform.h"
31#include "r_tsip_rx_if.h"
44 tsip_Key_tls_Rsa2048 = 6,
45 tsip_Key_unknown = -1,
49 l_TLS_RSA_WITH_AES_128_CBC_SHA = 0x2F,
50 l_TLS_RSA_WITH_AES_128_CBC_SHA256 = 0x3c,
51 l_TLS_RSA_WITH_AES_256_CBC_SHA = 0x35,
52 l_TLS_RSA_WITH_AES_256_CBC_SHA256 = 0x3d,
57 uint8_t *encrypted_session_key;
59 uint8_t *encrypted_user_tls_key;
60 tsip_tls_ca_certification_public_key_index_t user_rsa2048_tls_pubindex;
68void tsip_hw_unlock(
void );
69int tsip_usable(
const struct WOLFSSL *ssl);
70void tsip_inform_sflash_signedcacert(
const byte *ps_flash,
71 const byte *psigned_ca_cert, word32 len);
72void tsip_inform_cert_sign(
const byte *sign);
74void tsip_inform_user_keys(
byte *encrypted_session_key,
byte *iv,
75 byte *encrypted_user_tls_key);
77byte tsip_rootCAverified( );
78byte tsip_checkCA(word32 cmIdx);
79int tsip_tls_RootCertVerify(
const byte *cert , word32 cert_len,
80 word32 key_n_start, word32 key_n_len,
81 word32 key_e_start, word32 key_e_len,
83int tsip_tls_CertVerify(
const byte *cert, word32 certSz,
84 const byte *signature, word32 sigSz,
85 word32 key_n_start, word32 key_n_len,
86 word32 key_e_start, word32 key_e_len,
87 byte *tsip_encRsaKeyIdx);
88void tsip_inform_key_position(
const word32 key_n_start,
const word32 key_n_len,
89 const word32 key_e_start,
const word32 key_e_len);
90int tsip_generatePremasterSecret(
byte *premaster, word32 preSz);
91int tsip_generateEncryptPreMasterSecret(
struct WOLFSSL *ssl,
byte *out,
93int tsip_generateMasterSecret(
const byte *pre,
const byte *cr,
const byte *sr,
95int tsip_generateSeesionKey(
struct WOLFSSL *ssl);
96int tsip_Sha256Hmac(
const struct WOLFSSL *ssl,
const byte *myInner,
97 word32 innerSz,
const byte *in, word32 sz,
byte *digest,
99int tsip_Sha1Hmac(
const struct WOLFSSL *ssl,
const byte *myInner,
100 word32 innerSz,
const byte *in, word32 sz,
byte *digest,
103#if (!defined(NO_SHA) || !defined(NO_SHA256)) && \
104 !defined(NO_WOLFSSL_RENESAS_TSIP_CRYPT_HASH)
120#define WOLFSSL_NO_HASH_RAW
124#if !defined(NO_SHA256)
130#if defined(WOLFSSL_RENESAS_TSIP_TLS_AES_CRYPT)
132 tsip_aes_key_index_t tsip_keyIdx;
137 int wc_tsip_AesCbcEncrypt(
struct Aes* aes,
byte* out,
const byte* in,
139 int wc_tsip_AesCbcDecrypt(
struct Aes* aes,
byte* out,
const byte* in,
144#if defined(WOLFSSL_RENESAS_TSIP_CRYPT_DEBUG)
145byte *ret2err(word32 ret);
Definition renesas-tsip-crypt.h:131
Definition internal.h:3849
Definition renesas-tsip-crypt.h:56
Definition wolfcaam_sha.h:68
Definition renesas-tsip-crypt.h:111