OLD | NEW |
1 /* ***** BEGIN LICENSE BLOCK ***** | 1 /* ***** BEGIN LICENSE BLOCK ***** |
2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 2 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
3 * | 3 * |
4 * The contents of this file are subject to the Mozilla Public License Version | 4 * The contents of this file are subject to the Mozilla Public License Version |
5 * 1.1 (the "License"); you may not use this file except in compliance with | 5 * 1.1 (the "License"); you may not use this file except in compliance with |
6 * the License. You may obtain a copy of the License at | 6 * the License. You may obtain a copy of the License at |
7 * http://www.mozilla.org/MPL/ | 7 * http://www.mozilla.org/MPL/ |
8 * | 8 * |
9 * Software distributed under the License is distributed on an "AS IS" basis, | 9 * Software distributed under the License is distributed on an "AS IS" basis, |
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License | 10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License |
(...skipping 18 matching lines...) Expand all Loading... |
29 * in which case the provisions of the GPL or the LGPL are applicable instead | 29 * in which case the provisions of the GPL or the LGPL are applicable instead |
30 * of those above. If you wish to allow use of your version of this file only | 30 * of those above. If you wish to allow use of your version of this file only |
31 * under the terms of either the GPL or the LGPL, and not to allow others to | 31 * under the terms of either the GPL or the LGPL, and not to allow others to |
32 * use your version of this file under the terms of the MPL, indicate your | 32 * use your version of this file under the terms of the MPL, indicate your |
33 * decision by deleting the provisions above and replace them with the notice | 33 * decision by deleting the provisions above and replace them with the notice |
34 * and other provisions required by the GPL or the LGPL. If you do not delete | 34 * and other provisions required by the GPL or the LGPL. If you do not delete |
35 * the provisions above, a recipient may use your version of this file under | 35 * the provisions above, a recipient may use your version of this file under |
36 * the terms of any one of the MPL, the GPL or the LGPL. | 36 * the terms of any one of the MPL, the GPL or the LGPL. |
37 * | 37 * |
38 * ***** END LICENSE BLOCK ***** */ | 38 * ***** END LICENSE BLOCK ***** */ |
39 /* $Id: mpmontg.c,v 1.20 2006/08/29 02:41:38 nelson%bolyard.com Exp $ */ | 39 /* $Id: mpmontg.c,v 1.22 2010/05/02 22:36:41 nelson%bolyard.com Exp $ */ |
40 | 40 |
41 /* This file implements moduluar exponentiation using Montgomery's | 41 /* This file implements moduluar exponentiation using Montgomery's |
42 * method for modular reduction. This file implements the method | 42 * method for modular reduction. This file implements the method |
43 * described as "Improvement 1" in the paper "A Cryptogrpahic Library for | 43 * described as "Improvement 1" in the paper "A Cryptogrpahic Library for |
44 * the Motorola DSP56000" by Stephen R. Dusse' and Burton S. Kaliski Jr. | 44 * the Motorola DSP56000" by Stephen R. Dusse' and Burton S. Kaliski Jr. |
45 * published in "Advances in Cryptology: Proceedings of EUROCRYPT '90" | 45 * published in "Advances in Cryptology: Proceedings of EUROCRYPT '90" |
46 * "Lecture Notes in Computer Science" volume 473, 1991, pg 230-244, | 46 * "Lecture Notes in Computer Science" volume 473, 1991, pg 230-244, |
47 * published by Springer Verlag. | 47 * published by Springer Verlag. |
48 */ | 48 */ |
49 | 49 |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 | 1200 |
1201 CLEANUP: | 1201 CLEANUP: |
1202 mp_clear(&montBase); | 1202 mp_clear(&montBase); |
1203 mp_clear(&goodBase); | 1203 mp_clear(&goodBase); |
1204 /* Don't mp_clear mmm.N because it is merely a copy of modulus. | 1204 /* Don't mp_clear mmm.N because it is merely a copy of modulus. |
1205 ** Just zap it. | 1205 ** Just zap it. |
1206 */ | 1206 */ |
1207 memset(&mmm, 0, sizeof mmm); | 1207 memset(&mmm, 0, sizeof mmm); |
1208 return res; | 1208 return res; |
1209 } | 1209 } |
OLD | NEW |