< prev index next >
src/jdk.crypto.ec/share/native/libsunec/impl/mpi.c
Print this page
rev 16167 : 8170525: Fix minor issues in AWT/ECC/PKCS11 coding
Reviewed-by: vinnie, clanger, prr, ssadetsky
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2007, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
@@ -32,11 +32,11 @@
*
* Contributor(s):
* Netscape Communications Corporation
* Douglas Stebila <douglas@stebila.ca> of Sun Laboratories.
*
- * Last Modified Date from the Original Code: June 2014
+ * Last Modified Date from the Original Code: Nov 2016
*********************************************************************** */
/* Arbitrary precision integer arithmetic library */
#include "mpi-priv.h"
@@ -657,10 +657,11 @@
if((res = s_mp_sqr(&x)) != MP_OKAY)
goto CLEANUP;
}
+ s.flag = (mp_flag)0;
s_mp_exch(&s, c);
CLEANUP:
mp_clear(&x);
X:
@@ -1607,10 +1608,11 @@
if((res = s_mp_sqr(&x)) != MP_OKAY ||
(res = mp_mod(&x, m, &x)) != MP_OKAY)
goto CLEANUP;
}
+ s.flag = (mp_flag)0;
s_mp_exch(&s, c);
CLEANUP:
mp_clear(&x);
X:
@@ -4181,10 +4183,11 @@
mp_err s_mp_sqr(mp_int *a)
{
mp_err res;
mp_int tmp;
+ tmp.flag = (mp_flag)0;
if((res = mp_init_size(&tmp, 2 * USED(a), FLAG(a))) != MP_OKAY)
return res;
res = mp_sqr(a, &tmp);
if (res == MP_OKAY) {
@@ -4218,10 +4221,12 @@
mp_err res;
mp_digit d;
mp_digit div_msd;
int ix;
+ t.dp = (mp_digit)0;
+
if(mp_cmp_z(div) == 0)
return MP_RANGE;
/* Shortcut if divisor is power of two */
if((ix = s_mp_ispow2(div)) >= 0) {
< prev index next >