21 #ifndef _WOLF_CRYPTO_CB_H_ 22 #define _WOLF_CRYPTO_CB_H_ 32 #define CRYPTO_CB_VER 2 64 typedef 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) 212 typedef int (*CryptoDevCallbackFunc)(
int devId, wc_CryptoInfo* info,
void* ctx);
214 WOLFSSL_LOCAL
void wc_CryptoCb_Init(
void);
216 WOLFSSL_API
int wc_CryptoCb_RegisterDevice(
int devId, CryptoDevCallbackFunc cb,
void* ctx);
217 WOLFSSL_API
void wc_CryptoCb_UnRegisterDevice(
int devId);
220 #define wc_CryptoDev_RegisterDevice wc_CryptoCb_RegisterDevice 221 #define wc_CryptoDev_UnRegisterDevice wc_CryptoCb_UnRegisterDevice 225 WOLFSSL_LOCAL
int wc_CryptoCb_Rsa(
const byte* in, word32 inLen, byte* out,
228 #ifdef WOLFSSL_KEY_GEN 229 WOLFSSL_LOCAL
int wc_CryptoCb_MakeRsaKey(
RsaKey* key,
int size,
long e,
235 WOLFSSL_LOCAL
int wc_CryptoCb_MakeEccKey(
WC_RNG* rng,
int keySize,
238 WOLFSSL_LOCAL
int wc_CryptoCb_Ecdh(
ecc_key* private_key,
ecc_key* public_key,
239 byte* out, word32* outlen);
241 WOLFSSL_LOCAL
int wc_CryptoCb_EccSign(
const byte* in, word32 inlen, byte* out,
244 WOLFSSL_LOCAL
int wc_CryptoCb_EccVerify(
const byte* sig, word32 siglen,
245 const byte* hash, word32 hashlen,
int* res,
ecc_key* key);
250 WOLFSSL_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);
254 WOLFSSL_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);
260 WOLFSSL_LOCAL
int wc_CryptoCb_AesCbcEncrypt(
Aes* aes, byte* out,
261 const byte* in, word32 sz);
262 WOLFSSL_LOCAL
int wc_CryptoCb_AesCbcDecrypt(
Aes* aes, byte* out,
263 const byte* in, word32 sz);
268 WOLFSSL_LOCAL
int wc_CryptoCb_Des3Encrypt(
Des3* des3, byte* out,
269 const byte* in, word32 sz);
270 WOLFSSL_LOCAL
int wc_CryptoCb_Des3Decrypt(
Des3* des3, byte* out,
271 const byte* in, word32 sz);
275 WOLFSSL_LOCAL
int wc_CryptoCb_ShaHash(
wc_Sha* sha,
const byte* in,
276 word32 inSz, byte* digest);
280 WOLFSSL_LOCAL
int wc_CryptoCb_Sha256Hash(
wc_Sha256* sha256,
const byte* in,
281 word32 inSz, byte* digest);
284 WOLFSSL_LOCAL
int wc_CryptoCb_Hmac(
Hmac* hmac,
int macType,
const byte* in,
285 word32 inSz, byte* digest);
289 WOLFSSL_LOCAL
int wc_CryptoCb_RandomBlock(
WC_RNG* rng, byte* out, word32 sz);
290 WOLFSSL_LOCAL
int wc_CryptoCb_RandomSeed(
OS_Seed* os, byte* seed, word32 sz);
Definition: wolfcaam_sha.h:68
Definition: user_rsa.h:60