Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Unified Diff: nss/lib/freebl/ecl/ecp_256_32.c

Issue 1843333003: Update NSPR to 4.12 and NSS to 3.23 on iOS (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/nss.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: nss/lib/freebl/ecl/ecp_256_32.c
diff --git a/nss/lib/freebl/ecl/ecp_256_32.c b/nss/lib/freebl/ecl/ecp_256_32.c
index cd8cd23846dfab2cc90b68b883a34ef733cb39cc..eb7a4be63a125a7a954afa5852e994c151847e5a 100644
--- a/nss/lib/freebl/ecl/ecp_256_32.c
+++ b/nss/lib/freebl/ecl/ecp_256_32.c
@@ -1302,23 +1302,23 @@ static mp_err to_montgomery(felem out, const mp_int *in, const ECGroup *group)
int i;
mp_err res;
- mp_init(&in_shifted);
- s_mp_pad(&in_shifted, MP_USED(in) + MP_DIGITS_IN_256_BITS);
+ MP_CHECKOK(mp_init(&in_shifted));
+ MP_CHECKOK(s_mp_pad(&in_shifted, MP_USED(in) + MP_DIGITS_IN_256_BITS));
memcpy(&MP_DIGIT(&in_shifted, MP_DIGITS_IN_256_BITS),
MP_DIGITS(in),
MP_USED(in)*sizeof(mp_digit));
- mp_mul_2(&in_shifted, &in_shifted);
+ MP_CHECKOK(mp_mul_2(&in_shifted, &in_shifted));
MP_CHECKOK(group->meth->field_mod(&in_shifted, &in_shifted, group->meth));
for (i = 0;; i++) {
out[i] = MP_DIGIT(&in_shifted, 0) & kBottom29Bits;
- mp_div_d(&in_shifted, kTwo29, &in_shifted, NULL);
+ MP_CHECKOK(mp_div_d(&in_shifted, kTwo29, &in_shifted, NULL));
i++;
if (i == NLIMBS)
break;
out[i] = MP_DIGIT(&in_shifted, 0) & kBottom28Bits;
- mp_div_d(&in_shifted, kTwo28, &in_shifted, NULL);
+ MP_CHECKOK(mp_div_d(&in_shifted, kTwo28, &in_shifted, NULL));
}
CLEANUP:
@@ -1334,8 +1334,8 @@ static mp_err from_montgomery(mp_int *out, const felem in,
mp_err res;
int i;
- mp_init(&result);
- mp_init(&tmp);
+ MP_CHECKOK(mp_init(&result));
+ MP_CHECKOK(mp_init(&tmp));
MP_CHECKOK(mp_add_d(&tmp, in[NLIMBS-1], &result));
for (i = NLIMBS-2; i >= 0; i--) {
« no previous file with comments | « nss/lib/freebl/ecl/ec_naf.c ('k') | nss/lib/freebl/ecl/ecp_aff.c » ('j') | nss/lib/util/secoid.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698