This commit is contained in:
NIIBE Yutaka
2014-01-22 15:53:13 +09:00
parent 5c01e92c20
commit c29bd10555
2 changed files with 4 additions and 4 deletions

View File

@@ -158,7 +158,7 @@ mod_inv (bn256 *C, const bn256 *X, const bn256 *N)
switch (c)
{
case 0:
case 3:
bn256_shift (u, u, -1);
if (bn256_is_even (A))
{
@@ -293,7 +293,7 @@ mod_inv (bn256 *C, const bn256 *X, const bn256 *N)
}
break;
case 3:
case 0:
bn256_shift (tmp, tmp, -1);
if (bn256_is_even (tmp))
{

View File

@@ -248,7 +248,7 @@ modp256_inv (bn256 *C, const bn256 *a)
switch (c)
{
case 0:
case 3:
bn256_shift (u, u, -1);
if (bn256_is_even (A))
{
@@ -359,7 +359,7 @@ modp256_inv (bn256 *C, const bn256 *a)
}
break;
case 3:
case 0:
bn256_shift (tmp, tmp, -1);
if (bn256_is_even (tmp))
{