21#ifndef _WOLF_CRYPTO_CB_H_
22#define _WOLF_CRYPTO_CB_H_
32#define CRYPTO_CB_VER 2
64typedef struct wc_CryptoInfo {
66#if !defined(NO_RSA) || defined(HAVE_ECC)
80 #ifdef WOLFSSL_KEY_GEN
122#if !defined(NO_AES) || !defined(NO_DES3)
172#if !defined(NO_SHA) || !defined(NO_SHA256)
212typedef int (*CryptoDevCallbackFunc)(
int devId, wc_CryptoInfo* info,
void* ctx);
214WOLFSSL_LOCAL
void wc_CryptoCb_Init(
void);
216WOLFSSL_API
int wc_CryptoCb_RegisterDevice(
int devId, CryptoDevCallbackFunc cb,
void* ctx);
217WOLFSSL_API
void wc_CryptoCb_UnRegisterDevice(
int devId);
220#define wc_CryptoDev_RegisterDevice wc_CryptoCb_RegisterDevice
221#define wc_CryptoDev_UnRegisterDevice wc_CryptoCb_UnRegisterDevice
225WOLFSSL_LOCAL
int wc_CryptoCb_Rsa(
const byte* in, word32 inLen,
byte* out,
228#ifdef WOLFSSL_KEY_GEN
229WOLFSSL_LOCAL
int wc_CryptoCb_MakeRsaKey(
RsaKey* key,
int size,
long e,
235WOLFSSL_LOCAL
int wc_CryptoCb_MakeEccKey(
WC_RNG* rng,
int keySize,
238WOLFSSL_LOCAL
int wc_CryptoCb_Ecdh(
ecc_key* private_key,
ecc_key* public_key,
239 byte* out, word32* outlen);
241WOLFSSL_LOCAL
int wc_CryptoCb_EccSign(
const byte* in, word32 inlen,
byte* out,
244WOLFSSL_LOCAL
int wc_CryptoCb_EccVerify(
const byte* sig, word32 siglen,
245 const byte* hash, word32 hashlen,
int* res,
ecc_key* key);
250WOLFSSL_LOCAL
int wc_CryptoCb_AesGcmEncrypt(
Aes* aes,
byte* out,
251 const byte* in, word32 sz,
const byte* iv, word32 ivSz,
252 byte* authTag, word32 authTagSz,
const byte* authIn, word32 authInSz);
254WOLFSSL_LOCAL
int wc_CryptoCb_AesGcmDecrypt(
Aes* aes,
byte* out,
255 const byte* in, word32 sz,
const byte* iv, word32 ivSz,
256 const byte* authTag, word32 authTagSz,
257 const byte* authIn, word32 authInSz);
260WOLFSSL_LOCAL
int wc_CryptoCb_AesCbcEncrypt(
Aes* aes,
byte* out,
261 const byte* in, word32 sz);
262WOLFSSL_LOCAL
int wc_CryptoCb_AesCbcDecrypt(
Aes* aes,
byte* out,
263 const byte* in, word32 sz);
268WOLFSSL_LOCAL
int wc_CryptoCb_Des3Encrypt(
Des3* des3,
byte* out,
269 const byte* in, word32 sz);
270WOLFSSL_LOCAL
int wc_CryptoCb_Des3Decrypt(
Des3* des3,
byte* out,
271 const byte* in, word32 sz);
275WOLFSSL_LOCAL
int wc_CryptoCb_ShaHash(
wc_Sha* sha,
const byte* in,
276 word32 inSz,
byte* digest);
280WOLFSSL_LOCAL
int wc_CryptoCb_Sha256Hash(
wc_Sha256* sha256,
const byte* in,
281 word32 inSz,
byte* digest);
284WOLFSSL_LOCAL
int wc_CryptoCb_Hmac(
Hmac* hmac,
int macType,
const byte* in,
285 word32 inSz,
byte* digest);
289WOLFSSL_LOCAL
int wc_CryptoCb_RandomBlock(
WC_RNG* rng,
byte* out, word32 sz);
290WOLFSSL_LOCAL
int wc_CryptoCb_RandomSeed(
OS_Seed* os,
byte* seed, word32 sz);
Definition wolfcaam_sha.h:68