forked from wolfSSL/wolfssl
Added next set of ABI for ECC APIs
This commit is contained in:
@ -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 */
|
/* 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)
|
int wc_ecc_ctx_reset(ecEncCtx* ctx, WC_RNG* rng)
|
||||||
{
|
{
|
||||||
if (ctx == NULL || rng == NULL)
|
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 */
|
/* alloc/init and set defaults, return new Context */
|
||||||
|
WOLFSSL_ABI
|
||||||
ecEncCtx* wc_ecc_ctx_new(int flags, WC_RNG* rng)
|
ecEncCtx* wc_ecc_ctx_new(int flags, WC_RNG* rng)
|
||||||
{
|
{
|
||||||
return wc_ecc_ctx_new_ex(flags, rng, NULL);
|
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 */
|
/* free any resources, clear any keys */
|
||||||
|
WOLFSSL_ABI
|
||||||
void wc_ecc_ctx_free(ecEncCtx* ctx)
|
void wc_ecc_ctx_free(ecEncCtx* ctx)
|
||||||
{
|
{
|
||||||
if (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
|
ctx holds non default algos and inputs
|
||||||
msgSz should be the right size for encAlgo, i.e., already padded
|
msgSz should be the right size for encAlgo, i.e., already padded
|
||||||
return 0 on success */
|
return 0 on success */
|
||||||
|
WOLFSSL_ABI
|
||||||
int wc_ecc_encrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
|
int wc_ecc_encrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
|
||||||
word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx)
|
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
|
/* ecc decrypt with shared secret run through kdf
|
||||||
ctx holds non default algos and inputs
|
ctx holds non default algos and inputs
|
||||||
return 0 on success */
|
return 0 on success */
|
||||||
|
WOLFSSL_ABI
|
||||||
int wc_ecc_decrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
|
int wc_ecc_decrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
|
||||||
word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx)
|
word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx)
|
||||||
{
|
{
|
||||||
|
@ -857,13 +857,13 @@ enum ecFlags {
|
|||||||
|
|
||||||
typedef struct ecEncCtx ecEncCtx;
|
typedef struct ecEncCtx ecEncCtx;
|
||||||
|
|
||||||
WOLFSSL_API
|
WOLFSSL_ABI WOLFSSL_API
|
||||||
ecEncCtx* wc_ecc_ctx_new(int flags, WC_RNG* rng);
|
ecEncCtx* wc_ecc_ctx_new(int flags, WC_RNG* rng);
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
ecEncCtx* wc_ecc_ctx_new_ex(int flags, WC_RNG* rng, void* heap);
|
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);
|
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 */
|
int wc_ecc_ctx_reset(ecEncCtx* ctx, WC_RNG* rng); /* reset for use again w/o alloc/free */
|
||||||
|
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
@ -878,13 +878,13 @@ int wc_ecc_ctx_set_kdf_salt(ecEncCtx* ctx, const byte* salt, word32 sz);
|
|||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
int wc_ecc_ctx_set_info(ecEncCtx* ctx, const byte* info, int sz);
|
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,
|
int wc_ecc_encrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
|
||||||
word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx);
|
word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx);
|
||||||
WOLFSSL_API
|
WOLFSSL_API
|
||||||
int wc_ecc_encrypt_ex(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
|
int wc_ecc_encrypt_ex(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
|
||||||
word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx, int compressed);
|
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,
|
int wc_ecc_decrypt(ecc_key* privKey, ecc_key* pubKey, const byte* msg,
|
||||||
word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx);
|
word32 msgSz, byte* out, word32* outSz, ecEncCtx* ctx);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user