mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-27 21:16:50 +03:00
fixed some valgrind detected issues.
git-svn-id: svn://svn.code.sf.net/p/axtls/code/trunk@185 9a5d90b5-6617-0410-8a86-bb477d3ed2e3
This commit is contained in:
parent
28c35cf0f3
commit
bc9a451b51
@ -826,11 +826,10 @@ static bigint *regular_multiply(BI_CTX *ctx, bigint *bia, bigint *bib,
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
comp carry = 0;
|
comp carry = 0;
|
||||||
comp b = *sb++;
|
|
||||||
int r_index = i;
|
int r_index = i;
|
||||||
j = 0;
|
j = 0;
|
||||||
|
|
||||||
if (outer_partial)
|
if (outer_partial && outer_partial-i > 0 && outer_partial < n)
|
||||||
{
|
{
|
||||||
r_index = outer_partial-1;
|
r_index = outer_partial-1;
|
||||||
j = outer_partial-i-1;
|
j = outer_partial-i-1;
|
||||||
@ -843,7 +842,7 @@ static bigint *regular_multiply(BI_CTX *ctx, bigint *bia, bigint *bib,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
long_comp tmp = sr[r_index] + ((long_comp)sa[j])*b + carry;
|
long_comp tmp = sr[r_index] + ((long_comp)sa[j])*sb[i] + carry;
|
||||||
sr[r_index++] = (comp)tmp; /* downsize */
|
sr[r_index++] = (comp)tmp; /* downsize */
|
||||||
carry = tmp >> COMP_BIT_SIZE;
|
carry = tmp >> COMP_BIT_SIZE;
|
||||||
} while (++j < n);
|
} while (++j < n);
|
||||||
@ -945,7 +944,7 @@ static bigint *regular_square(BI_CTX *ctx, bigint *bi)
|
|||||||
{
|
{
|
||||||
int t = bi->size;
|
int t = bi->size;
|
||||||
int i = 0, j;
|
int i = 0, j;
|
||||||
bigint *biR = alloc(ctx, t*2);
|
bigint *biR = alloc(ctx, t*2+1);
|
||||||
comp *w = biR->comps;
|
comp *w = biR->comps;
|
||||||
comp *x = bi->comps;
|
comp *x = bi->comps;
|
||||||
long_comp carry;
|
long_comp carry;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user