summaryrefslogtreecommitdiffstats
path: root/security/nss/lib/freebl/mpi/mpi.h
diff options
context:
space:
mode:
authorSohaib ul Hassan <sohaibulhassan@tuni.fi>2020-07-09 18:51:51 +0000
committerMoonchild <moonchild@palemoon.org>2020-07-10 18:33:11 +0000
commitdcab408a5fbbe08a706904462b680c8daf299409 (patch)
treed8fec2f20569874520b1c55184d71fa755af2617 /security/nss/lib/freebl/mpi/mpi.h
parent407c503fa4f7a57f89195421eb004d3028013105 (diff)
downloadUXP-dcab408a5fbbe08a706904462b680c8daf299409.tar
UXP-dcab408a5fbbe08a706904462b680c8daf299409.tar.gz
UXP-dcab408a5fbbe08a706904462b680c8daf299409.tar.lz
UXP-dcab408a5fbbe08a706904462b680c8daf299409.tar.xz
UXP-dcab408a5fbbe08a706904462b680c8daf299409.zip
[NSS] Implement constant-time GCD and modular inversion
The implementation is based on the work by Bernstein and Yang (https://eprint.iacr.org/2019/266) "Fast constant-time gcd computation and modular inversion". It fixes the old mp_gcd and s_mp_invmod_odd_m functions. The patch also fixes mpl_significant_bits s_mp_div_2d and s_mp_mul_2d by having less control flow to reduce side-channel leaks. Co-authored by : Billy Bob Brumley
Diffstat (limited to 'security/nss/lib/freebl/mpi/mpi.h')
-rw-r--r--security/nss/lib/freebl/mpi/mpi.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/security/nss/lib/freebl/mpi/mpi.h b/security/nss/lib/freebl/mpi/mpi.h
index af608b43d..b1a07a61d 100644
--- a/security/nss/lib/freebl/mpi/mpi.h
+++ b/security/nss/lib/freebl/mpi/mpi.h
@@ -267,6 +267,7 @@ mp_size mp_trailing_zeros(const mp_int *mp);
void freebl_cpuid(unsigned long op, unsigned long *eax,
unsigned long *ebx, unsigned long *ecx,
unsigned long *edx);
+mp_err mp_cswap(mp_digit condition, mp_int *a, mp_int *b, mp_size numdigits);
#define MP_CHECKOK(x) \
if (MP_OKAY > (res = (x))) \