diff options
author | Tim Taubert <ttaubert@mozilla.com> | 2016-04-27 15:19:20 +0200 |
---|---|---|
committer | Tim Taubert <ttaubert@mozilla.com> | 2016-04-27 15:19:20 +0200 |
commit | f115c0b6df8f825a710f106a4ce22b1c94065036 (patch) | |
tree | a6f2fcf00346e49b277108ac87f82b796a88a395 | |
parent | d2ec5a56bf18831b538ebc9f071c6a58fd3f6769 (diff) | |
download | nss-hg-f115c0b6df8f825a710f106a4ce22b1c94065036.tar.gz |
Bug 1259051 - Remove MP_CRYPTO from libmpi r=franziskus
-rw-r--r-- | lib/freebl/mpi/README | 7 | ||||
-rw-r--r-- | lib/freebl/mpi/mpi-config.h | 4 | ||||
-rw-r--r-- | lib/freebl/mpi/mpi.c | 6 |
3 files changed, 0 insertions, 17 deletions
diff --git a/lib/freebl/mpi/README b/lib/freebl/mpi/README index 89907e9f3..a746f345c 100644 --- a/lib/freebl/mpi/README +++ b/lib/freebl/mpi/README @@ -522,13 +522,6 @@ MP_MEMCPY - If true, use memcpy() to copy buffers. If you run into weird alignment bugs, set this to zero and an explicit loop will be used. -MP_CRYPTO - If true, whenever arrays of digits are free'd, they - are zeroed first. This is useful if you're using - the library in a cryptographic environment; however, - it does add overhead to each free operation. For - performance, if you don't care about zeroing your - buffers, set this to false. - MP_ARGCHK - Set to 0, 1, or 2. This defines how the argument checking macro, ARGCHK(), gets expanded. If this is set to zero, ARGCHK() expands to nothing; no diff --git a/lib/freebl/mpi/mpi-config.h b/lib/freebl/mpi/mpi-config.h index 1d3502874..04a9d95b8 100644 --- a/lib/freebl/mpi/mpi-config.h +++ b/lib/freebl/mpi/mpi-config.h @@ -40,10 +40,6 @@ #define MP_MEMCPY 1 /* use memcpy() to copy buffers? */ #endif -#ifndef MP_CRYPTO -#define MP_CRYPTO 1 /* erase memory on free? */ -#endif - #ifndef MP_ARGCHK /* 0 = no parameter checks diff --git a/lib/freebl/mpi/mpi.c b/lib/freebl/mpi/mpi.c index d4af30b8c..c5b1a5d9f 100644 --- a/lib/freebl/mpi/mpi.c +++ b/lib/freebl/mpi/mpi.c @@ -199,9 +199,7 @@ mp_err mp_copy(const mp_int *from, mp_int *to) s_mp_copy(DIGITS(from), tmp, USED(from)); if(DIGITS(to) != NULL) { -#if MP_CRYPTO s_mp_setz(DIGITS(to), ALLOC(to)); -#endif s_mp_free(DIGITS(to)); } @@ -261,9 +259,7 @@ void mp_clear(mp_int *mp) return; if(DIGITS(mp) != NULL) { -#if MP_CRYPTO s_mp_setz(DIGITS(mp), ALLOC(mp)); -#endif s_mp_free(DIGITS(mp)); DIGITS(mp) = NULL; } @@ -2740,9 +2736,7 @@ mp_err s_mp_grow(mp_int *mp, mp_size min) s_mp_copy(DIGITS(mp), tmp, USED(mp)); -#if MP_CRYPTO s_mp_setz(DIGITS(mp), ALLOC(mp)); -#endif s_mp_free(DIGITS(mp)); DIGITS(mp) = tmp; ALLOC(mp) = min; |