summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/Crypto
authorClipperz <info@clipperz.com>2013-01-31 13:42:04 (UTC)
committer Clipperz <info@clipperz.com>2013-01-31 13:42:04 (UTC)
commit07d0357beef5d9328a2dd8d07ad7b39c87ac55e4 (patch) (unidiff)
treef7a4aed8848302db153c2a211f8e58b944eb4c5b /frontend/gamma/js/Clipperz/Crypto
parent767a3dcf48b6ac911c088af5dd7738a728eb6b99 (diff)
downloadclipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.zip
clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.gz
clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.bz2
Updated Copyright claims
- updated reference dates; - removed reference to Community Edition; - normalized logging using Clipperz.log[Warn|Error|Debug]
Diffstat (limited to 'frontend/gamma/js/Clipperz/Crypto') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/AES.js29
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/Base.js22
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/BigInt.js23
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/BigInt_scoped.js22
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Curve.js83
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/FiniteField.js26
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Point.js22
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Value.js24
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/ECC/StandardCurves.js31
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/PRNG.js33
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/RSA.js22
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/SHA.js22
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/SRP.js36
13 files changed, 145 insertions, 250 deletions
diff --git a/frontend/gamma/js/Clipperz/Crypto/AES.js b/frontend/gamma/js/Clipperz/Crypto/AES.js
index c811f1c..cb56f11 100644
--- a/frontend/gamma/js/Clipperz/Crypto/AES.js
+++ b/frontend/gamma/js/Clipperz/Crypto/AES.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
@@ -120,7 +118,6 @@ Clipperz.Crypto.AES.DeferredExecutionContext.prototype = MochiKit.Base.update(nu
120 }, 118 },
121 119
122 'isDone': function () { 120 'isDone': function () {
123//console.log("isDone", this.executionStep(), this.messageLength());
124 return (this._executionStep >= this._messageLength); 121 return (this._executionStep >= this._messageLength);
125 }, 122 },
126 123
@@ -144,7 +141,7 @@ Clipperz.Crypto.AES.Key = function(args) {
144 this._b = 240; 141 this._b = 240;
145 this._numberOfRounds = 14; 142 this._numberOfRounds = 14;
146 } else { 143 } else {
147 MochiKit.Logging.logError("AES unsupported key size: " + (this.keySize() * 8) + " bits"); 144 Clipperz.logError("AES unsupported key size: " + (this.keySize() * 8) + " bits");
148 throw Clipperz.Crypto.AES.exception.UnsupportedKeySize; 145 throw Clipperz.Crypto.AES.exception.UnsupportedKeySize;
149 } 146 }
150 147
@@ -808,7 +805,6 @@ MochiKit.Base.update(Clipperz.Crypto.AES, {
808 executionContext = new Clipperz.Crypto.AES.DeferredExecutionContext({key:key, message:someData, nonce:nonce}); 805 executionContext = new Clipperz.Crypto.AES.DeferredExecutionContext({key:key, message:someData, nonce:nonce});
809 806
810 deferredResult = new Clipperz.Async.Deferred("AES.deferredEncrypt"); 807 deferredResult = new Clipperz.Async.Deferred("AES.deferredEncrypt");
811//deferredResult.addCallback(function (aValue) { console.log(">>> deferredEncrypt"); return aValue; });
812 deferredResult.addCallback(Clipperz.Crypto.AES.deferredEncryptBlocks); 808 deferredResult.addCallback(Clipperz.Crypto.AES.deferredEncryptBlocks);
813 deferredResult.addCallback(function(anExecutionContext) { 809 deferredResult.addCallback(function(anExecutionContext) {
814 var result; 810 var result;
@@ -818,7 +814,6 @@ MochiKit.Base.update(Clipperz.Crypto.AES, {
818 814
819 return result; 815 return result;
820 }); 816 });
821//deferredResult.addCallback(function (aValue) { console.log("<<< deferredEncrypt"); return aValue; });
822 deferredResult.callback(executionContext) 817 deferredResult.callback(executionContext)
823 818
824 return deferredResult; 819 return deferredResult;
@@ -838,12 +833,10 @@ MochiKit.Base.update(Clipperz.Crypto.AES, {
838 executionContext = new Clipperz.Crypto.AES.DeferredExecutionContext({key:key, message:message, nonce:nonce}); 833 executionContext = new Clipperz.Crypto.AES.DeferredExecutionContext({key:key, message:message, nonce:nonce});
839 834
840 deferredResult = new Clipperz.Async.Deferred("AES.deferredDecrypt"); 835 deferredResult = new Clipperz.Async.Deferred("AES.deferredDecrypt");
841//deferredResult.addCallback(function (aValue) { console.log(">>> deferredDecrypt"); return aValue; });
842 deferredResult.addCallback(Clipperz.Crypto.AES.deferredEncryptBlocks); 836 deferredResult.addCallback(Clipperz.Crypto.AES.deferredEncryptBlocks);
843 deferredResult.addCallback(function(anExecutionContext) { 837 deferredResult.addCallback(function(anExecutionContext) {
844 return anExecutionContext.result(); 838 return anExecutionContext.result();
845 }); 839 });
846//deferredResult.addCallback(function (aValue) { console.log("<<< deferredDecrypt"); return aValue; });
847 deferredResult.callback(executionContext); 840 deferredResult.callback(executionContext);
848 841
849 return deferredResult; 842 return deferredResult;
diff --git a/frontend/gamma/js/Clipperz/Crypto/Base.js b/frontend/gamma/js/Clipperz/Crypto/Base.js
index d3a8e36..9acfc49 100644
--- a/frontend/gamma/js/Clipperz/Crypto/Base.js
+++ b/frontend/gamma/js/Clipperz/Crypto/Base.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
diff --git a/frontend/gamma/js/Clipperz/Crypto/BigInt.js b/frontend/gamma/js/Clipperz/Crypto/BigInt.js
index 41483a3..031ed30 100644
--- a/frontend/gamma/js/Clipperz/Crypto/BigInt.js
+++ b/frontend/gamma/js/Clipperz/Crypto/BigInt.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
@@ -1477,7 +1475,6 @@ MochiKit.Base.update(Clipperz.Crypto.BigInt.prototype, {
1477 1475
1478 if ((typeof(minimumLength) != 'undefined') && (result.length < minimumLength)) { 1476 if ((typeof(minimumLength) != 'undefined') && (result.length < minimumLength)) {
1479 var i, c; 1477 var i, c;
1480 //MochiKit.Logging.logDebug(">>> FIXING BigInt.asString length issue")
1481 c = (minimumLength - result.length); 1478 c = (minimumLength - result.length);
1482 for (i=0; i<c; i++) { 1479 for (i=0; i<c; i++) {
1483 result = '0' + result; 1480 result = '0' + result;
diff --git a/frontend/gamma/js/Clipperz/Crypto/BigInt_scoped.js b/frontend/gamma/js/Clipperz/Crypto/BigInt_scoped.js
index f91c7e9..bc60330 100644
--- a/frontend/gamma/js/Clipperz/Crypto/BigInt_scoped.js
+++ b/frontend/gamma/js/Clipperz/Crypto/BigInt_scoped.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
diff --git a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Curve.js b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Curve.js
index 19f19c2..0d76b9c 100644
--- a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Curve.js
+++ b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Curve.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
@@ -102,22 +100,13 @@ Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, {
102 'add': function(aPointA, aPointB) { 100 'add': function(aPointA, aPointB) {
103 var result; 101 var result;
104 102
105//console.log(">>> ECC.BinaryField.Curve.add");
106 if (aPointA.isZero()) { 103 if (aPointA.isZero()) {
107//console.log("--- pointA == zero");
108 result = aPointB; 104 result = aPointB;
109 } else if (aPointB.isZero()) { 105 } else if (aPointB.isZero()) {
110//console.log("--- pointB == zero");
111 result = aPointA; 106 result = aPointA;
112 } else if ((aPointA.x().compare(aPointB.x()) == 0) && ((aPointA.y().compare(aPointB.y()) != 0) || aPointB.x().isZero())) { 107 } else if ((aPointA.x().compare(aPointB.x()) == 0) && ((aPointA.y().compare(aPointB.y()) != 0) || aPointB.x().isZero())) {
113//console.log("compare A.x - B.x: ", aPointA.x().compare(aPointB.x()));
114//console.log("compare A.y - B.y: ", (aPointA.y().compare(aPointB.y()) != 0));
115//console.log("compare B.x.isZero(): ", aPointB.x().isZero());
116
117//console.log("--- result = zero");
118 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O}); 108 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
119 } else { 109 } else {
120//console.log("--- result = ELSE");
121 varf2m; 110 varf2m;
122 var x, y; 111 var x, y;
123 var lambda; 112 var lambda;
@@ -131,7 +120,6 @@ Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, {
131 f2m = this.finiteField(); 120 f2m = this.finiteField();
132 121
133 if (aPointA.x().compare(aPointB.x()) != 0) { 122 if (aPointA.x().compare(aPointB.x()) != 0) {
134//console.log(" a.x != b.x");
135 lambda =f2m._fastMultiply( 123 lambda =f2m._fastMultiply(
136 f2m._add(aY, bY), 124 f2m._add(aY, bY),
137 f2m._inverse(f2m._add(aX, bX)) 125 f2m._inverse(f2m._add(aX, bX))
@@ -141,25 +129,17 @@ Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, {
141 f2m._overwriteAdd(x, aX); 129 f2m._overwriteAdd(x, aX);
142 f2m._overwriteAdd(x, bX); 130 f2m._overwriteAdd(x, bX);
143 } else { 131 } else {
144//console.log(" a.x == b.x");
145 lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX))); 132 lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX)));
146//console.log(" lambda: " + lambda.asString(16));
147 x = f2m._add(this.a()._value, f2m._square(lambda)); 133 x = f2m._add(this.a()._value, f2m._square(lambda));
148//console.log(" x (step 1): " + x.asString(16));
149 f2m._overwriteAdd(x, lambda); 134 f2m._overwriteAdd(x, lambda);
150//console.log(" x (step 2): " + x.asString(16));
151 } 135 }
152 136
153 y = f2m._fastMultiply(f2m._add(bX, x), lambda); 137 y = f2m._fastMultiply(f2m._add(bX, x), lambda);
154//console.log(" y (step 1): " + y.asString(16));
155 f2m._overwriteAdd(y, x); 138 f2m._overwriteAdd(y, x);
156//console.log(" y (step 2): " + y.asString(16));
157 f2m._overwriteAdd(y, bY); 139 f2m._overwriteAdd(y, bY);
158//console.log(" y (step 3): " + y.asString(16));
159 140
160 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)}) 141 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)})
161 } 142 }
162//console.log("<<< ECC.BinaryField.Curve.add");
163 143
164 return result; 144 return result;
165 }, 145 },
@@ -197,7 +177,6 @@ Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, {
197 f2m = this.finiteField(); 177 f2m = this.finiteField();
198 178
199 if (aPointA.x().compare(aPointB.x()) != 0) { 179 if (aPointA.x().compare(aPointB.x()) != 0) {
200//console.log(" a.x != b.x");
201 lambda =f2m._fastMultiply( 180 lambda =f2m._fastMultiply(
202 f2m._add(aY, bY), 181 f2m._add(aY, bY),
203 f2m._inverse(f2m._add(aX, bX)) 182 f2m._inverse(f2m._add(aX, bX))
@@ -207,28 +186,20 @@ Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, {
207 f2m._overwriteAdd(x, aX); 186 f2m._overwriteAdd(x, aX);
208 f2m._overwriteAdd(x, bX); 187 f2m._overwriteAdd(x, bX);
209 } else { 188 } else {
210//console.log(" a.x == b.x");
211 lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX))); 189 lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX)));
212//console.log(" lambda: " + lambda.asString(16));
213 x = f2m._add(this.a()._value, f2m._square(lambda)); 190 x = f2m._add(this.a()._value, f2m._square(lambda));
214//console.log(" x (step 1): " + x.asString(16));
215 f2m._overwriteAdd(x, lambda); 191 f2m._overwriteAdd(x, lambda);
216//console.log(" x (step 2): " + x.asString(16));
217 } 192 }
218 193
219 y = f2m._fastMultiply(f2m._add(bX, x), lambda); 194 y = f2m._fastMultiply(f2m._add(bX, x), lambda);
220//console.log(" y (step 1): " + y.asString(16));
221 f2m._overwriteAdd(y, x); 195 f2m._overwriteAdd(y, x);
222//console.log(" y (step 2): " + y.asString(16));
223 f2m._overwriteAdd(y, bY); 196 f2m._overwriteAdd(y, bY);
224//console.log(" y (step 3): " + y.asString(16));
225 197
226 // result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)}) 198 // result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)})
227 aPointA._x._value = x; 199 aPointA._x._value = x;
228 aPointA._y._value = y; 200 aPointA._y._value = y;
229 201
230 } 202 }
231//console.log("<<< ECC.BinaryField.Curve.add");
232 203
233 return result; 204 return result;
234 }, 205 },
@@ -250,13 +221,11 @@ Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, {
250 k = aValue; 221 k = aValue;
251 Q = aPoint; 222 Q = aPoint;
252 } else { 223 } else {
253MochiKit.Logging.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!"); 224 Clipperz.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!");
254 k = aValue.negate(); 225 k = aValue.negate();
255 Q = this.negate(aPoint); 226 Q = this.negate(aPoint);
256 } 227 }
257 228
258//console.log("k: " + k.toString(16));
259//console.log("k.bitSize: " + k.bitSize());
260 for (i=k.bitSize()-1; i>=0; i--) { 229 for (i=k.bitSize()-1; i>=0; i--) {
261 result = this.add(result, result); 230 result = this.add(result, result);
262 // this.overwriteAdd(result, result); 231 // this.overwriteAdd(result, result);
@@ -265,7 +234,7 @@ MochiKit.Logging.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not w
265 // this.overwriteAdd(result, Q); 234 // this.overwriteAdd(result, Q);
266 } 235 }
267 236
268 // if (countIndex==100) {console.log("multiply.break"); break;} else countIndex++; 237 // if (countIndex==100) {Clipperz.log("multiply.break"); break;} else countIndex++;
269 } 238 }
270 } 239 }
271//console.profileEnd(); 240//console.profileEnd();
@@ -279,14 +248,14 @@ MochiKit.Logging.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not w
279 var deferredResult; 248 var deferredResult;
280 var result; 249 var result;
281 250
282MochiKit.Logging.logDebug(">>> deferredMultiply - value: " + aValue + ", point: " + aPoint); 251Clipperz.log(">>> deferredMultiply - value: " + aValue + ", point: " + aPoint);
283//console.profile("ECC.Curve.multiply"); 252//console.profile("ECC.Curve.multiply");
284 deferredResult = new MochiKit.Async.Deferred(); 253 deferredResult = new MochiKit.Async.Deferred();
285//deferredResult.addCallback(function(res) {console.profile("ECC.Curve.deferredMultiply"); return res;} ); 254//deferredResult.addCallback(function(res) {console.profile("ECC.Curve.deferredMultiply"); return res;} );
286//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 1: " + res); return res;}); 255//deferredResult.addBoth(function(res) {Clipperz.logDebug("# 1: " + res); return res;});
287 256
288 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O}); 257 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
289//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 2: " + res); return res;}); 258//deferredResult.addBoth(function(res) {Clipperz.logDebug("# 2: " + res); return res;});
290 259
291 if (aValue.isZero() == false) { 260 if (aValue.isZero() == false) {
292 var k, Q; 261 var k, Q;
@@ -297,18 +266,13 @@ MochiKit.Logging.logDebug(">>> deferredMultiply - value: " + aValue + ", point:
297 k = aValue; 266 k = aValue;
298 Q = aPoint; 267 Q = aPoint;
299 } else { 268 } else {
300MochiKit.Logging.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!"); 269 Clipperz.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!");
301 k = aValue.negate(); 270 k = aValue.negate();
302 Q = this.negate(aPoint); 271 Q = this.negate(aPoint);
303 } 272 }
304 273
305//console.log("k: " + k.toString(16));
306//console.log("k.bitSize: " + k.bitSize());
307 274
308//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 3: " + res); return res;});
309 for (i=k.bitSize()-1; i>=0; i--) { 275 for (i=k.bitSize()-1; i>=0; i--) {
310//MochiKit.Logging.logDebug("====> " + i);
311//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 4 > i = " + i + ": " + res); return res;});
312 deferredResult.addMethod(this, "addTwice"); 276 deferredResult.addMethod(this, "addTwice");
313 //# result = this.add(result, result); 277 //# result = this.add(result, result);
314 // this.overwriteAdd(result, result); 278 // this.overwriteAdd(result, result);
@@ -318,16 +282,10 @@ MochiKit.Logging.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not w
318 // this.overwriteAdd(result, Q); 282 // this.overwriteAdd(result, Q);
319 } 283 }
320 if (i%20 == 0) {deferredResult.addCallback(MochiKit.Async.wait, 0.1);} 284 if (i%20 == 0) {deferredResult.addCallback(MochiKit.Async.wait, 0.1);}
321
322 // if (countIndex==100) {console.log("multiply.break"); break;} else countIndex++;
323//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 4 < i = " + i + ": " + res); return res;});
324 } 285 }
325//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 4: " + res); return res;});
326 } 286 }
327//#console.profileEnd(); 287//#console.profileEnd();
328//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 5: " + res); return res;});
329//deferredResult.addBoth(function(res) {console.profileEnd(); return res;}); 288//deferredResult.addBoth(function(res) {console.profileEnd(); return res;});
330//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 6: " + res); return res;});
331 deferredResult.callback(result); 289 deferredResult.callback(result);
332 290
333 //# return result; 291 //# return result;
@@ -441,14 +399,12 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
441 varresult; 399 varresult;
442 400
443 if (aValue.bitSize() > 1140) { 401 if (aValue.bitSize() > 1140) {
444 MochiKit.Logging.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation"); 402 Clipperz.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation");
445 result = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule(aValue); 403 result = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule(aValue);
446 } else { 404 } else {
447 varC, T; 405 varC, T;
448 var i; 406 var i;
449 407
450//console.log(">>> binaryField.finiteField.(improved)module");
451 // C = aValue.value().slice(0);
452 C = aValue._value.slice(0); 408 C = aValue._value.slice(0);
453 for (i=35; i>=18; i--) { 409 for (i=35; i>=18; i--) {
454 T = C[i]; 410 T = C[i];
@@ -464,7 +420,6 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
464 } 420 }
465 421
466 result = new Clipperz.Crypto.ECC.BinaryField.Value(C); 422 result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
467//console.log("<<< binaryField.finiteField.(improved)module");
468 } 423 }
469 424
470 return result; 425 return result;
@@ -507,13 +462,12 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
507 varresult; 462 varresult;
508 463
509 if (aValue.bitSize() > 564) { 464 if (aValue.bitSize() > 564) {
510 MochiKit.Logging.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation"); 465 Clipperz.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation");
511 result = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule(aValue); 466 result = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule(aValue);
512 } else { 467 } else {
513 varC, T; 468 varC, T;
514 var i; 469 var i;
515 470
516//console.log(">>> binaryField.finiteField.(improved)module");
517 C = aValue._value.slice(0); 471 C = aValue._value.slice(0);
518 for (i=17; i>=9; i--) { 472 for (i=17; i>=9; i--) {
519 T = C[i]; 473 T = C[i];
@@ -529,7 +483,6 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
529 } 483 }
530 484
531 result = new Clipperz.Crypto.ECC.BinaryField.Value(C); 485 result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
532//console.log("<<< binaryField.finiteField.(improved)module");
533 } 486 }
534 487
535 return result; 488 return result;
diff --git a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/FiniteField.js b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/FiniteField.js
index 56f257a..7b7c2c6 100644
--- a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/FiniteField.js
+++ b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/FiniteField.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
@@ -53,7 +51,6 @@ Clipperz.Crypto.ECC.BinaryField.FiniteField.prototype = MochiKit.Base.update(nul
53 '_module': function(aValue) { 51 '_module': function(aValue) {
54 varresult; 52 varresult;
55 var modulusComparison; 53 var modulusComparison;
56//console.log(">>> binaryField.finiteField.(standard)module");
57 54
58 modulusComparison = Clipperz.Crypto.ECC.BinaryField.Value._compare(aValue, this.modulus()._value); 55 modulusComparison = Clipperz.Crypto.ECC.BinaryField.Value._compare(aValue, this.modulus()._value);
59 56
@@ -74,8 +71,7 @@ Clipperz.Crypto.ECC.BinaryField.FiniteField.prototype = MochiKit.Base.update(nul
74 resultBitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(result); 71 resultBitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(result);
75 } 72 }
76 } 73 }
77//console.log("<<< binaryField.finiteField.(standard)module"); 74
78
79 return result; 75 return result;
80 }, 76 },
81 77
diff --git a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Point.js b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Point.js
index ffe287b..fef3220 100644
--- a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Point.js
+++ b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Point.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
diff --git a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Value.js b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Value.js
index b705a20..634772a 100644
--- a/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Value.js
+++ b/frontend/gamma/js/Clipperz/Crypto/ECC/BinaryField/Value.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
@@ -368,8 +366,6 @@ Clipperz.Crypto.ECC.BinaryField.Value._compare = function(a,b) {
368 366
369 c = a.length; 367 c = a.length;
370 for (i=0; (i<c) && (result==0); i++) { 368 for (i=0; (i<c) && (result==0); i++) {
371//console.log("compare[" + c + " - " + i + " - 1] " + this.value()[c-i-1] + ", " + aValue.value()[c-i-1]);
372 // result = MochiKit.Base.compare(this.value()[c-i-1], aValue.value()[c-i-1]);
373 result = MochiKit.Base.compare(a[c-i-1], b[c-i-1]); 369 result = MochiKit.Base.compare(a[c-i-1], b[c-i-1]);
374 } 370 }
375 371
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;
diff --git a/frontend/gamma/js/Clipperz/Crypto/PRNG.js b/frontend/gamma/js/Clipperz/Crypto/PRNG.js
index adfdb16..c539f06 100644
--- a/frontend/gamma/js/Clipperz/Crypto/PRNG.js
+++ b/frontend/gamma/js/Clipperz/Crypto/PRNG.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
@@ -489,7 +487,6 @@ Clipperz.Crypto.PRNG.Fortuna.prototype = MochiKit.Base.update(null, {
489 487
490 this.setKey(Clipperz.Crypto.SHA.sha_d256(newKeySeed)); 488 this.setKey(Clipperz.Crypto.SHA.sha_d256(newKeySeed));
491 if (reseedCounter == 1) { 489 if (reseedCounter == 1) {
492//MochiKit.Logging.logDebug("### PRNG.readyToGenerateRandomBytes");
493Clipperz.log("### PRNG.readyToGenerateRandomBytes"); 490Clipperz.log("### PRNG.readyToGenerateRandomBytes");
494 MochiKit.Signal.signal(this, 'readyToGenerateRandomBytes'); 491 MochiKit.Signal.signal(this, 'readyToGenerateRandomBytes');
495 } 492 }
@@ -560,7 +557,7 @@ Clipperz.log("### PRNG.readyToGenerateRandomBytes");
560 newKey = this.getRandomBlock().appendBlock(this.getRandomBlock()); 557 newKey = this.getRandomBlock().appendBlock(this.getRandomBlock());
561 this.setKey(newKey); 558 this.setKey(newKey);
562 } else { 559 } else {
563MochiKit.Logging.logWarning("Fortuna generator has not enough entropy, yet!"); 560Clipperz.logWarning("Fortuna generator has not enough entropy, yet!");
564 throw Clipperz.Crypto.PRNG.exception.NotEnoughEntropy; 561 throw Clipperz.Crypto.PRNG.exception.NotEnoughEntropy;
565 } 562 }
566 563
@@ -610,21 +607,14 @@ MochiKit.Logging.logWarning("Fortuna generator has not enough entropy, yet!");
610 'deferredEntropyCollection': function(aValue) { 607 'deferredEntropyCollection': function(aValue) {
611 var result; 608 var result;
612 609
613//MochiKit.Logging.logDebug(">>> PRNG.deferredEntropyCollection");
614 610
615 if (this.isReadyToGenerateRandomValues()) { 611 if (this.isReadyToGenerateRandomValues()) {
616//MochiKit.Logging.logDebug("--- PRNG.deferredEntropyCollection - 1");
617 result = aValue; 612 result = aValue;
618 } else { 613 } else {
619//MochiKit.Logging.logDebug("--- PRNG.deferredEntropyCollection - 2");
620 var deferredResult; 614 var deferredResult;
621 615
622 // Clipperz.NotificationCenter.notify(this, 'updatedProgressState', 'collectingEntropy', true);
623
624 deferredResult = new Clipperz.Async.Deferred("PRNG.deferredEntropyCollection"); 616 deferredResult = new Clipperz.Async.Deferred("PRNG.deferredEntropyCollection");
625 // deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.1 - PRNG.deferredEntropyCollection - 1: " + res); return res;});
626 deferredResult.addCallback(MochiKit.Base.partial(MochiKit.Async.succeed, aValue)); 617 deferredResult.addCallback(MochiKit.Base.partial(MochiKit.Async.succeed, aValue));
627 // deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.2 - PRNG.deferredEntropyCollection - 2: " + res); return res;});
628 MochiKit.Signal.connect(this, 618 MochiKit.Signal.connect(this,
629 'readyToGenerateRandomBytes', 619 'readyToGenerateRandomBytes',
630 deferredResult, 620 deferredResult,
@@ -632,7 +622,6 @@ MochiKit.Logging.logWarning("Fortuna generator has not enough entropy, yet!");
632 622
633 result = deferredResult; 623 result = deferredResult;
634 } 624 }
635//MochiKit.Logging.logDebug("<<< PRNG.deferredEntropyCollection - result: " + result);
636 625
637 return result; 626 return result;
638 }, 627 },
diff --git a/frontend/gamma/js/Clipperz/Crypto/RSA.js b/frontend/gamma/js/Clipperz/Crypto/RSA.js
index 6844dba..5a480f1 100644
--- a/frontend/gamma/js/Clipperz/Crypto/RSA.js
+++ b/frontend/gamma/js/Clipperz/Crypto/RSA.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
diff --git a/frontend/gamma/js/Clipperz/Crypto/SHA.js b/frontend/gamma/js/Clipperz/Crypto/SHA.js
index b07fa85..f8bfe6e 100644
--- a/frontend/gamma/js/Clipperz/Crypto/SHA.js
+++ b/frontend/gamma/js/Clipperz/Crypto/SHA.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
diff --git a/frontend/gamma/js/Clipperz/Crypto/SRP.js b/frontend/gamma/js/Clipperz/Crypto/SRP.js
index 3b25275..597e72d 100644
--- a/frontend/gamma/js/Clipperz/Crypto/SRP.js
+++ b/frontend/gamma/js/Clipperz/Crypto/SRP.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
@@ -131,7 +129,6 @@ Clipperz.Crypto.SRP.Connection.prototype = MochiKit.Base.update(null, {
131 if (this._a == null) { 129 if (this._a == null) {
132 this._a = new Clipperz.Crypto.BigInt(Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32).toHexString().substring(2), 16); 130 this._a = new Clipperz.Crypto.BigInt(Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32).toHexString().substring(2), 16);
133 // this._a = new Clipperz.Crypto.BigInt("37532428169486597638072888476611365392249575518156687476805936694442691012367", 10); 131 // this._a = new Clipperz.Crypto.BigInt("37532428169486597638072888476611365392249575518156687476805936694442691012367", 10);
134//MochiKit.Logging.logDebug("SRP a: " + this._a);
135 } 132 }
136 133
137 return this._a; 134 return this._a;
@@ -145,10 +142,9 @@ Clipperz.Crypto.SRP.Connection.prototype = MochiKit.Base.update(null, {
145 this._A = Clipperz.Crypto.SRP.g().powerModule(this.a(), Clipperz.Crypto.SRP.n()); 142 this._A = Clipperz.Crypto.SRP.g().powerModule(this.a(), Clipperz.Crypto.SRP.n());
146 143
147 if (this._A.equals(0)) { 144 if (this._A.equals(0)) {
148MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to 0."); 145 Clipperz.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to 0.");
149 throw Clipperz.Crypto.SRP.exception.InvalidValue; 146 throw Clipperz.Crypto.SRP.exception.InvalidValue;
150 } 147 }
151//MochiKit.Logging.logDebug("SRP A: " + this._A);
152 } 148 }
153 149
154 return this._A; 150 return this._A;
@@ -158,7 +154,6 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to
158 154
159 's': function () { 155 's': function () {
160 return this._s; 156 return this._s;
161//MochiKit.Logging.logDebug("SRP s: " + this._S);
162 }, 157 },
163 158
164 'set_s': function(aValue) { 159 'set_s': function(aValue) {
@@ -175,9 +170,8 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to
175 //Warning: this value should be strictly greater than zero: how should we perform this check? 170 //Warning: this value should be strictly greater than zero: how should we perform this check?
176 if (! aValue.equals(0)) { 171 if (! aValue.equals(0)) {
177 this._B = aValue; 172 this._B = aValue;
178//MochiKit.Logging.logDebug("SRP B: " + this._B);
179 } else { 173 } else {
180MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to 0."); 174 Clipperz.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to 0.");
181 throw Clipperz.Crypto.SRP.exception.InvalidValue; 175 throw Clipperz.Crypto.SRP.exception.InvalidValue;
182 } 176 }
183 }, 177 },
@@ -187,7 +181,6 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to
187 'x': function () { 181 'x': function () {
188 if (this._x == null) { 182 if (this._x == null) {
189 this._x = new Clipperz.Crypto.BigInt(this.stringHash(this.s().asString(16, 64) + this.P()), 16); 183 this._x = new Clipperz.Crypto.BigInt(this.stringHash(this.s().asString(16, 64) + this.P()), 16);
190//MochiKit.Logging.logDebug("SRP x: " + this._x);
191 } 184 }
192 185
193 return this._x; 186 return this._x;
@@ -198,7 +191,6 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to
198 'u': function () { 191 'u': function () {
199 if (this._u == null) { 192 if (this._u == null) {
200 this._u = new Clipperz.Crypto.BigInt(this.stringHash(this.B().asString()), 16); 193 this._u = new Clipperz.Crypto.BigInt(this.stringHash(this.B().asString()), 16);
201//MochiKit.Logging.logDebug("SRP u: " + this._u);
202 } 194 }
203 195
204 return this._u; 196 return this._u;
@@ -219,7 +211,6 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to
219 bigint.add(this.a(), bigint.multiply(this.u(), this.x())), 211 bigint.add(this.a(), bigint.multiply(this.u(), this.x())),
220 srp.n() 212 srp.n()
221 ) 213 )
222//MochiKit.Logging.logDebug("SRP S: " + this._S);
223 } 214 }
224 215
225 return this._S; 216 return this._S;
@@ -230,7 +221,6 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to
230 'K': function () { 221 'K': function () {
231 if (this._K == null) { 222 if (this._K == null) {
232 this._K = this.stringHash(this.S().asString()); 223 this._K = this.stringHash(this.S().asString());
233//MochiKit.Logging.logDebug("SRP K: " + this._K);
234 } 224 }
235 225
236 return this._K; 226 return this._K;
@@ -241,7 +231,6 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to
241 'M1': function () { 231 'M1': function () {
242 if (this._M1 == null) { 232 if (this._M1 == null) {
243 this._M1 = this.stringHash(this.A().asString(10) + this.B().asString(10) + this.K()); 233 this._M1 = this.stringHash(this.A().asString(10) + this.B().asString(10) + this.K());
244//MochiKit.Logging.logDebug("SRP M1: " + this._M1);
245 } 234 }
246 235
247 return this._M1; 236 return this._M1;
@@ -252,7 +241,6 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to
252 'M2': function () { 241 'M2': function () {
253 if (this._M2 == null) { 242 if (this._M2 == null) {
254 this._M2 = this.stringHash(this.A().asString(10) + this.M1() + this.K()); 243 this._M2 = this.stringHash(this.A().asString(10) + this.M1() + this.K());
255//MochiKit.Logging.logDebug("SRP M2: " + this._M2);
256 } 244 }
257 245
258 return this._M2; 246 return this._M2;