sync ltc whitespace
Karel Miko
7 years ago
92 | 92 |
}
|
93 | 93 |
}
|
94 | 94 |
|
95 | |
/* init montgomery reduction */
|
96 | |
if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) {
|
|
95 |
/* init montgomery reduction */
|
|
96 |
if ((err = mp_montgomery_setup(modulus, &mp)) != CRYPT_OK) {
|
97 | 97 |
goto ERR_P;
|
98 | |
}
|
99 | |
if ((err = mp_init(&mu)) != CRYPT_OK) {
|
|
98 |
}
|
|
99 |
if ((err = mp_init(&mu)) != CRYPT_OK) {
|
100 | 100 |
goto ERR_MP;
|
101 | |
}
|
102 | |
if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) {
|
|
101 |
}
|
|
102 |
if ((err = mp_montgomery_normalization(mu, modulus)) != CRYPT_OK) {
|
103 | 103 |
goto ERR_MU;
|
104 | |
}
|
|
104 |
}
|
105 | 105 |
|
106 | 106 |
/* copy ones ... */
|
107 | 107 |
if ((err = mp_mulmod(A->x, mu, modulus, precomp[1]->x)) != CRYPT_OK) { goto ERR_MU; }
|
59 | 59 |
return err;
|
60 | 60 |
}
|
61 | 61 |
|
62 | |
/* alloc ram for window temps */
|
63 | |
for (i = 0; i < 3; i++) {
|
|
62 |
/* alloc ram for window temps */
|
|
63 |
for (i = 0; i < 3; i++) {
|
64 | 64 |
M[i] = ltc_ecc_new_point();
|
65 | 65 |
if (M[i] == NULL) {
|
66 | 66 |
for (j = 0; j < i; j++) {
|
|
70 | 70 |
mp_montgomery_free(mp);
|
71 | 71 |
return CRYPT_MEM;
|
72 | 72 |
}
|
73 | |
}
|
|
73 |
}
|
74 | 74 |
|
75 | 75 |
/* make a copy of G incase R==G */
|
76 | 76 |
tG = ltc_ecc_new_point();
|