Added next set of ABI for ECC APIs

This commit is contained in:
Uriah Pollock
2022-08-05 16:26:20 -05:00
parent 65d402d8d7
commit c9c19c82b3
2 changed files with 10 additions and 5 deletions

View File

@ -12540,6 +12540,7 @@ static void ecc_ctx_init(ecEncCtx* ctx, int flags, WC_RNG* rng)
/* allow ecc context reset so user doesn't have to init/free for reuse */
WOLFSSL_ABI
int wc_ecc_ctx_reset(ecEncCtx* ctx, WC_RNG* rng)
{
if (ctx == NULL || rng == NULL)
@ -12572,6 +12573,7 @@ ecEncCtx* wc_ecc_ctx_new_ex(int flags, WC_RNG* rng, void* heap)
/* alloc/init and set defaults, return new Context */
WOLFSSL_ABI
ecEncCtx* wc_ecc_ctx_new(int flags, WC_RNG* rng)
{
return wc_ecc_ctx_new_ex(flags, rng, NULL);
@ -12579,6 +12581,7 @@ ecEncCtx* wc_ecc_ctx_new(int flags, WC_RNG* rng)
/* free any resources, clear any keys */
WOLFSSL_ABI
void wc_ecc_ctx_free(ecEncCtx* ctx)
{
if (ctx) {
@ -12987,6 +12990,7 @@ int wc_ecc_encrypt_ex(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
ctx holds non default algos and inputs
msgSz should be the right size for encAlgo, i.e., already padded
return 0 on success */
WOLFSSL_ABI
int wc_ecc_encrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx)
{
@ -12996,6 +13000,7 @@ int wc_ecc_encrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
/* ecc decrypt with shared secret run through kdf
ctx holds non default algos and inputs
return 0 on success */
WOLFSSL_ABI
int wc_ecc_decrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx)
{

View File

@ -857,13 +857,13 @@ enum ecFlags {
typedef struct ecEncCtx ecEncCtx;
WOLFSSL_API
WOLFSSL_ABI WOLFSSL_API
ecEncCtx* wc_ecc_ctx_new(int flags, WC_RNG* rng);
WOLFSSL_API
ecEncCtx* wc_ecc_ctx_new_ex(int flags, WC_RNG* rng, void* heap);
WOLFSSL_API
WOLFSSL_ABI WOLFSSL_API
void wc_ecc_ctx_free(ecEncCtx* ctx);
WOLFSSL_API
WOLFSSL_ABI WOLFSSL_API
int wc_ecc_ctx_reset(ecEncCtx* ctx, WC_RNG* rng); /* reset for use again w/o alloc/free */
WOLFSSL_API
@ -878,13 +878,13 @@ int wc_ecc_ctx_set_kdf_salt(ecEncCtx* ctx, const byte* salt, word32 sz);
WOLFSSL_API
int wc_ecc_ctx_set_info(ecEncCtx* ctx, const byte* info, int sz);
WOLFSSL_API
WOLFSSL_ABI WOLFSSL_API
int wc_ecc_encrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx);
WOLFSSL_API
int wc_ecc_encrypt_ex(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx, int compressed);
WOLFSSL_API
WOLFSSL_ABI WOLFSSL_API
int wc_ecc_decrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx);