mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 12:14:38 +02:00
wolfssl/wolfcrypt/integer.h: for heapmath FREE_MP_INT_SIZE(), rather than WC_DO_NOTHING(), conditionally mp_free(), for functional isomorphism with sp_int and tfm MPI lifecycles.
This commit is contained in:
@@ -205,7 +205,12 @@ typedef int mp_err;
|
|||||||
#define NEW_MP_INT_SIZE(name, bits, heap, type) \
|
#define NEW_MP_INT_SIZE(name, bits, heap, type) \
|
||||||
XMEMSET(name, 0, sizeof(mp_int))
|
XMEMSET(name, 0, sizeof(mp_int))
|
||||||
/* Dispose of static mp_int. */
|
/* Dispose of static mp_int. */
|
||||||
#define FREE_MP_INT_SIZE(name, heap, type) WC_DO_NOTHING
|
#define FREE_MP_INT_SIZE(name, heap, type) \
|
||||||
|
do { \
|
||||||
|
if ((name) != NULL) { \
|
||||||
|
mp_free(name); \
|
||||||
|
} \
|
||||||
|
} while (0)
|
||||||
/* Initialize an mp_int. */
|
/* Initialize an mp_int. */
|
||||||
#define INIT_MP_INT_SIZE(name, bits) \
|
#define INIT_MP_INT_SIZE(name, bits) \
|
||||||
mp_init(name)
|
mp_init(name)
|
||||||
|
Reference in New Issue
Block a user