summaryrefslogtreecommitdiff
path: root/frontend/gamma/js/Clipperz/Crypto/BigInt.js
Side-by-side diff
Diffstat (limited to 'frontend/gamma/js/Clipperz/Crypto/BigInt.js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Clipperz/Crypto/BigInt.js23
1 files changed, 10 insertions, 13 deletions
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,46 +1,44 @@
/*
-Copyright 2008-2011 Clipperz Srl
+Copyright 2008-2013 Clipperz Srl
-This file is part of Clipperz Community Edition.
-Clipperz Community Edition is an online password manager.
+This file is part of Clipperz, the online password manager.
For further information about its features and functionalities please
refer to http://www.clipperz.com.
-* Clipperz Community Edition is free software: you can redistribute
- it and/or modify it under the terms of the GNU Affero General Public
- License as published by the Free Software Foundation, either version
- 3 of the License, or (at your option) any later version.
+* Clipperz is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
-* Clipperz Community Edition is distributed in the hope that it will
- be useful, but WITHOUT ANY WARRANTY; without even the implied
- warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+* Clipperz is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Affero General Public License for more details.
* You should have received a copy of the GNU Affero General Public
- License along with Clipperz Community Edition. If not, see
- <http://www.gnu.org/licenses/>.
+ License along with Clipperz. If not, see http://www.gnu.org/licenses/.
*/
if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; }
//#############################################################################
// Downloaded on March 05, 2007 from http://www.leemon.com/crypto/BigInt.js
//#############################################################################
////////////////////////////////////////////////////////////////////////////////////////
// Big Integer Library v. 5.0
// Created 2000, last modified 2006
// Leemon Baird
// www.leemon.com
//
// This file is public domain. You can use it for any purpose without restriction.
// I do not guarantee that it is correct, so use it at your own risk. If you use
// it for something interesting, I'd appreciate hearing about it. If you find
// any bugs or make any improvements, I'd appreciate hearing about those too.
// It would also be nice if my name and address were left in the comments.
// But none of that is required.
//
@@ -1456,49 +1454,48 @@ MochiKit.Base.update(Clipperz.Crypto.BigInt.prototype, {
'isBigInt': true,
//-------------------------------------------------------------------------
'toString': function(aBase) {
return this.asString(aBase);
},
//-------------------------------------------------------------------------
'asString': function (aBase, minimumLength) {
var result;
var base;
if (typeof(aBase) == 'undefined') {
base = 10;
} else {
base = aBase;
}
result = bigInt2str(this.internalValue(), base).toLowerCase();
if ((typeof(minimumLength) != 'undefined') && (result.length < minimumLength)) {
var i, c;
-//MochiKit.Logging.logDebug(">>> FIXING BigInt.asString length issue")
c = (minimumLength - result.length);
for (i=0; i<c; i++) {
result = '0' + result;
}
}
return result;
},
//-------------------------------------------------------------------------
'asByteArray': function() {
return new Clipperz.ByteArray("0x" + this.asString(16), 16);
},
//-------------------------------------------------------------------------
'equals': function (aValue) {
var result;
if (aValue.isBigInt) {
result = equals(this.internalValue(), aValue.internalValue());
} else if (typeof(aValue) == "number") {
result = equalsInt(this.internalValue(), aValue);