minor fixes

This commit is contained in:
NIIBE Yutaka 2014-02-18 14:01:34 +09:00
parent ea73e1ee7e
commit 13a52a0862
2 changed files with 14 additions and 0 deletions

View File

@ -138,7 +138,9 @@ bn256_sub_uint (bn256 *X, const bn256 *A, uint32_t w)
return borrow; return borrow;
} }
#ifndef BN256_C_IMPLEMENTATION
#define ASM_IMPLEMENTATION 1 #define ASM_IMPLEMENTATION 1
#endif
void void
bn256_mul (bn512 *X, const bn256 *A, const bn256 *B) bn256_mul (bn512 *X, const bn256 *A, const bn256 *B)
{ {
@ -413,6 +415,7 @@ bn256_cmp (const bn256 *A, const bn256 *B)
} }
#ifndef BN256_NO_RANDOM
void void
bn256_random (bn256 *X) bn256_random (bn256 *X)
{ {
@ -429,3 +432,4 @@ bn256_random (bn256 *X)
random_bytes_free (rand); random_bytes_free (rand);
} }
#endif

View File

@ -193,6 +193,16 @@ modp256r1_reduce (bn256 *X, const bn512 *A)
memcpy (tmp, X, sizeof (bn256)); memcpy (tmp, X, sizeof (bn256));
else else
memcpy (X, tmp, sizeof (bn256)); memcpy (X, tmp, sizeof (bn256));
#undef S1
#undef S2
#undef S3
#undef S4
#undef S5
#undef S6
#undef S7
#undef S8
#undef S9
} }
/** /**