Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 37 additions & 27 deletions wolfcrypt/src/sp_arm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -12500,9 +12500,9 @@ static int sp_2048_mod_exp_32(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -12653,9 +12653,9 @@ static int sp_2048_mod_exp_32(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -17366,9 +17366,9 @@ static int sp_2048_mod_exp_64(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -17502,9 +17502,9 @@ static int sp_2048_mod_exp_64(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -18648,9 +18648,9 @@ static int sp_2048_mod_exp_2_64(sp_digit* r, const sp_digit* e, int bits,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -38355,9 +38355,9 @@ static int sp_3072_mod_exp_48(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -38508,9 +38508,9 @@ static int sp_3072_mod_exp_48(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -45090,9 +45090,9 @@ static int sp_3072_mod_exp_96(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -45226,9 +45226,9 @@ static int sp_3072_mod_exp_96(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -46620,9 +46620,9 @@ static int sp_3072_mod_exp_2_96(sp_digit* r, const sp_digit* e, int bits,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -60698,9 +60698,9 @@ static int sp_4096_mod_exp_128(sp_digit* r, const sp_digit* a, const sp_digit* e
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -60834,9 +60834,9 @@ static int sp_4096_mod_exp_128(sp_digit* r, const sp_digit* a, const sp_digit* e
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -62476,9 +62476,9 @@ static int sp_4096_mod_exp_2_128(sp_digit* r, const sp_digit* e, int bits,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -120421,7 +120421,17 @@ static int sp_521_ecc_mulmod_fast_17(sp_point_521* r, const sp_point_521* g, con
}
y = k[0] & 0x1;
sp_521_proj_point_dbl_17(rt, rt, tmp);
sp_521_proj_point_add_17(rt, rt, &t[y], tmp);
#ifndef WC_NO_CACHE_RESISTANT
if (ct) {
sp_521_get_point_16_17(p, t, y);
p->infinity = !y;
sp_521_proj_point_add_17(rt, rt, p, tmp);
}
else
#endif
{
sp_521_proj_point_add_17(rt, rt, &t[y], tmp);
}

if (map != 0) {
sp_521_map_17(r, rt, tmp);
Expand Down
64 changes: 37 additions & 27 deletions wolfcrypt/src/sp_armthumb.c
Original file line number Diff line number Diff line change
Expand Up @@ -24132,9 +24132,9 @@ static int sp_2048_mod_exp_32(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -24285,9 +24285,9 @@ static int sp_2048_mod_exp_32(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -27684,9 +27684,9 @@ static int sp_2048_mod_exp_64(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -27820,9 +27820,9 @@ static int sp_2048_mod_exp_64(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -30010,9 +30010,9 @@ static int sp_2048_mod_exp_2_64(sp_digit* r, const sp_digit* e, int bits,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -75473,9 +75473,9 @@ static int sp_3072_mod_exp_48(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -75626,9 +75626,9 @@ static int sp_3072_mod_exp_48(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -79856,9 +79856,9 @@ static int sp_3072_mod_exp_96(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -79992,9 +79992,9 @@ static int sp_3072_mod_exp_96(sp_digit* r, const sp_digit* a, const sp_digit* e,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -82980,9 +82980,9 @@ static int sp_3072_mod_exp_2_96(sp_digit* r, const sp_digit* e, int bits,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -92314,9 +92314,9 @@ static int sp_4096_mod_exp_128(sp_digit* r, const sp_digit* a, const sp_digit* e
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -92450,9 +92450,9 @@ static int sp_4096_mod_exp_128(sp_digit* r, const sp_digit* a, const sp_digit* e
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -96231,9 +96231,9 @@ static int sp_4096_mod_exp_2_128(sp_digit* r, const sp_digit* e, int bits,
c = -c;
y = (byte)(n << c);
n = e[i--];
y |= (byte)(n >> (64 - c));
y |= (byte)(n >> (32 - c));
n <<= c;
c = 64 - c;
c = 32 - c;
}
else if (c == 0) {
/* All bits in top word used. */
Expand Down Expand Up @@ -124360,7 +124360,17 @@ static int sp_521_ecc_mulmod_fast_17(sp_point_521* r, const sp_point_521* g, con
}
y = k[0] & 0x1;
sp_521_proj_point_dbl_17(rt, rt, tmp);
sp_521_proj_point_add_17(rt, rt, &t[y], tmp);
#ifndef WC_NO_CACHE_RESISTANT
if (ct) {
sp_521_get_point_16_17(p, t, y);
p->infinity = !y;
sp_521_proj_point_add_17(rt, rt, p, tmp);
}
else
#endif
{
sp_521_proj_point_add_17(rt, rt, &t[y], tmp);
}

if (map != 0) {
sp_521_map_17(r, rt, tmp);
Expand Down
Loading
Loading