fix format

This commit is contained in:
Francois Perrad 2017-08-30 19:03:58 +02:00
parent 82a2d385db
commit cdbb9ca925
3 changed files with 8 additions and 14 deletions

View File

@ -21,8 +21,7 @@ void mp_dr_setup(mp_int *a, mp_digit *d)
/* the casts are required if DIGIT_BIT is one less than
* the number of bits in a mp_digit [e.g. DIGIT_BIT==31]
*/
*d = (mp_digit)((((mp_word)1) << ((mp_word)DIGIT_BIT)) -
((mp_word)a->dp[0]));
*d = (mp_digit)((((mp_word)1) << ((mp_word)DIGIT_BIT)) - ((mp_word)a->dp[0]));
}
#endif

View File

@ -52,11 +52,9 @@ int mp_export(void* rop, size_t* countp, int order, size_t size,
for (i = 0; i < count; ++i) {
for (j = 0; j < size; ++j) {
unsigned char* byte = (
(unsigned char*)rop +
(((order == -1) ? i : ((count - 1) - i)) * size) +
((endian == -1) ? j : ((size - 1) - j))
);
unsigned char *byte = (unsigned char *)rop +
(((order == -1) ? i : ((count - 1) - i)) * size) +
((endian == -1) ? j : ((size - 1) - j));
if (j >= (size - nail_bytes)) {
*byte = 0;

View File

@ -45,14 +45,11 @@ int mp_import(mp_int* rop, size_t count, int order, size_t size,
for (i = 0; i < count; ++i) {
for (j = 0; j < (size - nail_bytes); ++j) {
unsigned char byte = *(
(unsigned char*)op +
(((order == 1) ? i : ((count - 1) - i)) * size) +
((endian == 1) ? (j + nail_bytes) : (((size - 1) - j) - nail_bytes))
);
unsigned char byte = *((unsigned char *)op +
(((order == 1) ? i : ((count - 1) - i)) * size) +
((endian == 1) ? (j + nail_bytes) : (((size - 1) - j) - nail_bytes)));
if (
(result = mp_mul_2d(rop, ((j == 0) ? (8 - odd_nails) : 8), rop)) != MP_OKAY) {
if ((result = mp_mul_2d(rop, ((j == 0) ? (8 - odd_nails) : 8), rop)) != MP_OKAY) {
return result;
}