OLD | NEW |
1 /* This Source Code Form is subject to the terms of the Mozilla Public | 1 /* This Source Code Form is subject to the terms of the Mozilla Public |
2 * License, v. 2.0. If a copy of the MPL was not distributed with this | 2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
4 /* $Id$ */ | |
5 | 4 |
6 /* This file implements moduluar exponentiation using Montgomery's | 5 /* This file implements moduluar exponentiation using Montgomery's |
7 * method for modular reduction. This file implements the method | 6 * method for modular reduction. This file implements the method |
8 * described as "Improvement 2" in the paper "A Cryptogrpahic Library for | 7 * described as "Improvement 2" in the paper "A Cryptogrpahic Library for |
9 * the Motorola DSP56000" by Stephen R. Dusse' and Burton S. Kaliski Jr. | 8 * the Motorola DSP56000" by Stephen R. Dusse' and Burton S. Kaliski Jr. |
10 * published in "Advances in Cryptology: Proceedings of EUROCRYPT '90" | 9 * published in "Advances in Cryptology: Proceedings of EUROCRYPT '90" |
11 * "Lecture Notes in Computer Science" volume 473, 1991, pg 230-244, | 10 * "Lecture Notes in Computer Science" volume 473, 1991, pg 230-244, |
12 * published by Springer Verlag. | 11 * published by Springer Verlag. |
13 */ | 12 */ |
14 | 13 |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 | 1164 |
1166 CLEANUP: | 1165 CLEANUP: |
1167 mp_clear(&montBase); | 1166 mp_clear(&montBase); |
1168 mp_clear(&goodBase); | 1167 mp_clear(&goodBase); |
1169 /* Don't mp_clear mmm.N because it is merely a copy of modulus. | 1168 /* Don't mp_clear mmm.N because it is merely a copy of modulus. |
1170 ** Just zap it. | 1169 ** Just zap it. |
1171 */ | 1170 */ |
1172 memset(&mmm, 0, sizeof mmm); | 1171 memset(&mmm, 0, sizeof mmm); |
1173 return res; | 1172 return res; |
1174 } | 1173 } |
OLD | NEW |