summaryrefslogtreecommitdiff
path: root/frontend/delta/js/Clipperz/Crypto/ECC/BinaryField/Curve.js
Unidiff
Diffstat (limited to 'frontend/delta/js/Clipperz/Crypto/ECC/BinaryField/Curve.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/delta/js/Clipperz/Crypto/ECC/BinaryField/Curve.js500
1 files changed, 500 insertions, 0 deletions
diff --git a/frontend/delta/js/Clipperz/Crypto/ECC/BinaryField/Curve.js b/frontend/delta/js/Clipperz/Crypto/ECC/BinaryField/Curve.js
new file mode 100644
index 0000000..0d76b9c
--- a/dev/null
+++ b/frontend/delta/js/Clipperz/Crypto/ECC/BinaryField/Curve.js
@@ -0,0 +1,500 @@
1/*
2
3Copyright 2008-2013 Clipperz Srl
4
5This file is part of Clipperz, the online password manager.
6For further information about its features and functionalities please
7refer to http://www.clipperz.com.
8
9* Clipperz is free software: you can redistribute it and/or modify it
10 under the terms of the GNU Affero General Public License as published
11 by the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14* Clipperz is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 See the GNU Affero General Public License for more details.
18
19* You should have received a copy of the GNU Affero General Public
20 License along with Clipperz. If not, see http://www.gnu.org/licenses/.
21
22*/
23
24//try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
25 //throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!";
26//}
27if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; }
28if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; }
29
30Clipperz.Crypto.ECC.BinaryField.Curve = function(args) {
31 args = args || {};
32
33 this._modulus = args.modulus;
34
35 this._a = args.a;
36 this._b = args.b;
37 this._G = args.G;
38 this._r = args.r;
39 this._h = args.h;
40
41 this._finiteField = null;
42
43 return this;
44}
45
46Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, {
47
48 'asString': function() {
49 return "Clipperz.Crypto.ECC.BinaryField.Curve";
50 },
51
52 //-----------------------------------------------------------------------------
53
54 'modulus': function() {
55 return this._modulus;
56 },
57
58 'a': function() {
59 return this._a;
60 },
61
62 'b': function() {
63 return this._b;
64 },
65
66 'G': function() {
67 return this._G;
68 },
69
70 'r': function() {
71 return this._r;
72 },
73
74 'h': function() {
75 return this._h;
76 },
77
78 //-----------------------------------------------------------------------------
79
80 'finiteField': function() {
81 if (this._finiteField == null) {
82 this._finiteField = new Clipperz.Crypto.ECC.BinaryField.FiniteField({modulus:this.modulus()})
83 }
84
85 return this._finiteField;
86 },
87
88 //-----------------------------------------------------------------------------
89
90 'negate': function(aPointA) {
91 var result;
92
93 result = new Clipperz.Crypto.ECC.Point({x:aPointA.x(), y:this.finiteField().add(aPointA.y(), aPointA.x())})
94
95 return result;
96 },
97
98 //-----------------------------------------------------------------------------
99
100 'add': function(aPointA, aPointB) {
101 var result;
102
103 if (aPointA.isZero()) {
104 result = aPointB;
105 } else if (aPointB.isZero()) {
106 result = aPointA;
107 } else if ((aPointA.x().compare(aPointB.x()) == 0) && ((aPointA.y().compare(aPointB.y()) != 0) || aPointB.x().isZero())) {
108 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
109 } else {
110 varf2m;
111 var x, y;
112 var lambda;
113 var aX, aY, bX, bY;
114
115 aX = aPointA.x()._value;
116 aY = aPointA.y()._value;
117 bX = aPointB.x()._value;
118 bY = aPointB.y()._value;
119
120 f2m = this.finiteField();
121
122 if (aPointA.x().compare(aPointB.x()) != 0) {
123 lambda =f2m._fastMultiply(
124 f2m._add(aY, bY),
125 f2m._inverse(f2m._add(aX, bX))
126 );
127 x = f2m._add(this.a()._value, f2m._square(lambda));
128 f2m._overwriteAdd(x, lambda);
129 f2m._overwriteAdd(x, aX);
130 f2m._overwriteAdd(x, bX);
131 } else {
132 lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX)));
133 x = f2m._add(this.a()._value, f2m._square(lambda));
134 f2m._overwriteAdd(x, lambda);
135 }
136
137 y = f2m._fastMultiply(f2m._add(bX, x), lambda);
138 f2m._overwriteAdd(y, x);
139 f2m._overwriteAdd(y, bY);
140
141 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)})
142 }
143
144 return result;
145 },
146
147 //-----------------------------------------------------------------------------
148
149 'addTwice': function(aPointA) {
150 return this.add(aPointA, aPointA);
151 },
152
153 //-----------------------------------------------------------------------------
154
155 'overwriteAdd': function(aPointA, aPointB) {
156 if (aPointA.isZero()) {
157 // result = aPointB;
158 aPointA._x._value = aPointB._x._value;
159 aPointA._y._value = aPointB._y._value;
160 } else if (aPointB.isZero()) {
161 // result = aPointA;
162 } else if ((aPointA.x().compare(aPointB.x()) == 0) && ((aPointA.y().compare(aPointB.y()) != 0) || aPointB.x().isZero())) {
163 // result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
164 aPointA._x = Clipperz.Crypto.ECC.BinaryField.Value.O;
165 aPointA._y = Clipperz.Crypto.ECC.BinaryField.Value.O;
166 } else {
167 varf2m;
168 var x, y;
169 var lambda;
170 var aX, aY, bX, bY;
171
172 aX = aPointA.x()._value;
173 aY = aPointA.y()._value;
174 bX = aPointB.x()._value;
175 bY = aPointB.y()._value;
176
177 f2m = this.finiteField();
178
179 if (aPointA.x().compare(aPointB.x()) != 0) {
180 lambda =f2m._fastMultiply(
181 f2m._add(aY, bY),
182 f2m._inverse(f2m._add(aX, bX))
183 );
184 x = f2m._add(this.a()._value, f2m._square(lambda));
185 f2m._overwriteAdd(x, lambda);
186 f2m._overwriteAdd(x, aX);
187 f2m._overwriteAdd(x, bX);
188 } else {
189 lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX)));
190 x = f2m._add(this.a()._value, f2m._square(lambda));
191 f2m._overwriteAdd(x, lambda);
192 }
193
194 y = f2m._fastMultiply(f2m._add(bX, x), lambda);
195 f2m._overwriteAdd(y, x);
196 f2m._overwriteAdd(y, bY);
197
198 // result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)})
199 aPointA._x._value = x;
200 aPointA._y._value = y;
201
202 }
203
204 return result;
205 },
206
207 //-----------------------------------------------------------------------------
208
209 'multiply': function(aValue, aPoint) {
210 var result;
211
212//console.profile();
213 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
214
215 if (aValue.isZero() == false) {
216 var k, Q;
217 var i;
218 var countIndex; countIndex = 0;
219
220 if (aValue.compare(Clipperz.Crypto.ECC.BinaryField.Value.O) > 0) {
221 k = aValue;
222 Q = aPoint;
223 } else {
224 Clipperz.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!");
225 k = aValue.negate();
226 Q = this.negate(aPoint);
227 }
228
229 for (i=k.bitSize()-1; i>=0; i--) {
230 result = this.add(result, result);
231 // this.overwriteAdd(result, result);
232 if (k.isBitSet(i)) {
233 result = this.add(result, Q);
234 // this.overwriteAdd(result, Q);
235 }
236
237 // if (countIndex==100) {Clipperz.log("multiply.break"); break;} else countIndex++;
238 }
239 }
240//console.profileEnd();
241
242 return result;
243 },
244
245 //-----------------------------------------------------------------------------
246
247 'deferredMultiply': function(aValue, aPoint) {
248 var deferredResult;
249 var result;
250
251Clipperz.log(">>> deferredMultiply - value: " + aValue + ", point: " + aPoint);
252//console.profile("ECC.Curve.multiply");
253 deferredResult = new MochiKit.Async.Deferred();
254//deferredResult.addCallback(function(res) {console.profile("ECC.Curve.deferredMultiply"); return res;} );
255//deferredResult.addBoth(function(res) {Clipperz.logDebug("# 1: " + res); return res;});
256
257 result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
258//deferredResult.addBoth(function(res) {Clipperz.logDebug("# 2: " + res); return res;});
259
260 if (aValue.isZero() == false) {
261 var k, Q;
262 var i;
263 var countIndex; countIndex = 0;
264
265 if (aValue.compare(Clipperz.Crypto.ECC.BinaryField.Value.O) > 0) {
266 k = aValue;
267 Q = aPoint;
268 } else {
269 Clipperz.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!");
270 k = aValue.negate();
271 Q = this.negate(aPoint);
272 }
273
274
275 for (i=k.bitSize()-1; i>=0; i--) {
276 deferredResult.addMethod(this, "addTwice");
277 //# result = this.add(result, result);
278 // this.overwriteAdd(result, result);
279 if (k.isBitSet(i)) {
280 deferredResult.addMethod(this, "add", Q);
281 //# result = this.add(result, Q);
282 // this.overwriteAdd(result, Q);
283 }
284 if (i%20 == 0) {deferredResult.addCallback(MochiKit.Async.wait, 0.1);}
285 }
286 }
287//#console.profileEnd();
288//deferredResult.addBoth(function(res) {console.profileEnd(); return res;});
289 deferredResult.callback(result);
290
291 //# return result;
292 return deferredResult;
293 },
294
295 //-----------------------------------------------------------------------------
296 __syntaxFix__: "syntax fix"
297});
298
299
300//#############################################################################
301
302Clipperz.Crypto.ECC.StandardCurves = {};
303
304MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
305/*
306 '_K571': null,
307 'K571': function() {
308 if (Clipperz.Crypto.ECC.StandardCurves._K571 == null) {
309 Clipperz.Crypto.ECC.StandardCurves._K571 = new Clipperz.Crypto.ECC.BinaryField.Curve({
310 modulus: new Clipperz.Crypto.ECC.BinaryField.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000425', 16),
311 a: new Clipperz.Crypto.ECC.BinaryField.Value('0', 16),
312 b: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16),
313 G: new Clipperz.Crypto.ECC.BinaryField.Point({
314 x: new Clipperz.Crypto.ECC.BinaryField.Value('026eb7a8 59923fbc 82189631 f8103fe4 ac9ca297 0012d5d4 60248048 01841ca4 43709584 93b205e6 47da304d b4ceb08c bbd1ba39 494776fb 988b4717 4dca88c7 e2945283 a01c8972', 16),
315 y: new Clipperz.Crypto.ECC.BinaryField.Value('0349dc80 7f4fbf37 4f4aeade 3bca9531 4dd58cec 9f307a54 ffc61efc 006d8a2c 9d4979c0 ac44aea7 4fbebbb9 f772aedc b620b01a 7ba7af1b 320430c8 591984f6 01cd4c14 3ef1c7a3', 16)
316 }),
317 r: new Clipperz.Crypto.ECC.BinaryField.Value('02000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 131850e1 f19a63e4 b391a8db 917f4138 b630d84b e5d63938 1e91deb4 5cfe778f 637c1001', 16),
318 h: new Clipperz.Crypto.ECC.BinaryField.Value('4', 16)
319 });
320 }
321
322 return Clipperz.Crypto.ECC.StandardCurves._K571;
323 },
324
325
326
327 '_K283': null,
328 'K283': function() { //f(z) = z^283 + z^12 + z^7 + z^5 + 1
329 if (Clipperz.Crypto.ECC.StandardCurves._K283 == null) {
330 Clipperz.Crypto.ECC.StandardCurves._K283 = new Clipperz.Crypto.ECC.BinaryField.Curve({
331 modulus: new Clipperz.Crypto.ECC.BinaryField.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16),
332 a: new Clipperz.Crypto.ECC.BinaryField.Value('0', 16),
333 b: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16),
334 G: new Clipperz.Crypto.ECC.BinaryField.Point({
335 x: new Clipperz.Crypto.ECC.BinaryField.Value('0503213f 78ca4488 3f1a3b81 62f188e5 53cd265f 23c1567a 16876913 b0c2ac24 58492836', 16),
336 y: new Clipperz.Crypto.ECC.BinaryField.Value('01ccda38 0f1c9e31 8d90f95d 07e5426f e87e45c0 e8184698 e4596236 4e341161 77dd2259', 16)
337 }),
338 r: new Clipperz.Crypto.ECC.BinaryField.Value('01ffffff ffffffff ffffffff ffffffff ffffe9ae 2ed07577 265dff7f 94451e06 1e163c61', 16),
339 h: new Clipperz.Crypto.ECC.BinaryField.Value('4', 16)
340 });
341 }
342
343 return Clipperz.Crypto.ECC.StandardCurves._K283;
344 },
345*/
346 //-----------------------------------------------------------------------------
347
348 '_B571': null,
349 'B571': function() { //f(z) = z^571 + z^10 + z^5 + z^2 + 1
350 if (Clipperz.Crypto.ECC.StandardCurves._B571 == null) {
351 Clipperz.Crypto.ECC.StandardCurves._B571 = new Clipperz.Crypto.ECC.BinaryField.Curve({
352 modulus: new Clipperz.Crypto.ECC.BinaryField.Value('80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425', 16),
353 a: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16),
354 b: new Clipperz.Crypto.ECC.BinaryField.Value('02f40e7e2221f295de297117b7f3d62f5c6a97ffcb8ceff1cd6ba8ce4a9a18ad84ffabbd8efa59332be7ad6756a66e294afd185a78ff12aa520e4de739baca0c7ffeff7f2955727a', 16),
355 G: new Clipperz.Crypto.ECC.BinaryField.Point({
356 x: new Clipperz.Crypto.ECC.BinaryField.Value('0303001d 34b85629 6c16c0d4 0d3cd775 0a93d1d2 955fa80a a5f40fc8 db7b2abd bde53950 f4c0d293 cdd711a3 5b67fb14 99ae6003 8614f139 4abfa3b4 c850d927 e1e7769c 8eec2d19', 16),
357 y: new Clipperz.Crypto.ECC.BinaryField.Value('037bf273 42da639b 6dccfffe b73d69d7 8c6c27a6 009cbbca 1980f853 3921e8a6 84423e43 bab08a57 6291af8f 461bb2a8 b3531d2f 0485c19b 16e2f151 6e23dd3c 1a4827af 1b8ac15b', 16)
358 }),
359 r: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff e661ce18 ff559873 08059b18 6823851e c7dd9ca1 161de93d 5174d66e 8382e9bb 2fe84e47', 16),
360 h: new Clipperz.Crypto.ECC.BinaryField.Value('2', 16)
361
362 // S: new Clipperz.Crypto.ECC.BinaryField.Value('2aa058f73a0e33ab486b0f610410c53a7f132310', 10),
363 // n: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe661ce18ff55987308059b186823851ec7dd9ca1161de93d5174d66e8382e9bb2fe84e47', 16)
364 });
365
366 //-----------------------------------------------------------------------------
367 //
368 //Guide to Elliptic Curve Cryptography
369 //Darrel Hankerson, Alfred Menezes, Scott Vanstone
370 //- Pag: 56, Alorithm 2.45 (with a typo!!!)
371 //
372 //-----------------------------------------------------------------------------
373 //
374 // http://www.milw0rm.com/papers/136
375 //
376 // -------------------------------------------------------------------------
377 // Polynomial Reduction Algorithm Modulo f571
378 // -------------------------------------------------------------------------
379 //
380 // Input: Polynomial p(x) of degree 1140 or less, stored as
381 // an array of 2T machinewords.
382 // Output: p(x) mod f571(x)
383 //
384 // FOR i = T-1, ..., 0 DO
385 // SET X := P[i+T]
386 // P[i] := P[i] ^ (X<<5) ^ (X<<7) ^ (X<<10) ^ (X<<15)
387 // P[i+1] := P[i+1] ^ (X>>17) ^ (X>>22) ^ (X>>25) ^ (X>>27)
388 //
389 // SET X := P[T-1] >> 27
390 // P[0] := P[0] ^ X ^ (X<<2) ^ (X<<5) ^ (X<<10)
391 // P[T-1] := P[T-1] & 0x07ffffff
392 //
393 // RETURN P[T-1],...,P[0]
394 //
395 // -------------------------------------------------------------------------
396 //
397 Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module;
398 Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module = function(aValue) {
399 varresult;
400
401 if (aValue.bitSize() > 1140) {
402 Clipperz.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation");
403 result = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule(aValue);
404 } else {
405 varC, T;
406 var i;
407
408 C = aValue._value.slice(0);
409 for (i=35; i>=18; i--) {
410 T = C[i];
411 C[i-18] = (((C[i-18] ^ (T<<5) ^ (T<<7) ^ (T<<10) ^ (T<<15)) & 0xffffffff) >>> 0);
412 C[i-17] = ((C[i-17] ^ (T>>>27) ^ (T>>>25) ^ (T>>>22) ^ (T>>>17)) >>> 0);
413 }
414 T = (C[17] >>> 27);
415 C[0] = ((C[0] ^ T ^ ((T<<2) ^ (T<<5) ^ (T<<10)) & 0xffffffff) >>> 0);
416 C[17] = (C[17] & 0x07ffffff);
417
418 for(i=18; i<=35; i++) {
419 C[i] = 0;
420 }
421
422 result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
423 }
424
425 return result;
426 };
427 }
428
429 return Clipperz.Crypto.ECC.StandardCurves._B571;
430 },
431
432 //-----------------------------------------------------------------------------
433
434 '_B283': null,
435 'B283': function() { //f(z) = z^283 + z^12 + z^7 + z^5 + 1
436 if (Clipperz.Crypto.ECC.StandardCurves._B283 == null) {
437 Clipperz.Crypto.ECC.StandardCurves._B283 = new Clipperz.Crypto.ECC.BinaryField.Curve({
438 // modulus: new Clipperz.Crypto.ECC.BinaryField.Value('10000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16),
439 modulus: new Clipperz.Crypto.ECC.BinaryField.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16),
440 a: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16),
441 b: new Clipperz.Crypto.ECC.BinaryField.Value('027b680a c8b8596d a5a4af8a 19a0303f ca97fd76 45309fa2 a581485a f6263e31 3b79a2f5', 16),
442 G: new Clipperz.Crypto.ECC.BinaryField.Point({
443 x: new Clipperz.Crypto.ECC.BinaryField.Value('05f93925 8db7dd90 e1934f8c 70b0dfec 2eed25b8 557eac9c 80e2e198 f8cdbecd 86b12053', 16),
444 y: new Clipperz.Crypto.ECC.BinaryField.Value('03676854 fe24141c b98fe6d4 b20d02b4 516ff702 350eddb0 826779c8 13f0df45 be8112f4', 16)
445 }),
446 r: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffff ffffffff ffffffff ffffffff ffffef90 399660fc 938a9016 5b042a7c efadb307', 16),
447 h: new Clipperz.Crypto.ECC.BinaryField.Value('2', 16)
448
449 // S: new Clipperz.Crypto.ECC.BinaryField.Value('2aa058f73a0e33ab486b0f610410c53a7f132310', 10),
450 // n: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe661ce18ff55987308059b186823851ec7dd9ca1161de93d5174d66e8382e9bb2fe84e47', 16)
451 });
452
453 //-----------------------------------------------------------------------------
454 //
455 //Guide to Elliptic Curve Cryptography
456 //Darrel Hankerson, Alfred Menezes, Scott Vanstone
457 //- Pag: 56, Alorithm 2.43
458 //
459 //-----------------------------------------------------------------------------
460 Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module;
461 Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module = function(aValue) {
462 varresult;
463
464 if (aValue.bitSize() > 564) {
465 Clipperz.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation");
466 result = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule(aValue);
467 } else {
468 varC, T;
469 var i;
470
471 C = aValue._value.slice(0);
472 for (i=17; i>=9; i--) {
473 T = C[i];
474 C[i-9] = (((C[i-9] ^ (T<<5) ^ (T<<10) ^ (T<<12) ^ (T<<17)) & 0xffffffff) >>> 0);
475 C[i-8] = ((C[i-8] ^ (T>>>27) ^ (T>>>22) ^ (T>>>20) ^ (T>>>15)) >>> 0);
476 }
477 T = (C[8] >>> 27);
478 C[0] = ((C[0] ^ T ^ ((T<<5) ^ (T<<7) ^ (T<<12)) & 0xffffffff) >>> 0);
479 C[8] = (C[8] & 0x07ffffff);
480
481 for(i=9; i<=17; i++) {
482 C[i] = 0;
483 }
484
485 result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
486 }
487
488 return result;
489 };
490 }
491
492 return Clipperz.Crypto.ECC.StandardCurves._B283;
493 },
494
495 //-----------------------------------------------------------------------------
496 __syntaxFix__: "syntax fix"
497});
498
499//#############################################################################
500