Merge pull request #2417 from SparkiDev/sp_mod_exp_cast_fix

SP Mod exp cast fix
This commit is contained in:
David Garske 2019-08-22 05:55:27 -07:00 committed by GitHub
commit cf83561b64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 40 additions and 40 deletions

View File

@ -4870,7 +4870,7 @@ static int sp_2048_mod_exp_32(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 32)
c = 28;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 32);
for (; i>=0 || c>=4; ) {
@ -5014,7 +5014,7 @@ static int sp_2048_mod_exp_32(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 32);
for (; i>=0 || c>=5; ) {
@ -7118,7 +7118,7 @@ static int sp_2048_mod_exp_64(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 32)
c = 28;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 64);
for (; i>=0 || c>=4; ) {
@ -7262,7 +7262,7 @@ static int sp_2048_mod_exp_64(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 64);
for (; i>=0 || c>=5; ) {
@ -8118,7 +8118,7 @@ static int sp_2048_mod_exp_2_64(sp_digit* r, sp_digit* e, int bits,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
sp_2048_lshift_64(r, norm, y);
for (; i>=0 || c>=5; ) {
@ -15267,7 +15267,7 @@ static int sp_3072_mod_exp_48(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 32)
c = 28;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 48);
for (; i>=0 || c>=4; ) {
@ -15411,7 +15411,7 @@ static int sp_3072_mod_exp_48(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 48);
for (; i>=0 || c>=5; ) {
@ -18315,7 +18315,7 @@ static int sp_3072_mod_exp_96(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 32)
c = 28;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 96);
for (; i>=0 || c>=4; ) {
@ -18459,7 +18459,7 @@ static int sp_3072_mod_exp_96(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 96);
for (; i>=0 || c>=5; ) {
@ -19507,7 +19507,7 @@ static int sp_3072_mod_exp_2_96(sp_digit* r, sp_digit* e, int bits,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
sp_3072_lshift_96(r, norm, y);
for (; i>=0 || c>=5; ) {

View File

@ -3107,7 +3107,7 @@ static int sp_2048_mod_exp_16(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 64)
c = 60;
y = n >> c;
y = (int)(n >> c);
n <<= 64 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 16);
for (; i>=0 || c>=4; ) {
@ -3251,7 +3251,7 @@ static int sp_2048_mod_exp_16(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 64)
c = 59;
y = n >> c;
y = (int)(n >> c);
n <<= 64 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 16);
for (; i>=0 || c>=5; ) {
@ -4475,7 +4475,7 @@ static int sp_2048_mod_exp_32(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 64)
c = 60;
y = n >> c;
y = (int)(n >> c);
n <<= 64 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 32);
for (; i>=0 || c>=4; ) {
@ -4619,7 +4619,7 @@ static int sp_2048_mod_exp_32(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 64)
c = 59;
y = n >> c;
y = (int)(n >> c);
n <<= 64 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 32);
for (; i>=0 || c>=5; ) {
@ -5281,7 +5281,7 @@ static int sp_2048_mod_exp_2_32(sp_digit* r, sp_digit* e, int bits,
c -= bits % 6;
if (c == 64)
c = 58;
y = n >> c;
y = (int)(n >> c);
n <<= 64 - c;
sp_2048_lshift_32(r, norm, y);
for (; i>=0 || c>=6; ) {
@ -10100,7 +10100,7 @@ static int sp_3072_mod_exp_24(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 64)
c = 60;
y = n >> c;
y = (int)(n >> c);
n <<= 64 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 24);
for (; i>=0 || c>=4; ) {
@ -10244,7 +10244,7 @@ static int sp_3072_mod_exp_24(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 64)
c = 59;
y = n >> c;
y = (int)(n >> c);
n <<= 64 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 24);
for (; i>=0 || c>=5; ) {
@ -11836,7 +11836,7 @@ static int sp_3072_mod_exp_48(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 64)
c = 60;
y = n >> c;
y = (int)(n >> c);
n <<= 64 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 48);
for (; i>=0 || c>=4; ) {
@ -11980,7 +11980,7 @@ static int sp_3072_mod_exp_48(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 64)
c = 59;
y = n >> c;
y = (int)(n >> c);
n <<= 64 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 48);
for (; i>=0 || c>=5; ) {
@ -12738,7 +12738,7 @@ static int sp_3072_mod_exp_2_48(sp_digit* r, sp_digit* e, int bits,
c -= bits % 6;
if (c == 64)
c = 58;
y = n >> c;
y = (int)(n >> c);
n <<= 64 - c;
sp_3072_lshift_48(r, norm, y);
for (; i>=0 || c>=6; ) {

View File

@ -3168,7 +3168,7 @@ static int sp_2048_mod_exp_32(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 32)
c = 28;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 32);
for (; i>=0 || c>=4; ) {
@ -3312,7 +3312,7 @@ static int sp_2048_mod_exp_32(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 32);
for (; i>=0 || c>=5; ) {
@ -3991,7 +3991,7 @@ static int sp_2048_mod_exp_64(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 32)
c = 28;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 64);
for (; i>=0 || c>=4; ) {
@ -4135,7 +4135,7 @@ static int sp_2048_mod_exp_64(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 64);
for (; i>=0 || c>=5; ) {
@ -4997,7 +4997,7 @@ static int sp_2048_mod_exp_2_64(sp_digit* r, sp_digit* e, int bits,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
sp_2048_lshift_64(r, norm, y);
for (; i>=0 || c>=5; ) {
@ -8779,7 +8779,7 @@ static int sp_3072_mod_exp_48(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 32)
c = 28;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 48);
for (; i>=0 || c>=4; ) {
@ -8923,7 +8923,7 @@ static int sp_3072_mod_exp_48(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 48);
for (; i>=0 || c>=5; ) {
@ -9608,7 +9608,7 @@ static int sp_3072_mod_exp_96(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 32)
c = 28;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 96);
for (; i>=0 || c>=4; ) {
@ -9752,7 +9752,7 @@ static int sp_3072_mod_exp_96(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 96);
for (; i>=0 || c>=5; ) {
@ -10812,7 +10812,7 @@ static int sp_3072_mod_exp_2_96(sp_digit* r, sp_digit* e, int bits,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
sp_3072_lshift_96(r, norm, y);
for (; i>=0 || c>=5; ) {

View File

@ -3473,7 +3473,7 @@ static int sp_2048_mod_exp_32(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 32)
c = 28;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 32);
for (; i>=0 || c>=4; ) {
@ -3617,7 +3617,7 @@ static int sp_2048_mod_exp_32(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 32);
for (; i>=0 || c>=5; ) {
@ -4154,7 +4154,7 @@ static int sp_2048_mod_exp_64(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 32)
c = 28;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 64);
for (; i>=0 || c>=4; ) {
@ -4298,7 +4298,7 @@ static int sp_2048_mod_exp_64(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 64);
for (; i>=0 || c>=5; ) {
@ -5160,7 +5160,7 @@ static int sp_2048_mod_exp_2_64(sp_digit* r, sp_digit* e, int bits,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
sp_2048_lshift_64(r, norm, y);
for (; i>=0 || c>=5; ) {
@ -8510,7 +8510,7 @@ static int sp_3072_mod_exp_48(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 32)
c = 28;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 48);
for (; i>=0 || c>=4; ) {
@ -8654,7 +8654,7 @@ static int sp_3072_mod_exp_48(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 48);
for (; i>=0 || c>=5; ) {
@ -9197,7 +9197,7 @@ static int sp_3072_mod_exp_96(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 4;
if (c == 32)
c = 28;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 96);
for (; i>=0 || c>=4; ) {
@ -9341,7 +9341,7 @@ static int sp_3072_mod_exp_96(sp_digit* r, sp_digit* a, sp_digit* e,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
XMEMCPY(r, t[y], sizeof(sp_digit) * 96);
for (; i>=0 || c>=5; ) {
@ -10399,7 +10399,7 @@ static int sp_3072_mod_exp_2_96(sp_digit* r, sp_digit* e, int bits,
c -= bits % 5;
if (c == 32)
c = 27;
y = n >> c;
y = (int)(n >> c);
n <<= 32 - c;
sp_3072_lshift_96(r, norm, y);
for (; i>=0 || c>=5; ) {