Skip to content

Commit

Permalink
Update sm9_z256.c
Browse files Browse the repository at this point in the history
  • Loading branch information
guanzhi committed May 23, 2024
1 parent b3707db commit 9d8da9c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/sm9_z256.c
Original file line number Diff line number Diff line change
Expand Up @@ -1847,7 +1847,7 @@ int sm9_z256_point_equ(const SM9_Z256_POINT *P, const SM9_Z256_POINT *Q)
sm9_z256_modp_mont_mul(t2, t2, Q->Z);
sm9_z256_modp_mont_mul(t3, P->Y, t2);
sm9_z256_modp_mont_mul(t4, Q->Y, t1);
return sm9_z256_equ(t3, t4);
return (int)sm9_z256_equ(t3, t4);
}

int sm9_z256_point_is_on_curve(const SM9_Z256_POINT *P)
Expand Down Expand Up @@ -2001,7 +2001,7 @@ void sm9_z256_point_mul(SM9_Z256_POINT *R, const sm9_z256_t k, const SM9_Z256_PO
uint64_t window_size = 5;
SM9_Z256_POINT T[16];
int R_infinity = 1;
int n = (256 + window_size - 1)/window_size;
int n = (int)(256 + window_size - 1)/window_size;
int i;

// T[i] = (i + 1) * P
Expand Down Expand Up @@ -2111,7 +2111,7 @@ void sm9_z256_point_mul_generator(SM9_Z256_POINT *R, const sm9_z256_t k)
{
size_t window_size = 7;
int R_infinity = 1;
int n = (256 + window_size - 1) / window_size;
int n = (int)(256 + window_size - 1) / window_size;
int i;

for (i = n - 1; i >= 0; i--) {
Expand Down Expand Up @@ -3014,7 +3014,6 @@ static const uint64_t SM9_Z256_N_BARRETT_MU[5] = {

void sm9_z256_modn_mul(sm9_z256_t r, const sm9_z256_t a, const sm9_z256_t b)
{
sm9_z256_t x, y;
uint64_t z[8], h[10], s[8];
uint64_t t, c = 0;

Expand Down

0 comments on commit 9d8da9c

Please sign in to comment.