Diffstat (limited to 'frontend/delta/js/Clipperz/Crypto/ECC/BinaryField/Point.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/delta/js/Clipperz/Crypto/ECC/BinaryField/Point.js | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/frontend/delta/js/Clipperz/Crypto/ECC/BinaryField/Point.js b/frontend/delta/js/Clipperz/Crypto/ECC/BinaryField/Point.js new file mode 100644 index 0000000..fef3220 --- a/dev/null +++ b/frontend/delta/js/Clipperz/Crypto/ECC/BinaryField/Point.js | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | |||
3 | Copyright 2008-2013 Clipperz Srl | ||
4 | |||
5 | This file is part of Clipperz, the online password manager. | ||
6 | For further information about its features and functionalities please | ||
7 | refer 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 | //} | ||
27 | if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; } | ||
28 | if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; } | ||
29 | |||
30 | Clipperz.Crypto.ECC.BinaryField.Point = function(args) { | ||
31 | args = args || {}; | ||
32 | this._x = args.x; | ||
33 | this._y = args.y; | ||
34 | |||
35 | return this; | ||
36 | } | ||
37 | |||
38 | Clipperz.Crypto.ECC.BinaryField.Point.prototype = MochiKit.Base.update(null, { | ||
39 | |||
40 | 'asString': function() { | ||
41 | return "Clipperz.Crypto.ECC.BinaryField.Point (" + this.x() + ", " + this.y() + ")"; | ||
42 | }, | ||
43 | |||
44 | //----------------------------------------------------------------------------- | ||
45 | |||
46 | 'x': function() { | ||
47 | return this._x; | ||
48 | }, | ||
49 | |||
50 | 'y': function() { | ||
51 | return this._y; | ||
52 | }, | ||
53 | |||
54 | //----------------------------------------------------------------------------- | ||
55 | |||
56 | 'isZero': function() { | ||
57 | return (this.x().isZero() && this.y().isZero()) | ||
58 | }, | ||
59 | |||
60 | //----------------------------------------------------------------------------- | ||
61 | __syntaxFix__: "syntax fix" | ||
62 | }); | ||