summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js
Unidiff
Diffstat (limited to 'frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js31
1 files changed, 12 insertions, 19 deletions
diff --git a/frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js b/frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js
index be197e3..239e264 100644
--- a/frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js
+++ b/frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js
@@ -1,25 +1,23 @@
1/* 1/*
2 2
3Copyright 2008-2011 Clipperz Srl 3Copyright 2008-2013 Clipperz Srl
4 4
5This file is part of Clipperz Community Edition. 5This file is part of Clipperz, the online password manager.
6Clipperz Community Edition is an online password manager.
7For further information about its features and functionalities please 6For further information about its features and functionalities please
8refer to http://www.clipperz.com. 7refer to http://www.clipperz.com.
9 8
10* Clipperz Community Edition is free software: you can redistribute 9* Clipperz is free software: you can redistribute it and/or modify it
11 it and/or modify it under the terms of the GNU Affero General Public 10 under the terms of the GNU Affero General Public License as published
12 License as published by the Free Software Foundation, either version 11 by the Free Software Foundation, either version 3 of the License, or
13 3 of the License, or (at your option) any later version. 12 (at your option) any later version.
14 13
15* Clipperz Community Edition is distributed in the hope that it will 14* Clipperz is distributed in the hope that it will be useful, but
16 be useful, but WITHOUT ANY WARRANTY; without even the implied 15 WITHOUT ANY WARRANTY; without even the implied warranty of
17 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU Affero General Public License for more details. 17 See the GNU Affero General Public License for more details.
19 18
20* You should have received a copy of the GNU Affero General Public 19* You should have received a copy of the GNU Affero General Public
21 License along with Clipperz Community Edition. If not, see 20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
22 <http://www.gnu.org/licenses/>.
23 21
24*/ 22*/
25 23
@@ -134,14 +132,12 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
134 varresult; 132 varresult;
135 133
136 if (aValue.bitSize() > 1140) { 134 if (aValue.bitSize() > 1140) {
137 MochiKit.Logging.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation"); 135 Clipperz.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation");
138 result = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule(aValue); 136 result = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule(aValue);
139 } else { 137 } else {
140 varC, T; 138 varC, T;
141 var i; 139 var i;
142 140
143//console.log(">>> binaryField.finiteField.(improved)module");
144 // C = aValue.value().slice(0);
145 C = aValue._value.slice(0); 141 C = aValue._value.slice(0);
146 for (i=35; i>=18; i--) { 142 for (i=35; i>=18; i--) {
147 T = C[i]; 143 T = C[i];
@@ -157,7 +153,6 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
157 } 153 }
158 154
159 result = new Clipperz.Crypto.ECC.BinaryField.Value(C); 155 result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
160//console.log("<<< binaryField.finiteField.(improved)module");
161 } 156 }
162 157
163 return result; 158 return result;
@@ -196,13 +191,12 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
196 varresult; 191 varresult;
197 192
198 if (aValue.bitSize() > 564) { 193 if (aValue.bitSize() > 564) {
199 MochiKit.Logging.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation"); 194 Clipperz.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation");
200 result = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule(aValue); 195 result = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule(aValue);
201 } else { 196 } else {
202 varC, T; 197 varC, T;
203 var i; 198 var i;
204 199
205//console.log(">>> binaryField.finiteField.(improved)module");
206 C = aValue._value.slice(0); 200 C = aValue._value.slice(0);
207 for (i=17; i>=9; i--) { 201 for (i=17; i>=9; i--) {
208 T = C[i]; 202 T = C[i];
@@ -218,7 +212,6 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
218 } 212 }
219 213
220 result = new Clipperz.Crypto.ECC.BinaryField.Value(C); 214 result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
221//console.log("<<< binaryField.finiteField.(improved)module");
222 } 215 }
223 216
224 return result; 217 return result;