summaryrefslogtreecommitdiff
path: root/frontend/gamma/js
Side-by-side diff
Diffstat (limited to 'frontend/gamma/js') (more/less context) (ignore whitespace changes)
-rw-r--r--frontend/gamma/js/Bookmarklet.js22
-rw-r--r--frontend/gamma/js/BookmarkletHash.js22
-rw-r--r--frontend/gamma/js/Bookmarklet_1.js22
-rw-r--r--frontend/gamma/js/Bookmarklet_2.js22
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-affix.js140
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-alert.js122
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-button.js128
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-carousel.js208
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-collapse.js190
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-dropdown.js184
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-modal.js268
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-popover.js137
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-scrollspy.js185
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-tab.js167
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-tooltip.js310
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-transition.js83
-rw-r--r--frontend/gamma/js/Bootstrap/bootstrap-typeahead.js346
-rw-r--r--frontend/gamma/js/Clipperz/Async.js50
-rw-r--r--frontend/gamma/js/Clipperz/Base.js41
-rw-r--r--frontend/gamma/js/Clipperz/ByteArray.js71
-rw-r--r--frontend/gamma/js/Clipperz/CSVProcessor.js78
-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
-rw-r--r--frontend/gamma/js/Clipperz/DOM.js24
-rw-r--r--frontend/gamma/js/Clipperz/Date.js25
-rw-r--r--frontend/gamma/js/Clipperz/KeePassExportProcessor.js22
-rw-r--r--frontend/gamma/js/Clipperz/KeyValueObjectStore.js27
-rw-r--r--frontend/gamma/js/Clipperz/Logging.js41
-rw-r--r--frontend/gamma/js/Clipperz/PM/BookmarkletProcessor.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Connection.js33
-rw-r--r--frontend/gamma/js/Clipperz/PM/Crypto.js48
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/DirectLogin.js34
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginBinding.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginFormValue.js23
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js30
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/OneTimePassword.js66
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.Field.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.js25
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/Record.js44
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js28
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Preferences.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js39
-rw-r--r--frontend/gamma/js/Clipperz/PM/DataModel/User.js24
-rw-r--r--frontend/gamma/js/Clipperz/PM/Date.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/PIN.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Proxy.js30
-rwxr-xr-xfrontend/gamma/js/Clipperz/PM/Proxy/Proxy.JSON.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js48
-rw-r--r--frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Proxy/Proxy.OfflineCache.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js28
-rw-r--r--frontend/gamma/js/Clipperz/PM/Strings.js27
-rw-r--r--frontend/gamma/js/Clipperz/PM/Strings/MessagePanelConfigurations.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Strings/Strings_defaults.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Strings/Strings_en-US.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/Toll.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js24
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js35
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js30
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js29
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js28
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js24
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js29
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js54
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js24
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js23
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js27
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js24
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js23
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js28
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js23
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js23
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js26
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js23
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js23
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js25
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js22
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js28
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js28
-rw-r--r--frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js28
-rw-r--r--frontend/gamma/js/Clipperz/Set.js22
-rw-r--r--frontend/gamma/js/Clipperz/Signal.js22
-rw-r--r--frontend/gamma/js/Clipperz/Style.js22
-rw-r--r--frontend/gamma/js/Clipperz/Visual.js22
-rw-r--r--frontend/gamma/js/Clipperz/YUI/DomHelper.js29
-rw-r--r--frontend/gamma/js/Clipperz/YUI/DomQuery.js22
-rw-r--r--frontend/gamma/js/Clipperz/YUI/Utils.js22
-rw-r--r--frontend/gamma/js/ClipperzCryptoLibrary/AES.js864
-rw-r--r--frontend/gamma/js/ClipperzCryptoLibrary/Base.js1847
-rw-r--r--frontend/gamma/js/ClipperzCryptoLibrary/BigInt.js1755
-rw-r--r--frontend/gamma/js/ClipperzCryptoLibrary/BigInt_scoped.js1644
-rw-r--r--frontend/gamma/js/ClipperzCryptoLibrary/ByteArray.js1496
-rw-r--r--frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/Curve.js545
-rw-r--r--frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/FiniteField.js521
-rw-r--r--frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/Point.js62
-rw-r--r--frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/Value.js381
-rw-r--r--frontend/gamma/js/ClipperzCryptoLibrary/ECC/StandardCurves.js234
-rw-r--r--frontend/gamma/js/ClipperzCryptoLibrary/PRNG.js850
-rw-r--r--frontend/gamma/js/ClipperzCryptoLibrary/RSA.js146
-rw-r--r--frontend/gamma/js/ClipperzCryptoLibrary/SHA.js296
-rw-r--r--frontend/gamma/js/ClipperzCryptoLibrary/SRP.js326
-rw-r--r--frontend/gamma/js/main.js22
-rw-r--r--frontend/gamma/js/main.mobile.js22
171 files changed, 15007 insertions, 2241 deletions
diff --git a/frontend/gamma/js/Bookmarklet.js b/frontend/gamma/js/Bookmarklet.js
index bcdcc46..9e74ae9 100644
--- a/frontend/gamma/js/Bookmarklet.js
+++ b/frontend/gamma/js/Bookmarklet.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/BookmarkletHash.js b/frontend/gamma/js/BookmarkletHash.js
index c3039f5..11b472f 100644
--- a/frontend/gamma/js/BookmarkletHash.js
+++ b/frontend/gamma/js/BookmarkletHash.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Bookmarklet_1.js b/frontend/gamma/js/Bookmarklet_1.js
index c7c7ae6..89b83b1 100644
--- a/frontend/gamma/js/Bookmarklet_1.js
+++ b/frontend/gamma/js/Bookmarklet_1.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Bookmarklet_2.js b/frontend/gamma/js/Bookmarklet_2.js
index 02f7de8..de1bbfa 100644
--- a/frontend/gamma/js/Bookmarklet_2.js
+++ b/frontend/gamma/js/Bookmarklet_2.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-affix.js b/frontend/gamma/js/Bootstrap/bootstrap-affix.js
new file mode 100644
index 0000000..052ecad
--- a/dev/null
+++ b/frontend/gamma/js/Bootstrap/bootstrap-affix.js
@@ -0,0 +1,140 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+/* ==========================================================
+ * bootstrap-affix.js v2.2.2
+ * http://twitter.github.com/bootstrap/javascript.html#affix
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* AFFIX CLASS DEFINITION
+ * ====================== */
+
+ var Affix = function (element, options) {
+ this.options = $.extend({}, $.fn.affix.defaults, options)
+ this.$window = $(window)
+ .on('scroll.affix.data-api', $.proxy(this.checkPosition, this))
+ .on('click.affix.data-api', $.proxy(function () { setTimeout($.proxy(this.checkPosition, this), 1) }, this))
+ this.$element = $(element)
+ this.checkPosition()
+ }
+
+ Affix.prototype.checkPosition = function () {
+ if (!this.$element.is(':visible')) return
+
+ var scrollHeight = $(document).height()
+ , scrollTop = this.$window.scrollTop()
+ , position = this.$element.offset()
+ , offset = this.options.offset
+ , offsetBottom = offset.bottom
+ , offsetTop = offset.top
+ , reset = 'affix affix-top affix-bottom'
+ , affix
+
+ if (typeof offset != 'object') offsetBottom = offsetTop = offset
+ if (typeof offsetTop == 'function') offsetTop = offset.top()
+ if (typeof offsetBottom == 'function') offsetBottom = offset.bottom()
+
+ affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ?
+ false : offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ?
+ 'bottom' : offsetTop != null && scrollTop <= offsetTop ?
+ 'top' : false
+
+ if (this.affixed === affix) return
+
+ this.affixed = affix
+ this.unpin = affix == 'bottom' ? position.top - scrollTop : null
+
+ this.$element.removeClass(reset).addClass('affix' + (affix ? '-' + affix : ''))
+ }
+
+
+ /* AFFIX PLUGIN DEFINITION
+ * ======================= */
+
+ var old = $.fn.affix
+
+ $.fn.affix = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('affix')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('affix', (data = new Affix(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.affix.Constructor = Affix
+
+ $.fn.affix.defaults = {
+ offset: 0
+ }
+
+
+ /* AFFIX NO CONFLICT
+ * ================= */
+
+ $.fn.affix.noConflict = function () {
+ $.fn.affix = old
+ return this
+ }
+
+
+ /* AFFIX DATA-API
+ * ============== */
+
+ $(window).on('load', function () {
+ $('[data-spy="affix"]').each(function () {
+ var $spy = $(this)
+ , data = $spy.data()
+
+ data.offset = data.offset || {}
+
+ data.offsetBottom && (data.offset.bottom = data.offsetBottom)
+ data.offsetTop && (data.offset.top = data.offsetTop)
+
+ $spy.affix(data)
+ })
+ })
+
+
+}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-alert.js b/frontend/gamma/js/Bootstrap/bootstrap-alert.js
new file mode 100644
index 0000000..63028f2
--- a/dev/null
+++ b/frontend/gamma/js/Bootstrap/bootstrap-alert.js
@@ -0,0 +1,122 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+/* ==========================================================
+ * bootstrap-alert.js v2.2.2
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* ALERT CLASS DEFINITION
+ * ====================== */
+
+ var dismiss = '[data-dismiss="alert"]'
+ , Alert = function (el) {
+ $(el).on('click', dismiss, this.close)
+ }
+
+ Alert.prototype.close = function (e) {
+ var $this = $(this)
+ , selector = $this.attr('data-target')
+ , $parent
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
+
+ $parent = $(selector)
+
+ e && e.preventDefault()
+
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
+
+ $parent.trigger(e = $.Event('close'))
+
+ if (e.isDefaultPrevented()) return
+
+ $parent.removeClass('in')
+
+ function removeElement() {
+ $parent
+ .trigger('closed')
+ .remove()
+ }
+
+ $.support.transition && $parent.hasClass('fade') ?
+ $parent.on($.support.transition.end, removeElement) :
+ removeElement()
+ }
+
+
+ /* ALERT PLUGIN DEFINITION
+ * ======================= */
+
+ var old = $.fn.alert
+
+ $.fn.alert = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('alert')
+ if (!data) $this.data('alert', (data = new Alert(this)))
+ if (typeof option == 'string') data[option].call($this)
+ })
+ }
+
+ $.fn.alert.Constructor = Alert
+
+
+ /* ALERT NO CONFLICT
+ * ================= */
+
+ $.fn.alert.noConflict = function () {
+ $.fn.alert = old
+ return this
+ }
+
+
+ /* ALERT DATA-API
+ * ============== */
+
+ $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
+
+}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-button.js b/frontend/gamma/js/Bootstrap/bootstrap-button.js
new file mode 100644
index 0000000..2c1226e
--- a/dev/null
+++ b/frontend/gamma/js/Bootstrap/bootstrap-button.js
@@ -0,0 +1,128 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+/* ============================================================
+ * bootstrap-button.js v2.2.2
+ * http://twitter.github.com/bootstrap/javascript.html#buttons
+ * ============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* BUTTON PUBLIC CLASS DEFINITION
+ * ============================== */
+
+ var Button = function (element, options) {
+ this.$element = $(element)
+ this.options = $.extend({}, $.fn.button.defaults, options)
+ }
+
+ Button.prototype.setState = function (state) {
+ var d = 'disabled'
+ , $el = this.$element
+ , data = $el.data()
+ , val = $el.is('input') ? 'val' : 'html'
+
+ state = state + 'Text'
+ data.resetText || $el.data('resetText', $el[val]())
+
+ $el[val](data[state] || this.options[state])
+
+ // push to event loop to allow forms to submit
+ setTimeout(function () {
+ state == 'loadingText' ?
+ $el.addClass(d).attr(d, d) :
+ $el.removeClass(d).removeAttr(d)
+ }, 0)
+ }
+
+ Button.prototype.toggle = function () {
+ var $parent = this.$element.closest('[data-toggle="buttons-radio"]')
+
+ $parent && $parent
+ .find('.active')
+ .removeClass('active')
+
+ this.$element.toggleClass('active')
+ }
+
+
+ /* BUTTON PLUGIN DEFINITION
+ * ======================== */
+
+ var old = $.fn.button
+
+ $.fn.button = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('button')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('button', (data = new Button(this, options)))
+ if (option == 'toggle') data.toggle()
+ else if (option) data.setState(option)
+ })
+ }
+
+ $.fn.button.defaults = {
+ loadingText: 'loading...'
+ }
+
+ $.fn.button.Constructor = Button
+
+
+ /* BUTTON NO CONFLICT
+ * ================== */
+
+ $.fn.button.noConflict = function () {
+ $.fn.button = old
+ return this
+ }
+
+
+ /* BUTTON DATA-API
+ * =============== */
+
+ $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) {
+ var $btn = $(e.target)
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
+ $btn.button('toggle')
+ })
+
+}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-carousel.js b/frontend/gamma/js/Bootstrap/bootstrap-carousel.js
new file mode 100644
index 0000000..e127bc7
--- a/dev/null
+++ b/frontend/gamma/js/Bootstrap/bootstrap-carousel.js
@@ -0,0 +1,208 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+/* ==========================================================
+ * bootstrap-carousel.js v2.2.2
+ * http://twitter.github.com/bootstrap/javascript.html#carousel
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* CAROUSEL CLASS DEFINITION
+ * ========================= */
+
+ var Carousel = function (element, options) {
+ this.$element = $(element)
+ this.options = options
+ this.options.pause == 'hover' && this.$element
+ .on('mouseenter', $.proxy(this.pause, this))
+ .on('mouseleave', $.proxy(this.cycle, this))
+ }
+
+ Carousel.prototype = {
+
+ cycle: function (e) {
+ if (!e) this.paused = false
+ this.options.interval
+ && !this.paused
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
+ return this
+ }
+
+ , to: function (pos) {
+ var $active = this.$element.find('.item.active')
+ , children = $active.parent().children()
+ , activePos = children.index($active)
+ , that = this
+
+ if (pos > (children.length - 1) || pos < 0) return
+
+ if (this.sliding) {
+ return this.$element.one('slid', function () {
+ that.to(pos)
+ })
+ }
+
+ if (activePos == pos) {
+ return this.pause().cycle()
+ }
+
+ return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
+ }
+
+ , pause: function (e) {
+ if (!e) this.paused = true
+ if (this.$element.find('.next, .prev').length && $.support.transition.end) {
+ this.$element.trigger($.support.transition.end)
+ this.cycle()
+ }
+ clearInterval(this.interval)
+ this.interval = null
+ return this
+ }
+
+ , next: function () {
+ if (this.sliding) return
+ return this.slide('next')
+ }
+
+ , prev: function () {
+ if (this.sliding) return
+ return this.slide('prev')
+ }
+
+ , slide: function (type, next) {
+ var $active = this.$element.find('.item.active')
+ , $next = next || $active[type]()
+ , isCycling = this.interval
+ , direction = type == 'next' ? 'left' : 'right'
+ , fallback = type == 'next' ? 'first' : 'last'
+ , that = this
+ , e
+
+ this.sliding = true
+
+ isCycling && this.pause()
+
+ $next = $next.length ? $next : this.$element.find('.item')[fallback]()
+
+ e = $.Event('slide', {
+ relatedTarget: $next[0]
+ })
+
+ if ($next.hasClass('active')) return
+
+ if ($.support.transition && this.$element.hasClass('slide')) {
+ this.$element.trigger(e)
+ if (e.isDefaultPrevented()) return
+ $next.addClass(type)
+ $next[0].offsetWidth // force reflow
+ $active.addClass(direction)
+ $next.addClass(direction)
+ this.$element.one($.support.transition.end, function () {
+ $next.removeClass([type, direction].join(' ')).addClass('active')
+ $active.removeClass(['active', direction].join(' '))
+ that.sliding = false
+ setTimeout(function () { that.$element.trigger('slid') }, 0)
+ })
+ } else {
+ this.$element.trigger(e)
+ if (e.isDefaultPrevented()) return
+ $active.removeClass('active')
+ $next.addClass('active')
+ this.sliding = false
+ this.$element.trigger('slid')
+ }
+
+ isCycling && this.cycle()
+
+ return this
+ }
+
+ }
+
+
+ /* CAROUSEL PLUGIN DEFINITION
+ * ========================== */
+
+ var old = $.fn.carousel
+
+ $.fn.carousel = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('carousel')
+ , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
+ , action = typeof option == 'string' ? option : options.slide
+ if (!data) $this.data('carousel', (data = new Carousel(this, options)))
+ if (typeof option == 'number') data.to(option)
+ else if (action) data[action]()
+ else if (options.interval) data.cycle()
+ })
+ }
+
+ $.fn.carousel.defaults = {
+ interval: 5000
+ , pause: 'hover'
+ }
+
+ $.fn.carousel.Constructor = Carousel
+
+
+ /* CAROUSEL NO CONFLICT
+ * ==================== */
+
+ $.fn.carousel.noConflict = function () {
+ $.fn.carousel = old
+ return this
+ }
+
+ /* CAROUSEL DATA-API
+ * ================= */
+
+ $(document).on('click.carousel.data-api', '[data-slide]', function (e) {
+ var $this = $(this), href
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
+ , options = $.extend({}, $target.data(), $this.data())
+ $target.carousel(options)
+ e.preventDefault()
+ })
+
+}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-collapse.js b/frontend/gamma/js/Bootstrap/bootstrap-collapse.js
new file mode 100644
index 0000000..31b7168
--- a/dev/null
+++ b/frontend/gamma/js/Bootstrap/bootstrap-collapse.js
@@ -0,0 +1,190 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+/* =============================================================
+ * bootstrap-collapse.js v2.2.2
+ * http://twitter.github.com/bootstrap/javascript.html#collapse
+ * =============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* COLLAPSE PUBLIC CLASS DEFINITION
+ * ================================ */
+
+ var Collapse = function (element, options) {
+ this.$element = $(element)
+ this.options = $.extend({}, $.fn.collapse.defaults, options)
+
+ if (this.options.parent) {
+ this.$parent = $(this.options.parent)
+ }
+
+ this.options.toggle && this.toggle()
+ }
+
+ Collapse.prototype = {
+
+ constructor: Collapse
+
+ , dimension: function () {
+ var hasWidth = this.$element.hasClass('width')
+ return hasWidth ? 'width' : 'height'
+ }
+
+ , show: function () {
+ var dimension
+ , scroll
+ , actives
+ , hasData
+
+ if (this.transitioning) return
+
+ dimension = this.dimension()
+ scroll = $.camelCase(['scroll', dimension].join('-'))
+ actives = this.$parent && this.$parent.find('> .accordion-group > .in')
+
+ if (actives && actives.length) {
+ hasData = actives.data('collapse')
+ if (hasData && hasData.transitioning) return
+ actives.collapse('hide')
+ hasData || actives.data('collapse', null)
+ }
+
+ this.$element[dimension](0)
+ this.transition('addClass', $.Event('show'), 'shown')
+ $.support.transition && this.$element[dimension](this.$element[0][scroll])
+ }
+
+ , hide: function () {
+ var dimension
+ if (this.transitioning) return
+ dimension = this.dimension()
+ this.reset(this.$element[dimension]())
+ this.transition('removeClass', $.Event('hide'), 'hidden')
+ this.$element[dimension](0)
+ }
+
+ , reset: function (size) {
+ var dimension = this.dimension()
+
+ this.$element
+ .removeClass('collapse')
+ [dimension](size || 'auto')
+ [0].offsetWidth
+
+ this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
+
+ return this
+ }
+
+ , transition: function (method, startEvent, completeEvent) {
+ var that = this
+ , complete = function () {
+ if (startEvent.type == 'show') that.reset()
+ that.transitioning = 0
+ that.$element.trigger(completeEvent)
+ }
+
+ this.$element.trigger(startEvent)
+
+ if (startEvent.isDefaultPrevented()) return
+
+ this.transitioning = 1
+
+ this.$element[method]('in')
+
+ $.support.transition && this.$element.hasClass('collapse') ?
+ this.$element.one($.support.transition.end, complete) :
+ complete()
+ }
+
+ , toggle: function () {
+ this[this.$element.hasClass('in') ? 'hide' : 'show']()
+ }
+
+ }
+
+
+ /* COLLAPSE PLUGIN DEFINITION
+ * ========================== */
+
+ var old = $.fn.collapse
+
+ $.fn.collapse = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('collapse')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('collapse', (data = new Collapse(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.collapse.defaults = {
+ toggle: true
+ }
+
+ $.fn.collapse.Constructor = Collapse
+
+
+ /* COLLAPSE NO CONFLICT
+ * ==================== */
+
+ $.fn.collapse.noConflict = function () {
+ $.fn.collapse = old
+ return this
+ }
+
+
+ /* COLLAPSE DATA-API
+ * ================= */
+
+ $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) {
+ var $this = $(this), href
+ , target = $this.attr('data-target')
+ || e.preventDefault()
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
+ , option = $(target).data('collapse') ? 'toggle' : $this.data()
+ $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed')
+ $(target).collapse(option)
+ })
+
+}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-dropdown.js b/frontend/gamma/js/Bootstrap/bootstrap-dropdown.js
new file mode 100644
index 0000000..3b77bb3
--- a/dev/null
+++ b/frontend/gamma/js/Bootstrap/bootstrap-dropdown.js
@@ -0,0 +1,184 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+/* ============================================================
+ * bootstrap-dropdown.js v2.2.2
+ * http://twitter.github.com/bootstrap/javascript.html#dropdowns
+ * ============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* DROPDOWN CLASS DEFINITION
+ * ========================= */
+
+ var toggle = '[data-toggle=dropdown]'
+ , Dropdown = function (element) {
+ var $el = $(element).on('click.dropdown.data-api', this.toggle)
+ $('html').on('click.dropdown.data-api', function () {
+ $el.parent().removeClass('open')
+ })
+ }
+
+ Dropdown.prototype = {
+
+ constructor: Dropdown
+
+ , toggle: function (e) {
+ var $this = $(this)
+ , $parent
+ , isActive
+
+ if ($this.is('.disabled, :disabled')) return
+
+ $parent = getParent($this)
+
+ isActive = $parent.hasClass('open')
+
+ clearMenus()
+
+ if (!isActive) {
+ $parent.toggleClass('open')
+ }
+
+ $this.focus()
+
+ return false
+ }
+
+ , keydown: function (e) {
+ var $this
+ , $items
+ , $active
+ , $parent
+ , isActive
+ , index
+
+ if (!/(38|40|27)/.test(e.keyCode)) return
+
+ $this = $(this)
+
+ e.preventDefault()
+ e.stopPropagation()
+
+ if ($this.is('.disabled, :disabled')) return
+
+ $parent = getParent($this)
+
+ isActive = $parent.hasClass('open')
+
+ if (!isActive || (isActive && e.keyCode == 27)) return $this.click()
+
+ $items = $('[role=menu] li:not(.divider):visible a', $parent)
+
+ if (!$items.length) return
+
+ index = $items.index($items.filter(':focus'))
+
+ if (e.keyCode == 38 && index > 0) index-- // up
+ if (e.keyCode == 40 && index < $items.length - 1) index++ // down
+ if (!~index) index = 0
+
+ $items
+ .eq(index)
+ .focus()
+ }
+
+ }
+
+ function clearMenus() {
+ $(toggle).each(function () {
+ getParent($(this)).removeClass('open')
+ })
+ }
+
+ function getParent($this) {
+ var selector = $this.attr('data-target')
+ , $parent
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
+
+ $parent = $(selector)
+ $parent.length || ($parent = $this.parent())
+
+ return $parent
+ }
+
+
+ /* DROPDOWN PLUGIN DEFINITION
+ * ========================== */
+
+ var old = $.fn.dropdown
+
+ $.fn.dropdown = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('dropdown')
+ if (!data) $this.data('dropdown', (data = new Dropdown(this)))
+ if (typeof option == 'string') data[option].call($this)
+ })
+ }
+
+ $.fn.dropdown.Constructor = Dropdown
+
+
+ /* DROPDOWN NO CONFLICT
+ * ==================== */
+
+ $.fn.dropdown.noConflict = function () {
+ $.fn.dropdown = old
+ return this
+ }
+
+
+ /* APPLY TO STANDARD DROPDOWN ELEMENTS
+ * =================================== */
+
+ $(document)
+ .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
+ .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
+ .on('touchstart.dropdown.data-api', '.dropdown-menu', function (e) { e.stopPropagation() })
+ .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
+ .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
+
+}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-modal.js b/frontend/gamma/js/Bootstrap/bootstrap-modal.js
new file mode 100644
index 0000000..fd7e337
--- a/dev/null
+++ b/frontend/gamma/js/Bootstrap/bootstrap-modal.js
@@ -0,0 +1,268 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+/* =========================================================
+ * bootstrap-modal.js v2.2.2
+ * http://twitter.github.com/bootstrap/javascript.html#modals
+ * =========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================= */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* MODAL CLASS DEFINITION
+ * ====================== */
+
+ var Modal = function (element, options) {
+ this.options = options
+ this.$element = $(element)
+ .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
+ this.options.remote && this.$element.find('.modal-body').load(this.options.remote)
+ }
+
+ Modal.prototype = {
+
+ constructor: Modal
+
+ , toggle: function () {
+ return this[!this.isShown ? 'show' : 'hide']()
+ }
+
+ , show: function () {
+ var that = this
+ , e = $.Event('show')
+
+ this.$element.trigger(e)
+
+ if (this.isShown || e.isDefaultPrevented()) return
+
+ this.isShown = true
+
+ this.escape()
+
+ this.backdrop(function () {
+ var transition = $.support.transition && that.$element.hasClass('fade')
+
+ if (!that.$element.parent().length) {
+ that.$element.appendTo(document.body) //don't move modals dom position
+ }
+
+ that.$element
+ .show()
+
+ if (transition) {
+ that.$element[0].offsetWidth // force reflow
+ }
+
+ that.$element
+ .addClass('in')
+ .attr('aria-hidden', false)
+
+ that.enforceFocus()
+
+ transition ?
+ that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) :
+ that.$element.focus().trigger('shown')
+
+ })
+ }
+
+ , hide: function (e) {
+ e && e.preventDefault()
+
+ var that = this
+
+ e = $.Event('hide')
+
+ this.$element.trigger(e)
+
+ if (!this.isShown || e.isDefaultPrevented()) return
+
+ this.isShown = false
+
+ this.escape()
+
+ $(document).off('focusin.modal')
+
+ this.$element
+ .removeClass('in')
+ .attr('aria-hidden', true)
+
+ $.support.transition && this.$element.hasClass('fade') ?
+ this.hideWithTransition() :
+ this.hideModal()
+ }
+
+ , enforceFocus: function () {
+ var that = this
+ $(document).on('focusin.modal', function (e) {
+ if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
+ that.$element.focus()
+ }
+ })
+ }
+
+ , escape: function () {
+ var that = this
+ if (this.isShown && this.options.keyboard) {
+ this.$element.on('keyup.dismiss.modal', function ( e ) {
+ e.which == 27 && that.hide()
+ })
+ } else if (!this.isShown) {
+ this.$element.off('keyup.dismiss.modal')
+ }
+ }
+
+ , hideWithTransition: function () {
+ var that = this
+ , timeout = setTimeout(function () {
+ that.$element.off($.support.transition.end)
+ that.hideModal()
+ }, 500)
+
+ this.$element.one($.support.transition.end, function () {
+ clearTimeout(timeout)
+ that.hideModal()
+ })
+ }
+
+ , hideModal: function (that) {
+ this.$element
+ .hide()
+ .trigger('hidden')
+
+ this.backdrop()
+ }
+
+ , removeBackdrop: function () {
+ this.$backdrop.remove()
+ this.$backdrop = null
+ }
+
+ , backdrop: function (callback) {
+ var that = this
+ , animate = this.$element.hasClass('fade') ? 'fade' : ''
+
+ if (this.isShown && this.options.backdrop) {
+ var doAnimate = $.support.transition && animate
+
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
+ .appendTo(document.body)
+
+ this.$backdrop.click(
+ this.options.backdrop == 'static' ?
+ $.proxy(this.$element[0].focus, this.$element[0])
+ : $.proxy(this.hide, this)
+ )
+
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
+
+ this.$backdrop.addClass('in')
+
+ doAnimate ?
+ this.$backdrop.one($.support.transition.end, callback) :
+ callback()
+
+ } else if (!this.isShown && this.$backdrop) {
+ this.$backdrop.removeClass('in')
+
+ $.support.transition && this.$element.hasClass('fade')?
+ this.$backdrop.one($.support.transition.end, $.proxy(this.removeBackdrop, this)) :
+ this.removeBackdrop()
+
+ } else if (callback) {
+ callback()
+ }
+ }
+ }
+
+
+ /* MODAL PLUGIN DEFINITION
+ * ======================= */
+
+ var old = $.fn.modal
+
+ $.fn.modal = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('modal')
+ , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
+ if (!data) $this.data('modal', (data = new Modal(this, options)))
+ if (typeof option == 'string') data[option]()
+ else if (options.show) data.show()
+ })
+ }
+
+ $.fn.modal.defaults = {
+ backdrop: true
+ , keyboard: true
+ , show: true
+ }
+
+ $.fn.modal.Constructor = Modal
+
+
+ /* MODAL NO CONFLICT
+ * ================= */
+
+ $.fn.modal.noConflict = function () {
+ $.fn.modal = old
+ return this
+ }
+
+
+ /* MODAL DATA-API
+ * ============== */
+
+ $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
+ var $this = $(this)
+ , href = $this.attr('href')
+ , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
+ , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
+
+ e.preventDefault()
+
+ $target
+ .modal(option)
+ .one('hide', function () {
+ $this.focus()
+ })
+ })
+
+}(window.jQuery);
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-popover.js b/frontend/gamma/js/Bootstrap/bootstrap-popover.js
new file mode 100644
index 0000000..89e1edb
--- a/dev/null
+++ b/frontend/gamma/js/Bootstrap/bootstrap-popover.js
@@ -0,0 +1,137 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+/* ===========================================================
+ * bootstrap-popover.js v2.2.2
+ * http://twitter.github.com/bootstrap/javascript.html#popovers
+ * ===========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* POPOVER PUBLIC CLASS DEFINITION
+ * =============================== */
+
+ var Popover = function (element, options) {
+ this.init('popover', element, options)
+ }
+
+
+ /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
+ ========================================== */
+
+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
+
+ constructor: Popover
+
+ , setContent: function () {
+ var $tip = this.tip()
+ , title = this.getTitle()
+ , content = this.getContent()
+
+ $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title)
+ $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content)
+
+ $tip.removeClass('fade top bottom left right in')
+ }
+
+ , hasContent: function () {
+ return this.getTitle() || this.getContent()
+ }
+
+ , getContent: function () {
+ var content
+ , $e = this.$element
+ , o = this.options
+
+ content = $e.attr('data-content')
+ || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
+
+ return content
+ }
+
+ , tip: function () {
+ if (!this.$tip) {
+ this.$tip = $(this.options.template)
+ }
+ return this.$tip
+ }
+
+ , destroy: function () {
+ this.hide().$element.off('.' + this.type).removeData(this.type)
+ }
+
+ })
+
+
+ /* POPOVER PLUGIN DEFINITION
+ * ======================= */
+
+ var old = $.fn.popover
+
+ $.fn.popover = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('popover')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('popover', (data = new Popover(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.popover.Constructor = Popover
+
+ $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
+ placement: 'right'
+ , trigger: 'click'
+ , content: ''
+ , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"></div></div></div>'
+ })
+
+
+ /* POPOVER NO CONFLICT
+ * =================== */
+
+ $.fn.popover.noConflict = function () {
+ $.fn.popover = old
+ return this
+ }
+
+}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-scrollspy.js b/frontend/gamma/js/Bootstrap/bootstrap-scrollspy.js
new file mode 100644
index 0000000..4366f26
--- a/dev/null
+++ b/frontend/gamma/js/Bootstrap/bootstrap-scrollspy.js
@@ -0,0 +1,185 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+/* =============================================================
+ * bootstrap-scrollspy.js v2.2.2
+ * http://twitter.github.com/bootstrap/javascript.html#scrollspy
+ * =============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* SCROLLSPY CLASS DEFINITION
+ * ========================== */
+
+ function ScrollSpy(element, options) {
+ var process = $.proxy(this.process, this)
+ , $element = $(element).is('body') ? $(window) : $(element)
+ , href
+ this.options = $.extend({}, $.fn.scrollspy.defaults, options)
+ this.$scrollElement = $element.on('scroll.scroll-spy.data-api', process)
+ this.selector = (this.options.target
+ || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
+ || '') + ' .nav li > a'
+ this.$body = $('body')
+ this.refresh()
+ this.process()
+ }
+
+ ScrollSpy.prototype = {
+
+ constructor: ScrollSpy
+
+ , refresh: function () {
+ var self = this
+ , $targets
+
+ this.offsets = $([])
+ this.targets = $([])
+
+ $targets = this.$body
+ .find(this.selector)
+ .map(function () {
+ var $el = $(this)
+ , href = $el.data('target') || $el.attr('href')
+ , $href = /^#\w/.test(href) && $(href)
+ return ( $href
+ && $href.length
+ && [[ $href.position().top + self.$scrollElement.scrollTop(), href ]] ) || null
+ })
+ .sort(function (a, b) { return a[0] - b[0] })
+ .each(function () {
+ self.offsets.push(this[0])
+ self.targets.push(this[1])
+ })
+ }
+
+ , process: function () {
+ var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
+ , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
+ , maxScroll = scrollHeight - this.$scrollElement.height()
+ , offsets = this.offsets
+ , targets = this.targets
+ , activeTarget = this.activeTarget
+ , i
+
+ if (scrollTop >= maxScroll) {
+ return activeTarget != (i = targets.last()[0])
+ && this.activate ( i )
+ }
+
+ for (i = offsets.length; i--;) {
+ activeTarget != targets[i]
+ && scrollTop >= offsets[i]
+ && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
+ && this.activate( targets[i] )
+ }
+ }
+
+ , activate: function (target) {
+ var active
+ , selector
+
+ this.activeTarget = target
+
+ $(this.selector)
+ .parent('.active')
+ .removeClass('active')
+
+ selector = this.selector
+ + '[data-target="' + target + '"],'
+ + this.selector + '[href="' + target + '"]'
+
+ active = $(selector)
+ .parent('li')
+ .addClass('active')
+
+ if (active.parent('.dropdown-menu').length) {
+ active = active.closest('li.dropdown').addClass('active')
+ }
+
+ active.trigger('activate')
+ }
+
+ }
+
+
+ /* SCROLLSPY PLUGIN DEFINITION
+ * =========================== */
+
+ var old = $.fn.scrollspy
+
+ $.fn.scrollspy = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('scrollspy')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.scrollspy.Constructor = ScrollSpy
+
+ $.fn.scrollspy.defaults = {
+ offset: 10
+ }
+
+
+ /* SCROLLSPY NO CONFLICT
+ * ===================== */
+
+ $.fn.scrollspy.noConflict = function () {
+ $.fn.scrollspy = old
+ return this
+ }
+
+
+ /* SCROLLSPY DATA-API
+ * ================== */
+
+ $(window).on('load', function () {
+ $('[data-spy="scroll"]').each(function () {
+ var $spy = $(this)
+ $spy.scrollspy($spy.data())
+ })
+ })
+
+}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-tab.js b/frontend/gamma/js/Bootstrap/bootstrap-tab.js
new file mode 100644
index 0000000..d7c7fc7
--- a/dev/null
+++ b/frontend/gamma/js/Bootstrap/bootstrap-tab.js
@@ -0,0 +1,167 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+/* ========================================================
+ * bootstrap-tab.js v2.2.2
+ * http://twitter.github.com/bootstrap/javascript.html#tabs
+ * ========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ======================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* TAB CLASS DEFINITION
+ * ==================== */
+
+ var Tab = function (element) {
+ this.element = $(element)
+ }
+
+ Tab.prototype = {
+
+ constructor: Tab
+
+ , show: function () {
+ var $this = this.element
+ , $ul = $this.closest('ul:not(.dropdown-menu)')
+ , selector = $this.attr('data-target')
+ , previous
+ , $target
+ , e
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
+
+ if ( $this.parent('li').hasClass('active') ) return
+
+ previous = $ul.find('.active:last a')[0]
+
+ e = $.Event('show', {
+ relatedTarget: previous
+ })
+
+ $this.trigger(e)
+
+ if (e.isDefaultPrevented()) return
+
+ $target = $(selector)
+
+ this.activate($this.parent('li'), $ul)
+ this.activate($target, $target.parent(), function () {
+ $this.trigger({
+ type: 'shown'
+ , relatedTarget: previous
+ })
+ })
+ }
+
+ , activate: function ( element, container, callback) {
+ var $active = container.find('> .active')
+ , transition = callback
+ && $.support.transition
+ && $active.hasClass('fade')
+
+ function next() {
+ $active
+ .removeClass('active')
+ .find('> .dropdown-menu > .active')
+ .removeClass('active')
+
+ element.addClass('active')
+
+ if (transition) {
+ element[0].offsetWidth // reflow for transition
+ element.addClass('in')
+ } else {
+ element.removeClass('fade')
+ }
+
+ if ( element.parent('.dropdown-menu') ) {
+ element.closest('li.dropdown').addClass('active')
+ }
+
+ callback && callback()
+ }
+
+ transition ?
+ $active.one($.support.transition.end, next) :
+ next()
+
+ $active.removeClass('in')
+ }
+ }
+
+
+ /* TAB PLUGIN DEFINITION
+ * ===================== */
+
+ var old = $.fn.tab
+
+ $.fn.tab = function ( option ) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('tab')
+ if (!data) $this.data('tab', (data = new Tab(this)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.tab.Constructor = Tab
+
+
+ /* TAB NO CONFLICT
+ * =============== */
+
+ $.fn.tab.noConflict = function () {
+ $.fn.tab = old
+ return this
+ }
+
+
+ /* TAB DATA-API
+ * ============ */
+
+ $(document).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
+ e.preventDefault()
+ $(this).tab('show')
+ })
+
+}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-tooltip.js b/frontend/gamma/js/Bootstrap/bootstrap-tooltip.js
new file mode 100644
index 0000000..bdcff7d
--- a/dev/null
+++ b/frontend/gamma/js/Bootstrap/bootstrap-tooltip.js
@@ -0,0 +1,310 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+/* ===========================================================
+ * bootstrap-tooltip.js v2.2.2
+ * http://twitter.github.com/bootstrap/javascript.html#tooltips
+ * Inspired by the original jQuery.tipsy by Jason Frame
+ * ===========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* TOOLTIP PUBLIC CLASS DEFINITION
+ * =============================== */
+
+ var Tooltip = function (element, options) {
+ this.init('tooltip', element, options)
+ }
+
+ Tooltip.prototype = {
+
+ constructor: Tooltip
+
+ , init: function (type, element, options) {
+ var eventIn
+ , eventOut
+
+ this.type = type
+ this.$element = $(element)
+ this.options = this.getOptions(options)
+ this.enabled = true
+
+ if (this.options.trigger == 'click') {
+ this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
+ } else if (this.options.trigger != 'manual') {
+ eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
+ eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
+ this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
+ this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
+ }
+
+ this.options.selector ?
+ (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
+ this.fixTitle()
+ }
+
+ , getOptions: function (options) {
+ options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
+
+ if (options.delay && typeof options.delay == 'number') {
+ options.delay = {
+ show: options.delay
+ , hide: options.delay
+ }
+ }
+
+ return options
+ }
+
+ , enter: function (e) {
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
+
+ if (!self.options.delay || !self.options.delay.show) return self.show()
+
+ clearTimeout(this.timeout)
+ self.hoverState = 'in'
+ this.timeout = setTimeout(function() {
+ if (self.hoverState == 'in') self.show()
+ }, self.options.delay.show)
+ }
+
+ , leave: function (e) {
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
+
+ if (this.timeout) clearTimeout(this.timeout)
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
+
+ self.hoverState = 'out'
+ this.timeout = setTimeout(function() {
+ if (self.hoverState == 'out') self.hide()
+ }, self.options.delay.hide)
+ }
+
+ , show: function () {
+ var $tip
+ , inside
+ , pos
+ , actualWidth
+ , actualHeight
+ , placement
+ , tp
+
+ if (this.hasContent() && this.enabled) {
+ $tip = this.tip()
+ this.setContent()
+
+ if (this.options.animation) {
+ $tip.addClass('fade')
+ }
+
+ placement = typeof this.options.placement == 'function' ?
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
+ this.options.placement
+
+ inside = /in/.test(placement)
+
+ $tip
+ .detach()
+ .css({ top: 0, left: 0, display: 'block' })
+ .insertAfter(this.$element)
+
+ pos = this.getPosition(inside)
+
+ actualWidth = $tip[0].offsetWidth
+ actualHeight = $tip[0].offsetHeight
+
+ switch (inside ? placement.split(' ')[1] : placement) {
+ case 'bottom':
+ tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
+ break
+ case 'top':
+ tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
+ break
+ case 'left':
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
+ break
+ case 'right':
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
+ break
+ }
+
+ $tip
+ .offset(tp)
+ .addClass(placement)
+ .addClass('in')
+ }
+ }
+
+ , setContent: function () {
+ var $tip = this.tip()
+ , title = this.getTitle()
+
+ $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title)
+ $tip.removeClass('fade in top bottom left right')
+ }
+
+ , hide: function () {
+ var that = this
+ , $tip = this.tip()
+
+ $tip.removeClass('in')
+
+ function removeWithAnimation() {
+ var timeout = setTimeout(function () {
+ $tip.off($.support.transition.end).detach()
+ }, 500)
+
+ $tip.one($.support.transition.end, function () {
+ clearTimeout(timeout)
+ $tip.detach()
+ })
+ }
+
+ $.support.transition && this.$tip.hasClass('fade') ?
+ removeWithAnimation() :
+ $tip.detach()
+
+ return this
+ }
+
+ , fixTitle: function () {
+ var $e = this.$element
+ if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
+ $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
+ }
+ }
+
+ , hasContent: function () {
+ return this.getTitle()
+ }
+
+ , getPosition: function (inside) {
+ return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
+ width: this.$element[0].offsetWidth
+ , height: this.$element[0].offsetHeight
+ })
+ }
+
+ , getTitle: function () {
+ var title
+ , $e = this.$element
+ , o = this.options
+
+ title = $e.attr('data-original-title')
+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
+
+ return title
+ }
+
+ , tip: function () {
+ return this.$tip = this.$tip || $(this.options.template)
+ }
+
+ , validate: function () {
+ if (!this.$element[0].parentNode) {
+ this.hide()
+ this.$element = null
+ this.options = null
+ }
+ }
+
+ , enable: function () {
+ this.enabled = true
+ }
+
+ , disable: function () {
+ this.enabled = false
+ }
+
+ , toggleEnabled: function () {
+ this.enabled = !this.enabled
+ }
+
+ , toggle: function (e) {
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
+ self[self.tip().hasClass('in') ? 'hide' : 'show']()
+ }
+
+ , destroy: function () {
+ this.hide().$element.off('.' + this.type).removeData(this.type)
+ }
+
+ }
+
+
+ /* TOOLTIP PLUGIN DEFINITION
+ * ========================= */
+
+ var old = $.fn.tooltip
+
+ $.fn.tooltip = function ( option ) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('tooltip')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.tooltip.Constructor = Tooltip
+
+ $.fn.tooltip.defaults = {
+ animation: true
+ , placement: 'top'
+ , selector: false
+ , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
+ , trigger: 'hover'
+ , title: ''
+ , delay: 0
+ , html: false
+ }
+
+
+ /* TOOLTIP NO CONFLICT
+ * =================== */
+
+ $.fn.tooltip.noConflict = function () {
+ $.fn.tooltip = old
+ return this
+ }
+
+}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-transition.js b/frontend/gamma/js/Bootstrap/bootstrap-transition.js
new file mode 100644
index 0000000..820d232
--- a/dev/null
+++ b/frontend/gamma/js/Bootstrap/bootstrap-transition.js
@@ -0,0 +1,83 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+/* ===================================================
+ * bootstrap-transition.js v2.2.2
+ * http://twitter.github.com/bootstrap/javascript.html#transitions
+ * ===================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
+ * ======================================================= */
+
+ $(function () {
+
+ $.support.transition = (function () {
+
+ var transitionEnd = (function () {
+
+ var el = document.createElement('bootstrap')
+ , transEndEventNames = {
+ 'WebkitTransition' : 'webkitTransitionEnd'
+ , 'MozTransition' : 'transitionend'
+ , 'OTransition' : 'oTransitionEnd otransitionend'
+ , 'transition' : 'transitionend'
+ }
+ , name
+
+ for (name in transEndEventNames){
+ if (el.style[name] !== undefined) {
+ return transEndEventNames[name]
+ }
+ }
+
+ }())
+
+ return transitionEnd && {
+ end: transitionEnd
+ }
+
+ })()
+
+ })
+
+}(window.jQuery); \ No newline at end of file
diff --git a/frontend/gamma/js/Bootstrap/bootstrap-typeahead.js b/frontend/gamma/js/Bootstrap/bootstrap-typeahead.js
new file mode 100644
index 0000000..d3d8d32
--- a/dev/null
+++ b/frontend/gamma/js/Bootstrap/bootstrap-typeahead.js
@@ -0,0 +1,346 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+/* =============================================================
+ * bootstrap-typeahead.js v2.2.2
+ * http://twitter.github.com/bootstrap/javascript.html#typeahead
+ * =============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function($){
+
+ "use strict"; // jshint ;_;
+
+
+ /* TYPEAHEAD PUBLIC CLASS DEFINITION
+ * ================================= */
+
+ var Typeahead = function (element, options) {
+ this.$element = $(element)
+ this.options = $.extend({}, $.fn.typeahead.defaults, options)
+ this.matcher = this.options.matcher || this.matcher
+ this.sorter = this.options.sorter || this.sorter
+ this.highlighter = this.options.highlighter || this.highlighter
+ this.updater = this.options.updater || this.updater
+ this.source = this.options.source
+ this.$menu = $(this.options.menu)
+ this.shown = false
+ this.listen()
+ }
+
+ Typeahead.prototype = {
+
+ constructor: Typeahead
+
+ , select: function () {
+ var val = this.$menu.find('.active').attr('data-value')
+ this.$element
+ .val(this.updater(val))
+ .change()
+ return this.hide()
+ }
+
+ , updater: function (item) {
+ return item
+ }
+
+ , show: function () {
+ var pos = $.extend({}, this.$element.position(), {
+ height: this.$element[0].offsetHeight
+ })
+
+ this.$menu
+ .insertAfter(this.$element)
+ .css({
+ top: pos.top + pos.height
+ , left: pos.left
+ })
+ .show()
+
+ this.shown = true
+ return this
+ }
+
+ , hide: function () {
+ this.$menu.hide()
+ this.shown = false
+ return this
+ }
+
+ , lookup: function (event) {
+ var items
+
+ this.query = this.$element.val()
+
+ if (!this.query || this.query.length < this.options.minLength) {
+ return this.shown ? this.hide() : this
+ }
+
+ items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source
+
+ return items ? this.process(items) : this
+ }
+
+ , process: function (items) {
+ var that = this
+
+ items = $.grep(items, function (item) {
+ return that.matcher(item)
+ })
+
+ items = this.sorter(items)
+
+ if (!items.length) {
+ return this.shown ? this.hide() : this
+ }
+
+ return this.render(items.slice(0, this.options.items)).show()
+ }
+
+ , matcher: function (item) {
+ return ~item.toLowerCase().indexOf(this.query.toLowerCase())
+ }
+
+ , sorter: function (items) {
+ var beginswith = []
+ , caseSensitive = []
+ , caseInsensitive = []
+ , item
+
+ while (item = items.shift()) {
+ if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
+ else if (~item.indexOf(this.query)) caseSensitive.push(item)
+ else caseInsensitive.push(item)
+ }
+
+ return beginswith.concat(caseSensitive, caseInsensitive)
+ }
+
+ , highlighter: function (item) {
+ var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
+ return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
+ return '<strong>' + match + '</strong>'
+ })
+ }
+
+ , render: function (items) {
+ var that = this
+
+ items = $(items).map(function (i, item) {
+ i = $(that.options.item).attr('data-value', item)
+ i.find('a').html(that.highlighter(item))
+ return i[0]
+ })
+
+ items.first().addClass('active')
+ this.$menu.html(items)
+ return this
+ }
+
+ , next: function (event) {
+ var active = this.$menu.find('.active').removeClass('active')
+ , next = active.next()
+
+ if (!next.length) {
+ next = $(this.$menu.find('li')[0])
+ }
+
+ next.addClass('active')
+ }
+
+ , prev: function (event) {
+ var active = this.$menu.find('.active').removeClass('active')
+ , prev = active.prev()
+
+ if (!prev.length) {
+ prev = this.$menu.find('li').last()
+ }
+
+ prev.addClass('active')
+ }
+
+ , listen: function () {
+ this.$element
+ .on('blur', $.proxy(this.blur, this))
+ .on('keypress', $.proxy(this.keypress, this))
+ .on('keyup', $.proxy(this.keyup, this))
+
+ if (this.eventSupported('keydown')) {
+ this.$element.on('keydown', $.proxy(this.keydown, this))
+ }
+
+ this.$menu
+ .on('click', $.proxy(this.click, this))
+ .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
+ }
+
+ , eventSupported: function(eventName) {
+ var isSupported = eventName in this.$element
+ if (!isSupported) {
+ this.$element.setAttribute(eventName, 'return;')
+ isSupported = typeof this.$element[eventName] === 'function'
+ }
+ return isSupported
+ }
+
+ , move: function (e) {
+ if (!this.shown) return
+
+ switch(e.keyCode) {
+ case 9: // tab
+ case 13: // enter
+ case 27: // escape
+ e.preventDefault()
+ break
+
+ case 38: // up arrow
+ e.preventDefault()
+ this.prev()
+ break
+
+ case 40: // down arrow
+ e.preventDefault()
+ this.next()
+ break
+ }
+
+ e.stopPropagation()
+ }
+
+ , keydown: function (e) {
+ this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27])
+ this.move(e)
+ }
+
+ , keypress: function (e) {
+ if (this.suppressKeyPressRepeat) return
+ this.move(e)
+ }
+
+ , keyup: function (e) {
+ switch(e.keyCode) {
+ case 40: // down arrow
+ case 38: // up arrow
+ case 16: // shift
+ case 17: // ctrl
+ case 18: // alt
+ break
+
+ case 9: // tab
+ case 13: // enter
+ if (!this.shown) return
+ this.select()
+ break
+
+ case 27: // escape
+ if (!this.shown) return
+ this.hide()
+ break
+
+ default:
+ this.lookup()
+ }
+
+ e.stopPropagation()
+ e.preventDefault()
+ }
+
+ , blur: function (e) {
+ var that = this
+ setTimeout(function () { that.hide() }, 150)
+ }
+
+ , click: function (e) {
+ e.stopPropagation()
+ e.preventDefault()
+ this.select()
+ }
+
+ , mouseenter: function (e) {
+ this.$menu.find('.active').removeClass('active')
+ $(e.currentTarget).addClass('active')
+ }
+
+ }
+
+
+ /* TYPEAHEAD PLUGIN DEFINITION
+ * =========================== */
+
+ var old = $.fn.typeahead
+
+ $.fn.typeahead = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('typeahead')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.typeahead.defaults = {
+ source: []
+ , items: 8
+ , menu: '<ul class="typeahead dropdown-menu"></ul>'
+ , item: '<li><a href="#"></a></li>'
+ , minLength: 1
+ }
+
+ $.fn.typeahead.Constructor = Typeahead
+
+
+ /* TYPEAHEAD NO CONFLICT
+ * =================== */
+
+ $.fn.typeahead.noConflict = function () {
+ $.fn.typeahead = old
+ return this
+ }
+
+
+ /* TYPEAHEAD DATA-API
+ * ================== */
+
+ $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
+ var $this = $(this)
+ if ($this.data('typeahead')) return
+ e.preventDefault()
+ $this.typeahead($this.data())
+ })
+
+}(window.jQuery);
diff --git a/frontend/gamma/js/Clipperz/Async.js b/frontend/gamma/js/Clipperz/Async.js
index f7a9517..d525453 100644
--- a/frontend/gamma/js/Clipperz/Async.js
+++ b/frontend/gamma/js/Clipperz/Async.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -62,8 +60,7 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
'callback': function (aValue) {
if (this._shouldTrace) {
- // Clipperz.log("CALLBACK " + this._name, aValue);
- console.log("CALLBACK " + this._name, aValue);
+ Clipperz.log("CALLBACK " + this._name, aValue);
}
if (this.chained == false) {
@@ -83,9 +80,7 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
resultMessage = "RESULT " + this._name + " <==";
// this.addCallback(function(aResult) {
Clipperz.Async.Deferred.superclass.addCallback.call(this, function(aResult) {
- // Clipperz.log(resultMessage, aResult);
- console.log(resultMessage, aResult);
-
+ Clipperz.log(resultMessage, aResult);
return aResult;
});
}
@@ -108,10 +103,8 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
message = "[" + this._count + "] " + this._name + " ";
// this.addBoth(function(aResult) {Clipperz.log(message + "-->", aResult); return aResult;});
this.addCallbacks(
- // function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;},
- function(aResult) {console.log("-OK- " + message + "-->"/*, aResult*/); return aResult;},
- // function(aResult) {Clipperz.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
- function(aResult) {console.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
+ function(aResult) {Clipperz.log("-OK- " + message + "-->"/*, aResult*/); return aResult;},
+ function(aResult) {Clipperz.log("FAIL " + message + "-->"/*, aResult*/); return aResult;}
);
}
@@ -120,10 +113,8 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
if (this._shouldTrace) {
// this.addBoth(function(aResult) {Clipperz.log(message + "<--", aResult); return aResult;});
this.addCallbacks(
- // function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;},
- function(aResult) {console.log("-OK- " + message + "<--", aResult); return aResult;},
- // function(aResult) {Clipperz.log("FAIL " + message + "<--", aResult); return aResult;}
- function(aResult) {console.log("FAIL " + message + "<--", aResult); return aResult;}
+ function(aResult) {Clipperz.log("-OK- " + message + "<--", aResult); return aResult;},
+ function(aResult) {Clipperz.log("FAIL " + message + "<--", aResult); return aResult;}
);
}
},
@@ -212,7 +203,6 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
'addLog': function (aLog) {
if (CLIPPERZ_DEFERRED_LOGGING_ENABLED) {
this.addBothPass(function(res) {Clipperz.log(aLog + " ", res);});
-// this.addBothPass(function(res) {console.log(aLog + " ", res);});
}
},
@@ -237,7 +227,7 @@ Clipperz.Base.extend(Clipperz.Async.Deferred, MochiKit.Async.Deferred, {
// ], {trace:false});
// });
// this.addErrback(function (aResult) {
-///console.log("releaseLock.addErrback:", aResult);
+///Clipperz.log("releaseLock.addErrback:", aResult);
// return Clipperz.Async.callbacks("Clipperz.Async.release <fail>", [
// MochiKit.Base.method(aLock, 'release'),
// MochiKit.Base.partial(MochiKit.Async.fail, aResult)
@@ -377,7 +367,7 @@ MochiKit.Base.update(Clipperz.Async.DeferredSynchronizer.prototype, {
var methodCalls;
var ii, cc;
-//console.log("TYPEOF", typeof(this.methods()[i]));
+//Clipperz.log("TYPEOF", typeof(this.methods()[i]));
if (typeof(this.methods()[i]) == 'function') {
methodCalls = [ this.methods()[i] ];
} else {
@@ -637,7 +627,7 @@ MochiKit.Base.update(Clipperz.Async, {
for (i=0; i<c; i++) {
deferredResult.addCallback(Clipperz.Async.insertIntoSortedArray, someObjects[i], aDeferredComparator);
if ((i % 50) == 0) {
-// console.log("######### sort wait ##########");
+// Clipperz.log("######### sort wait ##########");
deferredResult.addCallback(MochiKit.Async.wait, 0.5);
}
}
@@ -688,7 +678,7 @@ MochiKit.Base.update(Clipperz.Async, {
return Clipperz.Async.callbacks("Clipperz.Async.or", [
MochiKit.Base.values,
MochiKit.Base.flattenArguments,
-//function (aValue) { console.log("Record.hasAnyCleanTextData - flatten", aValue); return aValue; },
+//function (aValue) { Clipperz.log("Record.hasAnyCleanTextData - flatten", aValue); return aValue; },
function(someInnerValues) {
return MochiKit.Iter.some(someInnerValues, MochiKit.Base.operator.identity);
}
diff --git a/frontend/gamma/js/Clipperz/Base.js b/frontend/gamma/js/Clipperz/Base.js
index 9d399d9..84b2172 100644
--- a/frontend/gamma/js/Clipperz/Base.js
+++ b/frontend/gamma/js/Clipperz/Base.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -441,7 +439,6 @@ MochiKit.Base.update(Clipperz.Base, {
// if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; }
// if (typeof(Clipperz.PM.UI.Common.Components) == 'undefined') { Clipperz.PM.UI.Common.Components = {}; }
-//console.log(">>> module: " + aValue);
var currentScope;
var pathElements;
var i,c;
@@ -450,8 +447,6 @@ MochiKit.Base.update(Clipperz.Base, {
pathElements = aValue.split('.');
c = pathElements.length;
for (i=0; i<c; i++) {
-//console.log("--- current path element: " + pathElements[i]);
-//console.log("--- current scope", currentScope);
if (typeof(currentScope[pathElements[i]]) == 'undefined') {
currentScope[pathElements[i]] = {};
}
@@ -500,33 +495,19 @@ MochiKit.Base.registerComparator('Object dummy comparator',
var aKeys;
var bKeys;
-//MochiKit.Logging.logDebug(">>> comparator");
-//MochiKit.Logging.logDebug("- a: " + Clipperz.Base.serializeJSON(a));
-//MochiKit.Logging.logDebug("- b: " + Clipperz.Base.serializeJSON(a));
aKeys = MochiKit.Base.keys(a).sort();
bKeys = MochiKit.Base.keys(b).sort();
-
result = MochiKit.Base.compare(aKeys, bKeys);
-//if (result != 0) {
-// MochiKit.Logging.logDebug("- comparator 'keys':");
-// MochiKit.Logging.logDebug("- comparator aKeys: " + Clipperz.Base.serializeJSON(aKeys));
-// MochiKit.Logging.logDebug("- comparator bKeys: " + Clipperz.Base.serializeJSON(bKeys));
-//}
+
if (result == 0) {
var i, c;
c = aKeys.length;
for (i=0; (i<c) && (result == 0); i++) {
result = MochiKit.Base.compare(a[aKeys[i]], b[bKeys[i]]);
-//if (result != 0) {
-// MochiKit.Logging.logDebug("- comparator 'values':");
-// MochiKit.Logging.logDebug("- comparator a[aKeys[i]]: " + Clipperz.Base.serializeJSON(a[aKeys[i]]));
-// MochiKit.Logging.logDebug("- comparator b[bKeys[i]]: " + Clipperz.Base.serializeJSON(b[bKeys[i]]));
-//}
}
}
-//MochiKit.Logging.logDebug("<<< comparator - result: " + result);
return result;
},
true
diff --git a/frontend/gamma/js/Clipperz/ByteArray.js b/frontend/gamma/js/Clipperz/ByteArray.js
index ae586e7..22c7c6e 100644
--- a/frontend/gamma/js/Clipperz/ByteArray.js
+++ b/frontend/gamma/js/Clipperz/ByteArray.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -89,11 +87,8 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
//-------------------------------------------------------------------------
'checkByteValue': function(aValue) {
-//Clipperz.log("aValue", aValue.toString(16));
-//Clipperz.log("(aValue & 0xff)", (aValue & 0xff).toString(16));
-
if ((aValue & 0xff) != aValue) {
- MochiKit.Logging.logError("Clipperz.ByteArray.appendByte: the provided value (0x" + aValue.toString(16) + ") is not a byte value.");
+ Clipperz.logError("Clipperz.ByteArray.appendByte: the provided value (0x" + aValue.toString(16) + ") is not a byte value.");
throw Clipperz.ByteArray.exception.InvalidValue;
}
},
@@ -144,8 +139,6 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
}
}
-
-// result = new Clipperz.ByteArray();
result = this.newInstance();
c = a.length();
for (i=0; i<c; i++) {
@@ -156,16 +149,6 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
},
//-------------------------------------------------------------------------
-/*
- 'shiftLeft': function(aNumberOfBitsToShift) {
- var result;
-
- result = this.clone(); // ???????????
-
- return result;
- },
-*/
- //-------------------------------------------------------------------------
'appendBlock': function(aBlock) {
throw Clipperz.Base.exception.AbstractMethod;
@@ -292,7 +275,6 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
selectedByteMask = 1;
}
result = selectedByte & selectedByteMask ? 1 : 0;
-//console.log("aBitPosition: " + aBitPosition + ", length: " + this.length() + ", bytePosition: " + bytePosition + ", bitPositionInSelectedByte: " + bitPositionInSelectedByte + ", selectedByteMask: " + selectedByteMask);
return result;
},
@@ -321,9 +303,6 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
var length;
var i;
-//var startTime = new Date();
-
-//# result = "";
result = [];
i = 0;
@@ -365,14 +344,10 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
currentCharacter = String.fromCharCode(unicode);
}
-// result += currentCharacter;
result.push(currentCharacter);
i++;
}
-//MochiKit.Logging.logDebug("[" + (new Date() - startTime) + "] ByteArray.asString");
-
-// return result;
return result.join("");
},
@@ -386,15 +361,6 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
'base64map': "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
'base64mapIndex': "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(''),
-// 'base64mapInvertedIndex': {
-// 'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': 6, 'H': 7, 'I': 8, 'J': 9,
-// 'K': 10, 'L': 11, 'M': 12, 'N': 13, 'O': 14, 'P': 15, 'Q': 16, 'R': 17, 'S': 18, 'T': 19,
-// 'U': 20, 'V': 21, 'W': 22, 'X': 23, 'Y': 24, 'Z': 25, 'a': 26, 'b': 27, 'c': 28, 'd': 29,
-// 'e': 30, 'f': 31, 'g': 32, 'h': 33, 'i': 34, 'j': 35, 'k': 36, 'l': 37, 'm': 38, 'n': 39,
-// 'o': 40, 'p': 41, 'q': 42, 'r': 43, 's': 44, 't': 45, 'u': 46, 'v': 47, 'w': 48, 'x': 49,
-// 'y': 50, 'z': 51, '0': 52, '1': 53, '2': 54, '3': 55, '4': 56, '5': 57, '6': 58, '7': 59,
-// '8': 60, '9': 61, '+': 62, '/': 63,
-// "=": -1},
//-------------------------------------------------------------------------
@@ -405,7 +371,7 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
length = aValue.length;
if ((length % 4) != 0) {
- MochiKit.Logging.logError("the value passed to the 'ByteArray.setBase64Value' is not correct");
+ Clipperz.logError("the value passed to the 'ByteArray.setBase64Value' is not correct");
throw Clipperz.ByteArray.exception.InvalidValue;
}
@@ -419,11 +385,6 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
value3 = this.base64map.indexOf(aValue.charAt(i+2));
value4 = this.base64map.indexOf(aValue.charAt(i+3));
-// value1 = this.base64mapInvertedIndex[aValue.charAt(i)];
-// value2 = this.base64mapInvertedIndex[aValue.charAt(i+1)];
-// value3 = this.base64mapInvertedIndex[aValue.charAt(i+2)];
-// value4 = this.base64mapInvertedIndex[aValue.charAt(i+3)];
-
byte1 = (value1 << 2) | ((value2 & 0x30) >> 4);
if (value3 != -1) {
byte2 = ((value2 & 0x0f) << 4) | ((value3 & 0x3c) >> 2);
@@ -520,7 +481,7 @@ Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
length = value.length;
if ((length % 8) != 0) {
- MochiKit.Logging.logError("the value passed to the 'ByteArray.setBase32Value' is not correct");
+ Clipperz.logError("the value passed to the 'ByteArray.setBase32Value' is not correct");
throw Clipperz.ByteArray.exception.InvalidValue;
}
@@ -728,7 +689,7 @@ Clipperz.ByteArray_hex = function (args) {
this._value = "0" + value;
}
} else {
-MochiKit.Logging.logError("Clipperz.ByteArray should be inizialized with an hex string.");
+Clipperz.logError("Clipperz.ByteArray should be inizialized with an hex string.");
throw Clipperz.ByteArray.exception.InvalidValue;
}
} else {
@@ -914,7 +875,7 @@ Clipperz.ByteArray_array = function (args) {
value = "0" + value;
}
} else {
-MochiKit.Logging.logError("Clipperz.ByteArray should be inizialized with an hex string.");
+ Clipperz.logError("Clipperz.ByteArray should be inizialized with an hex string.");
throw Clipperz.ByteArray.exception.InvalidValue;
}
@@ -1115,7 +1076,7 @@ Clipperz.ByteArray_string = function (args) {
value = "0" + value;
}
} else {
-MochiKit.Logging.logError("Clipperz.ByteArray should be inizialized with an hex string.");
+Clipperz.logError("Clipperz.ByteArray should be inizialized with an hex string.");
throw Clipperz.ByteArray.exception.InvalidValue;
}
} else {
diff --git a/frontend/gamma/js/Clipperz/CSVProcessor.js b/frontend/gamma/js/Clipperz/CSVProcessor.js
index 0b18731..1288ed7 100644
--- a/frontend/gamma/js/Clipperz/CSVProcessor.js
+++ b/frontend/gamma/js/Clipperz/CSVProcessor.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -95,7 +93,7 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, {
var lines;
var parameter;
-//MochiKit.Logging.logDebug(">>> CSVProcessor.parse");
+//Clipperz.logDebug(">>> CSVProcessor.parse");
result = [];
lines = aValue.replace(/\r?\n/g, "\n").replace(/^\n* /g, "").replace(/\n$/g, "");;
@@ -114,10 +112,10 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, {
parameter.line = parameter.line.replace(/^\n* /g, "").replace(/\n$/g, "");
-//MochiKit.Logging.logDebug("line: '" + parameter.line + "'");
+//Clipperz.logDebug("line: '" + parameter.line + "'");
} while (parameter.line != "");
-//MochiKit.Logging.logDebug("--- CSVProcessor.parse - result: " + Clipperz.Base.serializeJSON(result));
-//MochiKit.Logging.logDebug("<<< CSVProcessor.parse");
+//Clipperz.logDebug("--- CSVProcessor.parse - result: " + Clipperz.Base.serializeJSON(result));
+//Clipperz.logDebug("<<< CSVProcessor.parse");
return result;
},
@@ -216,7 +214,7 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, {
inQuotes = false;
-//MochiKit.Logging.logDebug("#################################### '" + aParameter.line + "'");
+//Clipperz.logDebug("#################################### '" + aParameter.line + "'");
if (aParameter.line == "") {
if (aParameter.isThereAnEmptyFinalField == true) {
aParameter.isThereAnEmptyFinalField = false;
@@ -240,31 +238,31 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, {
while (!done) {
if (aParameter.line.length < 1) {
-//MochiKit.Logging.logDebug("---> 1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("---> 1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
if (inQuotes == true) {
-//MochiKit.Logging.logDebug("---> 1.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("---> 1.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
throw new Error("CSV Parsing error; end of string, missing closing double-quote...");
} else {
-//MochiKit.Logging.logDebug("---> 1.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("---> 1.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
done = true;
}
} else if (escapedQuoteBeginRegexp.test(aParameter.line)) {
-//MochiKit.Logging.logDebug("---> 2.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("---> 2.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
result += this.quoteChar();
aParameter.line = aParameter.line.substr(2, aParameter.line.length - 1);
-//MochiKit.Logging.logDebug("<--- 2.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("<--- 2.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
} else if (singleQuoteBeginRegexp.test(aParameter.line)) {
-//MochiKit.Logging.logDebug("---> 3: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("---> 3: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
if (inQuotes == true) {
if (aParameter.line.length == 1) {
-//MochiKit.Logging.logDebug("---> 3.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("---> 3.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
aParameter.line = '';
done = true;
} else if (singleQuoteCommaEndRegexp.test(aParameter.line)) {
-//MochiKit.Logging.logDebug("---> 3.3: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("---> 3.3: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
aParameter.line = aParameter.line.substr(2, aParameter.line.length - 1);
done = true;
-//MochiKit.Logging.logDebug("<--- 3.3: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("<--- 3.3: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
} else if (singleQuoteNewLineEndRegexp.test(aParameter.line)) {
aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1);
done = true;
@@ -272,38 +270,38 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, {
throw new Error("CSV Parsing error; double-quote, followed by undesirable character (bad character sequence)... " + aParameter.line);
}
} else {
-//MochiKit.Logging.logDebug("---> 4: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("---> 4: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
if (result == "") {
-//MochiKit.Logging.logDebug("---> 4.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("---> 4.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
inQuotes = true;
aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1);
-//MochiKit.Logging.logDebug("<--- 4.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("<--- 4.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
} else {
throw new Error("CSV Parsing error; double-quote, outside of double-quotes (bad character sequence)...");
}
}
} else if (commaBeginRegexp.test(aParameter.line)) {
-//MochiKit.Logging.logDebug("---> 5: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("---> 5: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
if (inQuotes) {
-//MochiKit.Logging.logDebug("---> 5.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("---> 5.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
result += aParameter.line.substr(0 ,1);
aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1);
-//MochiKit.Logging.logDebug("<--- 5.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("<--- 5.1: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
} else {
-//MochiKit.Logging.logDebug("---> 5.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("---> 5.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1);
if (newlineRegexp.test(aParameter.line) || aParameter.line == "") {
-//MochiKit.Logging.logDebug("######");
+//Clipperz.logDebug("######");
aParameter.isThereAnEmptyFinalField = true;
};
done = true;
-//MochiKit.Logging.logDebug("<--- 5.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("<--- 5.2: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
}
} else if (validRegexp.test(aParameter.line)) {
-//MochiKit.Logging.logDebug("---> 6: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("---> 6: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
result += aParameter.line.substr(0, 1);
aParameter.line = aParameter.line.substr(1, aParameter.line.length - 1);
-//MochiKit.Logging.logDebug("<--- 6: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
+//Clipperz.logDebug("<--- 6: '" + aParameter.line.replace(/\n/g, "\\n") + "'");
} else if (newlineRegexp.test(aParameter.line)) {
if (inQuotes == true) {
result += aParameter.line.substr(0 ,1);
@@ -324,16 +322,16 @@ Clipperz.CSVProcessor.prototype = MochiKit.Base.update(null, {
}
}
} catch(exception) {
- MochiKit.Logging.logError(exception.message);
+ Clipperz.logError(exception.message);
// result = null;
throw exception;
}
}
//if (result != null) {
-// MochiKit.Logging.logDebug("<=== result: '" + result.replace(/\n/g, "\\n") + "'");
+// Clipperz.logDebug("<=== result: '" + result.replace(/\n/g, "\\n") + "'");
//} else {
-// MochiKit.Logging.logDebug("<=== result: NULL");
+// Clipperz.logDebug("<=== result: NULL");
//}
return result;
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 @@
/*
-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/.
*/
@@ -120,7 +118,6 @@ Clipperz.Crypto.AES.DeferredExecutionContext.prototype = MochiKit.Base.update(nu
},
'isDone': function () {
-//console.log("isDone", this.executionStep(), this.messageLength());
return (this._executionStep >= this._messageLength);
},
@@ -144,7 +141,7 @@ Clipperz.Crypto.AES.Key = function(args) {
this._b = 240;
this._numberOfRounds = 14;
} else {
- MochiKit.Logging.logError("AES unsupported key size: " + (this.keySize() * 8) + " bits");
+ Clipperz.logError("AES unsupported key size: " + (this.keySize() * 8) + " bits");
throw Clipperz.Crypto.AES.exception.UnsupportedKeySize;
}
@@ -808,7 +805,6 @@ MochiKit.Base.update(Clipperz.Crypto.AES, {
executionContext = new Clipperz.Crypto.AES.DeferredExecutionContext({key:key, message:someData, nonce:nonce});
deferredResult = new Clipperz.Async.Deferred("AES.deferredEncrypt");
-//deferredResult.addCallback(function (aValue) { console.log(">>> deferredEncrypt"); return aValue; });
deferredResult.addCallback(Clipperz.Crypto.AES.deferredEncryptBlocks);
deferredResult.addCallback(function(anExecutionContext) {
var result;
@@ -818,7 +814,6 @@ MochiKit.Base.update(Clipperz.Crypto.AES, {
return result;
});
-//deferredResult.addCallback(function (aValue) { console.log("<<< deferredEncrypt"); return aValue; });
deferredResult.callback(executionContext)
return deferredResult;
@@ -838,12 +833,10 @@ MochiKit.Base.update(Clipperz.Crypto.AES, {
executionContext = new Clipperz.Crypto.AES.DeferredExecutionContext({key:key, message:message, nonce:nonce});
deferredResult = new Clipperz.Async.Deferred("AES.deferredDecrypt");
-//deferredResult.addCallback(function (aValue) { console.log(">>> deferredDecrypt"); return aValue; });
deferredResult.addCallback(Clipperz.Crypto.AES.deferredEncryptBlocks);
deferredResult.addCallback(function(anExecutionContext) {
return anExecutionContext.result();
});
-//deferredResult.addCallback(function (aValue) { console.log("<<< deferredDecrypt"); return aValue; });
deferredResult.callback(executionContext);
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 @@
/*
-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/.
*/
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 @@
/*
-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/.
*/
@@ -1477,7 +1475,6 @@ MochiKit.Base.update(Clipperz.Crypto.BigInt.prototype, {
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;
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 @@
/*
-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/.
*/
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 @@
/*
-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/.
*/
@@ -102,22 +100,13 @@ Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, {
'add': function(aPointA, aPointB) {
var result;
-//console.log(">>> ECC.BinaryField.Curve.add");
if (aPointA.isZero()) {
-//console.log("--- pointA == zero");
result = aPointB;
} else if (aPointB.isZero()) {
-//console.log("--- pointB == zero");
result = aPointA;
} else if ( (aPointA.x().compare(aPointB.x()) == 0) && ((aPointA.y().compare(aPointB.y()) != 0) || aPointB.x().isZero())) {
-//console.log("compare A.x - B.x: ", aPointA.x().compare(aPointB.x()));
-//console.log("compare A.y - B.y: ", (aPointA.y().compare(aPointB.y()) != 0));
-//console.log("compare B.x.isZero(): ", aPointB.x().isZero());
-
-//console.log("--- result = zero");
result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
} else {
-//console.log("--- result = ELSE");
var f2m;
var x, y;
var lambda;
@@ -131,7 +120,6 @@ Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, {
f2m = this.finiteField();
if (aPointA.x().compare(aPointB.x()) != 0) {
-//console.log(" a.x != b.x");
lambda = f2m._fastMultiply(
f2m._add(aY, bY),
f2m._inverse(f2m._add(aX, bX))
@@ -141,25 +129,17 @@ Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, {
f2m._overwriteAdd(x, aX);
f2m._overwriteAdd(x, bX);
} else {
-//console.log(" a.x == b.x");
lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX)));
-//console.log(" lambda: " + lambda.asString(16));
x = f2m._add(this.a()._value, f2m._square(lambda));
-//console.log(" x (step 1): " + x.asString(16));
f2m._overwriteAdd(x, lambda);
-//console.log(" x (step 2): " + x.asString(16));
}
y = f2m._fastMultiply(f2m._add(bX, x), lambda);
-//console.log(" y (step 1): " + y.asString(16));
f2m._overwriteAdd(y, x);
-//console.log(" y (step 2): " + y.asString(16));
f2m._overwriteAdd(y, bY);
-//console.log(" y (step 3): " + y.asString(16));
result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)})
}
-//console.log("<<< ECC.BinaryField.Curve.add");
return result;
},
@@ -197,7 +177,6 @@ Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, {
f2m = this.finiteField();
if (aPointA.x().compare(aPointB.x()) != 0) {
-//console.log(" a.x != b.x");
lambda = f2m._fastMultiply(
f2m._add(aY, bY),
f2m._inverse(f2m._add(aX, bX))
@@ -207,28 +186,20 @@ Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, {
f2m._overwriteAdd(x, aX);
f2m._overwriteAdd(x, bX);
} else {
-//console.log(" a.x == b.x");
lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX)));
-//console.log(" lambda: " + lambda.asString(16));
x = f2m._add(this.a()._value, f2m._square(lambda));
-//console.log(" x (step 1): " + x.asString(16));
f2m._overwriteAdd(x, lambda);
-//console.log(" x (step 2): " + x.asString(16));
}
y = f2m._fastMultiply(f2m._add(bX, x), lambda);
-//console.log(" y (step 1): " + y.asString(16));
f2m._overwriteAdd(y, x);
-//console.log(" y (step 2): " + y.asString(16));
f2m._overwriteAdd(y, bY);
-//console.log(" y (step 3): " + y.asString(16));
// result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)})
aPointA._x._value = x;
aPointA._y._value = y;
}
-//console.log("<<< ECC.BinaryField.Curve.add");
return result;
},
@@ -250,13 +221,11 @@ Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, {
k = aValue;
Q = aPoint;
} else {
-MochiKit.Logging.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!");
+ Clipperz.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!");
k = aValue.negate();
Q = this.negate(aPoint);
}
-//console.log("k: " + k.toString(16));
-//console.log("k.bitSize: " + k.bitSize());
for (i=k.bitSize()-1; i>=0; i--) {
result = this.add(result, result);
// this.overwriteAdd(result, result);
@@ -265,7 +234,7 @@ MochiKit.Logging.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not w
// this.overwriteAdd(result, Q);
}
-// if (countIndex==100) {console.log("multiply.break"); break;} else countIndex++;
+// if (countIndex==100) {Clipperz.log("multiply.break"); break;} else countIndex++;
}
}
//console.profileEnd();
@@ -279,14 +248,14 @@ MochiKit.Logging.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not w
var deferredResult;
var result;
-MochiKit.Logging.logDebug(">>> deferredMultiply - value: " + aValue + ", point: " + aPoint);
+Clipperz.log(">>> deferredMultiply - value: " + aValue + ", point: " + aPoint);
//console.profile("ECC.Curve.multiply");
deferredResult = new MochiKit.Async.Deferred();
//deferredResult.addCallback(function(res) {console.profile("ECC.Curve.deferredMultiply"); return res;} );
-//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 1: " + res); return res;});
+//deferredResult.addBoth(function(res) {Clipperz.logDebug("# 1: " + res); return res;});
result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
-//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 2: " + res); return res;});
+//deferredResult.addBoth(function(res) {Clipperz.logDebug("# 2: " + res); return res;});
if (aValue.isZero() == false) {
var k, Q;
@@ -297,18 +266,13 @@ MochiKit.Logging.logDebug(">>> deferredMultiply - value: " + aValue + ", point:
k = aValue;
Q = aPoint;
} else {
-MochiKit.Logging.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!");
+ Clipperz.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!");
k = aValue.negate();
Q = this.negate(aPoint);
}
-//console.log("k: " + k.toString(16));
-//console.log("k.bitSize: " + k.bitSize());
-//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 3: " + res); return res;});
for (i=k.bitSize()-1; i>=0; i--) {
-//MochiKit.Logging.logDebug("====> " + i);
-//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 4 > i = " + i + ": " + res); return res;});
deferredResult.addMethod(this, "addTwice");
//# result = this.add(result, result);
// this.overwriteAdd(result, result);
@@ -318,16 +282,10 @@ MochiKit.Logging.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not w
// this.overwriteAdd(result, Q);
}
if (i%20 == 0) {deferredResult.addCallback(MochiKit.Async.wait, 0.1);}
-
-// if (countIndex==100) {console.log("multiply.break"); break;} else countIndex++;
-//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 4 < i = " + i + ": " + res); return res;});
}
-//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 4: " + res); return res;});
}
//#console.profileEnd();
-//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 5: " + res); return res;});
//deferredResult.addBoth(function(res) {console.profileEnd(); return res;});
-//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 6: " + res); return res;});
deferredResult.callback(result);
//# return result;
@@ -441,14 +399,12 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
var result;
if (aValue.bitSize() > 1140) {
- MochiKit.Logging.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation");
+ Clipperz.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation");
result = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule(aValue);
} else {
var C, T;
var i;
-//console.log(">>> binaryField.finiteField.(improved)module");
-// C = aValue.value().slice(0);
C = aValue._value.slice(0);
for (i=35; i>=18; i--) {
T = C[i];
@@ -464,7 +420,6 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
}
result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
-//console.log("<<< binaryField.finiteField.(improved)module");
}
return result;
@@ -507,13 +462,12 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
var result;
if (aValue.bitSize() > 564) {
- MochiKit.Logging.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation");
+ Clipperz.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation");
result = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule(aValue);
} else {
var C, T;
var i;
-//console.log(">>> binaryField.finiteField.(improved)module");
C = aValue._value.slice(0);
for (i=17; i>=9; i--) {
T = C[i];
@@ -529,7 +483,6 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
}
result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
-//console.log("<<< binaryField.finiteField.(improved)module");
}
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 @@
/*
-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/.
*/
@@ -53,7 +51,6 @@ Clipperz.Crypto.ECC.BinaryField.FiniteField.prototype = MochiKit.Base.update(nul
'_module': function(aValue) {
var result;
var modulusComparison;
-//console.log(">>> binaryField.finiteField.(standard)module");
modulusComparison = Clipperz.Crypto.ECC.BinaryField.Value._compare(aValue, this.modulus()._value);
@@ -74,8 +71,7 @@ Clipperz.Crypto.ECC.BinaryField.FiniteField.prototype = MochiKit.Base.update(nul
resultBitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(result);
}
}
-//console.log("<<< binaryField.finiteField.(standard)module");
-
+
return result;
},
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 @@
/*
-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/.
*/
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 @@
/*
-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/.
*/
@@ -368,8 +366,6 @@ Clipperz.Crypto.ECC.BinaryField.Value._compare = function(a,b) {
c = a.length;
for (i=0; (i<c) && (result==0); i++) {
-//console.log("compare[" + c + " - " + i + " - 1] " + this.value()[c-i-1] + ", " + aValue.value()[c-i-1]);
-// result = MochiKit.Base.compare(this.value()[c-i-1], aValue.value()[c-i-1]);
result = MochiKit.Base.compare(a[c-i-1], b[c-i-1]);
}
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 @@
/*
-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/.
*/
@@ -134,14 +132,12 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
var result;
if (aValue.bitSize() > 1140) {
- MochiKit.Logging.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation");
+ Clipperz.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation");
result = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule(aValue);
} else {
var C, T;
var i;
-//console.log(">>> binaryField.finiteField.(improved)module");
-// C = aValue.value().slice(0);
C = aValue._value.slice(0);
for (i=35; i>=18; i--) {
T = C[i];
@@ -157,7 +153,6 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
}
result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
-//console.log("<<< binaryField.finiteField.(improved)module");
}
return result;
@@ -196,13 +191,12 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
var result;
if (aValue.bitSize() > 564) {
- MochiKit.Logging.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation");
+ Clipperz.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation");
result = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule(aValue);
} else {
var C, T;
var i;
-//console.log(">>> binaryField.finiteField.(improved)module");
C = aValue._value.slice(0);
for (i=17; i>=9; i--) {
T = C[i];
@@ -218,7 +212,6 @@ MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
}
result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
-//console.log("<<< binaryField.finiteField.(improved)module");
}
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 @@
/*
-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/.
*/
@@ -489,7 +487,6 @@ Clipperz.Crypto.PRNG.Fortuna.prototype = MochiKit.Base.update(null, {
this.setKey(Clipperz.Crypto.SHA.sha_d256(newKeySeed));
if (reseedCounter == 1) {
-//MochiKit.Logging.logDebug("### PRNG.readyToGenerateRandomBytes");
Clipperz.log("### PRNG.readyToGenerateRandomBytes");
MochiKit.Signal.signal(this, 'readyToGenerateRandomBytes');
}
@@ -560,7 +557,7 @@ Clipperz.log("### PRNG.readyToGenerateRandomBytes");
newKey = this.getRandomBlock().appendBlock(this.getRandomBlock());
this.setKey(newKey);
} else {
-MochiKit.Logging.logWarning("Fortuna generator has not enough entropy, yet!");
+Clipperz.logWarning("Fortuna generator has not enough entropy, yet!");
throw Clipperz.Crypto.PRNG.exception.NotEnoughEntropy;
}
@@ -610,21 +607,14 @@ MochiKit.Logging.logWarning("Fortuna generator has not enough entropy, yet!");
'deferredEntropyCollection': function(aValue) {
var result;
-//MochiKit.Logging.logDebug(">>> PRNG.deferredEntropyCollection");
if (this.isReadyToGenerateRandomValues()) {
-//MochiKit.Logging.logDebug("--- PRNG.deferredEntropyCollection - 1");
result = aValue;
} else {
-//MochiKit.Logging.logDebug("--- PRNG.deferredEntropyCollection - 2");
var deferredResult;
-// Clipperz.NotificationCenter.notify(this, 'updatedProgressState', 'collectingEntropy', true);
-
deferredResult = new Clipperz.Async.Deferred("PRNG.deferredEntropyCollection");
-// deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.1 - PRNG.deferredEntropyCollection - 1: " + res); return res;});
deferredResult.addCallback(MochiKit.Base.partial(MochiKit.Async.succeed, aValue));
-// deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.2 - PRNG.deferredEntropyCollection - 2: " + res); return res;});
MochiKit.Signal.connect(this,
'readyToGenerateRandomBytes',
deferredResult,
@@ -632,7 +622,6 @@ MochiKit.Logging.logWarning("Fortuna generator has not enough entropy, yet!");
result = deferredResult;
}
-//MochiKit.Logging.logDebug("<<< PRNG.deferredEntropyCollection - result: " + result);
return result;
},
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 @@
/*
-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/.
*/
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 @@
/*
-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/.
*/
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 @@
/*
-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/.
*/
@@ -131,7 +129,6 @@ Clipperz.Crypto.SRP.Connection.prototype = MochiKit.Base.update(null, {
if (this._a == null) {
this._a = new Clipperz.Crypto.BigInt(Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32).toHexString().substring(2), 16);
// this._a = new Clipperz.Crypto.BigInt("37532428169486597638072888476611365392249575518156687476805936694442691012367", 10);
-//MochiKit.Logging.logDebug("SRP a: " + this._a);
}
return this._a;
@@ -145,10 +142,9 @@ Clipperz.Crypto.SRP.Connection.prototype = MochiKit.Base.update(null, {
this._A = Clipperz.Crypto.SRP.g().powerModule(this.a(), Clipperz.Crypto.SRP.n());
if (this._A.equals(0)) {
-MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to 0.");
+ Clipperz.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to 0.");
throw Clipperz.Crypto.SRP.exception.InvalidValue;
}
-//MochiKit.Logging.logDebug("SRP A: " + this._A);
}
return this._A;
@@ -158,7 +154,6 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to
's': function () {
return this._s;
-//MochiKit.Logging.logDebug("SRP s: " + this._S);
},
'set_s': function(aValue) {
@@ -175,9 +170,8 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to
// Warning: this value should be strictly greater than zero: how should we perform this check?
if (! aValue.equals(0)) {
this._B = aValue;
-//MochiKit.Logging.logDebug("SRP B: " + this._B);
} else {
-MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to 0.");
+ Clipperz.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to 0.");
throw Clipperz.Crypto.SRP.exception.InvalidValue;
}
},
@@ -187,7 +181,6 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to
'x': function () {
if (this._x == null) {
this._x = new Clipperz.Crypto.BigInt(this.stringHash(this.s().asString(16, 64) + this.P()), 16);
-//MochiKit.Logging.logDebug("SRP x: " + this._x);
}
return this._x;
@@ -198,7 +191,6 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to
'u': function () {
if (this._u == null) {
this._u = new Clipperz.Crypto.BigInt(this.stringHash(this.B().asString()), 16);
-//MochiKit.Logging.logDebug("SRP u: " + this._u);
}
return this._u;
@@ -219,7 +211,6 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to
bigint.add(this.a(), bigint.multiply(this.u(), this.x())),
srp.n()
)
-//MochiKit.Logging.logDebug("SRP S: " + this._S);
}
return this._S;
@@ -230,7 +221,6 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to
'K': function () {
if (this._K == null) {
this._K = this.stringHash(this.S().asString());
-//MochiKit.Logging.logDebug("SRP K: " + this._K);
}
return this._K;
@@ -241,7 +231,6 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to
'M1': function () {
if (this._M1 == null) {
this._M1 = this.stringHash(this.A().asString(10) + this.B().asString(10) + this.K());
-//MochiKit.Logging.logDebug("SRP M1: " + this._M1);
}
return this._M1;
@@ -252,7 +241,6 @@ MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to
'M2': function () {
if (this._M2 == null) {
this._M2 = this.stringHash(this.A().asString(10) + this.M1() + this.K());
-//MochiKit.Logging.logDebug("SRP M2: " + this._M2);
}
return this._M2;
diff --git a/frontend/gamma/js/Clipperz/DOM.js b/frontend/gamma/js/Clipperz/DOM.js
index 8f24653..1d52a4b 100644
--- a/frontend/gamma/js/Clipperz/DOM.js
+++ b/frontend/gamma/js/Clipperz/DOM.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -106,7 +104,7 @@ MochiKit.Base.update(Clipperz.DOM, {
if (aNode.type == "select-one") {
Clipperz.DOM.selectOptionMatchingValue(aNode, values[name]);
} else { // aNode.type == "select-multiple"
-MochiKit.Logging.logWarning("### unhandled Select.type = 'select-multiple' condition");
+ Clipperz.logWarning("### unhandled Select.type = 'select-multiple' condition");
}
} else if (tagName === "FORM" || tagName === "P" || tagName === "SPAN" || tagName === "DIV") {
result = aNode.childNodes;
diff --git a/frontend/gamma/js/Clipperz/Date.js b/frontend/gamma/js/Clipperz/Date.js
index 020d77b..163790e 100644
--- a/frontend/gamma/js/Clipperz/Date.js
+++ b/frontend/gamma/js/Clipperz/Date.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -239,7 +237,6 @@ MochiKit.Base.update(Clipperz.Date, {
var formatter;
var i,c;
-//MochiKit.Logging.logDebug(">>> Clipperz.Date.formatDateWithPHPLikeTemplateAndLocale");
formatterCode = "Clipperz.Date.__scratchFormatter = function(aDate, aLocale){return ''";
c = aFormat.length;
@@ -261,12 +258,10 @@ MochiKit.Base.update(Clipperz.Date, {
}
formatterCode += ";}";
-//MochiKit.Logging.logDebug("--- Clipperz.Date.formatDateWithPHPLikeTemplateAndLocale - formatterCode: " + formatterCode);
eval(formatterCode);
result = Clipperz.Date.__scratchFormatter.call(this, aDate, aLocale);
delete Clipperz.Date.__scratchFormatter;
-//MochiKit.Logging.logDebug("<<< Clipperz.Date.formatDateWithPHPLikeTemplateAndLocale");
return result;
},
diff --git a/frontend/gamma/js/Clipperz/KeePassExportProcessor.js b/frontend/gamma/js/Clipperz/KeePassExportProcessor.js
index a3c10c8..e35d729 100644
--- a/frontend/gamma/js/Clipperz/KeePassExportProcessor.js
+++ b/frontend/gamma/js/Clipperz/KeePassExportProcessor.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/KeyValueObjectStore.js b/frontend/gamma/js/Clipperz/KeyValueObjectStore.js
index 36cda88..8bc125b 100644
--- a/frontend/gamma/js/Clipperz/KeyValueObjectStore.js
+++ b/frontend/gamma/js/Clipperz/KeyValueObjectStore.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -33,7 +31,6 @@ Clipperz.KeyValueObjectStore = function(args) {
// this._name = args['name'] || "unnamed KeyValueObjectStore";
this._values = args['values'] || {};
// this._referenceObjectStore = null;
-//console.log("new KeyValueObjectStore", args, this._values);
return this;
}
@@ -50,7 +47,6 @@ Clipperz.KeyValueObjectStore.prototype = MochiKit.Base.update(null, {
},
'setValues': function (someValues) {
-//console.log("KeyValueObjectStore.setValues", someValues);
this._values = someValues;
return this;
},
@@ -96,12 +92,10 @@ Clipperz.KeyValueObjectStore.prototype = MochiKit.Base.update(null, {
var keys;
var i,c;
-//console.log(">>> KeyValueObjectStore.setValue", this, this.values(), aKeyPath, aValue);
targetObject = this.values();
keys = (aKeyPath + '').split('.');
c = keys.length - 1;
for (i=0; i<c; i++) {
-//console.log("--- KeyValueObjectStore.setValue", i, targetObject, keys[i]);
if (typeof targetObject[keys[i]] == 'undefined') {
targetObject[keys[i]] = {}
}
@@ -110,7 +104,6 @@ Clipperz.KeyValueObjectStore.prototype = MochiKit.Base.update(null, {
}
targetObject[keys[c]] = aValue;
-//console.log("<<< KeyValueObjectStore.setValue");
return aValue;
},
diff --git a/frontend/gamma/js/Clipperz/Logging.js b/frontend/gamma/js/Clipperz/Logging.js
index 77a0896..b6b806a 100644
--- a/frontend/gamma/js/Clipperz/Logging.js
+++ b/frontend/gamma/js/Clipperz/Logging.js
@@ -1,39 +1,32 @@
/*
-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/.
*/
Clipperz.Base.module('Clipperz');
-if (typeof console == 'undefined') {
- Clipperz.log = MochiKit.Logging.logDebug;
-// Safari/WebKit 4
-} else if (navigator.userAgent.match(/WebKit/)) {
-// Clipperz.log = console.log;
- Clipperz.log = MochiKit.Logging.logDebug;
-} else if (navigator.userAgent.match(/Gecko/)) {
- Clipperz.log = function () {
-// firebug 1.3 bug see http://code.google.com/p/fbug/issues/detail?id=1347
- console.log.apply(window._firebug, arguments);
- };
-} \ No newline at end of file
+Clipperz.log = function () {
+ console.log.apply(console, arguments);
+}
+
+Clipperz.logError = Clipperz.log;
+Clipperz.logWarning = Clipperz.log;
+Clipperz.logDebug = Clipperz.log; \ No newline at end of file
diff --git a/frontend/gamma/js/Clipperz/PM/BookmarkletProcessor.js b/frontend/gamma/js/Clipperz/PM/BookmarkletProcessor.js
index 897beed..4818b76 100644
--- a/frontend/gamma/js/Clipperz/PM/BookmarkletProcessor.js
+++ b/frontend/gamma/js/Clipperz/PM/BookmarkletProcessor.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/Connection.js b/frontend/gamma/js/Clipperz/PM/Connection.js
index a05a310..6a8f15e 100644
--- a/frontend/gamma/js/Clipperz/PM/Connection.js
+++ b/frontend/gamma/js/Clipperz/PM/Connection.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -86,7 +84,8 @@ Clipperz.PM.Connection.prototype = MochiKit.Base.update(null, {
//-------------------------------------------------------------------------
'defaultErrorHandler': function(anErrorString, anException) {
-MochiKit.Logging.logError("### Connection.defaultErrorHandler: " + anErrorString + " (" + anException + ")");
+// Clipperz.logError("### Connection.defaultErrorHandler: " + anErrorString, anException);
+ Clipperz.logError("### Connection.defaultErrorHandler: " + anErrorString + " (" + anException + ")");
},
//-------------------------------------------------------------------------
@@ -273,7 +272,6 @@ Clipperz.PM.Connection.SRP['1.0'].prototype = MochiKit.Base.update(new Clipperz.
//=========================================================================
'redeemOneTimePassword': function (someParameters) {
-//console.log("Connections.redeemOneTimePassword", someParameters['username'], someParameters['password']);
/*
//=========================================================================
// LOGIN WITH PASSPHRASE, extracted from the TRUNK version (LoginPanel.js)
@@ -453,7 +451,6 @@ Clipperz.PM.Connection.SRP['1.0'].prototype = MochiKit.Base.update(new Clipperz.
parameters['user']['lock'] = this.serverLockValue();
}
-//console.log(">>> Connection.message", aMessageName, someParameters);
args = {
message: aMessageName,
srpSharedSecret: this.sharedSecret(),
@@ -489,7 +486,7 @@ Clipperz.PM.Connection.SRP['1.0'].prototype = MochiKit.Base.update(new Clipperz.
'messageExceptionHandler': function(anOriginalMessageArguments, anError) {
var result;
-console.log(">>> Connection.messageExceptionHandler", anError, anError.message);
+Clipperz.log(">>> Connection.messageExceptionHandler: " + anError.message, anError);
if (anError instanceof MochiKit.Async.CancelledError) {
result = anError;
} else {
@@ -503,8 +500,8 @@ console.log(">>> Connection.messageExceptionHandler", anError, anError.message);
result = anError;
}
}
-console.log("<<< Connection.messageExceptionHandler", anError)
-
+Clipperz.log("<<< Connection.messageExceptionHandler")
+
return result;;
},
diff --git a/frontend/gamma/js/Clipperz/PM/Crypto.js b/frontend/gamma/js/Clipperz/PM/Crypto.js
index 31fe349..cd10e33 100644
--- a/frontend/gamma/js/Clipperz/PM/Crypto.js
+++ b/frontend/gamma/js/Clipperz/PM/Crypto.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -174,7 +172,7 @@ MochiKit.Base.update(Clipperz.PM.Crypto, {
try {
result = Clipperz.Base.evalJSON(decryptedValue.asString());
} catch (exception) {
- MochiKit.Logging.logError("Error while decrypting data [1]");
+ Clipperz.logError("Error while decrypting data [1]");
throw Clipperz.Crypto.Base.exception.CorruptedMessage;
}
} else {
@@ -206,7 +204,7 @@ MochiKit.Base.update(Clipperz.PM.Crypto, {
try {
result = Clipperz.Base.evalJSON(decryptedData.asString());
} catch (exception) {
- MochiKit.Logging.logError("Error while decrypting data [2]");
+ Clipperz.logError("Error while decrypting data [2]");
throw Clipperz.Crypto.Base.exception.CorruptedMessage;
}
@@ -291,7 +289,7 @@ MochiKit.Base.update(Clipperz.PM.Crypto, {
try {
result = Clipperz.Base.evalJSON(value);
} catch (exception) {
- MochiKit.Logging.logError("Error while decrypting data [3]");
+ Clipperz.logError("Error while decrypting data [3]");
throw Clipperz.Crypto.Base.exception.CorruptedMessage;
}
} else {
@@ -322,7 +320,7 @@ MochiKit.Base.update(Clipperz.PM.Crypto, {
deferredResult.addCallback(MochiKit.Async.wait, 0.1);
deferredResult.addCallback(Clipperz.Base.evalJSON);
deferredResult.addErrback(function(anError) {
- MochiKit.Logging.logError("Error while decrypting data [4]");
+ Clipperz.logError("Error while decrypting data [4]");
throw Clipperz.Crypto.Base.exception.CorruptedMessage;
})
} else {
@@ -359,27 +357,27 @@ MochiKit.Base.update(Clipperz.PM.Crypto, {
var dataToEncrypt;
var encryptedData;
-//MochiKit.Logging.logDebug(">>> [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt");
+//Clipperz.logDebug(">>> [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt");
key = Clipperz.Crypto.SHA.sha_d256(new Clipperz.ByteArray(aKey));
-//MochiKit.Logging.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 1");
+//Clipperz.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 1");
value = Clipperz.Base.serializeJSON(aValue);
-//MochiKit.Logging.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 2");
+//Clipperz.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 2");
/ *
-//MochiKit.Logging.logDebug("--> encrypt.fullSize: " + value.length);
+//Clipperz.logDebug("--> encrypt.fullSize: " + value.length);
value = value.replace(/":{"label":"/g, '":{l:"');
value = value.replace(/":{"key":"/g, '":{k:"');
value = value.replace(/":{"notes":"/g, '":{n:"');
value = value.replace(/":{"record":"/g, '":{r:"');
value = value.replace(/", "label":"/g, '",l:"');
value = value.replace(/", "favicon":"/g, '",f:"');
-//MochiKit.Logging.logDebug("<-- encrypt.compressed: " + value.length);
+//Clipperz.logDebug("<-- encrypt.compressed: " + value.length);
* /
data = new Clipperz.ByteArray(value);
-//MochiKit.Logging.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 3");
+//Clipperz.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 3");
encryptedData = Clipperz.Crypto.AES.encrypt(key, data, aNonce);
-//MochiKit.Logging.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 4");
+//Clipperz.logDebug("--- [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt - 4");
result = encryptedData.toBase64String();
-//MochiKit.Logging.logDebug("<<< [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt");
+//Clipperz.logDebug("<<< [" + (new Date()).valueOf() + "] Clipperz.PM.Crypto.versions[0.3].encrypt");
return result;
},
@@ -408,7 +406,7 @@ MochiKit.Base.update(Clipperz.PM.Crypto, {
try {
result = Clipperz.Base.evalJSON(value);
} catch (exception) {
- MochiKit.Logging.logError("Error while decrypting data");
+ Clipperz.logError("Error while decrypting data");
throw Clipperz.Crypto.Base.exception.CorruptedMessage;
}
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLogin.js b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLogin.js
index 8f8696d..507ee31 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLogin.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLogin.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -329,7 +327,7 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.DirectLogin, Object, {
fixedConfiguration = Clipperz.Base.deepClone(aConfiguration);
-//console.log("PROCESS CONFIGURATION", aConfiguration);
+//Clipperz.log("PROCESS CONFIGURATION", aConfiguration);
switch (aConfiguration['bookmarkletVersion']) {
case '0.1':
fixedConfiguration['formData'] = this.fixFormDataFromBookmarkletVersion_0_1(aConfiguration['formData']);
@@ -481,10 +479,9 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.DirectLogin, Object, {
var bookmarkletConfiguration;
bookmarkletConfiguration = Clipperz.PM.DataModel.DirectLogin.checkBookmarkletConfiguration(aValue);
-//console.log("BOOKMARKLET CONFIGURATION", bookmarkletConfiguration);
+
return Clipperz.Async.callbacks("DirectLogin.setBookmarkletConfiguration", [
MochiKit.Base.method(this, 'setValue', 'formData', bookmarkletConfiguration['form']),
-//function (aValue) { console.log("SET VALUE - formData", aValue); return aValue; },
MochiKit.Base.method(this, 'setValue', 'bookmarkletVersion', bookmarkletConfiguration['version']),
MochiKit.Base.method(this, 'favicon'),
@@ -536,10 +533,7 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.DirectLogin, Object, {
'updateInputsAfterChangingBookmarkletConfiguration': function () {
return Clipperz.Async.callbacks("DirectLogin.updateInputsAfterChangingBookmarkletConfiguration", [
-// MochiKit.Base.method(this, 'getValue', ''),
-//function (aValue) { console.log("VALUE", aValue); return aValue },
MochiKit.Base.method(this, 'getValue', 'formData'),
-//function (aValue) { console.log("FORM DATA", aValue); return aValue },
MochiKit.Base.method(this, 'setInputWithFormDataConfiguration')
], {trace:false});
},
@@ -550,7 +544,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.DirectLogin, Object, {
return Clipperz.Async.callbacks("DirectLogin.inputValues", [
MochiKit.Base.method(this, 'inputs'),
MochiKit.Base.values,
-//function (aValue) { console.log("INPUTS", aValue); return aValue; },
MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.partial(MochiKit.Base.method(this, 'inputValue'))),
Clipperz.Async.collectAll,
Clipperz.Base.mergeItems
@@ -674,19 +667,16 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.DirectLogin, Object, {
this._bindings[anInput.name()] = newBinding;
}, this))
-//console.log("THIS._BINDINGS", this._bindings);
return newBindingValues;
/*
this._bindings = {};
-//console.log("CONFIGURATION", aConfiguration);
if (someValues['currentValues'] != null) {
if (someValues['currentValues']['bindingData'] != null) {
var bindingKey;
-//console.log("BINDING DATA", someValues['currentValues']['bindingData']);
for (bindingKey in someValues['currentValues']['bindingData']) {
var newBinding;
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginBinding.js b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginBinding.js
index 4377853..a8ebb97 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginBinding.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginBinding.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginFormValue.js b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginFormValue.js
index a461197..2429f88 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginFormValue.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginFormValue.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -87,7 +85,6 @@ Clipperz.PM.DataModel.DirectLoginFormValue.prototype = MochiKit.Base.update(null
},
'setValue': function (aValue) {
-//console.log("DirectLoginFormValue.setValue", aValue);
this._value = aValue;
return this.directLogin().setValue('formValues' + '.' + this.key(), aValue);
},
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js
index 8188389..d9995fc 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/DirectLoginInput.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -76,7 +74,7 @@ Clipperz.PM.DataModel.DirectLoginInput.prototype = MochiKit.Base.update(null, {
/*
'formConfiguration': function(someFormValues, someBindings, someFields) {
var result;
-//console.log("### DirectLoginInput.formConfiguration", someFields);
+
if (this.shouldSetValue()) {
switch (this.type()) {
case 'select':
@@ -154,12 +152,6 @@ Clipperz.PM.DataModel.DirectLoginInput.prototype = MochiKit.Base.update(null, {
// binding = this.directLogin().bindings()[this.name()];
binding = someBindings[this.name()];
-//console.log("### binding", binding);
-//if (binding != null) {
-/// console.log(" binding.field()", binding.field());
-/// console.log(" binding.field().value()", binding.field().value());
-// console.log(" someFields[binding.fieldKey()].value()", someFields[binding.fieldKey()].value());
-//}
result = MochiKit.DOM.INPUT({
type:((this.type() != 'password') ? this.type() : 'text'),
name:this.name(),
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js b/frontend/gamma/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js
index cdeec8b..1aa7a52 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/EncryptedRemoteObject.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -411,10 +409,6 @@ Clipperz.PM.DataModel.EncryptedRemoteObject.prototype = MochiKit.Base.update(nul
]
});
deferredResult.addCallback(function (someValues) {
-//if (someValues['decryptedData'] != someValues['objectData']) {
-// console.log("ORIGINAL DATA", '[[[' + someValues['decryptedData'] + ']]]');
-// console.log("CURRENT DATA", '>>>' + someValues['objectData'] + '<<<');
-//}
return (someValues['decryptedData'] != someValues['objectData']);
});
deferredResult.callback();
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/OneTimePassword.js b/frontend/gamma/js/Clipperz/PM/DataModel/OneTimePassword.js
index 834e21b..fbca1ff 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/OneTimePassword.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/OneTimePassword.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -143,12 +141,12 @@ Clipperz.PM.DataModel.OneTimePassword.prototype = MochiKit.Base.update(null, {
getRandomBytes = MochiKit.Base.method(Clipperz.Crypto.PRNG.defaultRandomGenerator(), 'getRandomBytes');
encodedPassphrase = new Clipperz.ByteArray(this.user().passphrase()).toBase64String();
-//MochiKit.Logging.logDebug("--- encodedPassphrase.length: " + encodedPassphrase.length);
+//Clipperz.logDebug("--- encodedPassphrase.length: " + encodedPassphrase.length);
prefixPadding = getRandomBytes(getRandomBytes(1).byteAtIndex(0)).toBase64String();
-//MochiKit.Logging.logDebug("--- prefixPadding.length: " + prefixPadding.length);
+//Clipperz.logDebug("--- prefixPadding.length: " + prefixPadding.length);
suffixPadding = getRandomBytes((500 - prefixPadding.length - encodedPassphrase.length) * 6 / 8).toBase64String();
-//MochiKit.Logging.logDebug("--- suffixPadding.length: " + suffixPadding.length);
-//MochiKit.Logging.logDebug("--- total.length: " + (prefixPadding.length + encodedPassphrase.length + suffixPadding.length));
+//Clipperz.logDebug("--- suffixPadding.length: " + suffixPadding.length);
+//Clipperz.logDebug("--- total.length: " + (prefixPadding.length + encodedPassphrase.length + suffixPadding.length));
packedPassphrase = {
'prefix': prefixPadding,
@@ -158,8 +156,8 @@ Clipperz.PM.DataModel.OneTimePassword.prototype = MochiKit.Base.update(null, {
// result = Clipperz.Base.serializeJSON(packedPassphrase);
result = packedPassphrase;
-//MochiKit.Logging.logDebug("===== OTP packedPassprase: [" + result.length + "]" + result);
-//MochiKit.Logging.logDebug("<<< OneTimePassword.packedPassphrase");
+//Clipperz.logDebug("===== OTP packedPassprase: [" + result.length + "]" + result);
+//Clipperz.logDebug("<<< OneTimePassword.packedPassphrase");
return result;
},
@@ -176,8 +174,8 @@ Clipperz.PM.DataModel.OneTimePassword.prototype = MochiKit.Base.update(null, {
var deferredResult;
var result;
-//MochiKit.Logging.logDebug(">>> OneTimePassword.encryptedData");
-//MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - id: " + this.reference());
+//Clipperz.logDebug(">>> OneTimePassword.encryptedData");
+//Clipperz.logDebug("--- OneTimePassword.encryptedData - id: " + this.reference());
result = {
'reference': this.reference(),
'key': this.key(),
@@ -185,22 +183,22 @@ Clipperz.PM.DataModel.OneTimePassword.prototype = MochiKit.Base.update(null, {
'data': "",
'version': Clipperz.PM.Crypto.encryptingFunctions.currentVersion
}
-//MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 2: " + Clipperz.Base.serializeJSON(result));
+//Clipperz.logDebug("--- OneTimePassword.encryptedData - 2: " + Clipperz.Base.serializeJSON(result));
deferredResult = new MochiKit.Async.Deferred();
-//MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 3");
-//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.encryptedData - 1: " + res); return res;});
+//Clipperz.logDebug("--- OneTimePassword.encryptedData - 3");
+//deferredResult.addBoth(function(res) {Clipperz.logDebug("OneTimePassword.encryptedData - 1: " + res); return res;});
//# deferredResult.addCallback(Clipperz.PM.Crypto.deferredEncryptWithCurrentVersion, this.passwordValue(), this.packedPassphrase());
deferredResult.addCallback(MochiKit.Base.method(this, 'encryptedPackedPassphrase'));
-//MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 4");
-//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.encryptedData - 2: [" + res.length + "]" + res); return res;});
+//Clipperz.logDebug("--- OneTimePassword.encryptedData - 4");
+//deferredResult.addBoth(function(res) {Clipperz.logDebug("OneTimePassword.encryptedData - 2: [" + res.length + "]" + res); return res;});
deferredResult.addCallback(function(aResult, res) {
aResult['data'] = res;
return aResult;
}, result);
-//MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 5");
-//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.encryptedData - 3: " + Clipperz.Base.serializeJSON(res)); return res;});
+//Clipperz.logDebug("--- OneTimePassword.encryptedData - 5");
+//deferredResult.addBoth(function(res) {Clipperz.logDebug("OneTimePassword.encryptedData - 3: " + Clipperz.Base.serializeJSON(res)); return res;});
deferredResult.callback();
-//MochiKit.Logging.logDebug("--- OneTimePassword.encryptedData - 6");
+//Clipperz.logDebug("--- OneTimePassword.encryptedData - 6");
return deferredResult;
},
@@ -211,7 +209,7 @@ Clipperz.PM.DataModel.OneTimePassword.prototype = MochiKit.Base.update(null, {
var deferredResult;
var result;
-//MochiKit.Logging.logDebug(">>> OneTimePassword.saveChanges");
+//Clipperz.logDebug(">>> OneTimePassword.saveChanges");
result = {};
deferredResult = new MochiKit.Async.Deferred();
@@ -230,16 +228,16 @@ Clipperz.PM.DataModel.OneTimePassword.prototype = MochiKit.Base.update(null, {
}, result);
deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'saveOTP_sendingData');
-//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.saveChanges - 1: " + Clipperz.Base.serializeJSON(res)); return res;});
+//deferredResult.addBoth(function(res) {Clipperz.logDebug("OneTimePassword.saveChanges - 1: " + Clipperz.Base.serializeJSON(res)); return res;});
deferredResult.addCallback(MochiKit.Base.method(this.user().connection(), 'message'), 'addNewOneTimePassword');
deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'saveOTP_updatingInterface');
-//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.saveChanges - 2: " + res); return res;});
+//deferredResult.addBoth(function(res) {Clipperz.logDebug("OneTimePassword.saveChanges - 2: " + res); return res;});
deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'notify', 'OTPUpdated');
deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'oneTimePassword_saveChanges_done', null);
-//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("OneTimePassword.saveChanges - 2: " + res); return res;});
+//deferredResult.addBoth(function(res) {Clipperz.logDebug("OneTimePassword.saveChanges - 2: " + res); return res;});
deferredResult.callback();
-//MochiKit.Logging.logDebug("<<< OneTimePassword.saveChanges");
+//Clipperz.logDebug("<<< OneTimePassword.saveChanges");
return deferredResult;
},
@@ -308,7 +306,6 @@ Clipperz.PM.DataModel.OneTimePassword.isValidOneTimePasswordValue = function(aPa
var result;
// "yaxx k7ww - f8y6 tqz5 - 58b6 th44 - 9cwv q0fg"
-//console.log("Clipperz.PM.DataModel.OneTimePassword.isValidOneTimePasswordValue", aPassword);
if (aPassword.replace(/[\s\-]/g, '').length == 32) {
try {
var passwordByteArray;
@@ -347,7 +344,6 @@ Clipperz.PM.DataModel.OneTimePassword.normalizedOneTimePassword = function(aPass
result = aPassword;
}
-//console.log("Clipperz.PM.DataModel.OneTimePassword.normalizedOneTimePassword", aPassword, result);
return result;
}
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.Field.js b/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.Field.js
index f51bbc2..986db40 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.Field.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.Field.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.js b/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.js
index dd35fc9..87b319c 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/Record.Version.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -28,7 +26,6 @@ try { if (typeof(Clipperz.PM.DataModel.Record) == 'undefined') { throw ""; }} ca
}
Clipperz.PM.DataModel.Record.Version = function(args) {
-//console.log(">>> Record.new");
Clipperz.PM.DataModel.Record.Version.superclass.constructor.apply(this, arguments);
this._getVersionFunction = args.getVersion || Clipperz.Base.exception.raise('MandatoryParameter');
@@ -99,7 +96,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record.Version, Clipperz.PM.DataModel
'unpackData': function (someData) { // ++
var result;
-//console.log("Record.Version - UNPACK DATA", this, someData);
result = someData;
if ((someData['fields'] != null) && (someData['fields'] instanceof Array)) {
var fields;
@@ -292,7 +288,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record.Version, Clipperz.PM.DataModel
result = {};
-//console.log("prepareRemoteDataWithKey", aKey);
deferredResult = new Clipperz.Async.Deferred("Record.Version.prepareRemoteDataWithKey", {trace:false});
if (this.isBrandNew() == false) {
this.transientState()['originalReference'] = this.reference();
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/Record.js b/frontend/gamma/js/Clipperz/PM/DataModel/Record.js
index b816f80..3fc1813 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/Record.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/Record.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -29,7 +27,6 @@ if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {};
Clipperz.PM.DataModel.Record = function(args) {
-//console.log(">>> new Clipperz.PM.DataModel.Record", args);
Clipperz.PM.DataModel.Record.superclass.constructor.apply(this, arguments);
this._updateDate = (args.updateDate ? Clipperz.PM.Date.parse(args.updateDate) : Clipperz.Base.exception.raise('MandatoryParameter'));
@@ -62,8 +59,6 @@ Clipperz.PM.DataModel.Record = function(args) {
// this.setLabel('');
}
-//console.log("<<< new Clipperz.PM.DataModel.Record", args);
-
return this;
}
@@ -210,7 +205,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
'searchableContent': function () {
var deferredResult;
-//console.log(">>> searchableContent");
deferredResult = new Clipperz.Async.Deferred("Record.searchableContent", {trace:false});
deferredResult.collectResults({
@@ -224,7 +218,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
return someValues['recordLabel'] + ' ' + someValues['directLoginLabels'].join(' ');
});
deferredResult.callback();
-//console.log("<<< searchableContent");
return deferredResult;
},
@@ -270,7 +263,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
'saveOriginalDirectLoginStatusToTransientState': function () {
if (this.transientState().getValue('directLogins') == null) {
// this.transientState().setValue('directLogins', this._directLogins)
-//console.log("SET TRANSIENT STATE", Clipperz.Base.serializeJSON(MochiKit.Base.keys(this.transientState().getValue('directLogins'))))
MochiKit.Iter.forEach(MochiKit.Base.keys(this._directLogins), MochiKit.Base.bind(function(aKey) {
this.transientState().setValue('directLogins' + '.' + aKey, this._directLogins[aKey])
}, this))
@@ -329,7 +321,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
'unpackRemoteData': function (someData) {
var result;
-//console.log("new Clipperz.PM.DataModel.Record.Version [2]");
/*
this._currentRecordVersion = new Clipperz.PM.DataModel.Record.Version({
'reference': someData['currentVersion']['reference'],
@@ -340,7 +331,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
var versionKey;
for (versionKey in someData['versions']) {
-//console.log("### versionKey", versionKey);
this._versions[versionKey] = new Clipperz.PM.DataModel.Record.Version({
'reference': versionKey,
'retrieveKeyFunction': MochiKit.Base.method(this, 'getVersionKey'),
@@ -351,7 +341,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
// this._currentVersionReference = someData['currentVersion']['reference'];
this._currentVersionReference = someData['currentVersion'];
-//console.log("=== currentVersionReference", this._currentVersionReference, someData);
result = Clipperz.PM.DataModel.Record.superclass.unpackRemoteData.apply(this, arguments);
@@ -536,7 +525,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
//.........................................................................
'currentVersionReference': function () {
-//console.log("currentVersionReference");
return this._currentVersionReference;
},
@@ -585,7 +573,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
//-------------------------------------------------------------------------
'getCurrentRecordVersionKey': function () {
-//console.log("getCurrentRecordVersionKey");
return Clipperz.Async.callbacks("Record.getCurrentRecordVersionKey", [
MochiKit.Base.method(this, 'getValue', 'currentVersionKey'),
Clipperz.Async.deferredIf("currentVersionKey is NOT null", [
@@ -606,10 +593,8 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
//-------------------------------------------------------------------------
'invokeCurrentRecordVersionMethod': function (aMethodName, someValues) {
-//console.log(">>> invokeCurrentRecordVersionMethod", aMethodName);
return Clipperz.Async.callbacks("Record.invokeCurrentRecordVersionMethod", [
MochiKit.Base.method(this, 'getCurrentRecordVersion'),
-//function (aValue) { console.log("=== getCurrentRecordVersion", aValue); return aValue},
MochiKit.Base.methodcaller(aMethodName, someValues)
], {trace:false});
},
@@ -618,16 +603,11 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
'lazilyinvokeCurrentRecordVersionMethod': function (aMethodName, someValues, defaultResult) {
return Clipperz.Async.callbacks("Record.lazilyinvokeCurrentRecordVersionMethod", [
MochiKit.Base.method(this, 'currentVersionReference'),
-//function (aValue) { console.log("LAZY -> versions", aValue); return aValue; },
Clipperz.Async.deferredIf("versions has been loaded", [
-//function (aValue) { console.log("LAZY -> then"); return aValue; },
MochiKit.Base.method(this, 'getCurrentRecordVersion'),
MochiKit.Base.methodcaller(aMethodName, someValues),
-//function (aValue) { console.log("LAZY <- then"); return aValue; }
], [
-//function (aValue) { console.log("LAZY -> else"); return aValue; },
MochiKit.Base.partial(MochiKit.Async.succeed, defaultResult),
-//function (aValue) { console.log("LAZY <- else"); return aValue; }
])
], {trace:false});
},
@@ -648,7 +628,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
],
'directLogins': [
MochiKit.Base.method(this, 'directLogins'),
-//function (aValue) { console.log("Record.directLogins", aValue); return aValue; },
MochiKit.Base.values,
MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('hasPendingChanges')),
Clipperz.Async.collectAll,
@@ -658,7 +637,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
// }
]
});
-//deferredResult.addCallback(function (aValue) { console.log("Record.hasPendingResults", aValue); return aValue; });
deferredResult.addCallback(MochiKit.Base.values);
deferredResult.addCallback(MochiKit.Base.bind(function(someValues) {
var result;
@@ -776,7 +754,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
MochiKit.Base.method(this, 'lazilyinvokeCurrentRecordVersionMethod', 'resetTransientState'),
MochiKit.Base.method(this, 'directLogins'),
-//function (aValue) { console.log("resetTransientState - directLogins", aValue); return aValue; },
MochiKit.Base.values,
MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.methodcaller('resetTransientState')),
@@ -816,7 +793,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
//=========================================================================
'retrieveDirectLoginIndexDataFunction': function () {
-//console.log("Record.retrieveDirectLoginIndexDataFunction", this._retrieveDirectLoginIndexDataFunction);
return this._retrieveDirectLoginIndexDataFunction;
},
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js
index d6202ff..cda5a41 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Legacy.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js
index 3528db6..e82da47 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -51,9 +49,7 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.OneTimePasswords, Clipper
'packData': function (someData) { // ++
var result;
-console.log(">>> OneTimePasswords.packData", someData);
result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.packData.apply(this, arguments);
-console.log("<<< OneTimePasswords.packData");
return result;
},
@@ -63,9 +59,7 @@ console.log("<<< OneTimePasswords.packData");
'packRemoteData': function (someData) {
var result;
-console.log(">>> OneTimePasswords.packRemoteData", someData);
result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.packRemoteData.apply(this, arguments);
-console.log("<<< OneTimePasswords.packRemoteData");
return result;
},
@@ -75,9 +69,7 @@ console.log("<<< OneTimePasswords.packRemoteData");
'prepareRemoteDataWithKey': function (aKey) {
var result;
-console.log(">>> OneTimePasswords.prepareRemoteDataWithKey");
result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.prepareRemoteDataWithKey.apply(this, arguments);
-console.log("<<< OneTimePasswords.prepareRemoteDataWithKey");
return result;
},
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Preferences.js b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Preferences.js
index b164889..f1f95e8 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Preferences.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.Preferences.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js
index f77ea80..5681f70 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.RecordIndex.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -32,7 +30,6 @@ if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.Data
Clipperz.PM.DataModel.User.Header.RecordIndex = function(args) {
Clipperz.PM.DataModel.User.Header.RecordIndex.superclass.constructor.apply(this, arguments);
-//console.log("NEW Clipperz.PM.DataModel.User.Header.RecordIndex", args);
this._recordsData = new Clipperz.PM.DataModel.EncryptedRemoteObject({
'name': 'recordsData',
'retrieveKeyFunction': args.retrieveKeyFunction,
@@ -118,7 +115,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.RecordIndex, Object, {
},
'resetTransientState': function (isCommitting) {
-//console.log("######## UserHeaderRecordIndex - resetTransientState", Clipperz.Base.deepClone(this._transientState));
if (this._transientState != null) {
this._transientState.removeAllData();
}
@@ -158,7 +154,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.RecordIndex, Object, {
},
'setDirectLoginIndexData': function (aDirectLoginReference, aKey, aValue) {
-//console.log("UserHeaderRecordIndex.setDirectLoginIndexData", aDirectLoginReference, this.directLoginsIndex()[aDirectLoginReference], aKey);
//if (MochiKit.Base.isUndefinedOrNull(this.directLoginsIndex()[aDirectLoginReference])) {
// throw "PIPPO";
//}
@@ -166,7 +161,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.RecordIndex, Object, {
},
'addDirectLoginIndexData': function (aDirectLoginReference) {
-//console.log("UserHeaderRecordIndex.addDirectLoginIndexData", aDirectLoginReference, this.directLoginsIndex()[aDirectLoginReference]);
return this.directLoginsData().setValue(this.directLoginsIndex()[aDirectLoginReference], {});
},
@@ -261,12 +255,7 @@ Clipperz.log("SKIPPING record " + reference + " as there are no stas associated
'record': record
});
} else {
-Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!");
-//console.log("direct login data", someData['directLogins']);
-//console.log("current direct login data", someData['directLogins'][indexReference])
-//console.log("reference", reference);
-//console.log("record index", this.recordsIndex());
-//console.log("record inverted index", recordsInvertedIndex);
+ Clipperz.logWarning("WARNING: DIRECT LOGIN without a matching RECORD!!");
}
}
@@ -305,7 +294,6 @@ Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!");
var deferredResult;
var newRecord;
-//console.log("#### new Clipperz.PM.DataModel.Record [4]");
newRecord = new Clipperz.PM.DataModel.Record({
'retrieveKeyFunction': MochiKit.Base.method(this, 'getRecordKey'),
'retrieveRemoteDataFunction': this.retrieveRecordDetailFunction(),
@@ -386,9 +374,7 @@ Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!");
this.transientState().setValue('newDirectLoginReferences' + '.' + newDirectLogin.reference(), newDirectLogin);
-//console.log("UserHeaderRecordIndex.createNewDirectLogin [1]", newDirectLogin.reference(), newDirectLoginIndexValue);
this.directLoginsIndex()[newDirectLogin.reference()] = newDirectLoginIndexValue;
-//console.log("UserHeaderRecordIndex.createNewDirectLogin [2]", newDirectLogin.reference(), this.directLoginsIndex()[newDirectLogin.reference()]);
this.directLoginsData().setValue(this.directLoginsIndex()[newDirectLogin.reference()], {'record': this.recordsIndex()[aRecord.reference()]});
return newDirectLogin;
@@ -431,7 +417,6 @@ Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!");
// Clipperz.Async.collectAll
// ]
});
-//deferredResult.addCallback(function (aValue) { console.log("USER.Header.RecordIndex.hasAnyCleanTextData", aValue); return aValue});
// deferredResult.addCallback(MochiKit.Base.values);
// deferredResult.addCallback(MochiKit.Base.flattenArguments);
@@ -461,7 +446,6 @@ Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!");
MochiKit.Base.methodcaller('hasPendingChanges')
]
});
-//deferredResult.addCallback(function (aValue) { console.log("UserHeaderIndex.hasPendingResults", aValue); return aValue; });
deferredResult.addCallback(Clipperz.Async.or);
// deferredResult.addCallback(MochiKit.Base.values);
// deferredResult.addCallback(MochiKit.Base.flattenArguments);
@@ -570,7 +554,6 @@ Clipperz.log("WARNING: DIRECT LOGIN without a matching RECORD!!");
var deferredResult;
var result;
-//console.log("recordsIndex", this.recordsIndex());
result = {};
deferredResult = new Clipperz.Async.Deferred("User.Header.RecordIndex.prepareRemoteDataWithKey", {trace:false});
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/User.js b/frontend/gamma/js/Clipperz/PM/DataModel/User.js
index 646ce21..fd18faf 100644
--- a/frontend/gamma/js/Clipperz/PM/DataModel/User.js
+++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -328,7 +326,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User, Object, {
var preferences;
var oneTimePasswords;
-//console.log(">>> ***************** user.unpackServerData", someServerData);
// this.setServerLockValue(someServerData['lock']);
headerVersion = this.headerFormatVersion(someServerData['header']);
@@ -417,7 +414,6 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User, Object, {
};
this._serverData = unpackedData;
-//console.log("<<< ***************** user.unpackServerData", this._serverData);
return this._serverData;
},
diff --git a/frontend/gamma/js/Clipperz/PM/Date.js b/frontend/gamma/js/Clipperz/PM/Date.js
index 96a2700..a62857e 100644
--- a/frontend/gamma/js/Clipperz/PM/Date.js
+++ b/frontend/gamma/js/Clipperz/PM/Date.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/PIN.js b/frontend/gamma/js/Clipperz/PM/PIN.js
index bc932b2..a32889a 100644
--- a/frontend/gamma/js/Clipperz/PM/PIN.js
+++ b/frontend/gamma/js/Clipperz/PM/PIN.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy.js b/frontend/gamma/js/Clipperz/PM/Proxy.js
index 190bffd..a5eaae6 100644
--- a/frontend/gamma/js/Clipperz/PM/Proxy.js
+++ b/frontend/gamma/js/Clipperz/PM/Proxy.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -69,7 +67,6 @@ Clipperz.PM.Proxy.prototype = MochiKit.Base.update(null, {
'payToll': function(aRequestType, someParameters) {
var deferredResult;
-//console.log(">>> Proxy.payToll", aRequestType, someParameters);
if (this.shouldPayTolls()) {
deferredResult = new Clipperz.Async.Deferred("Proxy.payToll", {trace:false});
@@ -94,7 +91,6 @@ Clipperz.PM.Proxy.prototype = MochiKit.Base.update(null, {
} else {
deferredResult = MochiKit.Async.succeed({parameters:someParameters});
}
-//console.log("<<< Proxy.payToll");
return deferredResult;
},
@@ -102,20 +98,16 @@ Clipperz.PM.Proxy.prototype = MochiKit.Base.update(null, {
//-------------------------------------------------------------------------
'addToll': function(aToll) {
-//console.log(">>> Proxy.addToll", aToll);
this.tolls()[aToll.requestType()].push(aToll);
-//console.log("<<< Proxy.addToll");
},
//=========================================================================
'setTollCallback': function(someParameters) {
-//console.log(">>> Proxy.setTollCallback", someParameters);
if (typeof(someParameters['toll']) != 'undefined') {
-//console.log("added a new toll", someParameters['toll']);
this.addToll(new Clipperz.PM.Toll(someParameters['toll']));
}
-//console.log("<<< Proxy.setTallCallback", someParameters['result']);
+
return someParameters['result'];
},
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.JSON.js b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.JSON.js
index 5b39b4a..7d10dd4 100755
--- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.JSON.js
+++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.JSON.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js
index 01ba122..326022c 100644
--- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js
+++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.DataStore.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -107,7 +105,6 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
deferredResult.addMethod(this, 'userSerializedEncryptedData', someData['users'][i]);
deferredResult.addCallback(MochiKit.Base.bind(function(aUserSerializationContext) {
-//console.log("SERIALIZED USER", aUserSerializationContext);
resultData['users'][aUserSerializationContext['credentials']['C']] = {
's': aUserSerializationContext['credentials']['s'],
'v': aUserSerializationContext['credentials']['v'],
@@ -122,7 +119,6 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
}
deferredResult.addCallback(MochiKit.Base.bind(function() {
-//console.log("this._data", resultData);
this._data = resultData;
}, this));
@@ -395,7 +391,7 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
}
nextTollRequestType = 'CONNECT';
} else {
- MochiKit.Logging.logError("Clipperz.PM.Proxy.Test.handshake - unhandled message: " + someParameters.message);
+ Clipperz.logError("Clipperz.PM.Proxy.Test.handshake - unhandled message: " + someParameters.message);
}
result = {
@@ -525,9 +521,6 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
if (this.isReadOnly() == false) {
var i, c;
-//console.log("###===============================================================");
-//console.log("###>>>", Clipperz.Base.serializeJSON(someParameters));
-//console.log("###--- userData", Clipperz.Base.serializeJSON(this.userData()));
if (this.userData()['lock'] != someParameters['parameters']['user']['lock']) {
throw "the lock attribute is not processed correctly"
}
@@ -562,7 +555,6 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
this.userData()['lock'] = Clipperz.PM.Crypto.randomKey();
result['lock'] = this.userData()['lock'];
result['result'] = 'done';
-//console.log("###<<< userData", Clipperz.Base.serializeJSON(this.userData()));
} else {
throw Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly;
}
@@ -571,13 +563,6 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
if (this.isReadOnly() == false) {
var i, c;
-//console.log("###===============================================================");
-//console.log("###>>>", someParameters);
-//console.log("###>>>", Clipperz.Base.serializeJSON(someParameters));
-//console.log("###--- userData", Clipperz.Base.serializeJSON(this.userData()));
-//console.log("###===============================================================");
-//console.log("--- userData.lock ", this.userData()['lock']);
-//console.log("--- parameters.lock", someParameters['parameters']['user']['lock']);
if (aConnection['userData']['lock'] != someParameters['parameters']['user']['lock']) {
throw "the lock attribute is not processed correctly"
}
@@ -599,7 +584,6 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
&&
(typeof(currentRecordData['currentRecordVersion']) == 'undefined')
) {
-//console.log("######## SHIT HAPPENS");
throw "Record added without a recordVersion";
}
@@ -635,14 +619,12 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
var currentRecordReference;
currentRecordReference = someParameters['parameters']['records']['deleted'][i];
-//console.log("DELETING records", currentRecordReference);
delete aConnection['userData']['records'][currentRecordReference];
}
aConnection['userData']['lock'] = Clipperz.PM.Crypto.randomKey();
result['lock'] = aConnection['userData']['lock'];
result['result'] = 'done';
-//console.log("###<<< userData", Clipperz.Base.serializeJSON(this.userData()));
} else {
throw Clipperz.PM.Proxy.Offline.DataStore.exception.ReadOnly;
}
@@ -653,7 +635,7 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
//
//=====================================================================
} else {
- MochiKit.Logging.logError("Clipperz.PM.Proxy.Test.message - unhandled message: " + someParameters.message);
+ Clipperz.logError("Clipperz.PM.Proxy.Test.message - unhandled message: " + someParameters.message);
}
result = {
@@ -686,12 +668,12 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
var serializedHeader;
var version;
-//MochiKit.Logging.logDebug("### test data");
+//Clipperz.logDebug("### test data");
version = aConnection['userData']['userDetailsVersion'];
serializedHeader = Clipperz.Base.serializeJSON(aConnection['userData']['userDetails']);
result = Clipperz.PM.Crypto.encryptingFunctions.versions[version].encrypt(aConnection['userData']['__masterkey_test_value__'], serializedHeader);
} else {
-//MochiKit.Logging.logDebug("### NOT test data");
+//Clipperz.logDebug("### NOT test data");
result = aConnection['userData']['userDetails'];
}
@@ -749,11 +731,9 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
});
// deferredResult.addCallback(function(aDeferredContext) {
-//console.log("#-#-#-#-#", aDeferredContext);
// return aDeferredContext['user'].serializedDataUsingVersion(MochiKit.Base.values(aDeferredContext['user'].records()), aDeferredContext['data']['version']);
// }, deferredContext);
// deferredResult.addCallback(function(aUserSerializedData) {
-//console.log("USER SERIALIZED DATA", aUserSerializedData);
// });
//
// deferredResult.addCallback(MochiKit.Async.succeed, deferredContext);
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.js b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.js
index a86ac4f..5764bda 100644
--- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.js
+++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Offline.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.OfflineCache.js b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.OfflineCache.js
index 803c590..f628975 100644
--- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.OfflineCache.js
+++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.OfflineCache.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js
index d554c6a..d459726 100644
--- a/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js
+++ b/frontend/gamma/js/Clipperz/PM/Proxy/Proxy.Test.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -98,7 +96,6 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Test, Clipperz.PM.Proxy.Offline, {
'testExpectedRequestParameters': function (aPath, anActualRequest, anExpectedRequest) {
var aKey;
-//console.log(">>> Proxy.testExpectedRequestParameters [" + aPath + "]", anActualRequest, anExpectedRequest);
for (aKey in anExpectedRequest) {
if (typeof(anActualRequest[aKey]) == 'undefined') {
throw "the expected paramter [" + aKey + "] is missing from the actual request";
@@ -111,7 +108,6 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Test, Clipperz.PM.Proxy.Offline, {
}
}
}
-//console.log("<<< Proxy.testExpectedRequestParameters");
},
//-------------------------------------------------------------------------
@@ -120,9 +116,7 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Test, Clipperz.PM.Proxy.Offline, {
if (this.shouldCheckExpectedRequests()) {
var expectedRequest;
-//console.log(">>> Proxy.Test.checkRequest - " + aFunctionName, someParameters);
expectedRequest = this.expectedRequests().pop();
-//console.log("--- Proxy.Test.checkRequest - expectedRequest", expectedRequest);
if (expectedRequest == null) {
throw "Proxy.Test.sentMessage: no expected result specified. Got request '" + aFunctionName + "': " + someParameters;
}
@@ -134,11 +128,9 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Test, Clipperz.PM.Proxy.Offline, {
this.testExpectedRequestParameters("parameters", someParameters, expectedRequest.parameters);
} catch(exception) {
-//console.log("EXCEPTION: Proxy.Test.sentMessage[" + expectedRequest.name + "]", exception)
throw "Proxy.Test.sentMessage[" + expectedRequest.name + "]: " + exception;
}
}
-//console.log("<<< Proxy.Test.checkRequest");
},
//=========================================================================
diff --git a/frontend/gamma/js/Clipperz/PM/Strings.js b/frontend/gamma/js/Clipperz/PM/Strings.js
index a051365..7e855ff 100644
--- a/frontend/gamma/js/Clipperz/PM/Strings.js
+++ b/frontend/gamma/js/Clipperz/PM/Strings.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -241,22 +239,17 @@ Clipperz.PM.Strings.getValue = function (aKeyPath, someKeyValues) {
result = Clipperz.PM.Strings.stringsObjectStore.getValue(aKeyPath);
-//try {
if (typeof(result) == 'string') {
if (typeof (someKeyValues) != 'undefined') {
var key;
for (key in someKeyValues) {
result = result.replace( new RegExp(key), someKeyValues[key]);
- // result.replace(, '');
}
}
result = result.replace(new RegExp('\n'), '<br>');
}
-//} catch (exception) {
-// console.log("####", result, aKeyPath, someKeyValues, exception);
-//}
return result;
}
diff --git a/frontend/gamma/js/Clipperz/PM/Strings/MessagePanelConfigurations.js b/frontend/gamma/js/Clipperz/PM/Strings/MessagePanelConfigurations.js
index 7f6c52f..7565d2d 100644
--- a/frontend/gamma/js/Clipperz/PM/Strings/MessagePanelConfigurations.js
+++ b/frontend/gamma/js/Clipperz/PM/Strings/MessagePanelConfigurations.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/Strings/Strings_defaults.js b/frontend/gamma/js/Clipperz/PM/Strings/Strings_defaults.js
index 101ed3f..aefd94a 100644
--- a/frontend/gamma/js/Clipperz/PM/Strings/Strings_defaults.js
+++ b/frontend/gamma/js/Clipperz/PM/Strings/Strings_defaults.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/Strings/Strings_en-US.js b/frontend/gamma/js/Clipperz/PM/Strings/Strings_en-US.js
index b540633..85d55c0 100644
--- a/frontend/gamma/js/Clipperz/PM/Strings/Strings_en-US.js
+++ b/frontend/gamma/js/Clipperz/PM/Strings/Strings_en-US.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/Toll.js b/frontend/gamma/js/Clipperz/PM/Toll.js
index bb31c43..e9c3092 100644
--- a/frontend/gamma/js/Clipperz/PM/Toll.js
+++ b/frontend/gamma/js/Clipperz/PM/Toll.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js
index 25e82ca..f667526 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/download.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js
index ba425ec..dae5a2d 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/CoverActions/look.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js
index 5c1f860..497fd05 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/directLogin.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js
index b829ed6..f015535 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/protect.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js
index 8d73cc7..47972fc 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/share.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js
index 572d9be..a4f30b2 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Features/store.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js
index b9443bd..dccefab 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/GraphicFunctions.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js
index cc60bba..24c0bc3 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Logo/normal.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js
index 02f2f80..5982f0d 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/exclamationMark.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js
index fad5c10..2501992 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/info.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js
index 5842828..9a8ac7d 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Marks/questionMark.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js
index 2462d0e..65e5ca6 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/RegisterButton/normal.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js
index cf475c6..5b344ef 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Star/normal.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js
index cd7ed90..21dfcc0 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/close.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js
index 30c1c69..9c76865 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Canvas/Tips/open.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js
index b9d7adf..58b7593 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/BaseComponent.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -123,7 +121,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.BaseComponent, /*Ext.Compo
//-------------------------------------------------------------------------
'element': function() {
-//MochiKit.Logging.logDebug(">>> BaseComponent.element");
return MochiKit.DOM.getElement(this._element);
},
@@ -313,11 +310,8 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.BaseComponent, /*Ext.Compo
//-----------------------------------------------------
/*
'purgeListeners': function() {
-//MochiKit.Logging.logDebug(">>> Clipperz.PM.UI.Common.Components.BaseComponent.purgeListeners [" + this + "]");
-//MochiKit.Logging.logDebug("--- " + this + ".purgeListeners");
Clipperz.NotificationCenter.unregister(this);
MochiKit.Signal.disconnectAllTo(this);
-//MochiKit.Logging.logDebug("<<< Clipperz.PM.UI.Common.Components.BaseComponent.purgeListeners");
},
*/
//-----------------------------------------------------
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js
index 1010c9d..1268118 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Button.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js
index 7f56c1e..2f82359 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ComponentSlot.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js
index 2db2489..bf00ffc 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/FaviconComponent.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -77,7 +75,7 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.FaviconComponent, Clipperz
'handleOnLoad': function (anEvent) {
MochiKit.Signal.disconnectAll(anEvent.src());
-//console.log("HANDLE ON LOAD", anEvent, anEvent.src().src);
+
if (anEvent.src().complete == false) {
this.setSrc(null);
}
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js
index 2788b79..020290b 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/MessagePanelWithProgressBar.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -131,14 +129,12 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBa
//-------------------------------------------------------------------------
'closeOk': function () {
-//console.log("=== closeOk");
this.showProgressBar();
MochiKit.Async.callLater(0.5, MochiKit.Base.method(this.deferred(), 'callback'));
this._deferred = null;
},
'closeCancel': function () {
-//console.log("=== closeCancel");
this.deferredHideModal({closeToElement:this.onCancelCloseToElement()});
this.deferred().cancel();
this._deferred = null;
@@ -147,12 +143,10 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.MessagePanelWithProgressBa
//-------------------------------------------------------------------------
'deferredDone': function () {
-//console.log("=== deferredDone");
return this.deferredHideModal({closeToElement:this.onOkCloseToElement()});
},
'deferredError': function (someParameters) {
-//console.log("=== deferredError");
this.showFailure(someParameters);
},
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js
index 089e3d4..78e8c9b 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/PasswordEntropyDisplay.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -28,14 +26,12 @@ Clipperz.Base.module('Clipperz.PM.UI.Common.Components');
Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay = function(anElement, args) {
args = args || {};
-//MochiKit.Logging.logDebug(">>> new TextFormField");
Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay.superclass.constructor.call(this, anElement, args);
this._wrapperElement = null;
this._entropyElement = null;
this.render();
-//MochiKit.Logging.logDebug("<<< new TextFormField");
return this;
};
@@ -110,17 +106,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.PasswordEntropyDisplay, Cl
//-----------------------------------------------------
'updateEntropyElement': function(anEvent) {
-/*
-//MochiKit.Logging.logDebug(">>> PasswordEntropyDisplay.updateEntropyElement");
- var maxExtent;
- var entropy;
-
- entropy = Math.min(128, this.computeEntropyForString(this.passwordElement().dom.value));
-//MochiKit.Logging.logDebug("--- PasswordEntropyDisplay.updateEntropyElement - entropy: " + entropy);
- this.entropyElement().setStyle('background-position', "0px " + -entropy + "px");
- this.entropyElement().setWidth(this.passwordElement().getWidth() * (entropy/128));
-//MochiKit.Logging.logDebug("<<< PasswordEntropyDisplay.updateEntropyElement");
-*/
var entropy;
entropy = Math.min(128, this.computeEntropyForString(this.passwordElement().dom.value));
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js
index 5991530..6638008 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/ProgressBar.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js
index 1d816a9..8c98811 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/SimpleMessagePanel.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -218,19 +216,15 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.SimpleMessagePanel, Clippe
// MochiKit.Signal.signal(this, 'cancelEvent');
switch (aButton['result']) {
case 'OK':
-//console.log("==> OK");
this.closeOk();
break;
case 'CANCEL':
-//console.log("==> CANCEL");
this.closeCancel();
break;
default:
-//console.log("==> ????");
this.closeError();
break;
}
-//console.log("<==");
},
//-------------------------------------------------------------------------
@@ -279,16 +273,12 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.SimpleMessagePanel, Clippe
'keyDownHandler': function (anEvent) {
if (anEvent.key().string == 'KEY_ENTER') {
anEvent.preventDefault();
-//console.log("13 - RETURN ?", this);
this.closeOk();
-//console.log('<<< 13')
}
if (anEvent.key().string == 'KEY_ESCAPE') {
anEvent.preventDefault();
-//console.log("27 - ESC ?", this);
this.closeCancel();
-//console.log("<<< 27");
}
},
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js
index 936514a..1e2a690 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TabPanelComponent.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js
index 8df7e0e..6517d2a 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/Tooltip.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -141,11 +139,8 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Tooltip, Clipperz.PM.UI.Co
this.setIsVisible(true);
elementSizeAndPosition = Clipperz.Style.getSizeAndPosition(this.element());
-//console.log("ELEMENT SIZE AND POSITION", Clipperz.Base.serializeJSON(elementSizeAndPosition));
-//console.log("BOX DIMENSIONS", Clipperz.Base.serializeJSON(this.boxDimensions()));
switch (this.position()) {
case 'ABOVE':
-//console.log("ABOVE");
// MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px');
bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2);
bodyPosition.y = elementSizeAndPosition.position.y - this.boxDimensions().h - 13;
@@ -154,7 +149,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Tooltip, Clipperz.PM.UI.Co
// arrowPosition.y = elementSizeAndPosition.position.y - 13;
break;
case 'BELOW':
-//console.log("BELOW");
// MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:36, h:13}, 'px');
bodyPosition.x = elementSizeAndPosition.position.x + (elementSizeAndPosition.dimensions.w/2 - this.boxDimensions().w/2);
bodyPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h + 13;
@@ -163,7 +157,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Tooltip, Clipperz.PM.UI.Co
// arrowPosition.y = elementSizeAndPosition.position.y + elementSizeAndPosition.dimensions.h;
break;
case 'LEFT':
-//console.log("LEFT");
// MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px');
bodyPosition.x = elementSizeAndPosition.position.x - this.boxDimensions().w - 13;
bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2);
@@ -172,7 +165,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Tooltip, Clipperz.PM.UI.Co
// arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2);
break;
case 'RIGHT':
-//console.log("RIGHT");
// MochiKit.Style.setElementDimensions(this.getId('arrow'), {w:13, h:36}, 'px');
bodyPosition.x = elementSizeAndPosition.position.x + elementSizeAndPosition.dimensions.w + 13;
bodyPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - this.boxDimensions().h/2);
@@ -181,7 +173,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Common.Components.Tooltip, Clipperz.PM.UI.Co
// arrowPosition.y = elementSizeAndPosition.position.y + (elementSizeAndPosition.dimensions.h/2 - 36/2);
break;
}
-//console.log("X: " + bodyPosition.x + ", Y: " + bodyPosition.y);
MochiKit.Style.setElementPosition(this.getId('tooltip'), bodyPosition);
// MochiKit.Style.setElementPosition(this.getId('body'), bodyPosition);
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js
index c41fc7c..ba58edd 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Components/TranslatorWidget.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js
index 5fd10f9..77d59a5 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/DirectLoginRunner.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -154,7 +152,6 @@ MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.prototy
var completeUrl;
var url;
-//console.log("runHttpAuthDirectLogin", someAttributes);
url = someAttributes['inputValues']['url'];
if (/^https?\:\/\//.test(url) == false) {
@@ -182,7 +179,6 @@ MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.prototy
'runDirectLogin': function (aWindow) {
var deferredResult;
-//console.log(">>> runDirectLogin");
deferredResult = new Clipperz.Async.Deferred("DirectLoginRunner.openDirectLogin", {trace:false});
deferredResult.addMethod(this, 'initialWindowSetup', aWindow);
deferredResult.addMethod(this.directLogin(), 'label');
@@ -193,9 +189,7 @@ MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.prototy
'formAttributes': MochiKit.Base.method(this.directLogin(), 'formAttributes'),
'inputValues': MochiKit.Base.method(this.directLogin(), 'inputValues')
});
-//deferredResult.addCallback(function (aValue) { console.log("SOME ATTRIBUTES", aValue); return aValue; });
deferredResult.addCallback(MochiKit.Base.bind(function (someAttributes) {
-//console.log("SOME ATTRIBUTES", someAttributes);
switch (someAttributes['type']) {
case 'http_auth':
this.runHttpAuthDirectLogin(aWindow, someAttributes);
@@ -209,7 +203,6 @@ MochiKit.Base.update(Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.prototy
}
}, this));
deferredResult.callback();
-//console.log("<<< runDirectLogin");
return deferredResult;
},
@@ -256,7 +249,6 @@ Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.openDirectLogin = function (
Clipperz.PM.UI.Common.Controllers.DirectLoginRunner.testDirectLogin = function (aDirectLogin) {
var runner;
-//console.log(">>>>>> TESTING DIRECT LOGIN");
runner = new Clipperz.PM.UI.Common.Controllers.DirectLoginRunner({directLogin:aDirectLogin});
return runner.test();
};
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js
index 41fe17f..52d81d4 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/ProgressBarController.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js
index 341fde9..d3e86de 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/TabPanelController.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js
index ef38bc6..c13d96a 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Common/Controllers/WizardController.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js b/frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js
index ea987cd..f0ccdfb 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Compact/MainController.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -48,7 +46,7 @@ MochiKit.Base.update(Clipperz.PM.UI.Compact.MainController.prototype, {
//-----------------------------------------------------------------------------
'run': function(shouldShowRegistrationForm) {
-MochiKit.Logging.logDebug("running " + this.toString());
+ Clipperz.logDebug("running " + this.toString());
},
//-----------------------------------------------------------------------------
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js
index 32dfa63..abf4758 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardDetail.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -58,7 +56,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardDetail, Clipperz.PM.UI
//-------------------------------------------------------------------------
'renderSelf': function () {
-console.log("CardDetail.renderSelf");
this.append(this.element(), {tag:'div', cls:'cardDetail', children:[
{tag:'div', cls:'toolbar', children:[
{tag:'a', href:'#', cls:'back', html:"List"},
@@ -155,7 +152,6 @@ console.log("CardDetail.renderSelf");
]}
]})
-console.log("ADD DIRECT LOGIN", aDirectLogin);
},
//=========================================================================
@@ -165,7 +161,6 @@ console.log("ADD DIRECT LOGIN", aDirectLogin);
// this.render();
-console.log("CardDetail.showCard", aCard);
deferredResult = new Clipperz.Async.Deferred("CardDetail.showCard", {trace:false});
deferredResult.addMethod(aCard, 'label');
deferredResult.addMethod(this, 'setTitle');
@@ -266,7 +261,6 @@ console.log("CardDetail.showCard", aCard);
var nextState;
var fieldValue;
-//console.log("TOGGLE");
anEvent.preventDefault;
fieldValue = MochiKit.Selector.findChildElements(anEvent.src().parentNode.parentNode, ['span.password'])[0];
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js
index a4aa212..a0e4879 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/CardList.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -90,7 +88,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardList, Clipperz.PM.UI.C
'favicon': MochiKit.Base.methodcaller('favicon')
};
-//console.log("someCards", someCards);
deferredResult = new Clipperz.Async.Deferred("CardList.showCards", {trace:false});
deferredResult.addCallback(MochiKit.Base.map, Clipperz.Async.collectResults("CardList.value - collectResults", cardInfo, {trace:false}));
deferredResult.addCallback(Clipperz.Async.collectAll);
@@ -102,7 +99,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardList, Clipperz.PM.UI.C
},
'appendCardToList': function (aCardListElement, aCardInfo) {
-//console.log("appendCardToList", aCardInfo);
this.append(aCardListElement, {tag:'li', cls:'cardListItem arrow', cardreference:aCardInfo['_reference'], children:[
{tag:'a', href:'#', html:aCardInfo['label'], children:[
{tag:'small', cls:'favicon', children:[{tag:'img', cls:'favicon', src:aCardInfo['favicon']}]}
@@ -121,7 +117,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.CardList, Clipperz.PM.UI.C
listElement = MochiKit.DOM.getFirstParentByTagAndClassName(anEvent.target(), tagName='li', className='cardListItem');
}
cardReference = MochiKit.DOM.getNodeAttribute(listElement, 'cardreference');
-console.log("###", listElement, cardReference);
// TODO: Notify card with reference MochiKit.DOM.getNodeAttribute(listElement, 'cardreference') has been selected
MochiKit.Signal.signal(this, 'selectedCard', cardReference);
},
@@ -171,7 +166,6 @@ console.log("###", listElement, cardReference);
var cardListReference;
cardListReference = anEvent.target().id.match(/(cardListReference_|cardListItem_)(.*)/)[2];
-//console.log("Showing detail for card named", cardListReference);
MochiKit.Signal.signal(this, 'selectedCard', cardListReference);
}
},
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js
index eafcdbc..3aeac0c 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Components/LoginForm.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -139,7 +137,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.LoginForm, Clipperz.PM.UI.
},
'showErrors': function (args) {
-//console.log("LoginForm.showErrors", args);
if (args['previousFailedAttempt'] == 'LOGIN') {
this.setErrorMessage("Wrong credentials");
} else if (args['previousFailedAttempt'] == 'PIN') {
@@ -299,7 +296,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.LoginForm, Clipperz.PM.UI.
},
'submitCredentialsHandler': function (anEvent) {
-//console.log("submitCredentialsHandler");
var credentials;
this.setMessage(null);
@@ -331,24 +327,19 @@ Clipperz.Base.extend(Clipperz.PM.UI.Mobile.Components.LoginForm, Clipperz.PM.UI.
//-------------------------------------------------------------------------
'initProgressHandle': function (anEvent) {
-//console.log("** initProgressHandle", anEvent);
this._steps = anEvent['steps'];
this._actualSteps = 0;
},
'updateProgressHandle': function (anEvent) {
-//console.log("** updateProgressHandle", anEvent);
this._steps += anEvent['extraSteps'];
},
'advanceProgressHandle': function (anEvent) {
-//console.log("** advanceProgressHandle", anEvent);
this._actualSteps ++;
-//console.log("STEPS: " + this._actualSteps + "/" + this._steps);
},
'progressDoneHandle': function (anEvent) {
-//console.log("** progressDoneHandle", anEvent);
},
//-------------------------------------------------------------------------
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js
index 12a61f7..9951f44 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Mobile/Controllers/MainController.js
@@ -1,32 +1,30 @@
/*
-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/.
*/
Clipperz.Base.module('Clipperz.PM.UI.Mobile.Controllers');
Clipperz.PM.UI.Mobile.Controllers.MainController = function() {
- this._jQTouch = null;
+// this._jQTouch = null;
this._user = null;
this._proxy = null;
this._loginForm = null;
@@ -53,7 +51,7 @@ MochiKit.Base.update(Clipperz.PM.UI.Mobile.Controllers.MainController.prototype,
},
//-------------------------------------------------------------------------
-
+/*
'jQTouch': function () {
return this._jQTouch;
},
@@ -61,12 +59,10 @@ MochiKit.Base.update(Clipperz.PM.UI.Mobile.Controllers.MainController.prototype,
'setJQTouch': function (aValue) {
this._jQTouch = aValue;
},
-
+*/
//=========================================================================
'run': function () {
- console.log("MainController.run");
-
MochiKit.Signal.connect(Clipperz.Signal.NotificationCenter, 'doLogin', MochiKit.Base.method(this, 'doLogin'));
Clipperz.DOM.Helper.overwrite(MochiKit.DOM.currentDocument().body, {tag:'div', id:'jqt', children:[
{tag:'div', id:'loginForm'},
@@ -77,13 +73,13 @@ MochiKit.Base.update(Clipperz.PM.UI.Mobile.Controllers.MainController.prototype,
this.showLoginForm();
- this.initjQTouch();
+// this.initjQTouch();
// this.showAddToHomeScreenBaloon();
// this.selectInitialProxy();
},
-
+/*
'initjQTouch': function () {
var jqt;
@@ -124,23 +120,19 @@ MochiKit.Base.update(Clipperz.PM.UI.Mobile.Controllers.MainController.prototype,
this.setJQTouch(jqt);
},
-
+*/
//=========================================================================
'showAddToHomeScreenBaloon': function () {
-console.log(">>> showAddToHomeScreenBaloon");
},
//-------------------------------------------------------------------------
'selectInitialProxy': function () {
-//console.log(">>> selectInitialProxy");
if (this.isOnline()) {
-//console.log("--- selectInitialProxy: using default proxy");
this._proxy = Clipperz.PM.Proxy.defaultProxy;
} else {
if (this.hasLocalData()) {
-//console.log("--- selectInitialProxy: using local cache proxy");
this._proxy = new Clipperz.PM.Proxy.OfflineCache({'shouldPayTolls':false});
} else {
this.showOfflineError();
@@ -167,7 +159,6 @@ console.log(">>> showAddToHomeScreenBaloon");
//.........................................................................
'handleFailedCredentialsLogin': function () {
-console.log("LOGIN FAILED");
this.showLoginForm({'previousFailedAttempt':'LOGIN'});
},
@@ -190,7 +181,6 @@ console.log("LOGIN FAILED");
var user;
var getPassphraseDelegate;
-//console.log(">>> MainController.doLogin", someArgs);
credentials = someArgs['credentials'];
errorCallback = someArgs['errorCallback'] || MochiKit.Base.noop;
@@ -232,7 +222,6 @@ console.log("LOGIN FAILED");
'setupApplication': function () {
var deferredResult;
-console.log(">>> setupApplication");
deferredResult = new Clipperz.Async.Deferred("MainController.setupApplication", {trace:false});
deferredResult.addMethod(this, 'welcomeFirstTimeUser');
deferredResult.addMethod(this, 'showPaymentReminder');
@@ -255,7 +244,7 @@ console.log(">>> setupApplication");
deferredResult = new Clipperz.Async.Deferred('MainController.welcomeFirstTimeUser', {trace:false});
if (this.isFirstTimeUser()) {
- deferredResult.addCallback(function () { console.log("--> welcome"); });
+ deferredResult.addCallback(function () { Clipperz.log("--> welcome"); });
}
deferredResult.callback();
@@ -274,7 +263,7 @@ console.log(">>> setupApplication");
deferredResult = new Clipperz.Async.Deferred('MainController.showPaymentReminder', {trace:false});
if (this.shouldShowPaymentReminder()) {
- deferredResult.addCallback(function () { console.log("--> payment reminder"); });
+ deferredResult.addCallback(function () { Clipperz.log("--> payment reminder"); });
}
deferredResult.callback();
@@ -293,7 +282,7 @@ console.log(">>> setupApplication");
deferredResult = new Clipperz.Async.Deferred('MainController.copyDataLocally', {trace:false});
if (this.canCopyDataLocally()) {
- deferredResult.addCallback(function () { console.log("--> copy data locally"); });
+ deferredResult.addCallback(function () { Clipperz.log("--> copy data locally"); });
}
deferredResult.callback();
@@ -306,7 +295,6 @@ console.log(">>> setupApplication");
'runApplication': function () {
var deferredResult;
-//console.log(">>> runApplication");
deferredResult = new Clipperz.Async.Deferred('MainController.runApplication', {trace:true});
deferredResult.addMethod(this.user(), 'getRecords');
deferredResult.addMethod(this, 'showCards');
@@ -362,7 +350,7 @@ console.log(">>> setupApplication");
'showCards': function (someCards) {
this.cardList().showCards(someCards);
- this.jQTouch().goTo('#cardList', 'slideleft');
+// this.jQTouch().goTo('#cardList', 'slideleft');
},
//-------------------------------------------------------------------------
@@ -380,7 +368,7 @@ console.log(">>> setupApplication");
deferredResult = new Clipperz.Async.Deferred("MainController.selectCardHandler", {trace:true});
deferredResult.addMethod(this.cardDetail(), 'render');
- deferredResult.addMethod(this.jQTouch(), 'goTo', '#cardDetail', 'slideleft');
+// deferredResult.addMethod(this.jQTouch(), 'goTo', '#cardDetail', 'slideleft');
deferredResult.addMethod(this.user(), 'getRecord', aCardReference);
deferredResult.addMethod(this.cardDetail(), 'showCard');
deferredResult.callback();
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js
index d6b0574..82c8dfd 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AccountPanel.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js
index 3b3c8b4..da5fd76 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/AppPage.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js
index 1835ca9..4cfca32 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/BookmarkletComponent.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js
index af33d85..8bb64f5 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogComponent.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -682,7 +680,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogComponent, Clipperz
},
'showError': function (anError) {
-//console.log(">>> showError", anError);
MochiKit.Style.hideElement(this.getId('progress'));
this.getElement('errorMessage').innerHTML = Clipperz.PM.Strings.errorDescriptionForException(anError['message']);
MochiKit.Style.showElement(this.getId('error'));
@@ -762,7 +759,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogComponent, Clipperz
//-------------------------------------------------------------------------
'handleKeyEvent': function (anEvent) {
-//console.log("####", anEvent.key().string);
if (anEvent.key().string == 'KEY_ESCAPE') {
MochiKit.Signal.signal(this, 'changedValue');
this.cancel();
@@ -798,8 +794,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogComponent, Clipperz
'onOkCloseToElement': null, // this.getElement('cancelButton'),
'onCancelCloseToElement': this.getElement('cancelButton')
});
-// deferredResult.addCallback(function () { console.log("DELETE: " + anObject.toString(), anObject); });
-// deferredResult.addErrbackPass(function () { console.log("skip deletion: " + anObject.toString(), anObject); });
deferredResult.callback();
return deferredResult;
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js
index 2e61f5f..0cee650 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordDirectLoginComponent.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -55,7 +53,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginCo
//-------------------------------------------------------------------------
'renderSelf': function() {
-//console.log(">>> CardDialogRecordDirectLoginComponent.renderSelf");
this.append(this.element(), [
{tag:'div', cls:'cardDialogRecordDirectLoginComponent_favicon', children:[
{tag:'img', cls:'favicon', id:this.getId('favicon')}
@@ -117,7 +114,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginCo
'faviconComponent': function () {
if (this._faviconComponent == null) {
-//console.log("created the FAVICON component");
this._faviconComponent = new Clipperz.PM.UI.Common.Components.FaviconComponent({element:this.getId('favicon')});
}
@@ -160,7 +156,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginCo
anEvent.preventDefault();
MochiKit.Signal.signal(this, 'editDirectLogin', this.reference());
-//console.log("EDIT DIRECT LOGIN");
},
//-------------------------------------------------------------------------
@@ -169,7 +164,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordDirectLoginCo
anEvent.preventDefault();
MochiKit.Signal.signal(this, 'deleteDirectLogin', this.reference());
-//console.log("DELETE DIRECT LOGIN");
},
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js
index b58062c..689406a 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CardDialogRecordFieldComponent.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -169,8 +167,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.CardDialogRecordFieldComponen
'handleActionLink': function (anEvent) {
anEvent.preventDefault();
-
-//console.log("ACTION LINK - " + this.actionType());
MochiKit.Signal.signal(this, 'performAction', this.reference(), anEvent.target());
},
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js
index 391c379..41e32a0 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ColumnManager.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js
index d3aa175..3d0ba76 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/CreateNewCardSplashComponent.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js
index 462d864..23f6710 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DataPanel.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js
index ea55ba4..b305045 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DateColumnManager.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js
index fe59494..6efe4c6 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DeleteObjectColumnManager.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js
index a1f0f9f..2dad703 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginColumnManager.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js
index 1a76b0c..f5f99d4 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingBindingComponent.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js
index 5114b1d..55d2c01 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingComponent.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -105,7 +103,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingComponent,
},
'setLabel': function (aValue) {
-//console.log("##> LABEL: " + aValue);
this.getElement('label').value = (aValue ? aValue : '');
},
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js
index fa57233..58b5b26 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginEditingFormValueComponent.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -93,9 +91,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueCo
//=========================================================================
'renderSelf': function() {
-//console.log(">>> DirectLoginEditingFormValueComponent.renderSelf");
-//console.log("FIELD OPTIONS", this.fieldOptions());
-//console.log("OPTION VALUES", this.optionValues());
this.append(this.element(), {tag:'div', id:this.getId('div'), cls:'formValue', children:[
{tag:'span', cls:'formFieldName', html:this.formFieldName()},
{tag:'div', id:this.getId('values')}
@@ -141,13 +136,11 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.DirectLoginEditingFormValueCo
} else {
WTF = TODO;
}
-//console.log("<<< DirectLoginEditingFormValueComponent.renderSelf");
},
//=========================================================================
'handleSelectChange': function (anEvent) {
-//console.log("handleSelectChange", anEvent, anEvent.src(), anEvent.src().value);
var options;
options = {};
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js
index d8dc941..b4fc24e 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/DirectLoginsColumnManager.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js
index 6297002..bdb044a 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/FaviconColumnManager.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js
index 51d55f4..21dddc9 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/GridComponent.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -125,13 +123,11 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.GridComponent, Clipperz.PM.UI
//-------------------------------------------------------------------------
'startSearch': function () {
-//console.log("--> startSearch");
MochiKit.DOM.addElementClass(this.getElement('search'), 'running');
},
'endSearch': function () {
MochiKit.DOM.removeElementClass(this.getElement('search'), 'running');
-//console.log("<-- startSearch");
},
//-------------------------------------------------------------------------
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js
index 3e03fcf..d1d9d7f 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ImageColumnManager.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js
index f3f9cd5..69f735b 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LinkColumnManager.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js
index a10ba4f..38a9421 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginForm.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js
index 2894af8..3498e3f 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginPage.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js
index 26506e7..3fef6c5 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/LoginProgress.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -66,7 +64,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.LoginProgress, Clipperz.PM.UI
// loginProgressElement = this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress'}, true);
// }
-//console.log(">> LoginProgress.renderSelf", this.element());
this.append(this.element(), {tag:'div', id:'loginProgress', cls:'LoginProgress', children: [
// this.append(loginProgressElement, [
{tag:'div', cls:'header', children:[
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js
index feb16ad..06746d1 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/NewUserCreationComponent.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -123,8 +121,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.NewUserCreationComponent, Cli
//-------------------------------------------------------------------------
'renderSelf': function() {
-//console.log('** Clipperz.targetModalDimensionsAndPosition', Clipperz.Base.serializeJSON(Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition));
-
this.append(this.element(), {tag:'div', cls:'NewUserCreation mainDialog', id:this.getId('panel'), children: [
{tag:'form', id:this.getId('form'), cls:'newUserCreationForm', children:[
{tag:'div', cls:'header', children:[
@@ -333,10 +329,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.NewUserCreationComponent, Cli
// MochiKit.Style.getElementDimensions(this.element())['h'];
// result = MochiKit.Style.getElementPosition(this.getElement('footer'))['y'];
-//console.log("### bottomMargin");
-//console.log('displayElement', this.displayElement());
-//console.log('-- Clipperz.targetModalDimensionsAndPosition', Clipperz.Base.serializeJSON(Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition));
-//console.log('element', MochiKit.Style.getElementPosition('modalDialog') ['y'], MochiKit.Style.getElementDimensions('modalDialog')['h']);
// result = 450;
result = Clipperz.PM.UI.Common.Components.BaseComponent.targetModalDimensionsAndPosition['position']['y'] +
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js
index 3cc5a37..30cbeb2 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/Page.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js
index dcf506f..df3ca0c 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageFooter.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js
index b8f3b05..5e49fb5 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PageHeader.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js
index 987e51e..5eb0c1f 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/PasswordTooltip.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js
index 69c1ede..ad8d677 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/RulerComponent.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -112,7 +110,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.RulerComponent, Clipperz.PM.U
]}
]}
]));
-//console.log("ELEMENT", this.element());
MochiKit.Signal.connect(this.getElement('exit'), 'onclick', this, 'handleExit');
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js
index 666afe9..edcdb62 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TabSidePanel.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js
index 3dc9ce9..9b1796a 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/TextColumnManager.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js
index 0fa369f..034ed91 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/ToolsPanel.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js
index 21ccf2a..fe46729 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UnlockPasswordComponent.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -160,7 +158,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UnlockPasswordComponent, Clip
},
'userLoginFailedHandler': function (anEvent) {
-//console.log("############### FAILED LOGIN ################");
this.showFailure();
},
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js
index d699dc6..fbf58e0 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Components/UserInfoBox.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -76,7 +74,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UserInfoBox, Clipperz.PM.UI.C
var deferredResult;
var shouldLock;
-//console.log(">>> UserInfoBox.toggleLock [locked: " + this.isLocked() + "]");
anEvent.preventDefault();
this.lockTooltip().hide();
@@ -98,7 +95,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UserInfoBox, Clipperz.PM.UI.C
MochiKit.Base.partial(MochiKit.Signal.signal, this, 'unlock')
], {trace:false});
}
-//console.log("<<< UserInfoBox.toggleLock");
return deferredResult;
},
@@ -133,7 +129,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UserInfoBox, Clipperz.PM.UI.C
return deferredResult;
*/
-//console.log(">>> UserInfoBox.askForPassphrase");
unlockPasswordComponent = new Clipperz.PM.UI.Web.Components.UnlockPasswordComponent({
'title': "Unlock account",
'text': "Insert the passprase to unlock the account",
@@ -146,7 +141,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Components.UserInfoBox, Clipperz.PM.UI.C
'onOkCloseToElement': null,
'onCancelCloseToElement': this.getId('lock')
});
-//console.log("<<< UserInfoBox.askForPassphrase");
return unlockPasswordComponent.getPassphrase();
},
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js
index 1ab2e69..3d9d6d3 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/AppController.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -324,7 +322,6 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.AppController.prototype, {
},
'handleDownloadOfflineCopy': function (anEvent) {
-console.log("AppController.handleDownloadOfflineCopy");
var downloadHref;
downloadHref = window.location.href.replace(/\/[^\/]*$/,'') + Clipperz_dumpUrl;
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js
index effde31..b1ff81f 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardDialogController.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -374,7 +372,6 @@ Clipperz.Base.extend(Clipperz.PM.UI.Web.Controllers.CardDialogController, Object
//-------------------------------------------------------------------------
'handlePerformFieldAction': function (aFieldID, aTargetElement) {
-//console.log("### targetElement", aTargetElement);
return Clipperz.Async.callbacks("CardDialogController.handleDeleteField", [
MochiKit.Base.method(this.record(), 'fields'),
MochiKit.Base.itemgetter(aFieldID),
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js
index f58f0b8..68b5b9f 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/CardsController.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js
index c025a51..92ed6e3 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginWizardController.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -163,7 +161,6 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController.
},
'setOriginalBindings': function (aValue) {
-//console.log("BINDINGS", aValue);
this._originalBindings = aValue;
},
@@ -407,8 +404,6 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.DirectLoginWizardController.
MochiKit.Base.method(this.directLoginEditingComponent(), 'bindingComponents'),
// MochiKit.Base.partial(MochiKit.Base.map, MochiKit.Base.bind(function (aBindingComponent) {
Clipperz.Async.forEach(MochiKit.Base.bind(function (aBindingComponent) {
-//console.log("aBindingComponent", aBindingComponent);
-// this.directLogin().
return Clipperz.Async.callbacks("DirectLoginWizardController.done - update directLogin bindings", [
MochiKit.Base.method(this.directLogin(), 'bindings'),
MochiKit.Base.itemgetter(aBindingComponent.formFieldName()),
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js
index 6ca3be4..7ab512a 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/DirectLoginsController.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js
index bfc093a..de59ec3 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/FilterController.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js
index 8bb3016..44fbdef 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/GridController.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js
index a57152d..ac85d36 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/LoginController.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -212,13 +210,12 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.LoginController.prototype, {
'handleFailedLogin': function(aLoginProgress, anError) {
var result;
-//console.log("anError", anError);
if (anError instanceof MochiKit.Async.CancelledError) {
result = anError;
} else {
var deferredResult;
-MochiKit.Logging.logError("## MainController - FAILED LOGIN: " + anError);
+Clipperz.logError("## MainController - FAILED LOGIN: " + anError);
deferredResult = new MochiKit.Async.Deferred();
aLoginProgress.showErrorMessage("failed login");
@@ -237,8 +234,7 @@ MochiKit.Logging.logError("## MainController - FAILED LOGIN: " + anError);
if (anError instanceof MochiKit.Async.CancelledError) {
result = anError;
} else {
-MochiKit.Logging.logError("## MainController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack);
-//console.log(anError);
+Clipperz.logError("## MainController - GENERIC ERROR" + "\n" + "==>> " + anError + " <<==\n" + anError.stack);
result = new MochiKit.Async.CancelledError(anError);
}
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js
index c83e3c0..9194125 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/MainController.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -175,14 +173,8 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.MainController.prototype, {
//-------------------------------------------------------------------------
'loginControllerUserLoggedInCallback': function(anEvent) {
-//Clipperz.log(">>> loginControllerUserLoggedInCallback", anEvent);
-// this.setUser(anEvent.parameters()['user']);
-//console.log("--- loginControllerUserLoggedInCallback - 1");
-
-//console.log("--- loginControllerUserLoggedInCallback - 2");
this.headerComponent().switchToLoggedMode();
this.appController().run({slot:this.pageComponent().slotNamed('body'), user:anEvent['user']});
-//Clipperz.log("<<< loginControllerUserLoggedInCallback");
},
//-----------------------------------------------------------------------------
diff --git a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js
index 7db6888..b70aa17 100644
--- a/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js
+++ b/frontend/gamma/js/Clipperz/PM/UI/Web/Controllers/NewUserWizardController.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -72,7 +70,6 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prot
},
'setUserCreationState': function (aValue) {
-//console.log("+++ NewUserWizardController.setUserCreationState", aValue);
this._userCreationState = aValue;
this.checkState();
},
@@ -222,8 +219,6 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prot
case 'TERMS_OF_SERVICE':
this.newUserCreationComponent().enableTermsOfServicePanel();
-//console.log("awareOfUnrecoverablePassphrase", this.newUserCreationComponent().awareOfUnrecoverablePassphrase());
-//console.log("readTermsOfService", this.newUserCreationComponent().readTermsOfService());
enableNext = (
(this.newUserCreationComponent().awareOfUnrecoverablePassphrase() == 'on')
&&
@@ -231,7 +226,6 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prot
)
break;
case 'CREATE_USER':
-//console.log(">>> CREATE_USER", this.userCreationState());
this.newUserCreationComponent().enableCreateUserPanel();
switch (this.userCreationState()) {
@@ -337,7 +331,6 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prot
afterMoveAction = MochiKit.Base.noop;
-//console.log("<-- backward", this.currentStep());
switch(this.currentStep()) {
case 'CREDENTIALS':
case 'CHECK_CREDENTIALS':
@@ -406,7 +399,6 @@ MochiKit.Base.update(Clipperz.PM.UI.Web.Controllers.NewUserWizardController.prot
//-------------------------------------------------------------------------
'handleNewUserCreationComponentKeyPressed': function (anEvent) {
-//console.log(">>> handleNewUserCreationComponentKeyPressed", anEvent.key().string);
if (anEvent.key().string == 'KEY_ENTER') {
if (anEvent.target().nodeName != 'TEXTAREA') {
anEvent.preventDefault();
diff --git a/frontend/gamma/js/Clipperz/Set.js b/frontend/gamma/js/Clipperz/Set.js
index 7023888..b3831a4 100644
--- a/frontend/gamma/js/Clipperz/Set.js
+++ b/frontend/gamma/js/Clipperz/Set.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/Signal.js b/frontend/gamma/js/Clipperz/Signal.js
index ca3e322..f9b74c9 100644
--- a/frontend/gamma/js/Clipperz/Signal.js
+++ b/frontend/gamma/js/Clipperz/Signal.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/Style.js b/frontend/gamma/js/Clipperz/Style.js
index d377893..acbe71b 100644
--- a/frontend/gamma/js/Clipperz/Style.js
+++ b/frontend/gamma/js/Clipperz/Style.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/Visual.js b/frontend/gamma/js/Clipperz/Visual.js
index c2da3b7..93ed725 100644
--- a/frontend/gamma/js/Clipperz/Visual.js
+++ b/frontend/gamma/js/Clipperz/Visual.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/YUI/DomHelper.js b/frontend/gamma/js/Clipperz/YUI/DomHelper.js
index 87c74f5..0a1f9fe 100644
--- a/frontend/gamma/js/Clipperz/YUI/DomHelper.js
+++ b/frontend/gamma/js/Clipperz/YUI/DomHelper.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
@@ -440,18 +438,13 @@ Clipperz.YUI.DomHelper.Template.prototype = {
var sanitizedValues;
var key;
-// sanitizedValues = MochiKit.Base.map(sanitizedValues)
-//console.log("values", values);
sanitizedValues = {};
for (key in values) {
sanitizedValues[key] = Clipperz.Base.sanitizeString(values[key]);
}
-//console.log("sanitizedValues", sanitizedValues);
-// el = el.dom ? el.dom : YAHOO.util.Dom.get(el);
el = (typeof el == 'string') ? YAHOO.util.Dom.get(el) : el;
-//Clipperz.log(this.applyTemplate(sanitizedValues));
var newNode = Clipperz.YUI.DomHelper.insertHtml('beforeEnd', el, this.applyTemplate(sanitizedValues));
-// return returnElement ? YAHOO.Element.get(newNode, true) : newNode;
+
return newNode;
},
diff --git a/frontend/gamma/js/Clipperz/YUI/DomQuery.js b/frontend/gamma/js/Clipperz/YUI/DomQuery.js
index 76d0fae..c1af0ca 100644
--- a/frontend/gamma/js/Clipperz/YUI/DomQuery.js
+++ b/frontend/gamma/js/Clipperz/YUI/DomQuery.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/Clipperz/YUI/Utils.js b/frontend/gamma/js/Clipperz/YUI/Utils.js
index e9929fc..4def842 100644
--- a/frontend/gamma/js/Clipperz/YUI/Utils.js
+++ b/frontend/gamma/js/Clipperz/YUI/Utils.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/ClipperzCryptoLibrary/AES.js b/frontend/gamma/js/ClipperzCryptoLibrary/AES.js
new file mode 100644
index 0000000..cbbbb13
--- a/dev/null
+++ b/frontend/gamma/js/ClipperzCryptoLibrary/AES.js
@@ -0,0 +1,864 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
+ throw "Clipperz.Crypto.AES depends on Clipperz.ByteArray!";
+}
+
+// Dependency commented to avoid a circular reference
+//try { if (typeof(Clipperz.Crypto.PRNG) == 'undefined') { throw ""; }} catch (e) {
+// throw "Clipperz.Crypto.AES depends on Clipperz.Crypto.PRNG!";
+//}
+
+if (typeof(Clipperz.Crypto.AES) == 'undefined') { Clipperz.Crypto.AES = {}; }
+
+//#############################################################################
+
+Clipperz.Crypto.AES.DeferredExecutionContext = function(args) {
+ args = args || {};
+
+ this._key = args.key;
+ this._message = args.message;
+ this._result = args.message.clone();
+ this._nonce = args.nonce;
+ this._messageLength = this._message.length();
+
+ this._messageArray = this._message.arrayValues();
+ this._resultArray = this._result.arrayValues();
+ this._nonceArray = this._nonce.arrayValues();
+
+ this._executionStep = 0;
+
+// this._elaborationChunkSize = 1024; // 4096; // 16384; // 4096;
+ this._elaborationChunks = 10;
+ this._pauseTime = 0.02; // 0.02 // 0.2;
+
+ return this;
+}
+
+Clipperz.Crypto.AES.DeferredExecutionContext.prototype = MochiKit.Base.update(null, {
+
+ 'key': function() {
+ return this._key;
+ },
+
+ 'message': function() {
+ return this._message;
+ },
+
+ 'messageLength': function() {
+ return this._messageLength;
+ },
+
+ 'result': function() {
+ return new Clipperz.ByteArray(this.resultArray());
+ },
+
+ 'nonce': function() {
+ return this._nonce;
+ },
+
+ 'messageArray': function() {
+ return this._messageArray;
+ },
+
+ 'resultArray': function() {
+ return this._resultArray;
+ },
+
+ 'nonceArray': function() {
+ return this._nonceArray;
+ },
+
+ 'elaborationChunkSize': function() {
+// return Clipperz.Crypto.AES.DeferredExecution.chunkSize;
+// return this._elaborationChunkSize;
+ return (this._elaborationChunks * 1024);
+ },
+
+ 'executionStep': function() {
+ return this._executionStep;
+ },
+
+ 'setExecutionStep': function(aValue) {
+ this._executionStep = aValue;
+ },
+
+ 'tuneExecutionParameters': function (anElapsedTime) {
+//var originalChunks = this._elaborationChunks;
+ if (anElapsedTime > 0) {
+ this._elaborationChunks = Math.round(this._elaborationChunks * ((anElapsedTime + 1000)/(anElapsedTime * 2)));
+ }
+//Clipperz.log("tuneExecutionParameters - elapsedTime: " + anElapsedTime + /*originalChunks,*/ " chunks # " + this._elaborationChunks + " [" + this._executionStep + " / " + this._messageLength + "]");
+ },
+
+ 'pause': function(aValue) {
+// return MochiKit.Async.wait(Clipperz.Crypto.AES.DeferredExecution.pauseTime, aValue);
+ return MochiKit.Async.wait(this._pauseTime, aValue);
+ },
+
+ 'isDone': function () {
+//console.log("isDone", this.executionStep(), this.messageLength());
+ return (this._executionStep >= this._messageLength);
+ },
+
+ //-----------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+
+});
+
+//#############################################################################
+
+Clipperz.Crypto.AES.Key = function(args) {
+ args = args || {};
+
+ this._key = args.key;
+ this._keySize = args.keySize || this.key().length();
+
+ if (this.keySize() == 128/8) {
+ this._b = 176;
+ this._numberOfRounds = 10;
+ } else if (this.keySize() == 256/8) {
+ this._b = 240;
+ this._numberOfRounds = 14;
+ } else {
+ MochiKit.Logging.logError("AES unsupported key size: " + (this.keySize() * 8) + " bits");
+ throw Clipperz.Crypto.AES.exception.UnsupportedKeySize;
+ }
+
+ this._stretchedKey = null;
+
+ return this;
+}
+
+Clipperz.Crypto.AES.Key.prototype = MochiKit.Base.update(null, {
+
+ 'asString': function() {
+ return "Clipperz.Crypto.AES.Key (" + this.key().toHexString() + ")";
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'key': function() {
+ return this._key;
+ },
+
+ 'keySize': function() {
+ return this._keySize;
+ },
+
+ 'b': function() {
+ return this._b;
+ },
+
+ 'numberOfRounds': function() {
+ return this._numberOfRounds;
+ },
+ //=========================================================================
+
+ 'keyScheduleCore': function(aWord, aRoundConstantsIndex) {
+ var result;
+ var sbox;
+
+ sbox = Clipperz.Crypto.AES.sbox();
+
+ result = [ sbox[aWord[1]] ^ Clipperz.Crypto.AES.roundConstants()[aRoundConstantsIndex],
+ sbox[aWord[2]],
+ sbox[aWord[3]],
+ sbox[aWord[0]] ];
+
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'xorWithPreviousStretchValues': function(aKey, aWord, aPreviousWordIndex) {
+ var result;
+ var i,c;
+
+ result = [];
+ c = 4;
+ for (i=0; i<c; i++) {
+ result[i] = aWord[i] ^ aKey.byteAtIndex(aPreviousWordIndex + i);
+ }
+
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'sboxShakeup': function(aWord) {
+ var result;
+ var sbox;
+ var i,c;
+
+ result = [];
+ sbox = Clipperz.Crypto.AES.sbox();
+ c =4;
+ for (i=0; i<c; i++) {
+ result[i] = sbox[aWord[i]];
+ }
+
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'stretchKey': function(aKey) {
+ var currentWord;
+ var keyLength;
+ var previousStretchIndex;
+ var i,c;
+
+ keyLength = aKey.length();
+ previousStretchIndex = keyLength - this.keySize();
+
+ currentWord = [ aKey.byteAtIndex(keyLength - 4),
+ aKey.byteAtIndex(keyLength - 3),
+ aKey.byteAtIndex(keyLength - 2),
+ aKey.byteAtIndex(keyLength - 1) ];
+ currentWord = this.keyScheduleCore(currentWord, keyLength / this.keySize());
+
+ if (this.keySize() == 256/8) {
+ c = 8;
+ } else if (this.keySize() == 128/8){
+ c = 4;
+ }
+
+ for (i=0; i<c; i++) {
+ if (i == 4) {
+ // fifth streatch word
+ currentWord = this.sboxShakeup(currentWord);
+ }
+
+ currentWord = this.xorWithPreviousStretchValues(aKey, currentWord, previousStretchIndex + (i*4));
+ aKey.appendBytes(currentWord);
+ }
+
+ return aKey;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'stretchedKey': function() {
+ if (this._stretchedKey == null) {
+ var stretchedKey;
+
+ stretchedKey = this.key().clone();
+
+ while (stretchedKey.length() < this.keySize()) {
+ stretchedKey.appendByte(0);
+ }
+
+ while (stretchedKey.length() < this.b()) {
+ stretchedKey = this.stretchKey(stretchedKey);
+ }
+
+ this._stretchedKey = stretchedKey.split(0, this.b());
+ }
+
+ return this._stretchedKey;
+ },
+
+ //=========================================================================
+ __syntaxFix__: "syntax fix"
+});
+
+//#############################################################################
+
+Clipperz.Crypto.AES.State = function(args) {
+ args = args || {};
+
+ this._data = args.block;
+ this._key = args.key;
+
+ return this;
+}
+
+Clipperz.Crypto.AES.State.prototype = MochiKit.Base.update(null, {
+
+ 'key': function() {
+ return this._key;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'data': function() {
+ return this._data;
+ },
+
+ 'setData': function(aValue) {
+ this._data = aValue;
+ },
+
+ //=========================================================================
+
+ 'addRoundKey': function(aRoundNumber) {
+ // each byte of the state is combined with the round key; each round key is derived from the cipher key using a key schedule.
+ var data;
+ var stretchedKey;
+ var firstStretchedKeyIndex;
+ var i,c;
+
+ data = this.data();
+ stretchedKey = this.key().stretchedKey();
+ firstStretchedKeyIndex = aRoundNumber * (128/8);
+ c = 128/8;
+ for (i=0; i<c; i++) {
+ data[i] = data[i] ^ stretchedKey.byteAtIndex(firstStretchedKeyIndex + i);
+ }
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'subBytes': function() {
+ // a non-linear substitution step where each byte is replaced with another according to a lookup table.
+ var i,c;
+ var data;
+ var sbox;
+
+ data = this.data();
+ sbox = Clipperz.Crypto.AES.sbox();
+
+ c = 16;
+ for (i=0; i<c; i++) {
+ data[i] = sbox[data[i]];
+ }
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'shiftRows': function() {
+ // a transposition step where each row of the state is shifted cyclically a certain number of steps.
+ var newValue;
+ var data;
+ var shiftMapping;
+ var i,c;
+
+ newValue = new Array(16);
+ data = this.data();
+ shiftMapping = Clipperz.Crypto.AES.shiftRowMapping();
+// [0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 1, 6, 11];
+ c = 16;
+ for (i=0; i<c; i++) {
+ newValue[i] = data[shiftMapping[i]];
+ }
+ for (i=0; i<c; i++) {
+ data[i] = newValue[i];
+ }
+ },
+
+ //-----------------------------------------------------------------------------
+/*
+ 'mixColumnsWithValues': function(someValues) {
+ var result;
+ var a;
+ var i,c;
+
+ c = 4;
+ result = [];
+ a = [];
+ for (i=0; i<c; i++) {
+ a[i] = [];
+ a[i][1] = someValues[i]
+ if ((a[i][1] & 0x80) == 0x80) {
+ a[i][2] = (a[i][1] << 1) ^ 0x11b;
+ } else {
+ a[i][2] = a[i][1] << 1;
+ }
+
+ a[i][3] = a[i][2] ^ a[i][1];
+ }
+
+ for (i=0; i<c; i++) {
+ var x;
+
+ x = Clipperz.Crypto.AES.mixColumnsMatrix()[i];
+ result[i] = a[0][x[0]] ^ a[1][x[1]] ^ a[2][x[2]] ^ a[3][x[3]];
+ }
+
+ return result;
+ },
+
+ 'mixColumns': function() {
+ // a mixing operation which operates on the columns of the state, combining the four bytes in each column using a linear transformation.
+ var data;
+ var i, c;
+
+ data = this.data();
+ c = 4;
+ for(i=0; i<c; i++) {
+ var blockIndex;
+ var mixedValues;
+
+ blockIndex = i * 4;
+ mixedValues = this.mixColumnsWithValues([ data[blockIndex + 0],
+ data[blockIndex + 1],
+ data[blockIndex + 2],
+ data[blockIndex + 3]]);
+ data[blockIndex + 0] = mixedValues[0];
+ data[blockIndex + 1] = mixedValues[1];
+ data[blockIndex + 2] = mixedValues[2];
+ data[blockIndex + 3] = mixedValues[3];
+ }
+ },
+*/
+
+ 'mixColumns': function() {
+ // a mixing operation which operates on the columns of the state, combining the four bytes in each column using a linear transformation.
+ var data;
+ var i, c;
+ var a_1;
+ var a_2;
+
+ a_1 = new Array(4);
+ a_2 = new Array(4);
+
+ data = this.data();
+ c = 4;
+ for(i=0; i<c; i++) {
+ var blockIndex;
+ var ii, cc;
+
+ blockIndex = i * 4;
+
+ cc = 4;
+ for (ii=0; ii<cc; ii++) {
+ var value;
+
+ value = data[blockIndex + ii];
+ a_1[ii] = value;
+ a_2[ii] = (value & 0x80) ? ((value << 1) ^ 0x011b) : (value << 1);
+ }
+
+ data[blockIndex + 0] = a_2[0] ^ a_1[1] ^ a_2[1] ^ a_1[2] ^ a_1[3];
+ data[blockIndex + 1] = a_1[0] ^ a_2[1] ^ a_1[2] ^ a_2[2] ^ a_1[3];
+ data[blockIndex + 2] = a_1[0] ^ a_1[1] ^ a_2[2] ^ a_1[3] ^ a_2[3];
+ data[blockIndex + 3] = a_1[0] ^ a_2[0] ^ a_1[1] ^ a_1[2] ^ a_2[3];
+ }
+ },
+
+ //=========================================================================
+
+ 'spinRound': function(aRoundNumber) {
+ this.addRoundKey(aRoundNumber);
+ this.subBytes();
+ this.shiftRows();
+ this.mixColumns();
+ },
+
+ 'spinLastRound': function() {
+ this.addRoundKey(this.key().numberOfRounds() - 1);
+ this.subBytes();
+ this.shiftRows();
+ this.addRoundKey(this.key().numberOfRounds());
+ },
+
+ //=========================================================================
+
+ 'encrypt': function() {
+ var i,c;
+
+ c = this.key().numberOfRounds() - 1;
+ for (i=0; i<c; i++) {
+ this.spinRound(i);
+ }
+
+ this.spinLastRound();
+ },
+
+ //=========================================================================
+ __syntaxFix__: "syntax fix"
+});
+
+//#############################################################################
+
+Clipperz.Crypto.AES.VERSION = "0.1";
+Clipperz.Crypto.AES.NAME = "Clipperz.Crypto.AES";
+
+MochiKit.Base.update(Clipperz.Crypto.AES, {
+
+// http://www.cs.eku.edu/faculty/styer/460/Encrypt/JS-AES.html
+// http://en.wikipedia.org/wiki/Advanced_Encryption_Standard
+// http://en.wikipedia.org/wiki/Rijndael_key_schedule
+// http://en.wikipedia.org/wiki/Rijndael_S-box
+
+ '__repr__': function () {
+ return "[" + this.NAME + " " + this.VERSION + "]";
+ },
+
+ 'toString': function () {
+ return this.__repr__();
+ },
+
+ //=============================================================================
+
+ '_sbox': null,
+ 'sbox': function() {
+ if (Clipperz.Crypto.AES._sbox == null) {
+ Clipperz.Crypto.AES._sbox = [
+0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
+0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
+0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
+0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
+0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
+0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
+0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
+0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
+0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
+0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
+0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
+0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
+0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
+0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
+0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
+0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
+ ];
+ }
+
+ return Clipperz.Crypto.AES._sbox;
+ },
+
+ //-----------------------------------------------------------------------------
+ //
+ // 0 4 8 12 0 4 8 12
+ // 1 5 9 13 => 5 9 13 1
+ // 2 6 10 14 10 14 2 6
+ // 3 7 11 15 15 3 7 11
+ //
+ '_shiftRowMapping': null,
+ 'shiftRowMapping': function() {
+ if (Clipperz.Crypto.AES._shiftRowMapping == null) {
+ Clipperz.Crypto.AES._shiftRowMapping = [0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 1, 6, 11];
+ }
+
+ return Clipperz.Crypto.AES._shiftRowMapping;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ '_mixColumnsMatrix': null,
+ 'mixColumnsMatrix': function() {
+ if (Clipperz.Crypto.AES._mixColumnsMatrix == null) {
+ Clipperz.Crypto.AES._mixColumnsMatrix = [ [2, 3, 1 ,1],
+ [1, 2, 3, 1],
+ [1, 1, 2, 3],
+ [3, 1, 1, 2] ];
+ }
+
+ return Clipperz.Crypto.AES._mixColumnsMatrix;
+ },
+
+ '_roundConstants': null,
+ 'roundConstants': function() {
+ if (Clipperz.Crypto.AES._roundConstants == null) {
+ Clipperz.Crypto.AES._roundConstants = [ , 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154];
+// Clipperz.Crypto.AES._roundConstants = [ , 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a];
+ }
+
+ return Clipperz.Crypto.AES._roundConstants;
+ },
+
+ //=============================================================================
+
+ 'incrementNonce': function(aNonce) {
+//Clipperz.Profile.start("Clipperz.Crypto.AES.incrementNonce");
+ var i;
+ var done;
+
+ done = false;
+ i = aNonce.length - 1;
+
+ while ((i>=0) && (done == false)) {
+ var currentByteValue;
+
+ currentByteValue = aNonce[i];
+
+ if (currentByteValue == 0xff) {
+ aNonce[i] = 0;
+ if (i>= 0) {
+ i --;
+ } else {
+ done = true;
+ }
+ } else {
+ aNonce[i] = currentByteValue + 1;
+ done = true;
+ }
+ }
+//Clipperz.Profile.stop("Clipperz.Crypto.AES.incrementNonce");
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'encryptBlock': function(aKey, aBlock) {
+ var result;
+ var state;
+
+ state = new Clipperz.Crypto.AES.State({block:aBlock, key:aKey});
+//is(state.data(), 'before');
+ state.encrypt();
+ result = state.data();
+
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'encryptBlocks': function(aKey, aMessage, aNonce) {
+ var result;
+ var nonce;
+ var self;
+ var messageIndex;
+ var messageLength;
+ var blockSize;
+
+ self = Clipperz.Crypto.AES;
+ blockSize = 128/8;
+ messageLength = aMessage.length;
+ nonce = aNonce;
+
+ result = aMessage;
+ messageIndex = 0;
+ while (messageIndex < messageLength) {
+ var encryptedBlock;
+ var i,c;
+
+ self.incrementNonce(nonce);
+ encryptedBlock = self.encryptBlock(aKey, nonce);
+
+ if ((messageLength - messageIndex) > blockSize) {
+ c = blockSize;
+ } else {
+ c = messageLength - messageIndex;
+ }
+
+ for (i=0; i<c; i++) {
+ result[messageIndex + i] = result[messageIndex + i] ^ encryptedBlock[i];
+ }
+
+ messageIndex += blockSize;
+ }
+
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'encrypt': function(aKey, someData, aNonce) {
+ var result;
+ var nonce;
+ var encryptedData;
+ var key;
+
+ key = new Clipperz.Crypto.AES.Key({key:aKey});
+ nonce = aNonce ? aNonce.clone() : Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(128/8);
+
+ encryptedData = Clipperz.Crypto.AES.encryptBlocks(key, someData.arrayValues(), nonce.arrayValues());
+
+ result = nonce.appendBytes(encryptedData);
+
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'decrypt': function(aKey, someData) {
+ var result;
+ var nonce;
+ var encryptedData;
+ var decryptedData;
+ var dataIterator;
+ var key;
+
+ key = new Clipperz.Crypto.AES.Key({key:aKey});
+
+ encryptedData = someData.arrayValues();
+ nonce = encryptedData.slice(0, (128/8));
+ encryptedData = encryptedData.slice(128/8);
+ decryptedData = Clipperz.Crypto.AES.encryptBlocks(key, encryptedData, nonce);
+
+ result = new Clipperz.ByteArray(decryptedData);
+
+ return result;
+ },
+
+ //=============================================================================
+
+ 'deferredEncryptExecutionChunk': function(anExecutionContext) {
+ var result;
+ var nonce;
+ var self;
+ var messageIndex;
+ var messageLength;
+ var blockSize;
+ var executionLimit;
+ var startTime, endTime;
+
+ self = Clipperz.Crypto.AES;
+ startTime = new Date();
+ blockSize = 128/8;
+ messageLength = anExecutionContext.messageArray().length;
+ nonce = anExecutionContext.nonceArray();
+ result = anExecutionContext.resultArray();
+
+ messageIndex = anExecutionContext.executionStep();
+ executionLimit = messageIndex + anExecutionContext.elaborationChunkSize();
+ executionLimit = Math.min(executionLimit, messageLength);
+
+ while (messageIndex < executionLimit) {
+ var encryptedBlock;
+ var i,c;
+
+ self.incrementNonce(nonce);
+ encryptedBlock = self.encryptBlock(anExecutionContext.key(), nonce);
+
+ if ((executionLimit - messageIndex) > blockSize) {
+ c = blockSize;
+ } else {
+ c = executionLimit - messageIndex;
+ }
+
+ for (i=0; i<c; i++) {
+ result[messageIndex + i] = result[messageIndex + i] ^ encryptedBlock[i];
+ }
+
+ messageIndex += blockSize;
+ }
+ anExecutionContext.setExecutionStep(messageIndex);
+ endTime = new Date();
+ anExecutionContext.tuneExecutionParameters(endTime - startTime);
+
+ return anExecutionContext;
+ },
+
+ //-----------------------------------------------------------------------------
+/*
+ 'deferredEncryptBlocks': function(anExecutionContext) {
+ var deferredResult;
+ var messageSize;
+ var i,c;
+
+ messageSize = anExecutionContext.messageLength();
+
+ deferredResult = new Clipperz.Async.Deferred("AES.deferredEncryptBloks");
+
+ c = Math.ceil(messageSize / anExecutionContext.elaborationChunkSize());
+ for (i=0; i<c; i++) {
+ deferredResult.addCallback(Clipperz.Crypto.AES.deferredEncryptExecutionChunk);
+ deferredResult.addMethod(anExecutionContext, 'pause');
+ }
+
+ deferredResult.callback(anExecutionContext);
+
+ return deferredResult;
+ },
+*/
+
+ 'deferredEncryptBlocks': function(anExecutionContext) {
+ var deferredResult;
+
+ if (! anExecutionContext.isDone()) {
+ deferredResult = Clipperz.Async.callbacks("Clipperz.Crypto.AES.deferredEncryptBloks", [
+ Clipperz.Crypto.AES.deferredEncryptExecutionChunk,
+ MochiKit.Base.method(anExecutionContext, 'pause'),
+ Clipperz.Crypto.AES.deferredEncryptBlocks
+ ], {trace:false}, anExecutionContext);
+ } else {
+ deferredResult = MochiKit.Async.succeed(anExecutionContext);
+ }
+
+ return deferredResult;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'deferredEncrypt': function(aKey, someData, aNonce) {
+ var deferredResult;
+ var executionContext;
+ var result;
+ var nonce;
+ var key;
+
+ key = new Clipperz.Crypto.AES.Key({key:aKey});
+ nonce = aNonce ? aNonce.clone() : Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(128/8);
+
+ executionContext = new Clipperz.Crypto.AES.DeferredExecutionContext({key:key, message:someData, nonce:nonce});
+
+ deferredResult = new Clipperz.Async.Deferred("AES.deferredEncrypt");
+//deferredResult.addCallback(function (aValue) { console.log(">>> deferredEncrypt"); return aValue; });
+ deferredResult.addCallback(Clipperz.Crypto.AES.deferredEncryptBlocks);
+ deferredResult.addCallback(function(anExecutionContext) {
+ var result;
+
+ result = anExecutionContext.nonce().clone();
+ result.appendBytes(anExecutionContext.resultArray());
+
+ return result;
+ });
+//deferredResult.addCallback(function (aValue) { console.log("<<< deferredEncrypt"); return aValue; });
+ deferredResult.callback(executionContext)
+
+ return deferredResult;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'deferredDecrypt': function(aKey, someData) {
+ var deferredResult
+ var nonce;
+ var message;
+ var key;
+
+ key = new Clipperz.Crypto.AES.Key({key:aKey});
+ nonce = someData.split(0, (128/8));
+ message = someData.split(128/8);
+ executionContext = new Clipperz.Crypto.AES.DeferredExecutionContext({key:key, message:message, nonce:nonce});
+
+ deferredResult = new Clipperz.Async.Deferred("AES.deferredDecrypt");
+//deferredResult.addCallback(function (aValue) { console.log(">>> deferredDecrypt"); return aValue; });
+ deferredResult.addCallback(Clipperz.Crypto.AES.deferredEncryptBlocks);
+ deferredResult.addCallback(function(anExecutionContext) {
+ return anExecutionContext.result();
+ });
+//deferredResult.addCallback(function (aValue) { console.log("<<< deferredDecrypt"); return aValue; });
+ deferredResult.callback(executionContext);
+
+ return deferredResult;
+ },
+
+ //-----------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+
+});
+
+//#############################################################################
+
+//Clipperz.Crypto.AES.DeferredExecution = {
+// 'chunkSize': 16384, // 4096, // 1024 4096 8192 16384 32768;
+// 'pauseTime': 0.02 // 0.2
+//}
+
+Clipperz.Crypto.AES.exception = {
+ 'UnsupportedKeySize': new MochiKit.Base.NamedError("Clipperz.Crypto.AES.exception.UnsupportedKeySize")
+};
diff --git a/frontend/gamma/js/ClipperzCryptoLibrary/Base.js b/frontend/gamma/js/ClipperzCryptoLibrary/Base.js
new file mode 100644
index 0000000..9acfc49
--- a/dev/null
+++ b/frontend/gamma/js/ClipperzCryptoLibrary/Base.js
@@ -0,0 +1,1847 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+try { if (typeof(Clipperz.Base) == 'undefined') { throw ""; }} catch (e) {
+ throw "Clipperz.Crypto.Base depends on Clipperz.Base!";
+}
+
+if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; }
+if (typeof(Clipperz.Crypto.Base) == 'undefined') { Clipperz.Crypto.Base = {}; }
+
+Clipperz.Crypto.Base.VERSION = "0.1";
+Clipperz.Crypto.Base.NAME = "Clipperz.Crypto.Base";
+
+//#############################################################################
+// Downloaded on March 30, 2006 from http://anmar.eu.org/projects/jssha2/files/jssha2-0.3.zip (jsSha2/sha256.js)
+//#############################################################################
+
+/* A JavaScript implementation of the Secure Hash Algorithm, SHA-256
+ * Version 0.3 Copyright Angel Marin 2003-2004 - http://anmar.eu.org/
+ * Distributed under the BSD License
+ * Some bits taken from Paul Johnston's SHA-1 implementation
+ */
+var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
+function safe_add (x, y) {
+ var lsw = (x & 0xFFFF) + (y & 0xFFFF);
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+ return (msw << 16) | (lsw & 0xFFFF);
+}
+function S (X, n) {return ( X >>> n ) | (X << (32 - n));}
+function R (X, n) {return ( X >>> n );}
+function Ch(x, y, z) {return ((x & y) ^ ((~x) & z));}
+function Maj(x, y, z) {return ((x & y) ^ (x & z) ^ (y & z));}
+function Sigma0256(x) {return (S(x, 2) ^ S(x, 13) ^ S(x, 22));}
+function Sigma1256(x) {return (S(x, 6) ^ S(x, 11) ^ S(x, 25));}
+function Gamma0256(x) {return (S(x, 7) ^ S(x, 18) ^ R(x, 3));}
+function Gamma1256(x) {return (S(x, 17) ^ S(x, 19) ^ R(x, 10));}
+function core_sha256 (m, l) {
+ var K = new Array(0x428A2F98,0x71374491,0xB5C0FBCF,0xE9B5DBA5,0x3956C25B,0x59F111F1,0x923F82A4,0xAB1C5ED5,0xD807AA98,0x12835B01,0x243185BE,0x550C7DC3,0x72BE5D74,0x80DEB1FE,0x9BDC06A7,0xC19BF174,0xE49B69C1,0xEFBE4786,0xFC19DC6,0x240CA1CC,0x2DE92C6F,0x4A7484AA,0x5CB0A9DC,0x76F988DA,0x983E5152,0xA831C66D,0xB00327C8,0xBF597FC7,0xC6E00BF3,0xD5A79147,0x6CA6351,0x14292967,0x27B70A85,0x2E1B2138,0x4D2C6DFC,0x53380D13,0x650A7354,0x766A0ABB,0x81C2C92E,0x92722C85,0xA2BFE8A1,0xA81A664B,0xC24B8B70,0xC76C51A3,0xD192E819,0xD6990624,0xF40E3585,0x106AA070,0x19A4C116,0x1E376C08,0x2748774C,0x34B0BCB5,0x391C0CB3,0x4ED8AA4A,0x5B9CCA4F,0x682E6FF3,0x748F82EE,0x78A5636F,0x84C87814,0x8CC70208,0x90BEFFFA,0xA4506CEB,0xBEF9A3F7,0xC67178F2);
+ var HASH = new Array(0x6A09E667, 0xBB67AE85, 0x3C6EF372, 0xA54FF53A, 0x510E527F, 0x9B05688C, 0x1F83D9AB, 0x5BE0CD19);
+ var W = new Array(64);
+ var a, b, c, d, e, f, g, h, i, j;
+ var T1, T2;
+ /* append padding */
+ m[l >> 5] |= 0x80 << (24 - l % 32);
+ m[((l + 64 >> 9) << 4) + 15] = l;
+ for ( var i = 0; i<m.length; i+=16 ) {
+ a = HASH[0]; b = HASH[1]; c = HASH[2]; d = HASH[3]; e = HASH[4]; f = HASH[5]; g = HASH[6]; h = HASH[7];
+ for ( var j = 0; j<64; j++) {
+ if (j < 16) W[j] = m[j + i];
+ else W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);
+ T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);
+ T2 = safe_add(Sigma0256(a), Maj(a, b, c));
+ h = g; g = f; f = e; e = safe_add(d, T1); d = c; c = b; b = a; a = safe_add(T1, T2);
+ }
+ HASH[0] = safe_add(a, HASH[0]); HASH[1] = safe_add(b, HASH[1]); HASH[2] = safe_add(c, HASH[2]); HASH[3] = safe_add(d, HASH[3]); HASH[4] = safe_add(e, HASH[4]); HASH[5] = safe_add(f, HASH[5]); HASH[6] = safe_add(g, HASH[6]); HASH[7] = safe_add(h, HASH[7]);
+ }
+ return HASH;
+}
+function str2binb (str) {
+ var bin = Array();
+ var mask = (1 << chrsz) - 1;
+ for(var i = 0; i < str.length * chrsz; i += chrsz)
+ bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i%32);
+ return bin;
+}
+function binb2hex (binarray) {
+ var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
+ var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
+ var str = "";
+ for (var i = 0; i < binarray.length * 4; i++) {
+ str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) + hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);
+ }
+ return str;
+}
+function hex_sha256(s){return binb2hex(core_sha256(str2binb(s),s.length * chrsz));}
+
+
+
+//#############################################################################
+// Downloaded on March 30, 2006 from http://www.fourmilab.ch/javascrypt/javascrypt.zip (entropy.js)
+//#############################################################################
+
+ // Entropy collection utilities
+
+ /* Start by declaring static storage and initialise
+ the entropy vector from the time we come through
+ here. */
+
+ var entropyData = new Array(); // Collected entropy data
+ var edlen = 0; // Keyboard array data length
+
+ addEntropyTime(); // Start entropy collection with page load time
+ ce(); // Roll milliseconds into initial entropy
+
+ // Add a byte to the entropy vector
+
+ function addEntropyByte(b) {
+ entropyData[edlen++] = b;
+ }
+
+ /* Capture entropy. When the user presses a key or performs
+ various other events for which we can request
+ notification, add the time in 255ths of a second to the
+ entropyData array. The name of the function is short
+ so it doesn't bloat the form object declarations in
+ which it appears in various "onXXX" events. */
+
+ function ce() {
+ addEntropyByte(Math.floor((((new Date).getMilliseconds()) * 255) / 999));
+ }
+
+ // Add a 32 bit quantity to the entropy vector
+
+ function addEntropy32(w) {
+ var i;
+
+ for (i = 0; i < 4; i++) {
+ addEntropyByte(w & 0xFF);
+ w >>= 8;
+ }
+ }
+
+ /* Add the current time and date (milliseconds since the epoch,
+ truncated to 32 bits) to the entropy vector. */
+
+ function addEntropyTime() {
+ addEntropy32((new Date()).getTime());
+ }
+
+ /* Start collection of entropy from mouse movements. The
+ argument specifies the number of entropy items to be
+ obtained from mouse motion, after which mouse motion
+ will be ignored. Note that you can re-enable mouse
+ motion collection at any time if not already underway. */
+
+ var mouseMotionCollect = 0;
+ var oldMoveHandler; // For saving and restoring mouse move handler in IE4
+
+ function mouseMotionEntropy(maxsamp) {
+ if (mouseMotionCollect <= 0) {
+ mouseMotionCollect = maxsamp;
+ if ((document.implementation.hasFeature("Events", "2.0")) &&
+ document.addEventListener) {
+ // Browser supports Document Object Model (DOM) 2 events
+ document.addEventListener("mousemove", mouseMoveEntropy, false);
+ } else {
+ if (document.attachEvent) {
+ // Internet Explorer 5 and above event model
+ document.attachEvent("onmousemove", mouseMoveEntropy);
+ } else {
+ // Internet Explorer 4 event model
+ oldMoveHandler = document.onmousemove;
+ document.onmousemove = mouseMoveEntropy;
+ }
+ }
+//dump("Mouse enable", mouseMotionCollect);
+ }
+ }
+
+ /* Collect entropy from mouse motion events. Note that
+ this is craftily coded to work with either DOM2 or Internet
+ Explorer style events. Note that we don't use every successive
+ mouse movement event. Instead, we XOR the three bytes collected
+ from the mouse and use that to determine how many subsequent
+ mouse movements we ignore before capturing the next one. */
+
+ var mouseEntropyTime = 0; // Delay counter for mouse entropy collection
+
+ function mouseMoveEntropy(e) {
+ if (!e) {
+ e = window.event; // Internet Explorer event model
+ }
+ if (mouseMotionCollect > 0) {
+ if (mouseEntropyTime-- <= 0) {
+ addEntropyByte(e.screenX & 0xFF);
+ addEntropyByte(e.screenY & 0xFF);
+ ce();
+ mouseMotionCollect--;
+ mouseEntropyTime = (entropyData[edlen - 3] ^ entropyData[edlen - 2] ^
+ entropyData[edlen - 1]) % 19;
+//dump("Mouse Move", byteArrayToHex(entropyData.slice(-3)));
+ }
+ if (mouseMotionCollect <= 0) {
+ if (document.removeEventListener) {
+ document.removeEventListener("mousemove", mouseMoveEntropy, false);
+ } else if (document.detachEvent) {
+ document.detachEvent("onmousemove", mouseMoveEntropy);
+ } else {
+ document.onmousemove = oldMoveHandler;
+ }
+//dump("Spung!", 0);
+ }
+ }
+ }
+
+ /* Compute a 32 byte key value from the entropy vector.
+ We compute the value by taking the MD5 sum of the even
+ and odd bytes respectively of the entropy vector, then
+ concatenating the two MD5 sums. */
+
+ function keyFromEntropy() {
+ var i, k = new Array(32);
+
+ if (edlen == 0) {
+ alert("Blooie! Entropy vector void at call to keyFromEntropy.");
+ }
+//dump("Entropy bytes", edlen);
+
+ md5_init();
+ for (i = 0; i < edlen; i += 2) {
+ md5_update(entropyData[i]);
+ }
+ md5_finish();
+ for (i = 0; i < 16; i++) {
+ k[i] = digestBits[i];
+ }
+
+ md5_init();
+ for (i = 1; i < edlen; i += 2) {
+ md5_update(entropyData[i]);
+ }
+ md5_finish();
+ for (i = 0; i < 16; i++) {
+ k[i + 16] = digestBits[i];
+ }
+
+//dump("keyFromEntropy", byteArrayToHex(k));
+ return k;
+ }
+
+//#############################################################################
+// Downloaded on March 30, 2006 from http://www.fourmilab.ch/javascrypt/javascrypt.zip (aesprng.js)
+//#############################################################################
+
+
+ // AES based pseudorandom number generator
+
+ /* Constructor. Called with an array of 32 byte (0-255) values
+ containing the initial seed. */
+
+ function AESprng(seed) {
+ this.key = new Array();
+ this.key = seed;
+ this.itext = hexToByteArray("9F489613248148F9C27945C6AE62EECA3E3367BB14064E4E6DC67A9F28AB3BD1");
+ this.nbytes = 0; // Bytes left in buffer
+
+ this.next = AESprng_next;
+ this.nextbits = AESprng_nextbits;
+ this.nextInt = AESprng_nextInt;
+ this.round = AESprng_round;
+
+ /* Encrypt the initial text with the seed key
+ three times, feeding the output of the encryption
+ back into the key for the next round. */
+
+ bsb = blockSizeInBits;
+ blockSizeInBits = 256;
+ var i, ct;
+ for (i = 0; i < 3; i++) {
+ this.key = rijndaelEncrypt(this.itext, this.key, "ECB");
+ }
+
+ /* Now make between one and four additional
+ key-feedback rounds, with the number determined
+ by bits from the result of the first three
+ rounds. */
+
+ var n = 1 + (this.key[3] & 2) + (this.key[9] & 1);
+ for (i = 0; i < n; i++) {
+ this.key = rijndaelEncrypt(this.itext, this.key, "ECB");
+ }
+ blockSizeInBits = bsb;
+ }
+
+ function AESprng_round() {
+ bsb = blockSizeInBits;
+ blockSizeInBits = 256;
+ this.key = rijndaelEncrypt(this.itext, this.key, "ECB");
+ this.nbytes = 32;
+ blockSizeInBits = bsb;
+ }
+
+ // Return next byte from the generator
+
+ function AESprng_next() {
+ if (this.nbytes <= 0) {
+ this.round();
+ }
+ return(this.key[--this.nbytes]);
+ }
+
+ // Return n bit integer value (up to maximum integer size)
+
+ function AESprng_nextbits(n) {
+ var i, w = 0, nbytes = Math.floor((n + 7) / 8);
+
+ for (i = 0; i < nbytes; i++) {
+ w = (w << 8) | this.next();
+ }
+ return w & ((1 << n) - 1);
+ }
+
+ // Return integer between 0 and n inclusive
+
+ function AESprng_nextInt(n) {
+ var p = 1, nb = 0;
+
+ // Determine smallest p, 2^p > n
+ // nb = log_2 p
+
+ while (n >= p) {
+ p <<= 1;
+ nb++;
+ }
+ p--;
+
+ /* Generate values from 0 through n by first generating
+ values v from 0 to (2^p)-1, then discarding any results v > n.
+ For the rationale behind this (and why taking
+ values mod (n + 1) is biased toward smaller values, see
+ Ferguson and Schneier, "Practical Cryptography",
+ ISBN 0-471-22357-3, section 10.8). */
+
+ while (true) {
+ var v = this.nextbits(nb) & p;
+
+ if (v <= n) {
+ return v;
+ }
+ }
+ }
+
+//#############################################################################
+// Downloaded on March 30, 2006 from http://www.fourmilab.ch/javascrypt/javascrypt.zip (md5.js)
+//#############################################################################
+
+/*
+ * md5.jvs 1.0b 27/06/96
+ *
+ * Javascript implementation of the RSA Data Security, Inc. MD5
+ * Message-Digest Algorithm.
+ *
+ * Copyright (c) 1996 Henri Torgemane. All Rights Reserved.
+ *
+ * Permission to use, copy, modify, and distribute this software
+ * and its documentation for any purposes and without
+ * fee is hereby granted provided that this copyright notice
+ * appears in all copies.
+ *
+ * Of course, this soft is provided "as is" without express or implied
+ * warranty of any kind.
+
+ This version contains some trivial reformatting modifications
+ by John Walker.
+
+ */
+
+function array(n) {
+ for (i = 0; i < n; i++) {
+ this[i] = 0;
+ }
+ this.length = n;
+}
+
+/* Some basic logical functions had to be rewritten because of a bug in
+ * Javascript.. Just try to compute 0xffffffff >> 4 with it..
+ * Of course, these functions are slower than the original would be, but
+ * at least, they work!
+ */
+
+function integer(n) {
+ return n % (0xffffffff + 1);
+}
+
+function shr(a, b) {
+ a = integer(a);
+ b = integer(b);
+ if (a - 0x80000000 >= 0) {
+ a = a % 0x80000000;
+ a >>= b;
+ a += 0x40000000 >> (b - 1);
+ } else {
+ a >>= b;
+ }
+ return a;
+}
+
+function shl1(a) {
+ a = a % 0x80000000;
+ if (a & 0x40000000 == 0x40000000) {
+ a -= 0x40000000;
+ a *= 2;
+ a += 0x80000000;
+ } else {
+ a *= 2;
+ }
+ return a;
+}
+
+function shl(a, b) {
+ a = integer(a);
+ b = integer(b);
+ for (var i = 0; i < b; i++) {
+ a = shl1(a);
+ }
+ return a;
+}
+
+function and(a, b) {
+ a = integer(a);
+ b = integer(b);
+ var t1 = a - 0x80000000;
+ var t2 = b - 0x80000000;
+ if (t1 >= 0) {
+ if (t2 >= 0) {
+ return ((t1 & t2) + 0x80000000);
+ } else {
+ return (t1 & b);
+ }
+ } else {
+ if (t2 >= 0) {
+ return (a & t2);
+ } else {
+ return (a & b);
+ }
+ }
+}
+
+function or(a, b) {
+ a = integer(a);
+ b = integer(b);
+ var t1 = a - 0x80000000;
+ var t2 = b - 0x80000000;
+ if (t1 >= 0) {
+ if (t2 >= 0) {
+ return ((t1 | t2) + 0x80000000);
+ } else {
+ return ((t1 | b) + 0x80000000);
+ }
+ } else {
+ if (t2 >= 0) {
+ return ((a | t2) + 0x80000000);
+ } else {
+ return (a | b);
+ }
+ }
+}
+
+function xor(a, b) {
+ a = integer(a);
+ b = integer(b);
+ var t1 = a - 0x80000000;
+ var t2 = b - 0x80000000;
+ if (t1 >= 0) {
+ if (t2 >= 0) {
+ return (t1 ^ t2);
+ } else {
+ return ((t1 ^ b) + 0x80000000);
+ }
+ } else {
+ if (t2 >= 0) {
+ return ((a ^ t2) + 0x80000000);
+ } else {
+ return (a ^ b);
+ }
+ }
+}
+
+function not(a) {
+ a = integer(a);
+ return 0xffffffff - a;
+}
+
+/* Here begin the real algorithm */
+
+var state = new array(4);
+var count = new array(2);
+ count[0] = 0;
+ count[1] = 0;
+var buffer = new array(64);
+var transformBuffer = new array(16);
+var digestBits = new array(16);
+
+var S11 = 7;
+var S12 = 12;
+var S13 = 17;
+var S14 = 22;
+var S21 = 5;
+var S22 = 9;
+var S23 = 14;
+var S24 = 20;
+var S31 = 4;
+var S32 = 11;
+var S33 = 16;
+var S34 = 23;
+var S41 = 6;
+var S42 = 10;
+var S43 = 15;
+var S44 = 21;
+
+function F(x, y, z) {
+ return or(and(x, y), and(not(x), z));
+}
+
+function G(x, y, z) {
+ return or(and(x, z), and(y, not(z)));
+}
+
+function H(x, y, z) {
+ return xor(xor(x, y), z);
+}
+
+function I(x, y, z) {
+ return xor(y ,or(x , not(z)));
+}
+
+function rotateLeft(a, n) {
+ return or(shl(a, n), (shr(a, (32 - n))));
+}
+
+function FF(a, b, c, d, x, s, ac) {
+ a = a + F(b, c, d) + x + ac;
+ a = rotateLeft(a, s);
+ a = a + b;
+ return a;
+}
+
+function GG(a, b, c, d, x, s, ac) {
+ a = a + G(b, c, d) + x + ac;
+ a = rotateLeft(a, s);
+ a = a + b;
+ return a;
+}
+
+function HH(a, b, c, d, x, s, ac) {
+ a = a + H(b, c, d) + x + ac;
+ a = rotateLeft(a, s);
+ a = a + b;
+ return a;
+}
+
+function II(a, b, c, d, x, s, ac) {
+ a = a + I(b, c, d) + x + ac;
+ a = rotateLeft(a, s);
+ a = a + b;
+ return a;
+}
+
+function transform(buf, offset) {
+ var a = 0, b = 0, c = 0, d = 0;
+ var x = transformBuffer;
+
+ a = state[0];
+ b = state[1];
+ c = state[2];
+ d = state[3];
+
+ for (i = 0; i < 16; i++) {
+ x[i] = and(buf[i * 4 + offset], 0xFF);
+ for (j = 1; j < 4; j++) {
+ x[i] += shl(and(buf[i * 4 + j + offset] ,0xFF), j * 8);
+ }
+ }
+
+ /* Round 1 */
+ a = FF( a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
+ d = FF( d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
+ c = FF( c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
+ b = FF( b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
+ a = FF( a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
+ d = FF( d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
+ c = FF( c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
+ b = FF( b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
+ a = FF( a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
+ d = FF( d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
+ c = FF( c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
+ b = FF( b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
+ a = FF( a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
+ d = FF( d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
+ c = FF( c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
+ b = FF( b, c, d, a, x[15], S14, 0x49b40821); /* 16 */
+
+ /* Round 2 */
+ a = GG( a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
+ d = GG( d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
+ c = GG( c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
+ b = GG( b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
+ a = GG( a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
+ d = GG( d, a, b, c, x[10], S22, 0x2441453); /* 22 */
+ c = GG( c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
+ b = GG( b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
+ a = GG( a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
+ d = GG( d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
+ c = GG( c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
+ b = GG( b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
+ a = GG( a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
+ d = GG( d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
+ c = GG( c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
+ b = GG( b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */
+
+ /* Round 3 */
+ a = HH( a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
+ d = HH( d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
+ c = HH( c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
+ b = HH( b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
+ a = HH( a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
+ d = HH( d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
+ c = HH( c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
+ b = HH( b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
+ a = HH( a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
+ d = HH( d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
+ c = HH( c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
+ b = HH( b, c, d, a, x[ 6], S34, 0x4881d05); /* 44 */
+ a = HH( a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
+ d = HH( d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
+ c = HH( c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
+ b = HH( b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */
+
+ /* Round 4 */
+ a = II( a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
+ d = II( d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
+ c = II( c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
+ b = II( b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
+ a = II( a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
+ d = II( d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
+ c = II( c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
+ b = II( b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
+ a = II( a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
+ d = II( d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
+ c = II( c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
+ b = II( b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
+ a = II( a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
+ d = II( d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
+ c = II( c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
+ b = II( b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */
+
+ state[0] += a;
+ state[1] += b;
+ state[2] += c;
+ state[3] += d;
+
+}
+
+function md5_init() {
+ count[0] = count[1] = 0;
+ state[0] = 0x67452301;
+ state[1] = 0xefcdab89;
+ state[2] = 0x98badcfe;
+ state[3] = 0x10325476;
+ for (i = 0; i < digestBits.length; i++) {
+ digestBits[i] = 0;
+ }
+}
+
+function md5_update(b) {
+ var index, i;
+
+ index = and(shr(count[0],3) , 0x3F);
+ if (count[0] < 0xFFFFFFFF - 7) {
+ count[0] += 8;
+ } else {
+ count[1]++;
+ count[0] -= 0xFFFFFFFF + 1;
+ count[0] += 8;
+ }
+ buffer[index] = and(b, 0xff);
+ if (index >= 63) {
+ transform(buffer, 0);
+ }
+}
+
+function md5_finish() {
+ var bits = new array(8);
+ var padding;
+ var i = 0, index = 0, padLen = 0;
+
+ for (i = 0; i < 4; i++) {
+ bits[i] = and(shr(count[0], (i * 8)), 0xFF);
+ }
+ for (i = 0; i < 4; i++) {
+ bits[i + 4] = and(shr(count[1], (i * 8)), 0xFF);
+ }
+ index = and(shr(count[0], 3), 0x3F);
+ padLen = (index < 56) ? (56 - index) : (120 - index);
+ padding = new array(64);
+ padding[0] = 0x80;
+ for (i = 0; i < padLen; i++) {
+ md5_update(padding[i]);
+ }
+ for (i = 0; i < 8; i++) {
+ md5_update(bits[i]);
+ }
+
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < 4; j++) {
+ digestBits[i * 4 + j] = and(shr(state[i], (j * 8)) , 0xFF);
+ }
+ }
+}
+
+/* End of the MD5 algorithm */
+
+//#############################################################################
+// Downloaded on March 30, 2006 from http://www.fourmilab.ch/javascrypt/javascrypt.zip (aes.js)
+//#############################################################################
+
+
+/* rijndael.js Rijndael Reference Implementation
+
+ This is a modified version of the software described below,
+ produced in September 2003 by John Walker for use in the
+ JavsScrypt browser-based encryption package. The principal
+ changes are replacing the original getRandomBytes function with
+ one which calls our pseudorandom generator (which must
+ be instantiated and seeded before the first call on getRandomBytes),
+ and changing keySizeInBits to 256. Some code not required by the
+ JavsScrypt application has been commented out. Please see
+ http://www.fourmilab.ch/javascrypt/ for further information on
+ JavaScrypt.
+
+ The following is the original copyright and application
+ information.
+
+ Copyright (c) 2001 Fritz Schneider
+
+ This software is provided as-is, without express or implied warranty.
+ Permission to use, copy, modify, distribute or sell this software, with or
+ without fee, for any purpose and by any individual or organization, is hereby
+ granted, provided that the above copyright notice and this paragraph appear
+ in all copies. Distribution as a part of an application or binary must
+ include the above copyright notice in the documentation and/or other materials
+ provided with the application or distribution.
+
+ As the above disclaimer notes, you are free to use this code however you
+ want. However, I would request that you send me an email
+ (fritz /at/ cs /dot/ ucsd /dot/ edu) to say hi if you find this code useful
+ or instructional. Seeing that people are using the code acts as
+ encouragement for me to continue development. If you *really* want to thank
+ me you can buy the book I wrote with Thomas Powell, _JavaScript:
+ _The_Complete_Reference_ :)
+
+ This code is an UNOPTIMIZED REFERENCE implementation of Rijndael.
+ If there is sufficient interest I can write an optimized (word-based,
+ table-driven) version, although you might want to consider using a
+ compiled language if speed is critical to your application. As it stands,
+ one run of the monte carlo test (10,000 encryptions) can take up to
+ several minutes, depending upon your processor. You shouldn't expect more
+ than a few kilobytes per second in throughput.
+
+ Also note that there is very little error checking in these functions.
+ Doing proper error checking is always a good idea, but the ideal
+ implementation (using the instanceof operator and exceptions) requires
+ IE5+/NS6+, and I've chosen to implement this code so that it is compatible
+ with IE4/NS4.
+
+ And finally, because JavaScript doesn't have an explicit byte/char data
+ type (although JavaScript 2.0 most likely will), when I refer to "byte"
+ in this code I generally mean "32 bit integer with value in the interval
+ [0,255]" which I treat as a byte.
+
+ See http://www-cse.ucsd.edu/~fritz/rijndael.html for more documentation
+ of the (very simple) API provided by this code.
+
+ Fritz Schneider
+ fritz at cs.ucsd.edu
+
+*/
+
+
+// Rijndael parameters -- Valid values are 128, 192, or 256
+
+var keySizeInBits = 256;
+var blockSizeInBits = 128;
+
+//
+// Note: in the following code the two dimensional arrays are indexed as
+// you would probably expect, as array[row][column]. The state arrays
+// are 2d arrays of the form state[4][Nb].
+
+
+// The number of rounds for the cipher, indexed by [Nk][Nb]
+var roundsArray = [ ,,,,[,,,,10,, 12,, 14],,
+ [,,,,12,, 12,, 14],,
+ [,,,,14,, 14,, 14] ];
+
+// The number of bytes to shift by in shiftRow, indexed by [Nb][row]
+var shiftOffsets = [ ,,,,[,1, 2, 3],,[,1, 2, 3],,[,1, 3, 4] ];
+
+// The round constants used in subkey expansion
+var Rcon = [
+0x01, 0x02, 0x04, 0x08, 0x10, 0x20,
+0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8,
+0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc,
+0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4,
+0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91 ];
+
+// Precomputed lookup table for the SBox
+var SBox = [
+ 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171,
+118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164,
+114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113,
+216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226,
+235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214,
+179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203,
+190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69,
+249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245,
+188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68,
+23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42,
+144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73,
+ 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109,
+141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37,
+ 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62,
+181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225,
+248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223,
+140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187,
+ 22 ];
+
+// Precomputed lookup table for the inverse SBox
+var SBoxInverse = [
+ 82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215,
+251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222,
+233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66,
+250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73,
+109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92,
+204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21,
+ 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247,
+228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2,
+193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220,
+234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173,
+ 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29,
+ 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75,
+198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168,
+ 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81,
+127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160,
+224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97,
+ 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12,
+125 ];
+
+// This method circularly shifts the array left by the number of elements
+// given in its parameter. It returns the resulting array and is used for
+// the ShiftRow step. Note that shift() and push() could be used for a more
+// elegant solution, but they require IE5.5+, so I chose to do it manually.
+
+function cyclicShiftLeft(theArray, positions) {
+ var temp = theArray.slice(0, positions);
+ theArray = theArray.slice(positions).concat(temp);
+ return theArray;
+}
+
+// Cipher parameters ... do not change these
+var Nk = keySizeInBits / 32;
+var Nb = blockSizeInBits / 32;
+var Nr = roundsArray[Nk][Nb];
+
+// Multiplies the element "poly" of GF(2^8) by x. See the Rijndael spec.
+
+function xtime(poly) {
+ poly <<= 1;
+ return ((poly & 0x100) ? (poly ^ 0x11B) : (poly));
+}
+
+// Multiplies the two elements of GF(2^8) together and returns the result.
+// See the Rijndael spec, but should be straightforward: for each power of
+// the indeterminant that has a 1 coefficient in x, add y times that power
+// to the result. x and y should be bytes representing elements of GF(2^8)
+
+function mult_GF256(x, y) {
+ var bit, result = 0;
+
+ for (bit = 1; bit < 256; bit *= 2, y = xtime(y)) {
+ if (x & bit)
+ result ^= y;
+ }
+ return result;
+}
+
+// Performs the substitution step of the cipher. State is the 2d array of
+// state information (see spec) and direction is string indicating whether
+// we are performing the forward substitution ("encrypt") or inverse
+// substitution (anything else)
+
+function byteSub(state, direction) {
+ var S;
+ if (direction == "encrypt") // Point S to the SBox we're using
+ S = SBox;
+ else
+ S = SBoxInverse;
+ for (var i = 0; i < 4; i++) // Substitute for every byte in state
+ for (var j = 0; j < Nb; j++)
+ state[i][j] = S[state[i][j]];
+}
+
+// Performs the row shifting step of the cipher.
+
+function shiftRow(state, direction) {
+ for (var i=1; i<4; i++) // Row 0 never shifts
+ if (direction == "encrypt")
+ state[i] = cyclicShiftLeft(state[i], shiftOffsets[Nb][i]);
+ else
+ state[i] = cyclicShiftLeft(state[i], Nb - shiftOffsets[Nb][i]);
+
+}
+
+// Performs the column mixing step of the cipher. Most of these steps can
+// be combined into table lookups on 32bit values (at least for encryption)
+// to greatly increase the speed.
+
+function mixColumn(state, direction) {
+ var b = []; // Result of matrix multiplications
+ for (var j = 0; j < Nb; j++) { // Go through each column...
+ for (var i = 0; i < 4; i++) { // and for each row in the column...
+ if (direction == "encrypt")
+ b[i] = mult_GF256(state[i][j], 2) ^ // perform mixing
+ mult_GF256(state[(i+1)%4][j], 3) ^
+ state[(i+2)%4][j] ^
+ state[(i+3)%4][j];
+ else
+ b[i] = mult_GF256(state[i][j], 0xE) ^
+ mult_GF256(state[(i+1)%4][j], 0xB) ^
+ mult_GF256(state[(i+2)%4][j], 0xD) ^
+ mult_GF256(state[(i+3)%4][j], 9);
+ }
+ for (var i = 0; i < 4; i++) // Place result back into column
+ state[i][j] = b[i];
+ }
+}
+
+// Adds the current round key to the state information. Straightforward.
+
+function addRoundKey(state, roundKey) {
+ for (var j = 0; j < Nb; j++) { // Step through columns...
+ state[0][j] ^= (roundKey[j] & 0xFF); // and XOR
+ state[1][j] ^= ((roundKey[j]>>8) & 0xFF);
+ state[2][j] ^= ((roundKey[j]>>16) & 0xFF);
+ state[3][j] ^= ((roundKey[j]>>24) & 0xFF);
+ }
+}
+
+// This function creates the expanded key from the input (128/192/256-bit)
+// key. The parameter key is an array of bytes holding the value of the key.
+// The returned value is an array whose elements are the 32-bit words that
+// make up the expanded key.
+
+function keyExpansion(key) {
+ var expandedKey = new Array();
+ var temp;
+
+ // in case the key size or parameters were changed...
+ Nk = keySizeInBits / 32;
+ Nb = blockSizeInBits / 32;
+ Nr = roundsArray[Nk][Nb];
+
+ for (var j=0; j < Nk; j++) // Fill in input key first
+ expandedKey[j] =
+ (key[4*j]) | (key[4*j+1]<<8) | (key[4*j+2]<<16) | (key[4*j+3]<<24);
+
+ // Now walk down the rest of the array filling in expanded key bytes as
+ // per Rijndael's spec
+ for (j = Nk; j < Nb * (Nr + 1); j++) { // For each word of expanded key
+ temp = expandedKey[j - 1];
+ if (j % Nk == 0)
+ temp = ( (SBox[(temp>>8) & 0xFF]) |
+ (SBox[(temp>>16) & 0xFF]<<8) |
+ (SBox[(temp>>24) & 0xFF]<<16) |
+ (SBox[temp & 0xFF]<<24) ) ^ Rcon[Math.floor(j / Nk) - 1];
+ else if (Nk > 6 && j % Nk == 4)
+ temp = (SBox[(temp>>24) & 0xFF]<<24) |
+ (SBox[(temp>>16) & 0xFF]<<16) |
+ (SBox[(temp>>8) & 0xFF]<<8) |
+ (SBox[temp & 0xFF]);
+ expandedKey[j] = expandedKey[j-Nk] ^ temp;
+ }
+ return expandedKey;
+}
+
+// Rijndael's round functions...
+
+function Round(state, roundKey) {
+ byteSub(state, "encrypt");
+ shiftRow(state, "encrypt");
+ mixColumn(state, "encrypt");
+ addRoundKey(state, roundKey);
+}
+
+function InverseRound(state, roundKey) {
+ addRoundKey(state, roundKey);
+ mixColumn(state, "decrypt");
+ shiftRow(state, "decrypt");
+ byteSub(state, "decrypt");
+}
+
+function FinalRound(state, roundKey) {
+ byteSub(state, "encrypt");
+ shiftRow(state, "encrypt");
+ addRoundKey(state, roundKey);
+}
+
+function InverseFinalRound(state, roundKey){
+ addRoundKey(state, roundKey);
+ shiftRow(state, "decrypt");
+ byteSub(state, "decrypt");
+}
+
+// encrypt is the basic encryption function. It takes parameters
+// block, an array of bytes representing a plaintext block, and expandedKey,
+// an array of words representing the expanded key previously returned by
+// keyExpansion(). The ciphertext block is returned as an array of bytes.
+
+function encrypt(block, expandedKey) {
+ var i;
+ if (!block || block.length*8 != blockSizeInBits)
+ return;
+ if (!expandedKey)
+ return;
+
+ block = packBytes(block);
+ addRoundKey(block, expandedKey);
+ for (i=1; i<Nr; i++)
+ Round(block, expandedKey.slice(Nb*i, Nb*(i+1)));
+ FinalRound(block, expandedKey.slice(Nb*Nr));
+ return unpackBytes(block);
+}
+
+// decrypt is the basic decryption function. It takes parameters
+// block, an array of bytes representing a ciphertext block, and expandedKey,
+// an array of words representing the expanded key previously returned by
+// keyExpansion(). The decrypted block is returned as an array of bytes.
+
+function decrypt(block, expandedKey) {
+ var i;
+ if (!block || block.length*8 != blockSizeInBits)
+ return;
+ if (!expandedKey)
+ return;
+
+ block = packBytes(block);
+ InverseFinalRound(block, expandedKey.slice(Nb*Nr));
+ for (i = Nr - 1; i>0; i--)
+ InverseRound(block, expandedKey.slice(Nb*i, Nb*(i+1)));
+ addRoundKey(block, expandedKey);
+ return unpackBytes(block);
+}
+
+/* !NEEDED
+// This method takes a byte array (byteArray) and converts it to a string by
+// applying String.fromCharCode() to each value and concatenating the result.
+// The resulting string is returned. Note that this function SKIPS zero bytes
+// under the assumption that they are padding added in formatPlaintext().
+// Obviously, do not invoke this method on raw data that can contain zero
+// bytes. It is really only appropriate for printable ASCII/Latin-1
+// values. Roll your own function for more robust functionality :)
+
+function byteArrayToString(byteArray) {
+ var result = "";
+ for(var i=0; i<byteArray.length; i++)
+ if (byteArray[i] != 0)
+ result += String.fromCharCode(byteArray[i]);
+ return result;
+}
+*/
+
+// This function takes an array of bytes (byteArray) and converts them
+// to a hexadecimal string. Array element 0 is found at the beginning of
+// the resulting string, high nibble first. Consecutive elements follow
+// similarly, for example [16, 255] --> "10ff". The function returns a
+// string.
+
+function byteArrayToHex(byteArray) {
+ var result = "";
+ if (!byteArray)
+ return;
+ for (var i=0; i<byteArray.length; i++)
+ result += ((byteArray[i]<16) ? "0" : "") + byteArray[i].toString(16);
+
+ return result;
+}
+
+// This function converts a string containing hexadecimal digits to an
+// array of bytes. The resulting byte array is filled in the order the
+// values occur in the string, for example "10FF" --> [16, 255]. This
+// function returns an array.
+
+function hexToByteArray(hexString) {
+ var byteArray = [];
+ if (hexString.length % 2) // must have even length
+ return;
+ if (hexString.indexOf("0x") == 0 || hexString.indexOf("0X") == 0)
+ hexString = hexString.substring(2);
+ for (var i = 0; i<hexString.length; i += 2)
+ byteArray[Math.floor(i/2)] = parseInt(hexString.slice(i, i+2), 16);
+ return byteArray;
+}
+
+// This function packs an array of bytes into the four row form defined by
+// Rijndael. It assumes the length of the array of bytes is divisible by
+// four. Bytes are filled in according to the Rijndael spec (starting with
+// column 0, row 0 to 3). This function returns a 2d array.
+
+function packBytes(octets) {
+ var state = new Array();
+ if (!octets || octets.length % 4)
+ return;
+
+ state[0] = new Array(); state[1] = new Array();
+ state[2] = new Array(); state[3] = new Array();
+ for (var j=0; j<octets.length; j+= 4) {
+ state[0][j/4] = octets[j];
+ state[1][j/4] = octets[j+1];
+ state[2][j/4] = octets[j+2];
+ state[3][j/4] = octets[j+3];
+ }
+ return state;
+}
+
+// This function unpacks an array of bytes from the four row format preferred
+// by Rijndael into a single 1d array of bytes. It assumes the input "packed"
+// is a packed array. Bytes are filled in according to the Rijndael spec.
+// This function returns a 1d array of bytes.
+
+function unpackBytes(packed) {
+ var result = new Array();
+ for (var j=0; j<packed[0].length; j++) {
+ result[result.length] = packed[0][j];
+ result[result.length] = packed[1][j];
+ result[result.length] = packed[2][j];
+ result[result.length] = packed[3][j];
+ }
+ return result;
+}
+
+// This function takes a prospective plaintext (string or array of bytes)
+// and pads it with pseudorandom bytes if its length is not a multiple of the block
+// size. If plaintext is a string, it is converted to an array of bytes
+// in the process. The type checking can be made much nicer using the
+// instanceof operator, but this operator is not available until IE5.0 so I
+// chose to use the heuristic below.
+
+function formatPlaintext(plaintext) {
+ var bpb = blockSizeInBits / 8; // bytes per block
+ var fillWithRandomBits;
+ var i;
+
+ // if primitive string or String instance
+ if ((!((typeof plaintext == "object") &&
+ ((typeof (plaintext[0])) == "number"))) &&
+ ((typeof plaintext == "string") || plaintext.indexOf))
+ {
+ plaintext = plaintext.split("");
+ // Unicode issues here (ignoring high byte)
+ for (i=0; i<plaintext.length; i++) {
+ plaintext[i] = plaintext[i].charCodeAt(0) & 0xFF;
+ }
+ }
+
+ i = plaintext.length % bpb;
+ if (i > 0) {
+//alert("adding " + (bpb - 1) + " bytes");
+// plaintext = plaintext.concat(getRandomBytes(bpb - i));
+ {
+ var paddingBytes;
+ var ii,cc;
+
+ paddingBytes = new Array();
+ cc = bpb - i;
+ for (ii=0; ii<cc; ii++) {
+ paddingBytes[ii] = cc;
+ }
+
+//is("cc", cc);
+//is(getRandomBytes(bpb - i) + "", paddingBytes + "");
+ plaintext = plaintext.concat(paddingBytes);
+ }
+ }
+
+ return plaintext;
+}
+
+// Returns an array containing "howMany" random bytes.
+
+function getRandomBytes(howMany) {
+ var i, bytes = new Array();
+
+//alert("getting some random bytes");
+ for (i = 0; i < howMany; i++) {
+ bytes[i] = prng.nextInt(255);
+ }
+ return bytes;
+}
+
+// rijndaelEncrypt(plaintext, key, mode)
+// Encrypts the plaintext using the given key and in the given mode.
+// The parameter "plaintext" can either be a string or an array of bytes.
+// The parameter "key" must be an array of key bytes. If you have a hex
+// string representing the key, invoke hexToByteArray() on it to convert it
+// to an array of bytes. The third parameter "mode" is a string indicating
+// the encryption mode to use, either "ECB" or "CBC". If the parameter is
+// omitted, ECB is assumed.
+//
+// An array of bytes representing the cihpertext is returned. To convert
+// this array to hex, invoke byteArrayToHex() on it.
+
+function rijndaelEncrypt(plaintext, key, mode) {
+ var expandedKey, i, aBlock;
+ var bpb = blockSizeInBits / 8; // bytes per block
+ var ct; // ciphertext
+
+ if (!plaintext || !key)
+ return;
+ if (key.length*8 != keySizeInBits)
+ return;
+ if (mode == "CBC") {
+ ct = getRandomBytes(bpb); // get IV
+//dump("IV", byteArrayToHex(ct));
+ } else {
+ mode = "ECB";
+ ct = new Array();
+ }
+
+ // convert plaintext to byte array and pad with zeros if necessary.
+ plaintext = formatPlaintext(plaintext);
+
+ expandedKey = keyExpansion(key);
+
+ for (var block = 0; block < plaintext.length / bpb; block++) {
+ aBlock = plaintext.slice(block * bpb, (block + 1) * bpb);
+ if (mode == "CBC") {
+ for (var i = 0; i < bpb; i++) {
+ aBlock[i] ^= ct[(block * bpb) + i];
+ }
+ }
+ ct = ct.concat(encrypt(aBlock, expandedKey));
+ }
+
+ return ct;
+}
+
+// rijndaelDecrypt(ciphertext, key, mode)
+// Decrypts the using the given key and mode. The parameter "ciphertext"
+// must be an array of bytes. The parameter "key" must be an array of key
+// bytes. If you have a hex string representing the ciphertext or key,
+// invoke hexToByteArray() on it to convert it to an array of bytes. The
+// parameter "mode" is a string, either "CBC" or "ECB".
+//
+// An array of bytes representing the plaintext is returned. To convert
+// this array to a hex string, invoke byteArrayToHex() on it. To convert it
+// to a string of characters, you can use byteArrayToString().
+
+function rijndaelDecrypt(ciphertext, key, mode) {
+ var expandedKey;
+ var bpb = blockSizeInBits / 8; // bytes per block
+ var pt = new Array(); // plaintext array
+ var aBlock; // a decrypted block
+ var block; // current block number
+
+ if (!ciphertext || !key || typeof ciphertext == "string")
+ return;
+ if (key.length*8 != keySizeInBits)
+ return;
+ if (!mode) {
+ mode = "ECB"; // assume ECB if mode omitted
+ }
+
+ expandedKey = keyExpansion(key);
+
+ // work backwards to accomodate CBC mode
+ for (block=(ciphertext.length / bpb)-1; block>0; block--) {
+ aBlock =
+ decrypt(ciphertext.slice(block*bpb,(block+1)*bpb), expandedKey);
+ if (mode == "CBC")
+ for (var i=0; i<bpb; i++)
+ pt[(block-1)*bpb + i] = aBlock[i] ^ ciphertext[(block-1)*bpb + i];
+ else
+ pt = aBlock.concat(pt);
+ }
+
+ // do last block if ECB (skips the IV in CBC)
+ if (mode == "ECB")
+ pt = decrypt(ciphertext.slice(0, bpb), expandedKey).concat(pt);
+
+ return pt;
+}
+
+//#############################################################################
+// Downloaded on March 30, 2006 from http://www.fourmilab.ch/javascrypt/javascrypt.zip (utf-8.js)
+//#############################################################################
+
+
+ /* Encoding and decoding of Unicode character strings as
+ UTF-8 byte streams. */
+
+ // UNICODE_TO_UTF8 -- Encode Unicode argument string as UTF-8 return value
+
+ function unicode_to_utf8(s) {
+ var utf8 = "";
+
+ for (var n = 0; n < s.length; n++) {
+ var c = s.charCodeAt(n);
+
+ if (c <= 0x7F) {
+ // 0x00 - 0x7F: Emit as single byte, unchanged
+ utf8 += String.fromCharCode(c);
+ } else if ((c >= 0x80) && (c <= 0x7FF)) {
+ // 0x80 - 0x7FF: Output as two byte code, 0xC0 in first byte
+ // 0x80 in second byte
+ utf8 += String.fromCharCode((c >> 6) | 0xC0);
+ utf8 += String.fromCharCode((c & 0x3F) | 0x80);
+ } else {
+ // 0x800 - 0xFFFF: Output as three bytes, 0xE0 in first byte
+ // 0x80 in second byte
+ // 0x80 in third byte
+ utf8 += String.fromCharCode((c >> 12) | 0xE0);
+ utf8 += String.fromCharCode(((c >> 6) & 0x3F) | 0x80);
+ utf8 += String.fromCharCode((c & 0x3F) | 0x80);
+ }
+ }
+ return utf8;
+ }
+
+ // UTF8_TO_UNICODE -- Decode UTF-8 argument into Unicode string return value
+
+ function utf8_to_unicode(utf8) {
+ var s = "", i = 0, b1, b2, b2;
+
+ while (i < utf8.length) {
+ b1 = utf8.charCodeAt(i);
+ if (b1 < 0x80) { // One byte code: 0x00 0x7F
+ s += String.fromCharCode(b1);
+ i++;
+ } else if((b1 >= 0xC0) && (b1 < 0xE0)) { // Two byte code: 0x80 - 0x7FF
+ b2 = utf8.charCodeAt(i + 1);
+ s += String.fromCharCode(((b1 & 0x1F) << 6) | (b2 & 0x3F));
+ i += 2;
+ } else { // Three byte code: 0x800 - 0xFFFF
+ b2 = utf8.charCodeAt(i + 1);
+ b3 = utf8.charCodeAt(i + 2);
+ s += String.fromCharCode(((b1 & 0xF) << 12) |
+ ((b2 & 0x3F) << 6) |
+ (b3 & 0x3F));
+ i += 3;
+ }
+ }
+ return s;
+ }
+
+ /* ENCODE_UTF8 -- Encode string as UTF8 only if it contains
+ a character of 0x9D (Unicode OPERATING
+ SYSTEM COMMAND) or a character greater
+ than 0xFF. This permits all strings
+ consisting exclusively of 8 bit
+ graphic characters to be encoded as
+ themselves. We choose 0x9D as the sentinel
+ character as opposed to one of the more
+ logical PRIVATE USE characters because 0x9D
+ is not overloaded by the regrettable
+ "Windows-1252" character set. Now such characters
+ don't belong in JavaScript strings, but you never
+ know what somebody is going to paste into a
+ text box, so this choice keeps Windows-encoded
+ strings from bloating to UTF-8 encoding. */
+
+ function encode_utf8(s) {
+ var i, necessary = false;
+
+ for (i = 0; i < s.length; i++) {
+ if ((s.charCodeAt(i) == 0x9D) ||
+ (s.charCodeAt(i) > 0xFF)) {
+ necessary = true;
+ break;
+ }
+ }
+ if (!necessary) {
+ return s;
+ }
+ return String.fromCharCode(0x9D) + unicode_to_utf8(s);
+ }
+
+ /* DECODE_UTF8 -- Decode a string encoded with encode_utf8
+ above. If the string begins with the
+ sentinel character 0x9D (OPERATING
+ SYSTEM COMMAND), then we decode the
+ balance as a UTF-8 stream. Otherwise,
+ the string is output unchanged, as
+ it's guaranteed to contain only 8 bit
+ characters excluding 0x9D. */
+
+ function decode_utf8(s) {
+ if ((s.length > 0) && (s.charCodeAt(0) == 0x9D)) {
+ return utf8_to_unicode(s.substring(1));
+ }
+ return s;
+ }
+
+
+//#############################################################################
+// Downloaded on April 26, 2006 from http://pajhome.org.uk/crypt/md5/md5.js
+//#############################################################################
+
+/*
+ * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
+ * Digest Algorithm, as defined in RFC 1321.
+ * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
+ * Distributed under the BSD License
+ * See http://pajhome.org.uk/crypt/md5 for more info.
+ */
+
+/*
+ * Configurable variables. You may need to tweak these to be compatible with
+ * the server-side, but the defaults work in most cases.
+ */
+var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
+var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
+var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
+
+/*
+ * These are the functions you'll usually want to call
+ * They take string arguments and return either hex or base-64 encoded strings
+ */
+function hex_md5(s){ return binl2hex(core_md5(str2binl(s), s.length * chrsz));}
+function b64_md5(s){ return binl2b64(core_md5(str2binl(s), s.length * chrsz));}
+function str_md5(s){ return binl2str(core_md5(str2binl(s), s.length * chrsz));}
+function hex_hmac_md5(key, data) { return binl2hex(core_hmac_md5(key, data)); }
+function b64_hmac_md5(key, data) { return binl2b64(core_hmac_md5(key, data)); }
+function str_hmac_md5(key, data) { return binl2str(core_hmac_md5(key, data)); }
+
+/*
+ * Perform a simple self-test to see if the VM is working
+ */
+function md5_vm_test()
+{
+ return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
+}
+
+/*
+ * Calculate the MD5 of an array of little-endian words, and a bit length
+ */
+function core_md5(x, len)
+{
+ /* append padding */
+ x[len >> 5] |= 0x80 << ((len) % 32);
+ x[(((len + 64) >>> 9) << 4) + 14] = len;
+
+ var a = 1732584193;
+ var b = -271733879;
+ var c = -1732584194;
+ var d = 271733878;
+
+ for(var i = 0; i < x.length; i += 16)
+ {
+ var olda = a;
+ var oldb = b;
+ var oldc = c;
+ var oldd = d;
+
+ a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
+ d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
+ c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
+ b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
+ a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
+ d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
+ c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
+ b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
+ a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
+ d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
+ c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
+ b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
+ a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
+ d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
+ c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
+ b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
+
+ a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
+ d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
+ c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
+ b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
+ a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
+ d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
+ c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
+ b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
+ a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
+ d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
+ c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
+ b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
+ a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
+ d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
+ c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
+ b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
+
+ a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
+ d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
+ c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
+ b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
+ a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
+ d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
+ c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
+ b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
+ a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
+ d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
+ c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
+ b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
+ a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
+ d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
+ c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
+ b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
+
+ a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
+ d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
+ c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
+ b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
+ a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
+ d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
+ c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
+ b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
+ a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
+ d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
+ c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
+ b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
+ a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
+ d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
+ c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
+ b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
+
+ a = safe_add(a, olda);
+ b = safe_add(b, oldb);
+ c = safe_add(c, oldc);
+ d = safe_add(d, oldd);
+ }
+ return Array(a, b, c, d);
+
+}
+
+/*
+ * These functions implement the four basic operations the algorithm uses.
+ */
+function md5_cmn(q, a, b, x, s, t)
+{
+ return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
+}
+function md5_ff(a, b, c, d, x, s, t)
+{
+ return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
+}
+function md5_gg(a, b, c, d, x, s, t)
+{
+ return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
+}
+function md5_hh(a, b, c, d, x, s, t)
+{
+ return md5_cmn(b ^ c ^ d, a, b, x, s, t);
+}
+function md5_ii(a, b, c, d, x, s, t)
+{
+ return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
+}
+
+/*
+ * Calculate the HMAC-MD5, of a key and some data
+ */
+function core_hmac_md5(key, data)
+{
+ var bkey = str2binl(key);
+ if(bkey.length > 16) bkey = core_md5(bkey, key.length * chrsz);
+
+ var ipad = Array(16), opad = Array(16);
+ for(var i = 0; i < 16; i++)
+ {
+ ipad[i] = bkey[i] ^ 0x36363636;
+ opad[i] = bkey[i] ^ 0x5C5C5C5C;
+ }
+
+ var hash = core_md5(ipad.concat(str2binl(data)), 512 + data.length * chrsz);
+ return core_md5(opad.concat(hash), 512 + 128);
+}
+
+/*
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally
+ * to work around bugs in some JS interpreters.
+ */
+function safe_add(x, y)
+{
+ var lsw = (x & 0xFFFF) + (y & 0xFFFF);
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+ return (msw << 16) | (lsw & 0xFFFF);
+}
+
+/*
+ * Bitwise rotate a 32-bit number to the left.
+ */
+function bit_rol(num, cnt)
+{
+ return (num << cnt) | (num >>> (32 - cnt));
+}
+
+/*
+ * Convert a string to an array of little-endian words
+ * If chrsz is ASCII, characters >255 have their hi-byte silently ignored.
+ */
+function str2binl(str)
+{
+ var bin = Array();
+ var mask = (1 << chrsz) - 1;
+ for(var i = 0; i < str.length * chrsz; i += chrsz)
+ bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (i%32);
+ return bin;
+}
+
+/*
+ * Convert an array of little-endian words to a string
+ */
+function binl2str(bin)
+{
+ var str = "";
+ var mask = (1 << chrsz) - 1;
+ for(var i = 0; i < bin.length * 32; i += chrsz)
+ str += String.fromCharCode((bin[i>>5] >>> (i % 32)) & mask);
+ return str;
+}
+
+/*
+ * Convert an array of little-endian words to a hex string.
+ */
+function binl2hex(binarray)
+{
+ var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
+ var str = "";
+ for(var i = 0; i < binarray.length * 4; i++)
+ {
+ str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
+ hex_tab.charAt((binarray[i>>2] >> ((i%4)*8 )) & 0xF);
+ }
+ return str;
+}
+
+/*
+ * Convert an array of little-endian words to a base-64 string
+ */
+function binl2b64(binarray)
+{
+ var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ var str = "";
+ for(var i = 0; i < binarray.length * 4; i += 3)
+ {
+ var triplet = (((binarray[i >> 2] >> 8 * ( i %4)) & 0xFF) << 16)
+ | (((binarray[i+1 >> 2] >> 8 * ((i+1)%4)) & 0xFF) << 8 )
+ | ((binarray[i+2 >> 2] >> 8 * ((i+2)%4)) & 0xFF);
+ for(var j = 0; j < 4; j++)
+ {
+ if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
+ else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
+ }
+ }
+ return str;
+}
+
+
+//#############################################################################
+//#############################################################################
+//#############################################################################
+
+
+
+MochiKit.Base.update(Clipperz.Crypto.Base, {
+
+ '__repr__': function () {
+ return "[" + this.NAME + " " + this.VERSION + "]";
+ },
+
+ 'toString': function () {
+ return this.__repr__();
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'encryptUsingSecretKey': function (aKey, aMessage) {
+//Clipperz.Profile.start("Clipperz.Crypto.Base.encryptUsingSecretKey");
+ var result;
+ var plaintext;
+ var header;
+ var key;
+
+ key = hexToByteArray(Clipperz.Crypto.Base.computeHashValue(aKey));
+
+ addEntropyTime();
+ prng = new AESprng(keyFromEntropy());
+
+ plaintext = encode_utf8(aMessage);
+
+ header = Clipperz.Base.byteArrayToString(hexToByteArray(Clipperz.Crypto.Base.computeMD5HashValue(plaintext)));
+
+ // Add message length in bytes to header
+ i = plaintext.length;
+ header += String.fromCharCode(i >>> 24);
+ header += String.fromCharCode(i >>> 16);
+ header += String.fromCharCode(i >>> 8);
+ header += String.fromCharCode(i & 0xFF);
+
+ // The format of the actual message passed to rijndaelEncrypt
+ // is:
+ //
+ // Bytes Content
+ // 0-15 MD5 signature of plaintext
+ // 16-19 Length of plaintext, big-endian order
+ // 20-end Plaintext
+ //
+ // Note that this message will be padded with zero bytes
+ // to an integral number of AES blocks (blockSizeInBits / 8).
+ // This does not include the initial vector for CBC
+ // encryption, which is added internally by rijndaelEncrypt.
+ result = byteArrayToHex(rijndaelEncrypt(header + plaintext, key, "CBC"));
+
+ delete prng;
+
+//Clipperz.Profile.stop("Clipperz.Crypto.Base.encryptUsingSecretKey");
+ return result;
+ },
+
+ //.............................................................................
+
+ 'decryptUsingSecretKey': function (aKey, aMessage) {
+//Clipperz.Profile.start("Clipperz.Crypto.Base.decryptUsingSecretKey");
+ var key;
+ var decryptedText;
+ var textLength;
+ var header;
+ var headerDigest;
+ var plaintext;
+ var i;
+
+ key = hexToByteArray(Clipperz.Crypto.Base.computeHashValue(aKey));
+
+ decryptedText = rijndaelDecrypt(hexToByteArray(aMessage), key, "CBC");
+
+ header = decryptedText.slice(0, 20);
+ decryptedText = decryptedText.slice(20);
+
+ headerDigest = byteArrayToHex(header.slice(0,16));
+ textLength = (header[16] << 24) | (header[17] << 16) | (header[18] << 8) | header[19];
+
+ if ((textLength < 0) || (textLength > decryptedText.length)) {
+// jslog.warning("Message (length " + decryptedText.length + ") truncated. " + textLength + " characters expected.");
+ // Try to sauve qui peut by setting length to entire message
+ textLength = decryptedText.length;
+ }
+
+ plainText = "";
+
+ for (i=0; i<textLength; i++) {
+ plainText += String.fromCharCode(decryptedText[i]);
+ }
+
+ if (Clipperz.Crypto.Base.computeMD5HashValue(plainText) != headerDigest) {
+// jslog.warning("Message corrupted. Checksum of decrypted message does not match.");
+ throw Clipperz.Crypto.Base.exception.CorruptedMessage;
+// throw new Error("Message corrupted. Checksum of decrypted message does not match. Parsed result: " + decode_utf8(plainText));
+ }
+
+ // That's it; plug plaintext into the result field
+
+ result = decode_utf8(plainText);
+
+//Clipperz.Profile.stop("Clipperz.Crypto.Base.decryptUsingSecretKey");
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'computeHashValue': function (aMessage) {
+//Clipperz.Profile.start("Clipperz.Crypto.Base.computeHashValue");
+ var result;
+
+ result = hex_sha256(aMessage);
+//Clipperz.Profile.stop("Clipperz.Crypto.Base.computeHashValue");
+
+ return result;
+ },
+
+ //.........................................................................
+
+ 'computeMD5HashValue': function (aMessage) {
+ var result;
+//Clipperz.Profile.start("Clipperz.Crypto.Base.computeMD5HashValue");
+ result = hex_md5(aMessage);
+//Clipperz.Profile.stop("Clipperz.Crypto.Base.computeMD5HashValue");
+
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'generateRandomSeed': function () {
+//Clipperz.Profile.start("Clipperz.Crypto.Base.generateRandomSeed");
+ var result;
+ var seed;
+ var prng;
+ var charA;
+ var i;
+
+ addEntropyTime();
+
+ seed = keyFromEntropy();
+ prng = new AESprng(seed);
+
+ result = "";
+ charA = ("A").charCodeAt(0);
+
+ for (i = 0; i < 64; i++) {
+ result += String.fromCharCode(charA + prng.nextInt(25));
+ }
+
+ delete prng;
+
+ result = Clipperz.Crypto.Base.computeHashValue(result);
+
+//Clipperz.Profile.stop("Clipperz.Crypto.Base.generateRandomSeed");
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'exception': {
+ 'CorruptedMessage': new MochiKit.Base.NamedError("Clipperz.Crypto.Base.exception.CorruptedMessage")
+ },
+
+ //.........................................................................
+ __syntaxFix__: "syntax fix"
+});
+
diff --git a/frontend/gamma/js/ClipperzCryptoLibrary/BigInt.js b/frontend/gamma/js/ClipperzCryptoLibrary/BigInt.js
new file mode 100644
index 0000000..197cd9a
--- a/dev/null
+++ b/frontend/gamma/js/ClipperzCryptoLibrary/BigInt.js
@@ -0,0 +1,1755 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. 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.
+//
+// This code defines a bigInt library for arbitrary-precision integers.
+// A bigInt is an array of integers storing the value in chunks of bpe bits,
+// little endian (buff[0] is the least significant word).
+// Negative bigInts are stored two's complement.
+// Some functions assume their parameters have at least one leading zero element.
+// Functions with an underscore at the end of the name have unpredictable behavior in case of overflow,
+// so the caller must make sure overflow won't happen.
+// For each function where a parameter is modified, that same
+// variable must not be used as another argument too.
+// So, you cannot square x by doing multMod_(x,x,n).
+// You must use squareMod_(x,n) instead, or do y=dup(x); multMod_(x,y,n).
+//
+// These functions are designed to avoid frequent dynamic memory allocation in the inner loop.
+// For most functions, if it needs a BigInt as a local variable it will actually use
+// a global, and will only allocate to it when it's not the right size. This ensures
+// that when a function is called repeatedly with same-sized parameters, it only allocates
+// memory on the first call.
+//
+// Note that for cryptographic purposes, the calls to Math.random() must
+// be replaced with calls to a better pseudorandom number generator.
+//
+// In the following, "bigInt" means a bigInt with at least one leading zero element,
+// and "integer" means a nonnegative integer less than radix. In some cases, integer
+// can be negative. Negative bigInts are 2s complement.
+//
+// The following functions do not modify their inputs, but dynamically allocate memory every time they are called:
+//
+// function bigInt2str(x,base) //convert a bigInt into a string in a given base, from base 2 up to base 95
+// function dup(x) //returns a copy of bigInt x
+// function findPrimes(n) //return array of all primes less than integer n
+// function int2bigInt(t,n,m) //convert integer t to a bigInt with at least n bits and m array elements
+// function int2bigInt(s,b,n,m) //convert string s in base b to a bigInt with at least n bits and m array elements
+// function trim(x,k) //return a copy of x with exactly k leading zero elements
+//
+// The following functions do not modify their inputs, so there is never a problem with the result being too big:
+//
+// function bitSize(x) //returns how many bits long the bigInt x is, not counting leading zeros
+// function equals(x,y) //is the bigInt x equal to the bigint y?
+// function equalsInt(x,y) //is bigint x equal to integer y?
+// function greater(x,y) //is x>y? (x and y are nonnegative bigInts)
+// function greaterShift(x,y,shift)//is (x <<(shift*bpe)) > y?
+// function isZero(x) //is the bigInt x equal to zero?
+// function millerRabin(x,b) //does one round of Miller-Rabin base integer b say that bigInt x is possibly prime (as opposed to definitely composite)?
+// function modInt(x,n) //return x mod n for bigInt x and integer n.
+// function negative(x) //is bigInt x negative?
+//
+// The following functions do not modify their inputs, but allocate memory and call functions with underscores
+//
+// function add(x,y) //return (x+y) for bigInts x and y.
+// function addInt(x,n) //return (x+n) where x is a bigInt and n is an integer.
+// function expand(x,n) //return a copy of x with at least n elements, adding leading zeros if needed
+// function inverseMod(x,n) //return (x**(-1) mod n) for bigInts x and n. If no inverse exists, it returns null
+// function mod(x,n) //return a new bigInt equal to (x mod n) for bigInts x and n.
+// function mult(x,y) //return x*y for bigInts x and y. This is faster when y<x.
+// function multMod(x,y,n) //return (x*y mod n) for bigInts x,y,n. For greater speed, let y<x.
+// function powMod(x,y,n) //return (x**y mod n) where x,y,n are bigInts and ** is exponentiation. 0**0=1. Faster for odd n.
+// function randTruePrime(k) //return a new, random, k-bit, true prime using Maurer's algorithm.
+// function sub(x,y) //return (x-y) for bigInts x and y. Negative answers will be 2s complement
+//
+// The following functions write a bigInt result to one of the parameters, but
+// the result is never bigger than the original, so there can't be overflow problems:
+//
+// function divInt_(x,n) //do x=floor(x/n) for bigInt x and integer n, and return the remainder
+// function GCD_(x,y) //set x to the greatest common divisor of bigInts x and y, (y is destroyed).
+// function halve_(x) //do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement
+// function mod_(x,n) //do x=x mod n for bigInts x and n.
+// function rightShift_(x,n) //right shift bigInt x by n bits. 0 <= n < bpe.
+//
+// The following functions write a bigInt result to one of the parameters. The caller is responsible for
+// ensuring it is large enough to hold the result.
+//
+// function addInt_(x,n) //do x=x+n where x is a bigInt and n is an integer
+// function add_(x,y) //do x=x+y for bigInts x and y
+// function addShift_(x,y,ys) //do x=x+(y<<(ys*bpe))
+// function copy_(x,y) //do x=y on bigInts x and y
+// function copyInt_(x,n) //do x=n on bigInt x and integer n
+// function carry_(x) //do carries and borrows so each element of the bigInt x fits in bpe bits.
+// function divide_(x,y,q,r) //divide_ x by y giving quotient q and remainder r
+// function eGCD_(x,y,d,a,b) //sets a,b,d to positive big integers such that d = GCD_(x,y) = a*x-b*y
+// function inverseMod_(x,n) //do x=x**(-1) mod n, for bigInts x and n. Returns 1 (0) if inverse does (doesn't) exist
+// function inverseModInt_(x,n) //return x**(-1) mod n, for integers x and n. Return 0 if there is no inverse
+// function leftShift_(x,n) //left shift bigInt x by n bits. n<bpe.
+// function linComb_(x,y,a,b) //do x=a*x+b*y for bigInts x and y and integers a and b
+// function linCombShift_(x,y,b,ys) //do x=x+b*(y<<(ys*bpe)) for bigInts x and y, and integers b and ys
+// function mont_(x,y,n,np) //Montgomery multiplication (see comments where the function is defined)
+// function mult_(x,y) //do x=x*y for bigInts x and y.
+// function multInt_(x,n) //do x=x*n where x is a bigInt and n is an integer.
+// function multMod_(x,y,n) //do x=x*y mod n for bigInts x,y,n.
+// function powMod_(x,y,n) //do x=x**y mod n, where x,y,n are bigInts (n is odd) and ** is exponentiation. 0**0=1.
+// function randBigInt_(b,n,s) //do b = an n-bit random BigInt. if s=1, then nth bit (most significant bit) is set to 1. n>=1.
+// function randTruePrime_(ans,k) //do ans = a random k-bit true random prime (not just probable prime) with 1 in the msb.
+// function squareMod_(x,n) //do x=x*x mod n for bigInts x,n
+// function sub_(x,y) //do x=x-y for bigInts x and y. Negative answers will be 2s complement.
+// function subShift_(x,y,ys) //do x=x-(y<<(ys*bpe)). Negative answers will be 2s complement.
+//
+// The following functions are based on algorithms from the _Handbook of Applied Cryptography_
+// powMod_() = algorithm 14.94, Montgomery exponentiation
+// eGCD_,inverseMod_() = algorithm 14.61, Binary extended GCD_
+// GCD_() = algorothm 14.57, Lehmer's algorithm
+// mont_() = algorithm 14.36, Montgomery multiplication
+// divide_() = algorithm 14.20 Multiple-precision division
+// squareMod_() = algorithm 14.16 Multiple-precision squaring
+// randTruePrime_() = algorithm 4.62, Maurer's algorithm
+// millerRabin() = algorithm 4.24, Miller-Rabin algorithm
+//
+// Profiling shows:
+// randTruePrime_() spends:
+// 10% of its time in calls to powMod_()
+// 85% of its time in calls to millerRabin()
+// millerRabin() spends:
+// 99% of its time in calls to powMod_() (always with a base of 2)
+// powMod_() spends:
+// 94% of its time in calls to mont_() (almost always with x==y)
+//
+// This suggests there are several ways to speed up this library slightly:
+// - convert powMod_ to use a Montgomery form of k-ary window (or maybe a Montgomery form of sliding window)
+// -- this should especially focus on being fast when raising 2 to a power mod n
+// - convert randTruePrime_() to use a minimum r of 1/3 instead of 1/2 with the appropriate change to the test
+// - tune the parameters in randTruePrime_(), including c, m, and recLimit
+// - speed up the single loop in mont_() that takes 95% of the runtime, perhaps by reducing checking
+// within the loop when all the parameters are the same length.
+//
+// There are several ideas that look like they wouldn't help much at all:
+// - replacing trial division in randTruePrime_() with a sieve (that speeds up something taking almost no time anyway)
+// - increase bpe from 15 to 30 (that would help if we had a 32*32->64 multiplier, but not with JavaScript's 32*32->32)
+// - speeding up mont_(x,y,n,np) when x==y by doing a non-modular, non-Montgomery square
+// followed by a Montgomery reduction. The intermediate answer will be twice as long as x, so that
+// method would be slower. This is unfortunate because the code currently spends almost all of its time
+// doing mont_(x,x,...), both for randTruePrime_() and powMod_(). A faster method for Montgomery squaring
+// would have a large impact on the speed of randTruePrime_() and powMod_(). HAC has a couple of poorly-worded
+// sentences that seem to imply it's faster to do a non-modular square followed by a single
+// Montgomery reduction, but that's obviously wrong.
+////////////////////////////////////////////////////////////////////////////////////////
+
+//globals
+bpe=0; //bits stored per array element
+mask=0; //AND this with an array element to chop it down to bpe bits
+radix=mask+1; //equals 2^bpe. A single 1 bit to the left of the last bit of mask.
+
+//the digits for converting to different bases
+digitsStr='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_=!@#$%^&*()[]{}|;:,.<>/?`~ \\\'\"+-';
+
+//initialize the global variables
+for (bpe=0; (1<<(bpe+1)) > (1<<bpe); bpe++); //bpe=number of bits in the mantissa on this platform
+bpe>>=1; //bpe=number of bits in one element of the array representing the bigInt
+mask=(1<<bpe)-1; //AND the mask with an integer to get its bpe least significant bits
+radix=mask+1; //2^bpe. a single 1 bit to the left of the first bit of mask
+one=int2bigInt(1,1,1); //constant used in powMod_()
+
+//the following global variables are scratchpad memory to
+//reduce dynamic memory allocation in the inner loop
+t=new Array(0);
+ss=t; //used in mult_()
+s0=t; //used in multMod_(), squareMod_()
+s1=t; //used in powMod_(), multMod_(), squareMod_()
+s2=t; //used in powMod_(), multMod_()
+s3=t; //used in powMod_()
+s4=t; s5=t; //used in mod_()
+s6=t; //used in bigInt2str()
+s7=t; //used in powMod_()
+T=t; //used in GCD_()
+sa=t; //used in mont_()
+mr_x1=t; mr_r=t; mr_a=t; //used in millerRabin()
+eg_v=t; eg_u=t; eg_A=t; eg_B=t; eg_C=t; eg_D=t; //used in eGCD_(), inverseMod_()
+md_q1=t; md_q2=t; md_q3=t; md_r=t; md_r1=t; md_r2=t; md_tt=t; //used in mod_()
+
+primes=t; pows=t; s_i=t; s_i2=t; s_R=t; s_rm=t; s_q=t; s_n1=t;
+ s_a=t; s_r2=t; s_n=t; s_b=t; s_d=t; s_x1=t; s_x2=t, s_aa=t; //used in randTruePrime_()
+
+////////////////////////////////////////////////////////////////////////////////////////
+
+//return array of all primes less than integer n
+function findPrimes(n) {
+ var i,s,p,ans;
+ s=new Array(n);
+ for (i=0;i<n;i++)
+ s[i]=0;
+ s[0]=2;
+ p=0; //first p elements of s are primes, the rest are a sieve
+ for(;s[p]<n;) { //s[p] is the pth prime
+ for(i=s[p]*s[p]; i<n; i+=s[p]) //mark multiples of s[p]
+ s[i]=1;
+ p++;
+ s[p]=s[p-1]+1;
+ for(; s[p]<n && s[s[p]]; s[p]++); //find next prime (where s[p]==0)
+ }
+ ans=new Array(p);
+ for(i=0;i<p;i++)
+ ans[i]=s[i];
+ return ans;
+}
+
+//does a single round of Miller-Rabin base b consider x to be a possible prime?
+//x is a bigInt, and b is an integer
+function millerRabin(x,b) {
+ var i,j,k,s;
+
+ if (mr_x1.length!=x.length) {
+ mr_x1=dup(x);
+ mr_r=dup(x);
+ mr_a=dup(x);
+ }
+
+ copyInt_(mr_a,b);
+ copy_(mr_r,x);
+ copy_(mr_x1,x);
+
+ addInt_(mr_r,-1);
+ addInt_(mr_x1,-1);
+
+ //s=the highest power of two that divides mr_r
+ k=0;
+ for (i=0;i<mr_r.length;i++)
+ for (j=1;j<mask;j<<=1)
+ if (x[i] & j) {
+ s=(k<mr_r.length+bpe ? k : 0);
+ i=mr_r.length;
+ j=mask;
+ } else
+ k++;
+
+ if (s)
+ rightShift_(mr_r,s);
+
+ powMod_(mr_a,mr_r,x);
+
+ if (!equalsInt(mr_a,1) && !equals(mr_a,mr_x1)) {
+ j=1;
+ while (j<=s-1 && !equals(mr_a,mr_x1)) {
+ squareMod_(mr_a,x);
+ if (equalsInt(mr_a,1)) {
+ return 0;
+ }
+ j++;
+ }
+ if (!equals(mr_a,mr_x1)) {
+ return 0;
+ }
+ }
+ return 1;
+}
+
+//returns how many bits long the bigInt is, not counting leading zeros.
+function bitSize(x) {
+ var j,z,w;
+ for (j=x.length-1; (x[j]==0) && (j>0); j--);
+ for (z=0,w=x[j]; w; (w>>=1),z++);
+ z+=bpe*j;
+ return z;
+}
+
+//return a copy of x with at least n elements, adding leading zeros if needed
+function expand(x,n) {
+ var ans=int2bigInt(0,(x.length>n ? x.length : n)*bpe,0);
+ copy_(ans,x);
+ return ans;
+}
+
+//return a k-bit true random prime using Maurer's algorithm.
+function randTruePrime(k) {
+ var ans=int2bigInt(0,k,0);
+ randTruePrime_(ans,k);
+ return trim(ans,1);
+}
+
+//return a new bigInt equal to (x mod n) for bigInts x and n.
+function mod(x,n) {
+ var ans=dup(x);
+ mod_(ans,n);
+ return trim(ans,1);
+}
+
+//return (x+n) where x is a bigInt and n is an integer.
+function addInt(x,n) {
+ var ans=expand(x,x.length+1);
+ addInt_(ans,n);
+ return trim(ans,1);
+}
+
+//return x*y for bigInts x and y. This is faster when y<x.
+function mult(x,y) {
+ var ans=expand(x,x.length+y.length);
+ mult_(ans,y);
+ return trim(ans,1);
+}
+
+//return (x**y mod n) where x,y,n are bigInts and ** is exponentiation. 0**0=1. Faster for odd n.
+function powMod(x,y,n) {
+ var ans=expand(x,n.length);
+ powMod_(ans,trim(y,2),trim(n,2),0); //this should work without the trim, but doesn't
+ return trim(ans,1);
+}
+
+//return (x-y) for bigInts x and y. Negative answers will be 2s complement
+function sub(x,y) {
+ var ans=expand(x,(x.length>y.length ? x.length+1 : y.length+1));
+ sub_(ans,y);
+ return trim(ans,1);
+}
+
+//return (x+y) for bigInts x and y.
+function add(x,y) {
+ var ans=expand(x,(x.length>y.length ? x.length+1 : y.length+1));
+ add_(ans,y);
+ return trim(ans,1);
+}
+
+//return (x**(-1) mod n) for bigInts x and n. If no inverse exists, it returns null
+function inverseMod(x,n) {
+ var ans=expand(x,n.length);
+ var s;
+ s=inverseMod_(ans,n);
+ return s ? trim(ans,1) : null;
+}
+
+//return (x*y mod n) for bigInts x,y,n. For greater speed, let y<x.
+function multMod(x,y,n) {
+ var ans=expand(x,n.length);
+ multMod_(ans,y,n);
+ return trim(ans,1);
+}
+
+//generate a k-bit true random prime using Maurer's algorithm,
+//and put it into ans. The bigInt ans must be large enough to hold it.
+function randTruePrime_(ans,k) {
+ var c,m,pm,dd,j,r,B,divisible,z,zz,recSize;
+
+ if (primes.length==0)
+ primes=findPrimes(30000); //check for divisibility by primes <=30000
+
+ if (pows.length==0) {
+ pows=new Array(512);
+ for (j=0;j<512;j++) {
+ pows[j]=Math.pow(2,j/511.-1.);
+ }
+ }
+
+ //c and m should be tuned for a particular machine and value of k, to maximize speed
+ //this was: c=primes[primes.length-1]/k/k; //check using all the small primes. (c=0.1 in HAC)
+ c=0.1;
+ m=20; //generate this k-bit number by first recursively generating a number that has between k/2 and k-m bits
+ recLimit=20; /*must be at least 2 (was 29)*/ //stop recursion when k <=recLimit
+
+ if (s_i2.length!=ans.length) {
+ s_i2=dup(ans);
+ s_R =dup(ans);
+ s_n1=dup(ans);
+ s_r2=dup(ans);
+ s_d =dup(ans);
+ s_x1=dup(ans);
+ s_x2=dup(ans);
+ s_b =dup(ans);
+ s_n =dup(ans);
+ s_i =dup(ans);
+ s_rm=dup(ans);
+ s_q =dup(ans);
+ s_a =dup(ans);
+ s_aa=dup(ans);
+ }
+
+ if (k <= recLimit) { //generate small random primes by trial division up to its square root
+ pm=(1<<((k+2)>>1))-1; //pm is binary number with all ones, just over sqrt(2^k)
+ copyInt_(ans,0);
+ for (dd=1;dd;) {
+ dd=0;
+ ans[0]= 1 | (1<<(k-1)) | Math.floor(Math.random()*(1<<k)); //random, k-bit, odd integer, with msb 1
+ for (j=1;(j<primes.length) && ((primes[j]&pm)==primes[j]);j++) { //trial division by all primes 3...sqrt(2^k)
+ if (0==(ans[0]%primes[j])) {
+ dd=1;
+ break;
+ }
+ }
+ }
+ carry_(ans);
+ return;
+ }
+
+ B=c*k*k; //try small primes up to B (or all the primes[] array if the largest is less than B).
+ if (k>2*m) //generate this k-bit number by first recursively generating a number that has between k/2 and k-m bits
+ for (r=1; k-k*r<=m; )
+ r=pows[Math.floor(Math.random()*512)]; //r=Math.pow(2,Math.random()-1);
+ else
+ r=.5;
+
+ //simulation suggests the more complex algorithm using r=.333 is only slightly faster.
+
+ recSize=Math.floor(r*k)+1;
+
+ randTruePrime_(s_q,recSize);
+ copyInt_(s_i2,0);
+ s_i2[Math.floor((k-2)/bpe)] |= (1<<((k-2)%bpe)); //s_i2=2^(k-2)
+ divide_(s_i2,s_q,s_i,s_rm); //s_i=floor((2^(k-1))/(2q))
+
+ z=bitSize(s_i);
+
+ for (;;) {
+ for (;;) { //generate z-bit numbers until one falls in the range [0,s_i-1]
+ randBigInt_(s_R,z,0);
+ if (greater(s_i,s_R))
+ break;
+ } //now s_R is in the range [0,s_i-1]
+ addInt_(s_R,1); //now s_R is in the range [1,s_i]
+ add_(s_R,s_i); //now s_R is in the range [s_i+1,2*s_i]
+
+ copy_(s_n,s_q);
+ mult_(s_n,s_R);
+ multInt_(s_n,2);
+ addInt_(s_n,1); //s_n=2*s_R*s_q+1
+
+ copy_(s_r2,s_R);
+ multInt_(s_r2,2); //s_r2=2*s_R
+
+ //check s_n for divisibility by small primes up to B
+ for (divisible=0,j=0; (j<primes.length) && (primes[j]<B); j++)
+ if (modInt(s_n,primes[j])==0) {
+ divisible=1;
+ break;
+ }
+
+ if (!divisible) //if it passes small primes check, then try a single Miller-Rabin base 2
+ if (!millerRabin(s_n,2)) //this line represents 75% of the total runtime for randTruePrime_
+ divisible=1;
+
+ if (!divisible) { //if it passes that test, continue checking s_n
+ addInt_(s_n,-3);
+ for (j=s_n.length-1;(s_n[j]==0) && (j>0); j--); //strip leading zeros
+ for (zz=0,w=s_n[j]; w; (w>>=1),zz++);
+ zz+=bpe*j; //zz=number of bits in s_n, ignoring leading zeros
+ for (;;) { //generate z-bit numbers until one falls in the range [0,s_n-1]
+ randBigInt_(s_a,zz,0);
+ if (greater(s_n,s_a))
+ break;
+ } //now s_a is in the range [0,s_n-1]
+ addInt_(s_n,3); //now s_a is in the range [0,s_n-4]
+ addInt_(s_a,2); //now s_a is in the range [2,s_n-2]
+ copy_(s_b,s_a);
+ copy_(s_n1,s_n);
+ addInt_(s_n1,-1);
+ powMod_(s_b,s_n1,s_n); //s_b=s_a^(s_n-1) modulo s_n
+ addInt_(s_b,-1);
+ if (isZero(s_b)) {
+ copy_(s_b,s_a);
+ powMod_(s_b,s_r2,s_n);
+ addInt_(s_b,-1);
+ copy_(s_aa,s_n);
+ copy_(s_d,s_b);
+ GCD_(s_d,s_n); //if s_b and s_n are relatively prime, then s_n is a prime
+ if (equalsInt(s_d,1)) {
+ copy_(ans,s_aa);
+ return; //if we've made it this far, then s_n is absolutely guaranteed to be prime
+ }
+ }
+ }
+ }
+}
+
+//set b to an n-bit random BigInt. If s=1, then nth bit (most significant bit) is set to 1.
+//array b must be big enough to hold the result. Must have n>=1
+function randBigInt_(b,n,s) {
+ var i,a;
+ for (i=0;i<b.length;i++)
+ b[i]=0;
+ a=Math.floor((n-1)/bpe)+1; //# array elements to hold the BigInt
+ for (i=0;i<a;i++) {
+ b[i]=Math.floor(Math.random()*(1<<(bpe-1)));
+ }
+ b[a-1] &= (2<<((n-1)%bpe))-1;
+ if (s)
+ b[a-1] |= (1<<((n-1)%bpe));
+}
+
+//set x to the greatest common divisor of x and y.
+//x,y are bigInts with the same number of elements. y is destroyed.
+function GCD_(x,y) {
+ var i,xp,yp,A,B,C,D,q,sing;
+ if (T.length!=x.length)
+ T=dup(x);
+
+ sing=1;
+ while (sing) { //while y has nonzero elements other than y[0]
+ sing=0;
+ for (i=1;i<y.length;i++) //check if y has nonzero elements other than 0
+ if (y[i]) {
+ sing=1;
+ break;
+ }
+ if (!sing) break; //quit when y all zero elements except possibly y[0]
+
+ for (i=x.length;!x[i] && i>=0;i--); //find most significant element of x
+ xp=x[i];
+ yp=y[i];
+ A=1; B=0; C=0; D=1;
+ while ((yp+C) && (yp+D)) {
+ q =Math.floor((xp+A)/(yp+C));
+ qp=Math.floor((xp+B)/(yp+D));
+ if (q!=qp)
+ break;
+ t= A-q*C; A=C; C=t; // do (A,B,xp, C,D,yp) = (C,D,yp, A,B,xp) - q*(0,0,0, C,D,yp)
+ t= B-q*D; B=D; D=t;
+ t=xp-q*yp; xp=yp; yp=t;
+ }
+ if (B) {
+ copy_(T,x);
+ linComb_(x,y,A,B); //x=A*x+B*y
+ linComb_(y,T,D,C); //y=D*y+C*T
+ } else {
+ mod_(x,y);
+ copy_(T,x);
+ copy_(x,y);
+ copy_(y,T);
+ }
+ }
+ if (y[0]==0)
+ return;
+ t=modInt(x,y[0]);
+ copyInt_(x,y[0]);
+ y[0]=t;
+ while (y[0]) {
+ x[0]%=y[0];
+ t=x[0]; x[0]=y[0]; y[0]=t;
+ }
+}
+
+//do x=x**(-1) mod n, for bigInts x and n.
+//If no inverse exists, it sets x to zero and returns 0, else it returns 1.
+//The x array must be at least as large as the n array.
+function inverseMod_(x,n) {
+ var k=1+2*Math.max(x.length,n.length);
+
+ if(!(x[0]&1) && !(n[0]&1)) { //if both inputs are even, then inverse doesn't exist
+ copyInt_(x,0);
+ return 0;
+ }
+
+ if (eg_u.length!=k) {
+ eg_u=new Array(k);
+ eg_v=new Array(k);
+ eg_A=new Array(k);
+ eg_B=new Array(k);
+ eg_C=new Array(k);
+ eg_D=new Array(k);
+ }
+
+ copy_(eg_u,x);
+ copy_(eg_v,n);
+ copyInt_(eg_A,1);
+ copyInt_(eg_B,0);
+ copyInt_(eg_C,0);
+ copyInt_(eg_D,1);
+ for (;;) {
+ while(!(eg_u[0]&1)) { //while eg_u is even
+ halve_(eg_u);
+ if (!(eg_A[0]&1) && !(eg_B[0]&1)) { //if eg_A==eg_B==0 mod 2
+ halve_(eg_A);
+ halve_(eg_B);
+ } else {
+ add_(eg_A,n); halve_(eg_A);
+ sub_(eg_B,x); halve_(eg_B);
+ }
+ }
+
+ while (!(eg_v[0]&1)) { //while eg_v is even
+ halve_(eg_v);
+ if (!(eg_C[0]&1) && !(eg_D[0]&1)) { //if eg_C==eg_D==0 mod 2
+ halve_(eg_C);
+ halve_(eg_D);
+ } else {
+ add_(eg_C,n); halve_(eg_C);
+ sub_(eg_D,x); halve_(eg_D);
+ }
+ }
+
+ if (!greater(eg_v,eg_u)) { //eg_v <= eg_u
+ sub_(eg_u,eg_v);
+ sub_(eg_A,eg_C);
+ sub_(eg_B,eg_D);
+ } else { //eg_v > eg_u
+ sub_(eg_v,eg_u);
+ sub_(eg_C,eg_A);
+ sub_(eg_D,eg_B);
+ }
+
+ if (equalsInt(eg_u,0)) {
+ if (negative(eg_C)) //make sure answer is nonnegative
+ add_(eg_C,n);
+ copy_(x,eg_C);
+
+ if (!equalsInt(eg_v,1)) { //if GCD_(x,n)!=1, then there is no inverse
+ copyInt_(x,0);
+ return 0;
+ }
+ return 1;
+ }
+ }
+}
+
+//return x**(-1) mod n, for integers x and n. Return 0 if there is no inverse
+function inverseModInt_(x,n) {
+ var a=1,b=0,t;
+ for (;;) {
+ if (x==1) return a;
+ if (x==0) return 0;
+ b-=a*Math.floor(n/x);
+ n%=x;
+
+ if (n==1) return b; //to avoid negatives, change this b to n-b, and each -= to +=
+ if (n==0) return 0;
+ a-=b*Math.floor(x/n);
+ x%=n;
+ }
+}
+
+//Given positive bigInts x and y, change the bigints v, a, and b to positive bigInts such that:
+// v = GCD_(x,y) = a*x-b*y
+//The bigInts v, a, b, must have exactly as many elements as the larger of x and y.
+function eGCD_(x,y,v,a,b) {
+ var g=0;
+ var k=Math.max(x.length,y.length);
+ if (eg_u.length!=k) {
+ eg_u=new Array(k);
+ eg_A=new Array(k);
+ eg_B=new Array(k);
+ eg_C=new Array(k);
+ eg_D=new Array(k);
+ }
+ while(!(x[0]&1) && !(y[0]&1)) { //while x and y both even
+ halve_(x);
+ halve_(y);
+ g++;
+ }
+ copy_(eg_u,x);
+ copy_(v,y);
+ copyInt_(eg_A,1);
+ copyInt_(eg_B,0);
+ copyInt_(eg_C,0);
+ copyInt_(eg_D,1);
+ for (;;) {
+ while(!(eg_u[0]&1)) { //while u is even
+ halve_(eg_u);
+ if (!(eg_A[0]&1) && !(eg_B[0]&1)) { //if A==B==0 mod 2
+ halve_(eg_A);
+ halve_(eg_B);
+ } else {
+ add_(eg_A,y); halve_(eg_A);
+ sub_(eg_B,x); halve_(eg_B);
+ }
+ }
+
+ while (!(v[0]&1)) { //while v is even
+ halve_(v);
+ if (!(eg_C[0]&1) && !(eg_D[0]&1)) { //if C==D==0 mod 2
+ halve_(eg_C);
+ halve_(eg_D);
+ } else {
+ add_(eg_C,y); halve_(eg_C);
+ sub_(eg_D,x); halve_(eg_D);
+ }
+ }
+
+ if (!greater(v,eg_u)) { //v<=u
+ sub_(eg_u,v);
+ sub_(eg_A,eg_C);
+ sub_(eg_B,eg_D);
+ } else { //v>u
+ sub_(v,eg_u);
+ sub_(eg_C,eg_A);
+ sub_(eg_D,eg_B);
+ }
+ if (equalsInt(eg_u,0)) {
+ if (negative(eg_C)) { //make sure a (C)is nonnegative
+ add_(eg_C,y);
+ sub_(eg_D,x);
+ }
+ multInt_(eg_D,-1); ///make sure b (D) is nonnegative
+ copy_(a,eg_C);
+ copy_(b,eg_D);
+ leftShift_(v,g);
+ return;
+ }
+ }
+}
+
+
+//is bigInt x negative?
+function negative(x) {
+ return ((x[x.length-1]>>(bpe-1))&1);
+}
+
+
+//is (x << (shift*bpe)) > y?
+//x and y are nonnegative bigInts
+//shift is a nonnegative integer
+function greaterShift(x,y,shift) {
+ var kx=x.length, ky=y.length;
+ k=((kx+shift)<ky) ? (kx+shift) : ky;
+ for (i=ky-1-shift; i<kx && i>=0; i++)
+ if (x[i]>0)
+ return 1; //if there are nonzeros in x to the left of the first column of y, then x is bigger
+ for (i=kx-1+shift; i<ky; i++)
+ if (y[i]>0)
+ return 0; //if there are nonzeros in y to the left of the first column of x, then x is not bigger
+ for (i=k-1; i>=shift; i--)
+ if (x[i-shift]>y[i]) return 1;
+ else if (x[i-shift]<y[i]) return 0;
+ return 0;
+}
+
+//is x > y? (x and y both nonnegative)
+function greater(x,y) {
+ var i;
+ var k=(x.length<y.length) ? x.length : y.length;
+
+ for (i=x.length;i<y.length;i++)
+ if (y[i])
+ return 0; //y has more digits
+
+ for (i=y.length;i<x.length;i++)
+ if (x[i])
+ return 1; //x has more digits
+
+ for (i=k-1;i>=0;i--)
+ if (x[i]>y[i])
+ return 1;
+ else if (x[i]<y[i])
+ return 0;
+ return 0;
+}
+
+//divide_ x by y giving quotient q and remainder r. (q=floor(x/y), r=x mod y). All 4 are bigints.
+//x must have at least one leading zero element.
+//y must be nonzero.
+//q and r must be arrays that are exactly the same length as x.
+//the x array must have at least as many elements as y.
+function divide_(x,y,q,r) {
+ var kx, ky;
+ var i,j,y1,y2,c,a,b;
+ copy_(r,x);
+ for (ky=y.length;y[ky-1]==0;ky--); //kx,ky is number of elements in x,y, not including leading zeros
+ for (kx=r.length;r[kx-1]==0 && kx>ky;kx--);
+
+ //normalize: ensure the most significant element of y has its highest bit set
+ b=y[ky-1];
+ for (a=0; b; a++)
+ b>>=1;
+ a=bpe-a; //a is how many bits to shift so that the high order bit of y is leftmost in its array element
+ leftShift_(y,a); //multiply both by 1<<a now, then divide_ both by that at the end
+ leftShift_(r,a);
+
+ copyInt_(q,0); // q=0
+ while (!greaterShift(y,r,kx-ky)) { // while (leftShift_(y,kx-ky) <= r) {
+ subShift_(r,y,kx-ky); // r=r-leftShift_(y,kx-ky)
+ q[kx-ky]++; // q[kx-ky]++;
+ } // }
+
+ for (i=kx-1; i>=ky; i--) {
+ if (r[i]==y[ky-1])
+ q[i-ky]=mask;
+ else
+ q[i-ky]=Math.floor((r[i]*radix+r[i-1])/y[ky-1]);
+
+ //The following for(;;) loop is equivalent to the commented while loop,
+ //except that the uncommented version avoids overflow.
+ //The commented loop comes from HAC, which assumes r[-1]==y[-1]==0
+ // while (q[i-ky]*(y[ky-1]*radix+y[ky-2]) > r[i]*radix*radix+r[i-1]*radix+r[i-2])
+ // q[i-ky]--;
+ for (;;) {
+ y2=(ky>1 ? y[ky-2] : 0)*q[i-ky];
+ c=y2>>bpe;
+ y2=y2 & mask;
+ y1=c+q[i-ky]*y[ky-1];
+ c=y1>>bpe;
+ y1=y1 & mask;
+
+ if (c==r[i] ? y1==r[i-1] ? y2>(i>1 ? r[i-2] : 0) : y1>r[i-1] : c>r[i])
+ q[i-ky]--;
+ else
+ break;
+ }
+
+ linCombShift_(r,y,-q[i-ky],i-ky); //r=r-q[i-ky]*leftShift_(y,i-ky)
+ if (negative(r)) {
+ addShift_(r,y,i-ky); //r=r+leftShift_(y,i-ky)
+ q[i-ky]--;
+ }
+ }
+
+ rightShift_(y,a); //undo the normalization step
+ rightShift_(r,a); //undo the normalization step
+}
+
+//do carries and borrows so each element of the bigInt x fits in bpe bits.
+function carry_(x) {
+ var i,k,c,b;
+ k=x.length;
+ c=0;
+ for (i=0;i<k;i++) {
+ c+=x[i];
+ b=0;
+ if (c<0) {
+ b=-(c>>bpe);
+ c+=b*radix;
+ }
+ x[i]=c & mask;
+ c=(c>>bpe)-b;
+ }
+}
+
+//return x mod n for bigInt x and integer n.
+function modInt(x,n) {
+ var i,c=0;
+ for (i=x.length-1; i>=0; i--)
+ c=(c*radix+x[i])%n;
+ return c;
+}
+
+//convert the integer t into a bigInt with at least the given number of bits.
+//the returned array stores the bigInt in bpe-bit chunks, little endian (buff[0] is least significant word)
+//Pad the array with leading zeros so that it has at least minSize elements.
+//There will always be at least one leading 0 element.
+function int2bigInt(t,bits,minSize) {
+ var i,k;
+ k=Math.ceil(bits/bpe)+1;
+ k=minSize>k ? minSize : k;
+ buff=new Array(k);
+ copyInt_(buff,t);
+ return buff;
+}
+
+//return the bigInt given a string representation in a given base.
+//Pad the array with leading zeros so that it has at least minSize elements.
+//If base=-1, then it reads in a space-separated list of array elements in decimal.
+//The array will always have at least one leading zero, unless base=-1.
+function str2bigInt(s,base,minSize) {
+ var d, i, j, x, y, kk;
+ var k=s.length;
+ if (base==-1) { //comma-separated list of array elements in decimal
+ x=new Array(0);
+ for (;;) {
+ y=new Array(x.length+1);
+ for (i=0;i<x.length;i++)
+ y[i+1]=x[i];
+ y[0]=parseInt(s,10);
+ x=y;
+ d=s.indexOf(',',0);
+ if (d<1)
+ break;
+ s=s.substring(d+1);
+ if (s.length==0)
+ break;
+ }
+ if (x.length<minSize) {
+ y=new Array(minSize);
+ copy_(y,x);
+ return y;
+ }
+ return x;
+ }
+
+ x=int2bigInt(0,base*k,0);
+ for (i=0;i<k;i++) {
+ d=digitsStr.indexOf(s.substring(i,i+1),0);
+ if (base<=36 && d>=36) //convert lowercase to uppercase if base<=36
+ d-=26;
+ if (d<base && d>=0) { //ignore illegal characters
+ multInt_(x,base);
+ addInt_(x,d);
+ }
+ }
+
+ for (k=x.length;k>0 && !x[k-1];k--); //strip off leading zeros
+ k=minSize>k+1 ? minSize : k+1;
+ y=new Array(k);
+ kk=k<x.length ? k : x.length;
+ for (i=0;i<kk;i++)
+ y[i]=x[i];
+ for (;i<k;i++)
+ y[i]=0;
+ return y;
+}
+
+//is bigint x equal to integer y?
+//y must have less than bpe bits
+function equalsInt(x,y) {
+ var i;
+ if (x[0]!=y)
+ return 0;
+ for (i=1;i<x.length;i++)
+ if (x[i])
+ return 0;
+ return 1;
+}
+
+//are bigints x and y equal?
+//this works even if x and y are different lengths and have arbitrarily many leading zeros
+function equals(x,y) {
+ var i;
+ var k=x.length<y.length ? x.length : y.length;
+ for (i=0;i<k;i++)
+ if (x[i]!=y[i])
+ return 0;
+ if (x.length>y.length) {
+ for (;i<x.length;i++)
+ if (x[i])
+ return 0;
+ } else {
+ for (;i<y.length;i++)
+ if (y[i])
+ return 0;
+ }
+ return 1;
+}
+
+//is the bigInt x equal to zero?
+function isZero(x) {
+ var i;
+ for (i=0;i<x.length;i++)
+ if (x[i])
+ return 0;
+ return 1;
+}
+
+//convert a bigInt into a string in a given base, from base 2 up to base 95.
+//Base -1 prints the contents of the array representing the number.
+function bigInt2str(x,base) {
+ var i,t,s="";
+
+ if (s6.length!=x.length)
+ s6=dup(x);
+ else
+ copy_(s6,x);
+
+ if (base==-1) { //return the list of array contents
+ for (i=x.length-1;i>0;i--)
+ s+=x[i]+',';
+ s+=x[0];
+ }
+ else { //return it in the given base
+ while (!isZero(s6)) {
+ t=divInt_(s6,base); //t=s6 % base; s6=floor(s6/base);
+ s=digitsStr.substring(t,t+1)+s;
+ }
+ }
+ if (s.length==0)
+ s="0";
+ return s;
+}
+
+//returns a duplicate of bigInt x
+function dup(x) {
+ var i;
+ buff=new Array(x.length);
+ copy_(buff,x);
+ return buff;
+}
+
+//do x=y on bigInts x and y. x must be an array at least as big as y (not counting the leading zeros in y).
+function copy_(x,y) {
+ var i;
+ var k=x.length<y.length ? x.length : y.length;
+ for (i=0;i<k;i++)
+ x[i]=y[i];
+ for (i=k;i<x.length;i++)
+ x[i]=0;
+}
+
+//do x=y on bigInt x and integer y.
+function copyInt_(x,n) {
+ var i,c;
+ for (c=n,i=0;i<x.length;i++) {
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+}
+
+//do x=x+n where x is a bigInt and n is an integer.
+//x must be large enough to hold the result.
+function addInt_(x,n) {
+ var i,k,c,b;
+ x[0]+=n;
+ k=x.length;
+ c=0;
+ for (i=0;i<k;i++) {
+ c+=x[i];
+ b=0;
+ if (c<0) {
+ b=-(c>>bpe);
+ c+=b*radix;
+ }
+ x[i]=c & mask;
+ c=(c>>bpe)-b;
+ if (!c) return; //stop carrying as soon as the carry_ is zero
+ }
+}
+
+//right shift bigInt x by n bits. 0 <= n < bpe.
+function rightShift_(x,n) {
+ var i;
+ var k=Math.floor(n/bpe);
+ if (k) {
+ for (i=0;i<x.length-k;i++) //right shift x by k elements
+ x[i]=x[i+k];
+ for (;i<x.length;i++)
+ x[i]=0;
+ n%=bpe;
+ }
+ for (i=0;i<x.length-1;i++) {
+ x[i]=mask & ((x[i+1]<<(bpe-n)) | (x[i]>>n));
+ }
+ x[i]>>=n;
+}
+
+//do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement
+function halve_(x) {
+ var i;
+ for (i=0;i<x.length-1;i++) {
+ x[i]=mask & ((x[i+1]<<(bpe-1)) | (x[i]>>1));
+ }
+ x[i]=(x[i]>>1) | (x[i] & (radix>>1)); //most significant bit stays the same
+}
+
+//left shift bigInt x by n bits.
+function leftShift_(x,n) {
+ var i;
+ var k=Math.floor(n/bpe);
+ if (k) {
+ for (i=x.length; i>=k; i--) //left shift x by k elements
+ x[i]=x[i-k];
+ for (;i>=0;i--)
+ x[i]=0;
+ n%=bpe;
+ }
+ if (!n)
+ return;
+ for (i=x.length-1;i>0;i--) {
+ x[i]=mask & ((x[i]<<n) | (x[i-1]>>(bpe-n)));
+ }
+ x[i]=mask & (x[i]<<n);
+}
+
+//do x=x*n where x is a bigInt and n is an integer.
+//x must be large enough to hold the result.
+function multInt_(x,n) {
+ var i,k,c,b;
+ if (!n)
+ return;
+ k=x.length;
+ c=0;
+ for (i=0;i<k;i++) {
+ c+=x[i]*n;
+ b=0;
+ if (c<0) {
+ b=-(c>>bpe);
+ c+=b*radix;
+ }
+ x[i]=c & mask;
+ c=(c>>bpe)-b;
+ }
+}
+
+//do x=floor(x/n) for bigInt x and integer n, and return the remainder
+function divInt_(x,n) {
+ var i,r=0,s;
+ for (i=x.length-1;i>=0;i--) {
+ s=r*radix+x[i];
+ x[i]=Math.floor(s/n);
+ r=s%n;
+ }
+ return r;
+}
+
+//do the linear combination x=a*x+b*y for bigInts x and y, and integers a and b.
+//x must be large enough to hold the answer.
+function linComb_(x,y,a,b) {
+ var i,c,k,kk;
+ k=x.length<y.length ? x.length : y.length;
+ kk=x.length;
+ for (c=0,i=0;i<k;i++) {
+ c+=a*x[i]+b*y[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+ for (i=k;i<kk;i++) {
+ c+=a*x[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+}
+
+//do the linear combination x=a*x+b*(y<<(ys*bpe)) for bigInts x and y, and integers a, b and ys.
+//x must be large enough to hold the answer.
+function linCombShift_(x,y,b,ys) {
+ var i,c,k,kk;
+ k=x.length<ys+y.length ? x.length : ys+y.length;
+ kk=x.length;
+ for (c=0,i=ys;i<k;i++) {
+ c+=x[i]+b*y[i-ys];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+ for (i=k;c && i<kk;i++) {
+ c+=x[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+}
+
+//do x=x+(y<<(ys*bpe)) for bigInts x and y, and integers a,b and ys.
+//x must be large enough to hold the answer.
+function addShift_(x,y,ys) {
+ var i,c,k,kk;
+ k=x.length<ys+y.length ? x.length : ys+y.length;
+ kk=x.length;
+ for (c=0,i=ys;i<k;i++) {
+ c+=x[i]+y[i-ys];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+ for (i=k;c && i<kk;i++) {
+ c+=x[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+}
+
+//do x=x-(y<<(ys*bpe)) for bigInts x and y, and integers a,b and ys.
+//x must be large enough to hold the answer.
+function subShift_(x,y,ys) {
+ var i,c,k,kk;
+ k=x.length<ys+y.length ? x.length : ys+y.length;
+ kk=x.length;
+ for (c=0,i=ys;i<k;i++) {
+ c+=x[i]-y[i-ys];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+ for (i=k;c && i<kk;i++) {
+ c+=x[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+}
+
+//do x=x-y for bigInts x and y.
+//x must be large enough to hold the answer.
+//negative answers will be 2s complement
+function sub_(x,y) {
+ var i,c,k,kk;
+ k=x.length<y.length ? x.length : y.length;
+ for (c=0,i=0;i<k;i++) {
+ c+=x[i]-y[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+ for (i=k;c && i<x.length;i++) {
+ c+=x[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+}
+
+//do x=x+y for bigInts x and y.
+//x must be large enough to hold the answer.
+function add_(x,y) {
+ var i,c,k,kk;
+ k=x.length<y.length ? x.length : y.length;
+ for (c=0,i=0;i<k;i++) {
+ c+=x[i]+y[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+ for (i=k;c && i<x.length;i++) {
+ c+=x[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+}
+
+//do x=x*y for bigInts x and y. This is faster when y<x.
+function mult_(x,y) {
+ var i;
+ if (ss.length!=2*x.length)
+ ss=new Array(2*x.length);
+ copyInt_(ss,0);
+ for (i=0;i<y.length;i++)
+ if (y[i])
+ linCombShift_(ss,x,y[i],i); //ss=1*ss+y[i]*(x<<(i*bpe))
+ copy_(x,ss);
+}
+
+//do x=x mod n for bigInts x and n.
+function mod_(x,n) {
+ if (s4.length!=x.length)
+ s4=dup(x);
+ else
+ copy_(s4,x);
+ if (s5.length!=x.length)
+ s5=dup(x);
+ divide_(s4,n,s5,x); //x = remainder of s4 / n
+}
+
+//do x=x*y mod n for bigInts x,y,n.
+//for greater speed, let y<x.
+function multMod_(x,y,n) {
+ var i;
+ if (s0.length!=2*x.length)
+ s0=new Array(2*x.length);
+ copyInt_(s0,0);
+ for (i=0;i<y.length;i++)
+ if (y[i])
+ linCombShift_(s0,x,y[i],i); //s0=1*s0+y[i]*(x<<(i*bpe))
+ mod_(s0,n);
+ copy_(x,s0);
+}
+
+//do x=x*x mod n for bigInts x,n.
+function squareMod_(x,n) {
+ var i,j,d,c,kx,kn,k;
+ for (kx=x.length; kx>0 && !x[kx-1]; kx--); //ignore leading zeros in x
+ k=kx>n.length ? 2*kx : 2*n.length; //k=# elements in the product, which is twice the elements in the larger of x and n
+ if (s0.length!=k)
+ s0=new Array(k);
+ copyInt_(s0,0);
+ for (i=0;i<kx;i++) {
+ c=s0[2*i]+x[i]*x[i];
+ s0[2*i]=c & mask;
+ c>>=bpe;
+ for (j=i+1;j<kx;j++) {
+ c=s0[i+j]+2*x[i]*x[j]+c;
+ s0[i+j]=(c & mask);
+ c>>=bpe;
+ }
+ s0[i+kx]=c;
+ }
+ mod_(s0,n);
+ copy_(x,s0);
+}
+
+//return x with exactly k leading zero elements
+function trim(x,k) {
+ var i,y;
+ for (i=x.length; i>0 && !x[i-1]; i--);
+ y=new Array(i+k);
+ copy_(y,x);
+ return y;
+}
+
+//do x=x**y mod n, where x,y,n are bigInts and ** is exponentiation. 0**0=1.
+//this is faster when n is odd. x usually needs to have as many elements as n.
+function powMod_(x,y,n) {
+ var k1,k2,kn,np;
+ if(s7.length!=n.length)
+ s7=dup(n);
+
+ //for even modulus, use a simple square-and-multiply algorithm,
+ //rather than using the more complex Montgomery algorithm.
+ if ((n[0]&1)==0) {
+ copy_(s7,x);
+ copyInt_(x,1);
+ while(!equalsInt(y,0)) {
+ if (y[0]&1)
+ multMod_(x,s7,n);
+ divInt_(y,2);
+ squareMod_(s7,n);
+ }
+ return;
+ }
+
+ //calculate np from n for the Montgomery multiplications
+ copyInt_(s7,0);
+ for (kn=n.length;kn>0 && !n[kn-1];kn--);
+ np=radix-inverseModInt_(modInt(n,radix),radix);
+ s7[kn]=1;
+ multMod_(x ,s7,n); // x = x * 2**(kn*bp) mod n
+
+ if (s3.length!=x.length)
+ s3=dup(x);
+ else
+ copy_(s3,x);
+
+ for (k1=y.length-1;k1>0 & !y[k1]; k1--); //k1=first nonzero element of y
+ if (y[k1]==0) { //anything to the 0th power is 1
+ copyInt_(x,1);
+ return;
+ }
+ for (k2=1<<(bpe-1);k2 && !(y[k1] & k2); k2>>=1); //k2=position of first 1 bit in y[k1]
+ for (;;) {
+ if (!(k2>>=1)) { //look at next bit of y
+ k1--;
+ if (k1<0) {
+ mont_(x,one,n,np);
+ return;
+ }
+ k2=1<<(bpe-1);
+ }
+ mont_(x,x,n,np);
+
+ if (k2 & y[k1]) //if next bit is a 1
+ mont_(x,s3,n,np);
+ }
+}
+
+//do x=x*y*Ri mod n for bigInts x,y,n,
+// where Ri = 2**(-kn*bpe) mod n, and kn is the
+// number of elements in the n array, not
+// counting leading zeros.
+//x must be large enough to hold the answer.
+//It's OK if x and y are the same variable.
+//must have:
+// x,y < n
+// n is odd
+// np = -(n^(-1)) mod radix
+function mont_(x,y,n,np) {
+ var i,j,c,ui,t;
+ var kn=n.length;
+ var ky=y.length;
+
+ if (sa.length!=kn)
+ sa=new Array(kn);
+
+ for (;kn>0 && n[kn-1]==0;kn--); //ignore leading zeros of n
+ //this function sometimes gives wrong answers when the next line is uncommented
+ //for (;ky>0 && y[ky-1]==0;ky--); //ignore leading zeros of y
+
+ copyInt_(sa,0);
+
+ //the following loop consumes 95% of the runtime for randTruePrime_() and powMod_() for large keys
+ for (i=0; i<kn; i++) {
+ t=sa[0]+x[i]*y[0];
+ ui=((t & mask) * np) & mask; //the inner "& mask" is needed on Macintosh MSIE, but not windows MSIE
+ c=(t+ui*n[0]) >> bpe;
+ t=x[i];
+
+ //do sa=(sa+x[i]*y+ui*n)/b where b=2**bpe
+ for (j=1;j<ky;j++) {
+ c+=sa[j]+t*y[j]+ui*n[j];
+ sa[j-1]=c & mask;
+ c>>=bpe;
+ }
+ for (;j<kn;j++) {
+ c+=sa[j]+ui*n[j];
+ sa[j-1]=c & mask;
+ c>>=bpe;
+ }
+ sa[j-1]=c & mask;
+ }
+
+ if (!greater(n,sa))
+ sub_(sa,n);
+ copy_(x,sa);
+}
+
+
+
+
+//#############################################################################
+//#############################################################################
+//#############################################################################
+//#############################################################################
+//#############################################################################
+//#############################################################################
+//#############################################################################
+
+
+
+
+
+//#############################################################################
+
+Clipperz.Crypto.BigInt = function (aValue, aBase) {
+ var base;
+ var value;
+
+ if (typeof(aValue) == 'object') {
+ this._internalValue = aValue;
+ } else {
+ if (typeof(aValue) == 'undefined') {
+ value = "0";
+ } else {
+ value = aValue + "";
+ }
+
+ if (typeof(aBase) == 'undefined') {
+ base = 10;
+ } else {
+ base = aBase;
+ }
+
+ this._internalValue = str2bigInt(value, base, 1, 1);
+ }
+
+ return this;
+}
+
+//=============================================================================
+
+MochiKit.Base.update(Clipperz.Crypto.BigInt.prototype, {
+
+ 'clone': function() {
+ return new Clipperz.Crypto.BigInt(this.internalValue());
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'internalValue': function () {
+ return this._internalValue;
+ },
+
+ //-------------------------------------------------------------------------
+
+ '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);
+ } else {
+ throw Clipperz.Crypt.BigInt.exception.UnknownType;
+ }
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'compare': function(aValue) {
+/*
+ var result;
+ var thisAsString;
+ var aValueAsString;
+
+ thisAsString = this.asString(10);
+ aValueAsString = aValue.asString(10);
+
+ result = MochiKit.Base.compare(thisAsString.length, aValueAsString.length);
+ if (result == 0) {
+ result = MochiKit.Base.compare(thisAsString, aValueAsString);
+ }
+
+ return result;
+*/
+ var result;
+
+ if (equals(this.internalValue(), aValue.internalValue())) {
+ result = 0;
+ } else if (greater(this.internalValue(), aValue.internalValue())) {
+ result = 1;
+ } else {
+ result = -1;
+ }
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'add': function (aValue) {
+ var result;
+
+ if (aValue.isBigInt) {
+ result = add(this.internalValue(), aValue.internalValue());
+ } else {
+ result = addInt(this.internalValue(), aValue);
+ }
+
+ return new Clipperz.Crypto.BigInt(result);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'subtract': function (aValue) {
+ var result;
+ var value;
+
+ if (aValue.isBigInt) {
+ value = aValue;
+ } else {
+ value = new Clipperz.Crypto.BigInt(aValue);
+ }
+
+ result = sub(this.internalValue(), value.internalValue());
+
+ return new Clipperz.Crypto.BigInt(result);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'multiply': function (aValue, aModule) {
+ var result;
+ var value;
+
+ if (aValue.isBigInt) {
+ value = aValue;
+ } else {
+ value = new Clipperz.Crypto.BigInt(aValue);
+ }
+
+ if (typeof(aModule) == 'undefined') {
+ result = mult(this.internalValue(), value.internalValue());
+ } else {
+ if (greater(this.internalValue(), value.internalValue())) {
+ result = multMod(this.internalValue(), value.internalValue(), aModule);
+ } else {
+ result = multMod(value.internalValue(), this.internalValue(), aModule);
+ }
+ }
+
+ return new Clipperz.Crypto.BigInt(result);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'module': function (aModule) {
+ var result;
+ var module;
+
+ if (aModule.isBigInt) {
+ module = aModule;
+ } else {
+ module = new Clipperz.Crypto.BigInt(aModule);
+ }
+
+ result = mod(this.internalValue(), module.internalValue());
+
+ return new Clipperz.Crypto.BigInt(result);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'powerModule': function(aValue, aModule) {
+ var result;
+ var value;
+ var module;
+
+ if (aValue.isBigInt) {
+ value = aValue;
+ } else {
+ value = new Clipperz.Crypto.BigInt(aValue);
+ }
+
+ if (aModule.isBigInt) {
+ module = aModule;
+ } else {
+ module = new Clipperz.Crypto.BigInt(aModule);
+ }
+
+ if (aValue == -1) {
+ result = inverseMod(this.internalValue(), module.internalValue());
+ } else {
+ result = powMod(this.internalValue(), value.internalValue(), module.internalValue());
+ }
+
+ return new Clipperz.Crypto.BigInt(result);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'xor': function(aValue) {
+ var result;
+ var thisByteArray;
+ var aValueByteArray;
+ var xorArray;
+
+ thisByteArray = new Clipperz.ByteArray("0x" + this.asString(16), 16);
+ aValueByteArray = new Clipperz.ByteArray("0x" + aValue.asString(16), 16);
+ xorArray = thisByteArray.xorMergeWithBlock(aValueByteArray, 'right');
+ result = new Clipperz.Crypto.BigInt(xorArray.toHexString(), 16);
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'shiftLeft': function(aNumberOfBitsToShift) {
+ var result;
+ var internalResult;
+ var wholeByteToShift;
+ var bitsLeftToShift;
+
+ wholeByteToShift = Math.floor(aNumberOfBitsToShift / 8);
+ bitsLeftToShift = aNumberOfBitsToShift % 8;
+
+ if (wholeByteToShift == 0) {
+ internalResult = this.internalValue();
+ } else {
+ var hexValue;
+ var i,c;
+
+ hexValue = this.asString(16);
+ c = wholeByteToShift;
+ for (i=0; i<c; i++) {
+ hexValue += "00";
+ }
+ internalResult = str2bigInt(hexValue, 16, 1, 1);
+ }
+
+ if (bitsLeftToShift > 0) {
+ leftShift_(internalResult, bitsLeftToShift);
+ }
+ result = new Clipperz.Crypto.BigInt(internalResult);
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'bitSize': function() {
+ return bitSize(this.internalValue());
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'isBitSet': function(aBitPosition) {
+ var result;
+
+ if (this.asByteArray().bitAtIndex(aBitPosition) == 0) {
+ result = false;
+ } else {
+ result = true;
+ };
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+
+});
+
+//#############################################################################
+
+Clipperz.Crypto.BigInt.randomPrime = function(aBitSize) {
+ return new Clipperz.Crypto.BigInt(randTruePrime(aBitSize));
+}
+
+//#############################################################################
+//#############################################################################
+
+Clipperz.Crypto.BigInt.ZERO = new Clipperz.Crypto.BigInt(0);
+
+//#############################################################################
+
+Clipperz.Crypto.BigInt.equals = function(a, b) {
+ return a.equals(b);
+}
+
+Clipperz.Crypto.BigInt.add = function(a, b) {
+ return a.add(b);
+}
+
+Clipperz.Crypto.BigInt.subtract = function(a, b) {
+ return a.subtract(b);
+}
+
+Clipperz.Crypto.BigInt.multiply = function(a, b, module) {
+ return a.multiply(b, module);
+}
+
+Clipperz.Crypto.BigInt.module = function(a, module) {
+ return a.module(module);
+}
+
+Clipperz.Crypto.BigInt.powerModule = function(a, b, module) {
+ return a.powerModule(b, module);
+}
+
+Clipperz.Crypto.BigInt.exception = {
+ UnknownType: new MochiKit.Base.NamedError("Clipperz.Crypto.BigInt.exception.UnknownType")
+}
diff --git a/frontend/gamma/js/ClipperzCryptoLibrary/BigInt_scoped.js b/frontend/gamma/js/ClipperzCryptoLibrary/BigInt_scoped.js
new file mode 100644
index 0000000..bc60330
--- a/dev/null
+++ b/frontend/gamma/js/ClipperzCryptoLibrary/BigInt_scoped.js
@@ -0,0 +1,1644 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
+if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; }
+
+if (typeof(Leemon) == 'undefined') { Leemon = {}; }
+if (typeof(Baird.Crypto) == 'undefined') { Baird.Crypto = {}; }
+if (typeof(Baird.Crypto.BigInt) == 'undefined') { Baird.Crypto.BigInt = {}; }
+
+
+//#############################################################################
+// 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.
+//
+// This code defines a bigInt library for arbitrary-precision integers.
+// A bigInt is an array of integers storing the value in chunks of bpe bits,
+// little endian (buff[0] is the least significant word).
+// Negative bigInts are stored two's complement.
+// Some functions assume their parameters have at least one leading zero element.
+// Functions with an underscore at the end of the name have unpredictable behavior in case of overflow,
+// so the caller must make sure overflow won't happen.
+// For each function where a parameter is modified, that same
+// variable must not be used as another argument too.
+// So, you cannot square x by doing multMod_(x,x,n).
+// You must use squareMod_(x,n) instead, or do y=dup(x); multMod_(x,y,n).
+//
+// These functions are designed to avoid frequent dynamic memory allocation in the inner loop.
+// For most functions, if it needs a BigInt as a local variable it will actually use
+// a global, and will only allocate to it when it's not the right size. This ensures
+// that when a function is called repeatedly with same-sized parameters, it only allocates
+// memory on the first call.
+//
+// Note that for cryptographic purposes, the calls to Math.random() must
+// be replaced with calls to a better pseudorandom number generator.
+//
+// In the following, "bigInt" means a bigInt with at least one leading zero element,
+// and "integer" means a nonnegative integer less than radix. In some cases, integer
+// can be negative. Negative bigInts are 2s complement.
+//
+// The following functions do not modify their inputs, but dynamically allocate memory every time they are called:
+//
+// function bigInt2str(x,base) //convert a bigInt into a string in a given base, from base 2 up to base 95
+// function dup(x) //returns a copy of bigInt x
+// function findPrimes(n) //return array of all primes less than integer n
+// function int2bigInt(t,n,m) //convert integer t to a bigInt with at least n bits and m array elements
+// function str2bigInt(s,b,n,m) //convert string s in base b to a bigInt with at least n bits and m array elements
+// function trim(x,k) //return a copy of x with exactly k leading zero elements
+//
+// The following functions do not modify their inputs, so there is never a problem with the result being too big:
+//
+// function bitSize(x) //returns how many bits long the bigInt x is, not counting leading zeros
+// function equals(x,y) //is the bigInt x equal to the bigint y?
+// function equalsInt(x,y) //is bigint x equal to integer y?
+// function greater(x,y) //is x>y? (x and y are nonnegative bigInts)
+// function greaterShift(x,y,shift)//is (x <<(shift*bpe)) > y?
+// function isZero(x) //is the bigInt x equal to zero?
+// function millerRabin(x,b) //does one round of Miller-Rabin base integer b say that bigInt x is possibly prime (as opposed to definitely composite)?
+// function modInt(x,n) //return x mod n for bigInt x and integer n.
+// function negative(x) //is bigInt x negative?
+//
+// The following functions do not modify their inputs, but allocate memory and call functions with underscores
+//
+// function add(x,y) //return (x+y) for bigInts x and y.
+// function addInt(x,n) //return (x+n) where x is a bigInt and n is an integer.
+// function expand(x,n) //return a copy of x with at least n elements, adding leading zeros if needed
+// function inverseMod(x,n) //return (x**(-1) mod n) for bigInts x and n. If no inverse exists, it returns null
+// function mod(x,n) //return a new bigInt equal to (x mod n) for bigInts x and n.
+// function mult(x,y) //return x*y for bigInts x and y. This is faster when y<x.
+// function multMod(x,y,n) //return (x*y mod n) for bigInts x,y,n. For greater speed, let y<x.
+// function powMod(x,y,n) //return (x**y mod n) where x,y,n are bigInts and ** is exponentiation. 0**0=1. Faster for odd n.
+// function randTruePrime(k) //return a new, random, k-bit, true prime using Maurer's algorithm.
+// function sub(x,y) //return (x-y) for bigInts x and y. Negative answers will be 2s complement
+//
+// The following functions write a bigInt result to one of the parameters, but
+// the result is never bigger than the original, so there can't be overflow problems:
+//
+// function divInt_(x,n) //do x=floor(x/n) for bigInt x and integer n, and return the remainder
+// function GCD_(x,y) //set x to the greatest common divisor of bigInts x and y, (y is destroyed).
+// function halve_(x) //do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement
+// function mod_(x,n) //do x=x mod n for bigInts x and n.
+// function rightShift_(x,n) //right shift bigInt x by n bits. 0 <= n < bpe.
+//
+// The following functions write a bigInt result to one of the parameters. The caller is responsible for
+// ensuring it is large enough to hold the result.
+//
+// function addInt_(x,n) //do x=x+n where x is a bigInt and n is an integer
+// function add_(x,y) //do x=x+y for bigInts x and y
+// function addShift_(x,y,ys) //do x=x+(y<<(ys*bpe))
+// function copy_(x,y) //do x=y on bigInts x and y
+// function copyInt_(x,n) //do x=n on bigInt x and integer n
+// function carry_(x) //do carries and borrows so each element of the bigInt x fits in bpe bits.
+// function divide_(x,y,q,r) //divide_ x by y giving quotient q and remainder r
+// function eGCD_(x,y,d,a,b) //sets a,b,d to positive big integers such that d = GCD_(x,y) = a*x-b*y
+// function inverseMod_(x,n) //do x=x**(-1) mod n, for bigInts x and n. Returns 1 (0) if inverse does (doesn't) exist
+// function inverseModInt_(x,n) //return x**(-1) mod n, for integers x and n. Return 0 if there is no inverse
+// function leftShift_(x,n) //left shift bigInt x by n bits. n<bpe.
+// function linComb_(x,y,a,b) //do x=a*x+b*y for bigInts x and y and integers a and b
+// function linCombShift_(x,y,b,ys) //do x=x+b*(y<<(ys*bpe)) for bigInts x and y, and integers b and ys
+// function mont_(x,y,n,np) //Montgomery multiplication (see comments where the function is defined)
+// function mult_(x,y) //do x=x*y for bigInts x and y.
+// function multInt_(x,n) //do x=x*n where x is a bigInt and n is an integer.
+// function multMod_(x,y,n) //do x=x*y mod n for bigInts x,y,n.
+// function powMod_(x,y,n) //do x=x**y mod n, where x,y,n are bigInts (n is odd) and ** is exponentiation. 0**0=1.
+// function randBigInt_(b,n,s) //do b = an n-bit random BigInt. if s=1, then nth bit (most significant bit) is set to 1. n>=1.
+// function randTruePrime_(ans,k) //do ans = a random k-bit true random prime (not just probable prime) with 1 in the msb.
+// function squareMod_(x,n) //do x=x*x mod n for bigInts x,n
+// function sub_(x,y) //do x=x-y for bigInts x and y. Negative answers will be 2s complement.
+// function subShift_(x,y,ys) //do x=x-(y<<(ys*bpe)). Negative answers will be 2s complement.
+//
+// The following functions are based on algorithms from the _Handbook of Applied Cryptography_
+// powMod_() = algorithm 14.94, Montgomery exponentiation
+// eGCD_,inverseMod_() = algorithm 14.61, Binary extended GCD_
+// GCD_() = algorothm 14.57, Lehmer's algorithm
+// mont_() = algorithm 14.36, Montgomery multiplication
+// divide_() = algorithm 14.20 Multiple-precision division
+// squareMod_() = algorithm 14.16 Multiple-precision squaring
+// randTruePrime_() = algorithm 4.62, Maurer's algorithm
+// millerRabin() = algorithm 4.24, Miller-Rabin algorithm
+//
+// Profiling shows:
+// randTruePrime_() spends:
+// 10% of its time in calls to powMod_()
+// 85% of its time in calls to millerRabin()
+// millerRabin() spends:
+// 99% of its time in calls to powMod_() (always with a base of 2)
+// powMod_() spends:
+// 94% of its time in calls to mont_() (almost always with x==y)
+//
+// This suggests there are several ways to speed up this library slightly:
+// - convert powMod_ to use a Montgomery form of k-ary window (or maybe a Montgomery form of sliding window)
+// -- this should especially focus on being fast when raising 2 to a power mod n
+// - convert randTruePrime_() to use a minimum r of 1/3 instead of 1/2 with the appropriate change to the test
+// - tune the parameters in randTruePrime_(), including c, m, and recLimit
+// - speed up the single loop in mont_() that takes 95% of the runtime, perhaps by reducing checking
+// within the loop when all the parameters are the same length.
+//
+// There are several ideas that look like they wouldn't help much at all:
+// - replacing trial division in randTruePrime_() with a sieve (that speeds up something taking almost no time anyway)
+// - increase bpe from 15 to 30 (that would help if we had a 32*32->64 multiplier, but not with JavaScript's 32*32->32)
+// - speeding up mont_(x,y,n,np) when x==y by doing a non-modular, non-Montgomery square
+// followed by a Montgomery reduction. The intermediate answer will be twice as long as x, so that
+// method would be slower. This is unfortunate because the code currently spends almost all of its time
+// doing mont_(x,x,...), both for randTruePrime_() and powMod_(). A faster method for Montgomery squaring
+// would have a large impact on the speed of randTruePrime_() and powMod_(). HAC has a couple of poorly-worded
+// sentences that seem to imply it's faster to do a non-modular square followed by a single
+// Montgomery reduction, but that's obviously wrong.
+////////////////////////////////////////////////////////////////////////////////////////
+
+//
+// The whole library has been moved into the Baird.Crypto.BigInt scope by Giulio Cesare Solaroli <giulio.cesare@clipperz.com>
+//
+Baird.Crypto.BigInt.VERSION = "5.0";
+Baird.Crypto.BigInt.NAME = "Baird.Crypto.BigInt";
+
+MochiKit.Base.update(Baird.Crypto.BigInt, {
+ //globals
+ 'bpe': 0, //bits stored per array element
+ 'mask': 0, //AND this with an array element to chop it down to bpe bits
+ 'radix': Baird.Crypto.BigInt.mask + 1, //equals 2^bpe. A single 1 bit to the left of the last bit of mask.
+
+ //the digits for converting to different bases
+ 'digitsStr': '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_=!@#$%^&*()[]{}|;:,.<>/?`~ \\\'\"+-',
+
+//initialize the global variables
+for (bpe=0; (1<<(bpe+1)) > (1<<bpe); bpe++); //bpe=number of bits in the mantissa on this platform
+bpe>>=1; //bpe=number of bits in one element of the array representing the bigInt
+mask=(1<<bpe)-1; //AND the mask with an integer to get its bpe least significant bits
+radix=mask+1; //2^bpe. a single 1 bit to the left of the first bit of mask
+one=int2bigInt(1,1,1); //constant used in powMod_()
+
+//the following global variables are scratchpad memory to
+//reduce dynamic memory allocation in the inner loop
+t=new Array(0);
+ss=t; //used in mult_()
+s0=t; //used in multMod_(), squareMod_()
+s1=t; //used in powMod_(), multMod_(), squareMod_()
+s2=t; //used in powMod_(), multMod_()
+s3=t; //used in powMod_()
+s4=t; s5=t; //used in mod_()
+s6=t; //used in bigInt2str()
+s7=t; //used in powMod_()
+T=t; //used in GCD_()
+sa=t; //used in mont_()
+mr_x1=t; mr_r=t; mr_a=t; //used in millerRabin()
+eg_v=t; eg_u=t; eg_A=t; eg_B=t; eg_C=t; eg_D=t; //used in eGCD_(), inverseMod_()
+md_q1=t; md_q2=t; md_q3=t; md_r=t; md_r1=t; md_r2=t; md_tt=t; //used in mod_()
+
+primes=t; pows=t; s_i=t; s_i2=t; s_R=t; s_rm=t; s_q=t; s_n1=t;
+ s_a=t; s_r2=t; s_n=t; s_b=t; s_d=t; s_x1=t; s_x2=t, s_aa=t; //used in randTruePrime_()
+
+////////////////////////////////////////////////////////////////////////////////////////
+
+ //return array of all primes less than integer n
+ 'findPrimes': function(n) {
+ var i,s,p,ans;
+ s=new Array(n);
+ for (i=0;i<n;i++)
+ s[i]=0;
+ s[0]=2;
+ p=0; //first p elements of s are primes, the rest are a sieve
+ for(;s[p]<n;) { //s[p] is the pth prime
+ for(i=s[p]*s[p]; i<n; i+=s[p]) //mark multiples of s[p]
+ s[i]=1;
+ p++;
+ s[p]=s[p-1]+1;
+ for(; s[p]<n && s[s[p]]; s[p]++); //find next prime (where s[p]==0)
+ }
+ ans=new Array(p);
+ for(i=0;i<p;i++)
+ ans[i]=s[i];
+ return ans;
+ },
+
+ //does a single round of Miller-Rabin base b consider x to be a possible prime?
+ //x is a bigInt, and b is an integer
+ 'millerRabin': function(x,b) {
+ var i,j,k,s;
+
+ if (mr_x1.length!=x.length) {
+ mr_x1=dup(x);
+ mr_r=dup(x);
+ mr_a=dup(x);
+ }
+
+ copyInt_(mr_a,b);
+ copy_(mr_r,x);
+ copy_(mr_x1,x);
+
+ addInt_(mr_r,-1);
+ addInt_(mr_x1,-1);
+
+ //s=the highest power of two that divides mr_r
+ k=0;
+ for (i=0;i<mr_r.length;i++)
+ for (j=1;j<mask;j<<=1)
+ if (x[i] & j) {
+ s=(k<mr_r.length+bpe ? k : 0);
+ i=mr_r.length;
+ j=mask;
+ } else
+ k++;
+
+ if (s)
+ rightShift_(mr_r,s);
+
+ powMod_(mr_a,mr_r,x);
+
+ if (!equalsInt(mr_a,1) && !equals(mr_a,mr_x1)) {
+ j=1;
+ while (j<=s-1 && !equals(mr_a,mr_x1)) {
+ squareMod_(mr_a,x);
+ if (equalsInt(mr_a,1)) {
+ return 0;
+ }
+ j++;
+ }
+ if (!equals(mr_a,mr_x1)) {
+ return 0;
+ }
+ }
+
+ return 1;
+ },
+
+ //returns how many bits long the bigInt is, not counting leading zeros.
+ 'bitSize': function(x) {
+ var j,z,w;
+ for (j=x.length-1; (x[j]==0) && (j>0); j--);
+ for (z=0,w=x[j]; w; (w>>=1),z++);
+ z+=bpe*j;
+ return z;
+ },
+
+ //return a copy of x with at least n elements, adding leading zeros if needed
+ 'expand': function(x,n) {
+ var ans=int2bigInt(0,(x.length>n ? x.length : n)*bpe,0);
+ copy_(ans,x);
+ return ans;
+ },
+
+ //return a k-bit true random prime using Maurer's algorithm.
+ 'randTruePrime': function(k) {
+ var ans=int2bigInt(0,k,0);
+ randTruePrime_(ans,k);
+ return trim(ans,1);
+ },
+
+ //return a new bigInt equal to (x mod n) for bigInts x and n.
+ 'mod': function(x,n) {
+ var ans=dup(x);
+ mod_(ans,n);
+ return trim(ans,1);
+ },
+
+ //return (x+n) where x is a bigInt and n is an integer.
+ 'addInt': function(x,n) {
+ var ans=expand(x,x.length+1);
+ addInt_(ans,n);
+ return trim(ans,1);
+ },
+
+ //return x*y for bigInts x and y. This is faster when y<x.
+ 'mult': function(x,y) {
+ var ans=expand(x,x.length+y.length);
+ mult_(ans,y);
+ return trim(ans,1);
+ },
+
+ //return (x**y mod n) where x,y,n are bigInts and ** is exponentiation. 0**0=1. Faster for odd n.
+ 'powMod': function(x,y,n) {
+ var ans=expand(x,n.length);
+ powMod_(ans,trim(y,2),trim(n,2),0); //this should work without the trim, but doesn't
+ return trim(ans,1);
+ },
+
+ //return (x-y) for bigInts x and y. Negative answers will be 2s complement
+ 'sub': function(x,y) {
+ var ans=expand(x,(x.length>y.length ? x.length+1 : y.length+1));
+ sub_(ans,y);
+ return trim(ans,1);
+ },
+
+ //return (x+y) for bigInts x and y.
+ 'add': function(x,y) {
+ var ans=expand(x,(x.length>y.length ? x.length+1 : y.length+1));
+ add_(ans,y);
+ return trim(ans,1);
+ },
+
+ //return (x**(-1) mod n) for bigInts x and n. If no inverse exists, it returns null
+ 'inverseMod': function(x,n) {
+ var ans=expand(x,n.length);
+ var s;
+ s=inverseMod_(ans,n);
+ return s ? trim(ans,1) : null;
+ },
+
+ //return (x*y mod n) for bigInts x,y,n. For greater speed, let y<x.
+ 'multMod': function(x,y,n) {
+ var ans=expand(x,n.length);
+ multMod_(ans,y,n);
+ return trim(ans,1);
+ },
+
+ //generate a k-bit true random prime using Maurer's algorithm,
+ //and put it into ans. The bigInt ans must be large enough to hold it.
+ 'randTruePrime_': function(ans,k) {
+ var c,m,pm,dd,j,r,B,divisible,z,zz,recSize;
+
+ if (primes.length==0)
+ primes=findPrimes(30000); //check for divisibility by primes <=30000
+
+ if (pows.length==0) {
+ pows=new Array(512);
+ for (j=0;j<512;j++) {
+ pows[j]=Math.pow(2,j/511.-1.);
+ }
+ }
+
+ //c and m should be tuned for a particular machine and value of k, to maximize speed
+ //this was: c=primes[primes.length-1]/k/k; //check using all the small primes. (c=0.1 in HAC)
+ c=0.1;
+ m=20; //generate this k-bit number by first recursively generating a number that has between k/2 and k-m bits
+ recLimit=20; /*must be at least 2 (was 29)*/ //stop recursion when k <=recLimit
+
+ if (s_i2.length!=ans.length) {
+ s_i2=dup(ans);
+ s_R =dup(ans);
+ s_n1=dup(ans);
+ s_r2=dup(ans);
+ s_d =dup(ans);
+ s_x1=dup(ans);
+ s_x2=dup(ans);
+ s_b =dup(ans);
+ s_n =dup(ans);
+ s_i =dup(ans);
+ s_rm=dup(ans);
+ s_q =dup(ans);
+ s_a =dup(ans);
+ s_aa=dup(ans);
+ }
+
+ if (k <= recLimit) { //generate small random primes by trial division up to its square root
+ pm=(1<<((k+2)>>1))-1; //pm is binary number with all ones, just over sqrt(2^k)
+ copyInt_(ans,0);
+ for (dd=1;dd;) {
+ dd=0;
+ ans[0]= 1 | (1<<(k-1)) | Math.floor(Math.random()*(1<<k)); //random, k-bit, odd integer, with msb 1
+ for (j=1;(j<primes.length) && ((primes[j]&pm)==primes[j]);j++) { //trial division by all primes 3...sqrt(2^k)
+ if (0==(ans[0]%primes[j])) {
+ dd=1;
+ break;
+ }
+ }
+ }
+ carry_(ans);
+ return;
+ }
+
+ B=c*k*k; //try small primes up to B (or all the primes[] array if the largest is less than B).
+ if (k>2*m) //generate this k-bit number by first recursively generating a number that has between k/2 and k-m bits
+ for (r=1; k-k*r<=m; )
+ r=pows[Math.floor(Math.random()*512)]; //r=Math.pow(2,Math.random()-1);
+ else
+ r=.5;
+
+ //simulation suggests the more complex algorithm using r=.333 is only slightly faster.
+
+ recSize=Math.floor(r*k)+1;
+
+ randTruePrime_(s_q,recSize);
+ copyInt_(s_i2,0);
+ s_i2[Math.floor((k-2)/bpe)] |= (1<<((k-2)%bpe)); //s_i2=2^(k-2)
+ divide_(s_i2,s_q,s_i,s_rm); //s_i=floor((2^(k-1))/(2q))
+
+ z=bitSize(s_i);
+
+ for (;;) {
+ for (;;) { //generate z-bit numbers until one falls in the range [0,s_i-1]
+ randBigInt_(s_R,z,0);
+ if (greater(s_i,s_R))
+ break;
+ } //now s_R is in the range [0,s_i-1]
+ addInt_(s_R,1); //now s_R is in the range [1,s_i]
+ add_(s_R,s_i); //now s_R is in the range [s_i+1,2*s_i]
+
+ copy_(s_n,s_q);
+ mult_(s_n,s_R);
+ multInt_(s_n,2);
+ addInt_(s_n,1); //s_n=2*s_R*s_q+1
+
+ copy_(s_r2,s_R);
+ multInt_(s_r2,2); //s_r2=2*s_R
+
+ //check s_n for divisibility by small primes up to B
+ for (divisible=0,j=0; (j<primes.length) && (primes[j]<B); j++)
+ if (modInt(s_n,primes[j])==0) {
+ divisible=1;
+ break;
+ }
+
+ if (!divisible) //if it passes small primes check, then try a single Miller-Rabin base 2
+ if (!millerRabin(s_n,2)) //this line represents 75% of the total runtime for randTruePrime_
+ divisible=1;
+
+ if (!divisible) { //if it passes that test, continue checking s_n
+ addInt_(s_n,-3);
+ for (j=s_n.length-1;(s_n[j]==0) && (j>0); j--); //strip leading zeros
+ for (zz=0,w=s_n[j]; w; (w>>=1),zz++);
+ zz+=bpe*j; //zz=number of bits in s_n, ignoring leading zeros
+ for (;;) { //generate z-bit numbers until one falls in the range [0,s_n-1]
+ randBigInt_(s_a,zz,0);
+ if (greater(s_n,s_a))
+ break;
+ } //now s_a is in the range [0,s_n-1]
+ addInt_(s_n,3); //now s_a is in the range [0,s_n-4]
+ addInt_(s_a,2); //now s_a is in the range [2,s_n-2]
+ copy_(s_b,s_a);
+ copy_(s_n1,s_n);
+ addInt_(s_n1,-1);
+ powMod_(s_b,s_n1,s_n); //s_b=s_a^(s_n-1) modulo s_n
+ addInt_(s_b,-1);
+ if (isZero(s_b)) {
+ copy_(s_b,s_a);
+ powMod_(s_b,s_r2,s_n);
+ addInt_(s_b,-1);
+ copy_(s_aa,s_n);
+ copy_(s_d,s_b);
+ GCD_(s_d,s_n); //if s_b and s_n are relatively prime, then s_n is a prime
+ if (equalsInt(s_d,1)) {
+ copy_(ans,s_aa);
+ return; //if we've made it this far, then s_n is absolutely guaranteed to be prime
+ }
+ }
+ }
+ }
+ },
+
+ //set b to an n-bit random BigInt. If s=1, then nth bit (most significant bit) is set to 1.
+ //array b must be big enough to hold the result. Must have n>=1
+ 'randBigInt_': function(b,n,s) {
+ var i,a;
+ for (i=0;i<b.length;i++)
+ b[i]=0;
+ a=Math.floor((n-1)/bpe)+1; //# array elements to hold the BigInt
+ for (i=0;i<a;i++) {
+ b[i]=Math.floor(Math.random()*(1<<(bpe-1)));
+ }
+ b[a-1] &= (2<<((n-1)%bpe))-1;
+ if (s)
+ b[a-1] |= (1<<((n-1)%bpe));
+ },
+
+ //set x to the greatest common divisor of x and y.
+ //x,y are bigInts with the same number of elements. y is destroyed.
+ 'GCD_': function(x,y) {
+ var i,xp,yp,A,B,C,D,q,sing;
+ if (T.length!=x.length)
+ T=dup(x);
+
+ sing=1;
+ while (sing) { //while y has nonzero elements other than y[0]
+ sing=0;
+ for (i=1;i<y.length;i++) //check if y has nonzero elements other than 0
+ if (y[i]) {
+ sing=1;
+ break;
+ }
+ if (!sing) break; //quit when y all zero elements except possibly y[0]
+
+ for (i=x.length;!x[i] && i>=0;i--); //find most significant element of x
+ xp=x[i];
+ yp=y[i];
+ A=1; B=0; C=0; D=1;
+ while ((yp+C) && (yp+D)) {
+ q =Math.floor((xp+A)/(yp+C));
+ qp=Math.floor((xp+B)/(yp+D));
+ if (q!=qp)
+ break;
+ t= A-q*C; A=C; C=t; // do (A,B,xp, C,D,yp) = (C,D,yp, A,B,xp) - q*(0,0,0, C,D,yp)
+ t= B-q*D; B=D; D=t;
+ t=xp-q*yp; xp=yp; yp=t;
+ }
+ if (B) {
+ copy_(T,x);
+ linComb_(x,y,A,B); //x=A*x+B*y
+ linComb_(y,T,D,C); //y=D*y+C*T
+ } else {
+ mod_(x,y);
+ copy_(T,x);
+ copy_(x,y);
+ copy_(y,T);
+ }
+ }
+ if (y[0]==0)
+ return;
+ t=modInt(x,y[0]);
+ copyInt_(x,y[0]);
+ y[0]=t;
+ while (y[0]) {
+ x[0]%=y[0];
+ t=x[0]; x[0]=y[0]; y[0]=t;
+ }
+ },
+
+//do x=x**(-1) mod n, for bigInts x and n.
+//If no inverse exists, it sets x to zero and returns 0, else it returns 1.
+//The x array must be at least as large as the n array.
+function inverseMod_(x,n) {
+ var k=1+2*Math.max(x.length,n.length);
+
+ if(!(x[0]&1) && !(n[0]&1)) { //if both inputs are even, then inverse doesn't exist
+ copyInt_(x,0);
+ return 0;
+ }
+
+ if (eg_u.length!=k) {
+ eg_u=new Array(k);
+ eg_v=new Array(k);
+ eg_A=new Array(k);
+ eg_B=new Array(k);
+ eg_C=new Array(k);
+ eg_D=new Array(k);
+ }
+
+ copy_(eg_u,x);
+ copy_(eg_v,n);
+ copyInt_(eg_A,1);
+ copyInt_(eg_B,0);
+ copyInt_(eg_C,0);
+ copyInt_(eg_D,1);
+ for (;;) {
+ while(!(eg_u[0]&1)) { //while eg_u is even
+ halve_(eg_u);
+ if (!(eg_A[0]&1) && !(eg_B[0]&1)) { //if eg_A==eg_B==0 mod 2
+ halve_(eg_A);
+ halve_(eg_B);
+ } else {
+ add_(eg_A,n); halve_(eg_A);
+ sub_(eg_B,x); halve_(eg_B);
+ }
+ }
+
+ while (!(eg_v[0]&1)) { //while eg_v is even
+ halve_(eg_v);
+ if (!(eg_C[0]&1) && !(eg_D[0]&1)) { //if eg_C==eg_D==0 mod 2
+ halve_(eg_C);
+ halve_(eg_D);
+ } else {
+ add_(eg_C,n); halve_(eg_C);
+ sub_(eg_D,x); halve_(eg_D);
+ }
+ }
+
+ if (!greater(eg_v,eg_u)) { //eg_v <= eg_u
+ sub_(eg_u,eg_v);
+ sub_(eg_A,eg_C);
+ sub_(eg_B,eg_D);
+ } else { //eg_v > eg_u
+ sub_(eg_v,eg_u);
+ sub_(eg_C,eg_A);
+ sub_(eg_D,eg_B);
+ }
+
+ if (equalsInt(eg_u,0)) {
+ if (negative(eg_C)) //make sure answer is nonnegative
+ add_(eg_C,n);
+ copy_(x,eg_C);
+
+ if (!equalsInt(eg_v,1)) { //if GCD_(x,n)!=1, then there is no inverse
+ copyInt_(x,0);
+ return 0;
+ }
+ return 1;
+ }
+ }
+}
+
+//return x**(-1) mod n, for integers x and n. Return 0 if there is no inverse
+function inverseModInt_(x,n) {
+ var a=1,b=0,t;
+ for (;;) {
+ if (x==1) return a;
+ if (x==0) return 0;
+ b-=a*Math.floor(n/x);
+ n%=x;
+
+ if (n==1) return b; //to avoid negatives, change this b to n-b, and each -= to +=
+ if (n==0) return 0;
+ a-=b*Math.floor(x/n);
+ x%=n;
+ }
+}
+
+//Given positive bigInts x and y, change the bigints v, a, and b to positive bigInts such that:
+// v = GCD_(x,y) = a*x-b*y
+//The bigInts v, a, b, must have exactly as many elements as the larger of x and y.
+function eGCD_(x,y,v,a,b) {
+ var g=0;
+ var k=Math.max(x.length,y.length);
+ if (eg_u.length!=k) {
+ eg_u=new Array(k);
+ eg_A=new Array(k);
+ eg_B=new Array(k);
+ eg_C=new Array(k);
+ eg_D=new Array(k);
+ }
+ while(!(x[0]&1) && !(y[0]&1)) { //while x and y both even
+ halve_(x);
+ halve_(y);
+ g++;
+ }
+ copy_(eg_u,x);
+ copy_(v,y);
+ copyInt_(eg_A,1);
+ copyInt_(eg_B,0);
+ copyInt_(eg_C,0);
+ copyInt_(eg_D,1);
+ for (;;) {
+ while(!(eg_u[0]&1)) { //while u is even
+ halve_(eg_u);
+ if (!(eg_A[0]&1) && !(eg_B[0]&1)) { //if A==B==0 mod 2
+ halve_(eg_A);
+ halve_(eg_B);
+ } else {
+ add_(eg_A,y); halve_(eg_A);
+ sub_(eg_B,x); halve_(eg_B);
+ }
+ }
+
+ while (!(v[0]&1)) { //while v is even
+ halve_(v);
+ if (!(eg_C[0]&1) && !(eg_D[0]&1)) { //if C==D==0 mod 2
+ halve_(eg_C);
+ halve_(eg_D);
+ } else {
+ add_(eg_C,y); halve_(eg_C);
+ sub_(eg_D,x); halve_(eg_D);
+ }
+ }
+
+ if (!greater(v,eg_u)) { //v<=u
+ sub_(eg_u,v);
+ sub_(eg_A,eg_C);
+ sub_(eg_B,eg_D);
+ } else { //v>u
+ sub_(v,eg_u);
+ sub_(eg_C,eg_A);
+ sub_(eg_D,eg_B);
+ }
+ if (equalsInt(eg_u,0)) {
+ if (negative(eg_C)) { //make sure a (C)is nonnegative
+ add_(eg_C,y);
+ sub_(eg_D,x);
+ }
+ multInt_(eg_D,-1); ///make sure b (D) is nonnegative
+ copy_(a,eg_C);
+ copy_(b,eg_D);
+ leftShift_(v,g);
+ return;
+ }
+ }
+}
+
+
+//is bigInt x negative?
+function negative(x) {
+ return ((x[x.length-1]>>(bpe-1))&1);
+}
+
+
+//is (x << (shift*bpe)) > y?
+//x and y are nonnegative bigInts
+//shift is a nonnegative integer
+function greaterShift(x,y,shift) {
+ var kx=x.length, ky=y.length;
+ k=((kx+shift)<ky) ? (kx+shift) : ky;
+ for (i=ky-1-shift; i<kx && i>=0; i++)
+ if (x[i]>0)
+ return 1; //if there are nonzeros in x to the left of the first column of y, then x is bigger
+ for (i=kx-1+shift; i<ky; i++)
+ if (y[i]>0)
+ return 0; //if there are nonzeros in y to the left of the first column of x, then x is not bigger
+ for (i=k-1; i>=shift; i--)
+ if (x[i-shift]>y[i]) return 1;
+ else if (x[i-shift]<y[i]) return 0;
+ return 0;
+}
+
+//is x > y? (x and y both nonnegative)
+function greater(x,y) {
+ var i;
+ var k=(x.length<y.length) ? x.length : y.length;
+
+ for (i=x.length;i<y.length;i++)
+ if (y[i])
+ return 0; //y has more digits
+
+ for (i=y.length;i<x.length;i++)
+ if (x[i])
+ return 1; //x has more digits
+
+ for (i=k-1;i>=0;i--)
+ if (x[i]>y[i])
+ return 1;
+ else if (x[i]<y[i])
+ return 0;
+ return 0;
+}
+
+//divide_ x by y giving quotient q and remainder r. (q=floor(x/y), r=x mod y). All 4 are bigints.
+//x must have at least one leading zero element.
+//y must be nonzero.
+//q and r must be arrays that are exactly the same length as x.
+//the x array must have at least as many elements as y.
+function divide_(x,y,q,r) {
+ var kx, ky;
+ var i,j,y1,y2,c,a,b;
+ copy_(r,x);
+ for (ky=y.length;y[ky-1]==0;ky--); //kx,ky is number of elements in x,y, not including leading zeros
+ for (kx=r.length;r[kx-1]==0 && kx>ky;kx--);
+
+ //normalize: ensure the most significant element of y has its highest bit set
+ b=y[ky-1];
+ for (a=0; b; a++)
+ b>>=1;
+ a=bpe-a; //a is how many bits to shift so that the high order bit of y is leftmost in its array element
+ leftShift_(y,a); //multiply both by 1<<a now, then divide_ both by that at the end
+ leftShift_(r,a);
+
+ copyInt_(q,0); // q=0
+ while (!greaterShift(y,r,kx-ky)) { // while (leftShift_(y,kx-ky) <= r) {
+ subShift_(r,y,kx-ky); // r=r-leftShift_(y,kx-ky)
+ q[kx-ky]++; // q[kx-ky]++;
+ } // }
+
+ for (i=kx-1; i>=ky; i--) {
+ if (r[i]==y[ky-1])
+ q[i-ky]=mask;
+ else
+ q[i-ky]=Math.floor((r[i]*radix+r[i-1])/y[ky-1]);
+
+ //The following for(;;) loop is equivalent to the commented while loop,
+ //except that the uncommented version avoids overflow.
+ //The commented loop comes from HAC, which assumes r[-1]==y[-1]==0
+ // while (q[i-ky]*(y[ky-1]*radix+y[ky-2]) > r[i]*radix*radix+r[i-1]*radix+r[i-2])
+ // q[i-ky]--;
+ for (;;) {
+ y2=(ky>1 ? y[ky-2] : 0)*q[i-ky];
+ c=y2>>bpe;
+ y2=y2 & mask;
+ y1=c+q[i-ky]*y[ky-1];
+ c=y1>>bpe;
+ y1=y1 & mask;
+
+ if (c==r[i] ? y1==r[i-1] ? y2>(i>1 ? r[i-2] : 0) : y1>r[i-1] : c>r[i])
+ q[i-ky]--;
+ else
+ break;
+ }
+
+ linCombShift_(r,y,-q[i-ky],i-ky); //r=r-q[i-ky]*leftShift_(y,i-ky)
+ if (negative(r)) {
+ addShift_(r,y,i-ky); //r=r+leftShift_(y,i-ky)
+ q[i-ky]--;
+ }
+ }
+
+ rightShift_(y,a); //undo the normalization step
+ rightShift_(r,a); //undo the normalization step
+}
+
+//do carries and borrows so each element of the bigInt x fits in bpe bits.
+function carry_(x) {
+ var i,k,c,b;
+ k=x.length;
+ c=0;
+ for (i=0;i<k;i++) {
+ c+=x[i];
+ b=0;
+ if (c<0) {
+ b=-(c>>bpe);
+ c+=b*radix;
+ }
+ x[i]=c & mask;
+ c=(c>>bpe)-b;
+ }
+}
+
+//return x mod n for bigInt x and integer n.
+function modInt(x,n) {
+ var i,c=0;
+ for (i=x.length-1; i>=0; i--)
+ c=(c*radix+x[i])%n;
+ return c;
+}
+
+//convert the integer t into a bigInt with at least the given number of bits.
+//the returned array stores the bigInt in bpe-bit chunks, little endian (buff[0] is least significant word)
+//Pad the array with leading zeros so that it has at least minSize elements.
+//There will always be at least one leading 0 element.
+function int2bigInt(t,bits,minSize) {
+ var i,k;
+ k=Math.ceil(bits/bpe)+1;
+ k=minSize>k ? minSize : k;
+ buff=new Array(k);
+ copyInt_(buff,t);
+ return buff;
+}
+
+//return the bigInt given a string representation in a given base.
+//Pad the array with leading zeros so that it has at least minSize elements.
+//If base=-1, then it reads in a space-separated list of array elements in decimal.
+//The array will always have at least one leading zero, unless base=-1.
+function str2bigInt(s,base,minSize) {
+ var d, i, j, x, y, kk;
+ var k=s.length;
+ if (base==-1) { //comma-separated list of array elements in decimal
+ x=new Array(0);
+ for (;;) {
+ y=new Array(x.length+1);
+ for (i=0;i<x.length;i++)
+ y[i+1]=x[i];
+ y[0]=parseInt(s,10);
+ x=y;
+ d=s.indexOf(',',0);
+ if (d<1)
+ break;
+ s=s.substring(d+1);
+ if (s.length==0)
+ break;
+ }
+ if (x.length<minSize) {
+ y=new Array(minSize);
+ copy_(y,x);
+ return y;
+ }
+ return x;
+ }
+
+ x=int2bigInt(0,base*k,0);
+ for (i=0;i<k;i++) {
+ d=digitsStr.indexOf(s.substring(i,i+1),0);
+ if (base<=36 && d>=36) //convert lowercase to uppercase if base<=36
+ d-=26;
+ if (d<base && d>=0) { //ignore illegal characters
+ multInt_(x,base);
+ addInt_(x,d);
+ }
+ }
+
+ for (k=x.length;k>0 && !x[k-1];k--); //strip off leading zeros
+ k=minSize>k+1 ? minSize : k+1;
+ y=new Array(k);
+ kk=k<x.length ? k : x.length;
+ for (i=0;i<kk;i++)
+ y[i]=x[i];
+ for (;i<k;i++)
+ y[i]=0;
+ return y;
+}
+
+//is bigint x equal to integer y?
+//y must have less than bpe bits
+function equalsInt(x,y) {
+ var i;
+ if (x[0]!=y)
+ return 0;
+ for (i=1;i<x.length;i++)
+ if (x[i])
+ return 0;
+ return 1;
+}
+
+//are bigints x and y equal?
+//this works even if x and y are different lengths and have arbitrarily many leading zeros
+function equals(x,y) {
+ var i;
+ var k=x.length<y.length ? x.length : y.length;
+ for (i=0;i<k;i++)
+ if (x[i]!=y[i])
+ return 0;
+ if (x.length>y.length) {
+ for (;i<x.length;i++)
+ if (x[i])
+ return 0;
+ } else {
+ for (;i<y.length;i++)
+ if (y[i])
+ return 0;
+ }
+ return 1;
+}
+
+//is the bigInt x equal to zero?
+function isZero(x) {
+ var i;
+ for (i=0;i<x.length;i++)
+ if (x[i])
+ return 0;
+ return 1;
+}
+
+//convert a bigInt into a string in a given base, from base 2 up to base 95.
+//Base -1 prints the contents of the array representing the number.
+function bigInt2str(x,base) {
+ var i,t,s="";
+
+ if (s6.length!=x.length)
+ s6=dup(x);
+ else
+ copy_(s6,x);
+
+ if (base==-1) { //return the list of array contents
+ for (i=x.length-1;i>0;i--)
+ s+=x[i]+',';
+ s+=x[0];
+ }
+ else { //return it in the given base
+ while (!isZero(s6)) {
+ t=divInt_(s6,base); //t=s6 % base; s6=floor(s6/base);
+ s=digitsStr.substring(t,t+1)+s;
+ }
+ }
+ if (s.length==0)
+ s="0";
+ return s;
+}
+
+//returns a duplicate of bigInt x
+function dup(x) {
+ var i;
+ buff=new Array(x.length);
+ copy_(buff,x);
+ return buff;
+}
+
+//do x=y on bigInts x and y. x must be an array at least as big as y (not counting the leading zeros in y).
+function copy_(x,y) {
+ var i;
+ var k=x.length<y.length ? x.length : y.length;
+ for (i=0;i<k;i++)
+ x[i]=y[i];
+ for (i=k;i<x.length;i++)
+ x[i]=0;
+}
+
+//do x=y on bigInt x and integer y.
+function copyInt_(x,n) {
+ var i,c;
+ for (c=n,i=0;i<x.length;i++) {
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+}
+
+//do x=x+n where x is a bigInt and n is an integer.
+//x must be large enough to hold the result.
+function addInt_(x,n) {
+ var i,k,c,b;
+ x[0]+=n;
+ k=x.length;
+ c=0;
+ for (i=0;i<k;i++) {
+ c+=x[i];
+ b=0;
+ if (c<0) {
+ b=-(c>>bpe);
+ c+=b*radix;
+ }
+ x[i]=c & mask;
+ c=(c>>bpe)-b;
+ if (!c) return; //stop carrying as soon as the carry_ is zero
+ }
+}
+
+//right shift bigInt x by n bits. 0 <= n < bpe.
+function rightShift_(x,n) {
+ var i;
+ var k=Math.floor(n/bpe);
+ if (k) {
+ for (i=0;i<x.length-k;i++) //right shift x by k elements
+ x[i]=x[i+k];
+ for (;i<x.length;i++)
+ x[i]=0;
+ n%=bpe;
+ }
+ for (i=0;i<x.length-1;i++) {
+ x[i]=mask & ((x[i+1]<<(bpe-n)) | (x[i]>>n));
+ }
+ x[i]>>=n;
+}
+
+//do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement
+function halve_(x) {
+ var i;
+ for (i=0;i<x.length-1;i++) {
+ x[i]=mask & ((x[i+1]<<(bpe-1)) | (x[i]>>1));
+ }
+ x[i]=(x[i]>>1) | (x[i] & (radix>>1)); //most significant bit stays the same
+}
+
+//left shift bigInt x by n bits.
+function leftShift_(x,n) {
+ var i;
+ var k=Math.floor(n/bpe);
+ if (k) {
+ for (i=x.length; i>=k; i--) //left shift x by k elements
+ x[i]=x[i-k];
+ for (;i>=0;i--)
+ x[i]=0;
+ n%=bpe;
+ }
+ if (!n)
+ return;
+ for (i=x.length-1;i>0;i--) {
+ x[i]=mask & ((x[i]<<n) | (x[i-1]>>(bpe-n)));
+ }
+ x[i]=mask & (x[i]<<n);
+}
+
+//do x=x*n where x is a bigInt and n is an integer.
+//x must be large enough to hold the result.
+function multInt_(x,n) {
+ var i,k,c,b;
+ if (!n)
+ return;
+ k=x.length;
+ c=0;
+ for (i=0;i<k;i++) {
+ c+=x[i]*n;
+ b=0;
+ if (c<0) {
+ b=-(c>>bpe);
+ c+=b*radix;
+ }
+ x[i]=c & mask;
+ c=(c>>bpe)-b;
+ }
+}
+
+//do x=floor(x/n) for bigInt x and integer n, and return the remainder
+function divInt_(x,n) {
+ var i,r=0,s;
+ for (i=x.length-1;i>=0;i--) {
+ s=r*radix+x[i];
+ x[i]=Math.floor(s/n);
+ r=s%n;
+ }
+ return r;
+}
+
+//do the linear combination x=a*x+b*y for bigInts x and y, and integers a and b.
+//x must be large enough to hold the answer.
+function linComb_(x,y,a,b) {
+ var i,c,k,kk;
+ k=x.length<y.length ? x.length : y.length;
+ kk=x.length;
+ for (c=0,i=0;i<k;i++) {
+ c+=a*x[i]+b*y[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+ for (i=k;i<kk;i++) {
+ c+=a*x[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+}
+
+//do the linear combination x=a*x+b*(y<<(ys*bpe)) for bigInts x and y, and integers a, b and ys.
+//x must be large enough to hold the answer.
+function linCombShift_(x,y,b,ys) {
+ var i,c,k,kk;
+ k=x.length<ys+y.length ? x.length : ys+y.length;
+ kk=x.length;
+ for (c=0,i=ys;i<k;i++) {
+ c+=x[i]+b*y[i-ys];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+ for (i=k;c && i<kk;i++) {
+ c+=x[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+}
+
+//do x=x+(y<<(ys*bpe)) for bigInts x and y, and integers a,b and ys.
+//x must be large enough to hold the answer.
+function addShift_(x,y,ys) {
+ var i,c,k,kk;
+ k=x.length<ys+y.length ? x.length : ys+y.length;
+ kk=x.length;
+ for (c=0,i=ys;i<k;i++) {
+ c+=x[i]+y[i-ys];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+ for (i=k;c && i<kk;i++) {
+ c+=x[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+}
+
+//do x=x-(y<<(ys*bpe)) for bigInts x and y, and integers a,b and ys.
+//x must be large enough to hold the answer.
+function subShift_(x,y,ys) {
+ var i,c,k,kk;
+ k=x.length<ys+y.length ? x.length : ys+y.length;
+ kk=x.length;
+ for (c=0,i=ys;i<k;i++) {
+ c+=x[i]-y[i-ys];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+ for (i=k;c && i<kk;i++) {
+ c+=x[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+}
+
+//do x=x-y for bigInts x and y.
+//x must be large enough to hold the answer.
+//negative answers will be 2s complement
+function sub_(x,y) {
+ var i,c,k,kk;
+ k=x.length<y.length ? x.length : y.length;
+ for (c=0,i=0;i<k;i++) {
+ c+=x[i]-y[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+ for (i=k;c && i<x.length;i++) {
+ c+=x[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+}
+
+//do x=x+y for bigInts x and y.
+//x must be large enough to hold the answer.
+function add_(x,y) {
+ var i,c,k,kk;
+ k=x.length<y.length ? x.length : y.length;
+ for (c=0,i=0;i<k;i++) {
+ c+=x[i]+y[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+ for (i=k;c && i<x.length;i++) {
+ c+=x[i];
+ x[i]=c & mask;
+ c>>=bpe;
+ }
+}
+
+//do x=x*y for bigInts x and y. This is faster when y<x.
+function mult_(x,y) {
+ var i;
+ if (ss.length!=2*x.length)
+ ss=new Array(2*x.length);
+ copyInt_(ss,0);
+ for (i=0;i<y.length;i++)
+ if (y[i])
+ linCombShift_(ss,x,y[i],i); //ss=1*ss+y[i]*(x<<(i*bpe))
+ copy_(x,ss);
+}
+
+//do x=x mod n for bigInts x and n.
+function mod_(x,n) {
+ if (s4.length!=x.length)
+ s4=dup(x);
+ else
+ copy_(s4,x);
+ if (s5.length!=x.length)
+ s5=dup(x);
+ divide_(s4,n,s5,x); //x = remainder of s4 / n
+}
+
+//do x=x*y mod n for bigInts x,y,n.
+//for greater speed, let y<x.
+function multMod_(x,y,n) {
+ var i;
+ if (s0.length!=2*x.length)
+ s0=new Array(2*x.length);
+ copyInt_(s0,0);
+ for (i=0;i<y.length;i++)
+ if (y[i])
+ linCombShift_(s0,x,y[i],i); //s0=1*s0+y[i]*(x<<(i*bpe))
+ mod_(s0,n);
+ copy_(x,s0);
+}
+
+//do x=x*x mod n for bigInts x,n.
+function squareMod_(x,n) {
+ var i,j,d,c,kx,kn,k;
+ for (kx=x.length; kx>0 && !x[kx-1]; kx--); //ignore leading zeros in x
+ k=kx>n.length ? 2*kx : 2*n.length; //k=# elements in the product, which is twice the elements in the larger of x and n
+ if (s0.length!=k)
+ s0=new Array(k);
+ copyInt_(s0,0);
+ for (i=0;i<kx;i++) {
+ c=s0[2*i]+x[i]*x[i];
+ s0[2*i]=c & mask;
+ c>>=bpe;
+ for (j=i+1;j<kx;j++) {
+ c=s0[i+j]+2*x[i]*x[j]+c;
+ s0[i+j]=(c & mask);
+ c>>=bpe;
+ }
+ s0[i+kx]=c;
+ }
+ mod_(s0,n);
+ copy_(x,s0);
+}
+
+//return x with exactly k leading zero elements
+function trim(x,k) {
+ var i,y;
+ for (i=x.length; i>0 && !x[i-1]; i--);
+ y=new Array(i+k);
+ copy_(y,x);
+ return y;
+}
+
+//do x=x**y mod n, where x,y,n are bigInts and ** is exponentiation. 0**0=1.
+//this is faster when n is odd. x usually needs to have as many elements as n.
+function powMod_(x,y,n) {
+ var k1,k2,kn,np;
+ if(s7.length!=n.length)
+ s7=dup(n);
+
+ //for even modulus, use a simple square-and-multiply algorithm,
+ //rather than using the more complex Montgomery algorithm.
+ if ((n[0]&1)==0) {
+ copy_(s7,x);
+ copyInt_(x,1);
+ while(!equalsInt(y,0)) {
+ if (y[0]&1)
+ multMod_(x,s7,n);
+ divInt_(y,2);
+ squareMod_(s7,n);
+ }
+ return;
+ }
+
+ //calculate np from n for the Montgomery multiplications
+ copyInt_(s7,0);
+ for (kn=n.length;kn>0 && !n[kn-1];kn--);
+ np=radix-inverseModInt_(modInt(n,radix),radix);
+ s7[kn]=1;
+ multMod_(x ,s7,n); // x = x * 2**(kn*bp) mod n
+
+ if (s3.length!=x.length)
+ s3=dup(x);
+ else
+ copy_(s3,x);
+
+ for (k1=y.length-1;k1>0 & !y[k1]; k1--); //k1=first nonzero element of y
+ if (y[k1]==0) { //anything to the 0th power is 1
+ copyInt_(x,1);
+ return;
+ }
+ for (k2=1<<(bpe-1);k2 && !(y[k1] & k2); k2>>=1); //k2=position of first 1 bit in y[k1]
+ for (;;) {
+ if (!(k2>>=1)) { //look at next bit of y
+ k1--;
+ if (k1<0) {
+ mont_(x,one,n,np);
+ return;
+ }
+ k2=1<<(bpe-1);
+ }
+ mont_(x,x,n,np);
+
+ if (k2 & y[k1]) //if next bit is a 1
+ mont_(x,s3,n,np);
+ }
+}
+
+//do x=x*y*Ri mod n for bigInts x,y,n,
+// where Ri = 2**(-kn*bpe) mod n, and kn is the
+// number of elements in the n array, not
+// counting leading zeros.
+//x must be large enough to hold the answer.
+//It's OK if x and y are the same variable.
+//must have:
+// x,y < n
+// n is odd
+// np = -(n^(-1)) mod radix
+function mont_(x,y,n,np) {
+ var i,j,c,ui,t;
+ var kn=n.length;
+ var ky=y.length;
+
+ if (sa.length!=kn)
+ sa=new Array(kn);
+
+ for (;kn>0 && n[kn-1]==0;kn--); //ignore leading zeros of n
+ //this function sometimes gives wrong answers when the next line is uncommented
+ //for (;ky>0 && y[ky-1]==0;ky--); //ignore leading zeros of y
+
+ copyInt_(sa,0);
+
+ //the following loop consumes 95% of the runtime for randTruePrime_() and powMod_() for large keys
+ for (i=0; i<kn; i++) {
+ t=sa[0]+x[i]*y[0];
+ ui=((t & mask) * np) & mask; //the inner "& mask" is needed on Macintosh MSIE, but not windows MSIE
+ c=(t+ui*n[0]) >> bpe;
+ t=x[i];
+
+ //do sa=(sa+x[i]*y+ui*n)/b where b=2**bpe
+ for (j=1;j<ky;j++) {
+ c+=sa[j]+t*y[j]+ui*n[j];
+ sa[j-1]=c & mask;
+ c>>=bpe;
+ }
+ for (;j<kn;j++) {
+ c+=sa[j]+ui*n[j];
+ sa[j-1]=c & mask;
+ c>>=bpe;
+ }
+ sa[j-1]=c & mask;
+ }
+
+ if (!greater(n,sa))
+ sub_(sa,n);
+ copy_(x,sa);
+}
+
+
+
+
+//#############################################################################
+//#############################################################################
+//#############################################################################
+//#############################################################################
+//#############################################################################
+//#############################################################################
+//#############################################################################
+
+
+
+
+
+//#############################################################################
+
+Clipperz.Crypto.BigInt = function (aValue, aBase) {
+ var base;
+ var value;
+
+ if (typeof(aValue) == 'object') {
+ this._internalValue = aValue;
+ } else {
+ if (typeof(aValue) == 'undefined') {
+ value = "0";
+ } else {
+ value = aValue + "";
+ }
+
+ if (typeof(aBase) == 'undefined') {
+ base = 10;
+ } else {
+ base = aBase;
+ }
+
+ this._internalValue = str2bigInt(value, base, 1, 1);
+ }
+
+ return this;
+}
+
+//=============================================================================
+
+MochiKit.Base.update(Clipperz.Crypto.BigInt.prototype, {
+
+ //-------------------------------------------------------------------------
+
+ 'internalValue': function () {
+ return this._internalValue;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'isBigInt': true,
+
+ //-------------------------------------------------------------------------
+
+ 'toString': function(aBase) {
+ return this.asString(aBase);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'asString': function (aBase) {
+ var base;
+
+ if (typeof(aBase) == 'undefined') {
+ base = 10;
+ } else {
+ base = aBase;
+ }
+
+ return bigInt2str(this.internalValue(), base).toLowerCase();
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'equals': function (aValue) {
+ var result;
+
+ if (aValue.isBigInt) {
+ result = equals(this.internalValue(), aValue.internalValue());
+ } else if (typeof(aValue) == "number") {
+ result = equalsInt(this.internalValue(), aValue);
+ } else {
+ throw Clipperz.Crypt.BigInt.exception.UnknownType;
+ }
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'add': function (aValue) {
+ var result;
+
+ if (aValue.isBigInt) {
+ result = add(this.internalValue(), aValue.internalValue());
+ } else {
+ result = addInt(this.internalValue(), aValue);
+ }
+
+ return new Clipperz.Crypto.BigInt(result);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'subtract': function (aValue) {
+ var result;
+ var value;
+
+ if (aValue.isBigInt) {
+ value = aValue;
+ } else {
+ value = new Clipperz.Crypto.BigInt(aValue);
+ }
+
+ result = sub(this.internalValue(), value.internalValue());
+
+ return new Clipperz.Crypto.BigInt(result);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'multiply': function (aValue, aModule) {
+ var result;
+ var value;
+
+ if (aValue.isBigInt) {
+ value = aValue;
+ } else {
+ value = new Clipperz.Crypto.BigInt(aValue);
+ }
+
+ if (typeof(aModule) == 'undefined') {
+ result = mult(this.internalValue(), value.internalValue());
+ } else {
+ result = multMod(this.internalValue(), value.internalValue(), aModule);
+ }
+
+ return new Clipperz.Crypto.BigInt(result);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'module': function (aModule) {
+ var result;
+ var module;
+
+ if (aModule.isBigInt) {
+ module = aModule;
+ } else {
+ module = new Clipperz.Crypto.BigInt(aModule);
+ }
+
+ result = mod(this.internalValue(), module.internalValue());
+
+ return new Clipperz.Crypto.BigInt(result);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'powerModule': function(aValue, aModule) {
+ var result;
+ var value;
+ var module;
+
+ if (aValue.isBigInt) {
+ value = aValue;
+ } else {
+ value = new Clipperz.Crypto.BigInt(aValue);
+ }
+
+ if (aModule.isBigInt) {
+ module = aModule;
+ } else {
+ module = new Clipperz.Crypto.BigInt(aModule);
+ }
+
+ if (aValue == -1) {
+ result = inverseMod(this.internalValue(), module.internalValue());
+ } else {
+ result = powMod(this.internalValue(), value.internalValue(), module.internalValue());
+ }
+
+ return new Clipperz.Crypto.BigInt(result);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'bitSize': function() {
+ return bitSize(this.internalValue());
+ },
+
+ //-------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+
+});
+
+//#############################################################################
+
+Clipperz.Crypto.BigInt.randomPrime = function(aBitSize) {
+ return new Clipperz.Crypto.BigInt(randTruePrime(aBitSize));
+}
+
+//#############################################################################
+//#############################################################################
+//#############################################################################
+
+Clipperz.Crypto.BigInt.equals = function(a, b) {
+ return a.equals(b);
+}
+
+Clipperz.Crypto.BigInt.add = function(a, b) {
+ return a.add(b);
+}
+
+Clipperz.Crypto.BigInt.subtract = function(a, b) {
+ return a.subtract(b);
+}
+
+Clipperz.Crypto.BigInt.multiply = function(a, b, module) {
+ return a.multiply(b, module);
+}
+
+Clipperz.Crypto.BigInt.module = function(a, module) {
+ return a.module(module);
+}
+
+Clipperz.Crypto.BigInt.powerModule = function(a, b, module) {
+ return a.powerModule(b, module);
+}
+
+Clipperz.Crypto.BigInt.exception = {
+ UnknownType: new MochiKit.Base.NamedError("Clipperz.Crypto.BigInt.exception.UnknownType")
+}
diff --git a/frontend/gamma/js/ClipperzCryptoLibrary/ByteArray.js b/frontend/gamma/js/ClipperzCryptoLibrary/ByteArray.js
new file mode 100644
index 0000000..aca1c00
--- a/dev/null
+++ b/frontend/gamma/js/ClipperzCryptoLibrary/ByteArray.js
@@ -0,0 +1,1496 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
+
+//=============================================================================
+
+Clipperz.ByteArray_abstract = function(args) {
+ return this;
+}
+
+Clipperz.ByteArray_abstract.prototype = MochiKit.Base.update(null, {
+
+ //-------------------------------------------------------------------------
+
+ 'toString': function() {
+ return "Clipperz.ByteArray_abstract";
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'equals': function(aValue) {
+ return (this.compare(aValue) == 0);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'compare': function(aValue) {
+ var result;
+ var i;
+
+ result = MochiKit.Base.compare(this.length(), aValue.length());
+ i = this.length();
+
+ while ((result == 0) && (i>0)) {
+ i--;
+ result = MochiKit.Base.compare(this.byteAtIndex(i), aValue.byteAtIndex(i));
+ }
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'clone': function() {
+ throw Clipperz.Base.exception.AbstractMethod;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'newInstance': function() {
+ throw Clipperz.Base.exception.AbstractMethod;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'reset': function() {
+ throw Clipperz.Base.exception.AbstractMethod;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'length': function() {
+ throw Clipperz.Base.exception.AbstractMethod;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'checkByteValue': function(aValue) {
+//Clipperz.log("aValue", aValue.toString(16));
+//Clipperz.log("(aValue & 0xff)", (aValue & 0xff).toString(16));
+
+ if ((aValue & 0xff) != aValue) {
+ MochiKit.Logging.logError("Clipperz.ByteArray.appendByte: the provided value (0x" + aValue.toString(16) + ") is not a byte value.");
+ throw Clipperz.ByteArray.exception.InvalidValue;
+ }
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'xorMergeWithBlock': function(aBlock, anAllignment, paddingMode) {
+ var result;
+ var a, b;
+ var aLength;
+ var bLength;
+ var i, c;
+
+ if (this.length() > aBlock.length()) {
+ a = this;
+ b = aBlock;
+ } else {
+ a = aBlock;
+ b = this;
+ }
+
+ aLength = a.length();
+ bLength = b.length();
+
+ if (aLength != bLength) {
+ if (paddingMode == 'truncate') {
+ if (anAllignment == 'left') {
+ a = a.split(0, bLength);
+ } else {
+ a = a.split(aLength - bLength);
+ }
+ } else {
+ var ii, cc;
+ var padding;
+
+// padding = new Clipperz.ByteArray();
+ padding = this.newInstance();
+ cc = aLength - bLength;
+ for (ii=0; ii<cc; ii++) {
+ padding.appendByte(0);
+ }
+
+ if (anAllignment == 'left') {
+ b = b.appendBlock(padding);
+ } else {
+ b = padding.appendBlock(b);
+ }
+ }
+ }
+
+
+// result = new Clipperz.ByteArray();
+ result = this.newInstance();
+ c = a.length();
+ for (i=0; i<c; i++) {
+ result.appendByte(a.byteAtIndex(i) ^ b.byteAtIndex(i));
+ }
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+/*
+ 'shiftLeft': function(aNumberOfBitsToShift) {
+ var result;
+
+ result = this.clone(); // ???????????
+
+ return result;
+ },
+*/
+ //-------------------------------------------------------------------------
+
+ 'appendBlock': function(aBlock) {
+ throw Clipperz.Base.exception.AbstractMethod;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'appendByte': function(aValue) {
+ throw Clipperz.Base.exception.AbstractMethod;
+ },
+
+ 'appendBytes': function(args) {
+ var values;
+ var i,c;
+
+ if (args.constructor == Array) {
+ values = args;
+ } else {
+ values = arguments;
+ }
+
+ c = values.length;
+ for (i=0; i<c; i++) {
+ this.appendByte(values[i]);
+ }
+
+ return this;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'appendWord': function(aValue, isLittleEndian) {
+ var result;
+ var processAsLittleEndian;
+
+ processAsLittleEndian = isLittleEndian === true ? true : false;
+
+ if (processAsLittleEndian) {
+ result = this.appendBytes( (aValue) & 0xff, (aValue >> 8) & 0xff, (aValue >> 16) & 0xff, (aValue >> 24) & 0xff ); // little endian
+ } else {
+ result = this.appendBytes( (aValue >> 24) & 0xff, (aValue >> 16) & 0xff, (aValue >> 8) & 0xff, (aValue) & 0xff ); // big endian - DEFAULT
+ }
+
+ return result;
+ },
+
+ 'appendWords': function(args) {
+ var values;
+ var i,c;
+
+ if (args.constructor == Array) {
+ values = args;
+ } else {
+ values = arguments;
+ }
+
+ c = values.length;
+ for (i=0; i<c; i++) {
+ this.appendWord(values[i], false);
+ }
+
+ return this;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'appendBigEndianWords': function(args) {
+ var values;
+ var i,c;
+
+ if (args.constructor == Array) {
+ values = args;
+ } else {
+ values = arguments;
+ }
+
+ c = values.length;
+ for (i=0; i<c; i++) {
+ this.appendWord(values[i], true);
+ }
+
+ return this;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'appendBinaryString': function (aBinaryString) {
+ var i,c;
+
+ c = aBinaryString.length;
+ for (i=0; i<c; i++) {
+ this.appendByte(aBinaryString.charCodeAt(i));
+ };
+
+ return this;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'byteAtIndex': function(anIndex) {
+ throw Clipperz.Base.exception.AbstractMethod;
+ },
+
+ 'setByteAtIndex': function(aValue, anIndex) {
+ throw Clipperz.Base.exception.AbstractMethod;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'bitAtIndex': function(aBitPosition) {
+ var result;
+ var bytePosition;
+ var bitPositionInSelectedByte;
+ var selectedByte;
+ var selectedByteMask;
+
+ bytePosition = this.length() - Math.ceil((aBitPosition + 1)/ 8);
+ bitPositionInSelectedByte = aBitPosition % 8;
+ selectedByte = this.byteAtIndex(bytePosition);
+
+ if (bitPositionInSelectedByte > 0) {
+ selectedByteMask = (1 << bitPositionInSelectedByte);
+ } else {
+ selectedByteMask = 1;
+ }
+ result = selectedByte & selectedByteMask ? 1 : 0;
+//console.log("aBitPosition: " + aBitPosition + ", length: " + this.length() + ", bytePosition: " + bytePosition + ", bitPositionInSelectedByte: " + bitPositionInSelectedByte + ", selectedByteMask: " + selectedByteMask);
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'bitBlockAtIndexWithSize': function(aBitPosition, aSize) {
+ var result;
+ var bitValue;
+ var i,c;
+
+ result = 0;
+ c = aSize;
+ for (i=0; i<c; i++) {
+ bitValue = this.bitAtIndex(aBitPosition + i);
+ result = result | bitValue << i;
+ }
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'asString': function() {
+ var result;
+ var length;
+ var i;
+
+//var startTime = new Date();
+
+//# result = "";
+ result = [];
+
+ i = 0;
+ length = this.length();
+
+ while (i < length) {
+ var currentCharacter;
+ var currentByte;
+ var unicode;
+
+ currentByte = this.byteAtIndex(i);
+
+ if ((currentByte & 0x80) == 0x00 ) { // 0xxxxxxx
+ unicode = currentByte;
+ currentCharacter = String.fromCharCode(unicode);
+ } else if ((currentByte & 0xe0) == 0xc0 ) { // 110xxxxx 10xxxxxx
+ unicode = (currentByte & 0x1f) << 6;
+ i++; currentByte = this.byteAtIndex(i);
+ unicode = unicode | (currentByte & 0x3f);
+
+ currentCharacter = String.fromCharCode(unicode);
+ } else if ((currentByte & 0xf0) == 0xe0 ) { // 1110xxxx 10xxxxxx 10xxxxxx
+ unicode = (currentByte & 0x0f) << (6+6);
+ i++; currentByte = this.byteAtIndex(i);
+ unicode = unicode | ((currentByte & 0x3f) << 6);
+ i++; currentByte = this.byteAtIndex(i);
+ unicode = unicode | (currentByte & 0x3f);
+
+ currentCharacter = String.fromCharCode(unicode);
+ } else { // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ unicode = (currentByte & 0x07) << (6+6+6);
+ i++; currentByte = this.byteAtIndex(i);
+ unicode = unicode | ((currentByte & 0x3f) << (6+6));
+ i++; currentByte = this.byteAtIndex(i);
+ unicode = unicode | ((currentByte & 0x3f) << 6);
+ i++; currentByte = this.byteAtIndex(i);
+ unicode = unicode | (currentByte & 0x3f);
+
+ currentCharacter = String.fromCharCode(unicode);
+ }
+
+// result += currentCharacter;
+ result.push(currentCharacter);
+ i++;
+ }
+
+//MochiKit.Logging.logDebug("[" + (new Date() - startTime) + "] ByteArray.asString");
+
+// return result;
+ return result.join("");
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'toHexString': function() {
+ throw Clipperz.Base.exception.AbstractMethod;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'base64map': "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
+ 'base64mapIndex': "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(''),
+// 'base64mapInvertedIndex': {
+// 'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': 6, 'H': 7, 'I': 8, 'J': 9,
+// 'K': 10, 'L': 11, 'M': 12, 'N': 13, 'O': 14, 'P': 15, 'Q': 16, 'R': 17, 'S': 18, 'T': 19,
+// 'U': 20, 'V': 21, 'W': 22, 'X': 23, 'Y': 24, 'Z': 25, 'a': 26, 'b': 27, 'c': 28, 'd': 29,
+// 'e': 30, 'f': 31, 'g': 32, 'h': 33, 'i': 34, 'j': 35, 'k': 36, 'l': 37, 'm': 38, 'n': 39,
+// 'o': 40, 'p': 41, 'q': 42, 'r': 43, 's': 44, 't': 45, 'u': 46, 'v': 47, 'w': 48, 'x': 49,
+// 'y': 50, 'z': 51, '0': 52, '1': 53, '2': 54, '3': 55, '4': 56, '5': 57, '6': 58, '7': 59,
+// '8': 60, '9': 61, '+': 62, '/': 63,
+// "=": -1},
+
+ //-------------------------------------------------------------------------
+
+ 'appendBase64String': function(aValue) {
+ var i;
+ var length;
+
+ length = aValue.length;
+
+ if ((length % 4) != 0) {
+ MochiKit.Logging.logError("the value passed to the 'ByteArray.setBase64Value' is not correct");
+ throw Clipperz.ByteArray.exception.InvalidValue;
+ }
+
+ i = 0;
+ while (i<length) {
+ var value1, value2, value3, value4;
+ var byte1, byte2, byte3;
+
+ value1 = this.base64map.indexOf(aValue.charAt(i));
+ value2 = this.base64map.indexOf(aValue.charAt(i+1));
+ value3 = this.base64map.indexOf(aValue.charAt(i+2));
+ value4 = this.base64map.indexOf(aValue.charAt(i+3));
+
+// value1 = this.base64mapInvertedIndex[aValue.charAt(i)];
+// value2 = this.base64mapInvertedIndex[aValue.charAt(i+1)];
+// value3 = this.base64mapInvertedIndex[aValue.charAt(i+2)];
+// value4 = this.base64mapInvertedIndex[aValue.charAt(i+3)];
+
+ byte1 = (value1 << 2) | ((value2 & 0x30) >> 4);
+ if (value3 != -1) {
+ byte2 = ((value2 & 0x0f) << 4) | ((value3 & 0x3c) >> 2);
+
+ if (value4 != -1) {
+ byte3 = ((value3 & 0x03) << 6) | (value4);
+ } else {
+ byte3 = null;
+ }
+ } else {
+ byte2 = null;
+ byte3 = null;
+ }
+
+ this.appendByte(byte1);
+ this.appendByte(byte2);
+ this.appendByte(byte3);
+
+ i += 4;
+ }
+
+ return this;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'toBase64String': function() {
+ var result;
+ var length;
+ var i;
+ var byte1, byte2, byte3;
+ var char1, char2, char3, char4;
+
+ i = 0;
+ length = this.length();
+ result = new Array(Math.ceil(length/3));
+
+ while (i < length) {
+ byte1 = this.byteAtIndex(i);
+ if ((i+2) < length) {
+ byte2 = this.byteAtIndex(i+1);
+ byte3 = this.byteAtIndex(i+2);
+ } else if ((i+2) == length) {
+ byte2 = this.byteAtIndex(i+1);
+ byte3 = null;
+ } else {
+ byte2 = null;
+ byte3 = null;
+ }
+
+ char1 = this.base64mapIndex[byte1 >> 2];
+ if (byte2 != null) {
+ char2 = this.base64mapIndex[((byte1 & 0x03) << 4) | ((byte2 & 0xf0) >> 4)];
+ if (byte3 != null) {
+ char3 = this.base64mapIndex[((byte2 & 0x0f) << 2) | ((byte3 & 0xc0) >> 6)];
+ char4 = this.base64mapIndex[(byte3 & 0x3f)];
+ } else {
+ char3 = this.base64mapIndex[(byte2 & 0x0f) << 2];
+ char4 = "=";
+ }
+ } else {
+ char2 = this.base64mapIndex[(byte1 & 0x03) << 4];
+ char3 = "=";
+ char4 = "=";
+ }
+
+ result.push(char1 + char2 + char3 + char4);
+
+ i += 3;
+ }
+
+ return result.join("");
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'base32map': "0123456789abcdefghjkmnpqrstvwxyz",
+ 'base32mapIndex': "0123456789abcdefghjkmnpqrstvwxyz".split(''),
+
+ //-------------------------------------------------------------------------
+
+ 'appendBase32String': function(aValue) {
+ var value;
+ var i;
+ var length;
+ var value1, value2, value3, value4, value5, value6, value7, value8;
+ var byte1, byte2, byte3, byte4, byte5;
+
+ value = aValue.toLowerCase();
+ value = value.replace(/[\s\-]/g, '');
+ value = value.replace(/[0o]/g, '0');
+ value = value.replace(/[1il]/g, '1');
+
+ length = value.length;
+
+ if ((length % 8) != 0) {
+ MochiKit.Logging.logError("the value passed to the 'ByteArray.setBase32Value' is not correct");
+ throw Clipperz.ByteArray.exception.InvalidValue;
+ }
+
+ i = 0;
+ while (i<length) {
+ value1 = this.base32map.indexOf(value.charAt(i));
+ value2 = this.base32map.indexOf(value.charAt(i+1));
+ value3 = this.base32map.indexOf(value.charAt(i+2));
+ value4 = this.base32map.indexOf(value.charAt(i+3));
+ value5 = this.base32map.indexOf(value.charAt(i+4));
+ value6 = this.base32map.indexOf(value.charAt(i+5));
+ value7 = this.base32map.indexOf(value.charAt(i+6));
+ value8 = this.base32map.indexOf(value.charAt(i+7));
+
+ byte1 = byte2 = byte3 = byte4 = byte5 = null;
+
+ byte1 = (value1 << 3) | ((value2 & 0x1c) >> 2);
+ if (value3 != -1) {
+ byte2 = ((value2 & 0x03) << 6) | (value3 << 1) | ((value4 & 0x10) >> 4);
+ if (value5 != -1) {
+ byte3 = ((value4 & 0x0f) << 4) | ((value5 & 0x1e) >> 1);
+ if (value6 != -1) {
+ byte4 = ((value5 & 0x01) << 7) | (value6 << 2) | ((value7 & 0x18) >> 3);
+ if (value8 != -1) {
+ byte5 = ((value7 & 0x07) << 5) | (value8);
+ }
+ }
+ }
+ }
+
+ this.appendByte(byte1);
+ this.appendByte(byte2);
+ this.appendByte(byte3);
+ this.appendByte(byte4);
+ this.appendByte(byte5);
+
+ i += 8;
+ }
+
+ return this;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'toBase32String': function() {
+ var result;
+ var length;
+ var i;
+ var byte1, byte2, byte3, byte4, byte5;
+ var char1, char2, char3, char4, char5, char6, char7, char8;
+
+ i = 0;
+ length = this.length();
+ result = new Array(Math.ceil(length/5));
+
+ while (i < length) {
+ byte1 = this.byteAtIndex(i);
+
+ if ((i+4) < length) {
+ byte2 = this.byteAtIndex(i+1);
+ byte3 = this.byteAtIndex(i+2);
+ byte4 = this.byteAtIndex(i+3);
+ byte5 = this.byteAtIndex(i+4);
+ } else if ((i+4) == length) {
+ byte2 = this.byteAtIndex(i+1);
+ byte3 = this.byteAtIndex(i+2);
+ byte4 = this.byteAtIndex(i+3);
+ byte5 = null;
+ } else if ((i+3) == length) {
+ byte2 = this.byteAtIndex(i+1);
+ byte3 = this.byteAtIndex(i+2);
+ byte4 = null;
+ byte5 = null;
+ } else if ((i+2) == length) {
+ byte2 = this.byteAtIndex(i+1);
+ byte3 = null;
+ byte4 = null;
+ byte5 = null;
+ } else {
+ byte2 = null;
+ byte3 = null;
+ byte4 = null;
+ byte5 = null;
+ }
+
+
+ char1 = this.base32mapIndex[byte1 >> 3];
+ char2 = char3 = char4 = char5 = char6 = char7 = char8 = "=";
+
+ if (byte2 != null) {
+ char2 = this.base32mapIndex[((byte1 & 0x07) << 2) | ((byte2 & 0xc0) >> 6)];
+ char3 = this.base32mapIndex[((byte2 & 0x3e) >> 1)];
+ if (byte3 != null) {
+ char4 = this.base32mapIndex[((byte2 & 0x01) << 4) | ((byte3 & 0xf0) >> 4)];
+ if (byte4 != null) {
+ char5 = this.base32mapIndex[((byte3 & 0x0f) << 1) | ((byte4 & 0x80) >> 7)];
+ char6 = this.base32mapIndex[(byte4 & 0x7c) >> 2];
+ if (byte5 != null) {
+ char7 = this.base32mapIndex[((byte4 & 0x03) << 3) | ((byte5 & 0xe0) >> 5)];
+ char8 = this.base32mapIndex[(byte5 & 0x1f)];
+ } else {
+ char7 = this.base32mapIndex[(byte4 & 0x03) << 3];
+ }
+ } else {
+ char5 = this.base32mapIndex[(byte3 & 0x0f) << 1];
+ }
+
+ } else {
+ char4 = this.base32mapIndex[(byte2 & 0x01) << 4];
+ }
+ } else {
+ char2 = this.base32mapIndex[(byte1 & 0x07) << 2];
+ }
+
+ result.push(char1 + char2 + char3 + char4 + char5 + char6 + char7 + char8);
+ i += 5;
+ }
+
+ return result.join("");
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'toBinaryString': function () {
+ var i, c;
+ var result;
+
+ result = '';
+
+ c = this.length();
+ for (i=0; i<c; i++) {
+ result += String.fromCharCode(this.byteAtIndex(i));
+ }
+
+ return result;
+ },
+
+
+ //-------------------------------------------------------------------------
+
+ 'split': function(aStartingIndex, anEndingIndex) {
+ throw Clipperz.Base.exception.AbstractMethod;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'increment': function() {
+ var i;
+ var done;
+
+ done = false;
+ i = this.length() - 1;
+
+ while ((i>=0) && (done == false)) {
+ var currentByteValue;
+
+ currentByteValue = this.byteAtIndex(i);
+
+ if (currentByteValue == 0xff) {
+ this.setByteAtIndex(0, i);
+ if (i>= 0) {
+ i --;
+ } else {
+ done = true;
+ }
+ } else {
+ this.setByteAtIndex(currentByteValue + 1, i);
+ done = true;
+ }
+ }
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'arrayValues': function() {
+ throw Clipperz.Base.exception.AbstractMethod;
+ },
+
+ //-------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+
+});
+
+//=============================================================================
+//
+// Clipperz.ByteArray_hex
+//
+//=============================================================================
+/*
+Clipperz.ByteArray_hex = function (args) {
+ this._value = "";
+
+ if (typeof(args) != 'undefined') {
+ if (args.constructor == Array) {
+ this.appendBytes(args);
+ } else if (args.constructor == String) {
+ if (args.indexOf("0x") == 0) {
+ var value;
+
+ value = args.substring(2).toLowerCase();
+ if (/[0123456789abcdef]* /.test(value)) { the space in the regexp shoud be removed if the code is activate
+ if ((value.length % 2) == 0) {
+ this._value = value;
+ } else {
+ this._value = "0" + value;
+ }
+ } else {
+MochiKit.Logging.logError("Clipperz.ByteArray should be inizialized with an hex string.");
+ throw Clipperz.ByteArray.exception.InvalidValue;
+ }
+ } else {
+ var value;
+ var i,c;
+
+ c = args.length;
+ value = new Array(c);
+ for (i=0; i<c; i++) {
+ value.push(Clipperz.ByteArray.unicodeToUtf8HexString(args.charCodeAt(i)));
+ }
+
+ this._value = value.join("");
+ }
+ } else {
+ this.appendBytes(MochiKit.Base.extend(null, arguments));
+ }
+ }
+ return this;
+}
+
+Clipperz.ByteArray_hex.prototype = MochiKit.Base.update(new Clipperz.ByteArray_abstract(), {
+
+ //-------------------------------------------------------------------------
+
+ 'toString': function() {
+ return "Clipperz.ByteArray_hex";
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'clone': function() {
+ var result;
+
+ result = this.newInstance();
+ result._value = this._value;
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'newInstance': function() {
+ return new Clipperz.ByteArray_hex();
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'reset': function() {
+ this._value = "";
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'length': function() {
+ return (this._value.length / 2);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'appendBlock': function(aBlock) {
+ this._value = this._value += aBlock.toHexString().substring(2);
+
+ return this;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'appendByte': function(aValue) {
+ if (aValue != null) {
+ this.checkByteValue(aValue);
+ this._value += Clipperz.ByteArray.byteToHex(aValue);
+ }
+
+ return this;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'byteAtIndex': function(anIndex) {
+ return parseInt(this._value.substr(anIndex*2, 2), 16);
+ },
+
+ 'setByteAtIndex': function(aValue, anIndex) {
+ var missingBytes;
+
+ this.checkByteValue(aValue);
+
+ missingBytes = anIndex - this.length();
+
+ if (missingBytes < 0) {
+ var currentValue;
+ var firstCutIndex;
+ var secondCutIndex;
+
+ firstCutIndex = anIndex * 2;
+ secondCutIndex = firstCutIndex + 2;
+ currentValue = this._value;
+ this._value = currentValue.substring(0, firstCutIndex) +
+ Clipperz.ByteArray.byteToHex(aValue) +
+ currentValue.substring(secondCutIndex);
+ } else if (missingBytes == 0) {
+ this.appendByte(aValue);
+ } else {
+ var i,c;
+
+ c = missingBytes;
+ for (i=0; i<c; i++) {
+ this.appendByte(0);
+ }
+
+ this.appendByte(aValue);
+ }
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'toHexString': function() {
+ return "0x" + this._value;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'split': function(aStartingIndex, anEndingIndex) {
+ var result;
+ var startingIndex;
+ var endingIndex;
+
+ result = this.newInstance();
+
+ startingIndex = aStartingIndex * 2;
+ if (typeof(anEndingIndex) != 'undefined') {
+ endingIndex = anEndingIndex * 2;
+ result._value = this._value.substring(startingIndex, endingIndex);
+ } else {
+ result._value = this._value.substring(startingIndex);
+ }
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'arrayValues': function() {
+ var result;
+ var i,c;
+
+ c = this.length();
+
+ result = new Array(c);
+ for (i=0; i<c; i++) {
+ result[i] = this.byteAtIndex(i);
+ }
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+});
+*/
+
+//=============================================================================
+//
+// Clipperz.ByteArray_array
+//
+//=============================================================================
+
+Clipperz.ByteArray_array = function (args) {
+ if (typeof(args) != 'undefined') {
+ if (args.constructor == Array) {
+ this._value = args.slice(0);
+ } else if (args.constructor == String) {
+ var result;
+ var value;
+ var i, c;
+
+ if (args.indexOf("0x") == 0) {
+
+ value = args.substring(2).toLowerCase();
+ if (/[0123456789abcdef]*/.test(value)) {
+ if ((value.length % 2) != 0) {
+ value = "0" + value;
+ }
+ } else {
+MochiKit.Logging.logError("Clipperz.ByteArray should be inizialized with an hex string.");
+ throw Clipperz.ByteArray.exception.InvalidValue;
+ }
+
+ c = value.length / 2
+ result = new Array(c);
+ for (i=0; i<c; i++) {
+ result[i] = parseInt(value.substr(i*2, 2), 16);
+ }
+
+ } else {
+ var unicode;
+ result = [];
+ c = args.length;
+ for (i=0; i<c; i++) {
+// Clipperz.ByteArray.pushUtf8BytesOfUnicodeChar(result, args.charCodeAt(i));
+
+ unicode = args.charCodeAt(i);
+ if (unicode <= 0x7f) { // 0x00000000 - 0x0000007f -> 0xxxxxxx
+ result.push(unicode);
+ // } else if ((unicode >= 0x80) && (unicode <= 0x7ff)) { // 0x00000080 - 0x000007ff -> 110xxxxx 10xxxxxx
+ } else if (unicode <= 0x7ff) { // 0x00000080 - 0x000007ff -> 110xxxxx 10xxxxxx
+ result.push((unicode >> 6) | 0xc0);
+ result.push((unicode & 0x3F) | 0x80);
+ // } else if ((unicode >= 0x0800) && (unicode <= 0xffff)) { // 0x00000800 - 0x0000ffff -> 1110xxxx 10xxxxxx 10xxxxxx
+ } else if (unicode <= 0xffff) { // 0x00000800 - 0x0000ffff -> 1110xxxx 10xxxxxx 10xxxxxx
+ result.push((unicode >> 12) | 0xe0);
+ result.push(((unicode >> 6) & 0x3f) | 0x80);
+ result.push((unicode & 0x3f) | 0x80);
+ } else { // 0x00010000 - 0x001fffff -> 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ result.push((unicode >> 18) | 0xf0);
+ result.push(((unicode >> 12) & 0x3f) | 0x80);
+ result.push(((unicode >> 6) & 0x3f) | 0x80);
+ result.push((unicode & 0x3f) | 0x80);
+ }
+ }
+ }
+
+
+ this._value = result;
+ } else {
+ this._value = [];
+ this.appendBytes(MochiKit.Base.extend(null, arguments));
+ }
+ } else {
+ this._value = [];
+ }
+
+ return this;
+}
+
+Clipperz.ByteArray_array.prototype = MochiKit.Base.update(new Clipperz.ByteArray_abstract(), {
+
+ //-------------------------------------------------------------------------
+
+ 'toString': function() {
+ return "Clipperz.ByteArray_array";
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'clone': function() {
+ var result;
+
+ result = this.newInstance();
+ result.appendBytes(this._value);
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'newInstance': function() {
+ return new Clipperz.ByteArray_array();
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'reset': function() {
+ this._value = [];
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'length': function() {
+ return (this._value.length);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'appendBlock': function(aBlock) {
+ MochiKit.Base.extend(this._value, aBlock._value);
+
+ return this;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'appendByte': function(aValue) {
+ if (aValue != null) {
+ this.checkByteValue(aValue);
+ this._value.push(aValue);
+ }
+
+ return this;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'byteAtIndex': function(anIndex) {
+ return this._value[anIndex];
+ },
+
+ 'setByteAtIndex': function(aValue, anIndex) {
+ var missingBytes;
+
+ this.checkByteValue(aValue);
+
+ missingBytes = anIndex - this.length();
+
+ if (missingBytes < 0) {
+ this._value[anIndex] = aValue;
+ } else if (missingBytes == 0) {
+ this._value.push(aValue);
+ } else {
+ var i,c;
+
+ c = missingBytes;
+ for (i=0; i<c; i++) {
+ this._value.push(0);
+ }
+
+ this._value.push(aValue);
+ }
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'toHexString': function() {
+ var result;
+ var i, c;
+
+ result = "0x";
+ c = this.length();
+ for (i=0; i<c; i++) {
+ result += Clipperz.ByteArray.byteToHex(this._value[i]);
+ }
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'split': function(aStartingIndex, anEndingIndex) {
+ var result;
+
+ result = this.newInstance();
+ result._value = this._value.slice(aStartingIndex, anEndingIndex ? anEndingIndex : this.length());
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'arrayValues': function() {
+ return this._value.slice(0);
+ },
+
+ //-------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+});
+
+
+
+
+
+//=============================================================================
+//
+// Clipperz.ByteArray_string
+//
+//=============================================================================
+/*
+Clipperz.ByteArray_string = function (args) {
+ this._value = "";
+
+ if (typeof(args) != 'undefined') {
+ if (args.constructor == Array) {
+ this.appendBytes(args);
+ } else if (args.constructor == String) {
+ var result;
+ var value;
+ var i, c;
+
+ if (args.indexOf("0x") == 0) {
+
+ value = args.substring(2).toLowerCase();
+ if (/[0123456789abcdef]* /.test(value)) { the space in the regexp shoud be removed if the code is activated
+ if ((value.length % 2) != 0) {
+ value = "0" + value;
+ }
+ } else {
+MochiKit.Logging.logError("Clipperz.ByteArray should be inizialized with an hex string.");
+ throw Clipperz.ByteArray.exception.InvalidValue;
+ }
+ } else {
+ value = "";
+ c = args.length;
+ for (i=0; i<c; i++) {
+ value += Clipperz.ByteArray.unicodeToUtf8HexString(args.charCodeAt(i));
+ }
+ }
+
+ c = value.length / 2
+ for (i=0; i<c; i++) {
+ this.appendByte(parseInt(value.substr(i*2, 2), 16));
+ }
+ } else {
+ this.appendBytes(MochiKit.Base.extend(null, arguments));
+ }
+ }
+
+ return this;
+}
+
+Clipperz.ByteArray_string.prototype = MochiKit.Base.update(new Clipperz.ByteArray_abstract(), {
+
+ //-------------------------------------------------------------------------
+
+ 'toString': function() {
+ return "Clipperz.ByteArray_string";
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'clone': function() {
+ var result;
+
+ result = this.newInstance();
+ result._value = this._value;
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'newInstance': function() {
+ return new Clipperz.ByteArray_string();
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'reset': function() {
+ this._value = "";
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'length': function() {
+ return (this._value.length);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'appendBlock': function(aBlock) {
+ this._value += aBlock._value;
+
+ return this;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'appendByte': function(aValue) {
+ if (aValue != null) {
+ this.checkByteValue(aValue);
+ this._value += String.fromCharCode(aValue);
+ }
+
+ return this;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'byteAtIndex': function(anIndex) {
+ return this._value.charCodeAt(anIndex);
+ },
+
+ 'setByteAtIndex': function(aValue, anIndex) {
+ var missingBytes;
+
+ this.checkByteValue(aValue);
+
+ missingBytes = anIndex - this.length();
+
+ if (missingBytes < 0) {
+ this._value = this._value.substring(0, anIndex) + String.fromCharCode(aValue) + this._value.substring(anIndex + 1);
+ } else if (missingBytes == 0) {
+ this.appendByte(aValue);
+ } else {
+ var i,c;
+
+ c = missingBytes;
+ for (i=0; i<c; i++) {
+ this.appendByte(0);
+ }
+
+ this.appendByte(aValue);
+ }
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'toHexString': function() {
+ var result;
+ var i, c;
+
+ result = "0x";
+ c = this.length();
+ for (i=0; i<c; i++) {
+ result += Clipperz.ByteArray.byteToHex(this.byteAtIndex(i));
+ }
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'split': function(aStartingIndex, anEndingIndex) {
+ var result;
+ result = this.newInstance();
+ result._value = this._value.substring(aStartingIndex, anEndingIndex ? anEndingIndex : this.length());
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'arrayValues': function() {
+ var result;
+ var i,c;
+
+ c = this.length();
+
+ result = new Array(c);
+ for (i=0; i<c; i++) {
+ result[i] = this.byteAtIndex(i);
+ }
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+});
+*/
+
+//=============================================================================
+//
+// Clipperz.ByteArray
+//
+//=============================================================================
+
+Clipperz.ByteArray = Clipperz.ByteArray_array;
+//Clipperz.ByteArray = Clipperz.ByteArray_string;
+//Clipperz.ByteArray = Clipperz.ByteArray_hex;
+
+//#############################################################################
+
+Clipperz.ByteArray.byteToHex = function(aByte) {
+ return ((aByte < 16) ? "0" : "") + aByte.toString(16);
+}
+
+
+Clipperz.ByteArray.unicodeToUtf8HexString = function(aUnicode) {
+ var result;
+ var self;
+
+ self = Clipperz.ByteArray;
+
+ if (aUnicode <= 0x7f) { // 0x00000000 - 0x0000007f -> 0xxxxxxx
+ result = self.byteToHex(aUnicode);
+// } else if ((aUnicode >= 0x80) && (aUnicode <= 0x7ff)) { // 0x00000080 - 0x000007ff -> 110xxxxx 10xxxxxx
+ } else if (aUnicode <= 0x7ff) { // 0x00000080 - 0x000007ff -> 110xxxxx 10xxxxxx
+ result = self.byteToHex((aUnicode >> 6) | 0xc0);
+ result += self.byteToHex((aUnicode & 0x3F) | 0x80);
+// } else if ((aUnicode >= 0x0800) && (aUnicode <= 0xffff)) { // 0x00000800 - 0x0000ffff -> 1110xxxx 10xxxxxx 10xxxxxx
+ } else if (aUnicode <= 0xffff) { // 0x00000800 - 0x0000ffff -> 1110xxxx 10xxxxxx 10xxxxxx
+ result = self.byteToHex((aUnicode >> 12) | 0xe0);
+ result += self.byteToHex(((aUnicode >> 6) & 0x3f) | 0x80);
+ result += self.byteToHex((aUnicode & 0x3f) | 0x80);
+ } else { // 0x00010000 - 0x001fffff -> 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ result = self.byteToHex((aUnicode >> 18) | 0xf0);
+ result += self.byteToHex(((aUnicode >> 12) & 0x3f) | 0x80);
+ result += self.byteToHex(((aUnicode >> 6) & 0x3f) | 0x80);
+ result += self.byteToHex((aUnicode & 0x3f) | 0x80);
+ }
+
+ return result;
+}
+
+Clipperz.ByteArray.pushUtf8BytesOfUnicodeChar = function(anArray, aUnicode) {
+ var self;
+
+ self = Clipperz.ByteArray;
+
+ if (aUnicode <= 0x7f) { // 0x00000000 - 0x0000007f -> 0xxxxxxx
+ anArray.push(aUnicode);
+// } else if ((aUnicode >= 0x80) && (aUnicode <= 0x7ff)) { // 0x00000080 - 0x000007ff -> 110xxxxx 10xxxxxx
+ } else if (aUnicode <= 0x7ff) { // 0x00000080 - 0x000007ff -> 110xxxxx 10xxxxxx
+ anArray.push((aUnicode >> 6) | 0xc0);
+ anArray.push((aUnicode & 0x3F) | 0x80);
+// } else if ((aUnicode >= 0x0800) && (aUnicode <= 0xffff)) { // 0x00000800 - 0x0000ffff -> 1110xxxx 10xxxxxx 10xxxxxx
+ } else if (aUnicode <= 0xffff) { // 0x00000800 - 0x0000ffff -> 1110xxxx 10xxxxxx 10xxxxxx
+ anArray.push((aUnicode >> 12) | 0xe0);
+ anArray.push(((aUnicode >> 6) & 0x3f) | 0x80);
+ anArray.push((aUnicode & 0x3f) | 0x80);
+ } else { // 0x00010000 - 0x001fffff -> 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
+ anArray.push((aUnicode >> 18) | 0xf0);
+ anArray.push(((aUnicode >> 12) & 0x3f) | 0x80);
+ anArray.push(((aUnicode >> 6) & 0x3f) | 0x80);
+ anArray.push((aUnicode & 0x3f) | 0x80);
+ }
+}
+
+Clipperz.ByteArray.prefixMatchingBits = function (aValue, bValue) {
+ var result;
+ var i,c;
+
+ result = 0;
+
+ c = Math.min(aValue.length(), bValue.length());
+ i = 0;
+ while (i<c && (aValue.byteAtIndex(i) == bValue.byteAtIndex(i))) {
+ result += 8;
+ i++;
+ }
+
+ if (i<c) {
+ var xorValue;
+
+ xorValue = (aValue.byteAtIndex(i) ^ bValue.byteAtIndex(i));
+
+ if (xorValue >= 128) {
+ result += 0;
+ } else if (xorValue >= 64) {
+ result += 1;
+ } else if (xorValue >= 32) {
+ result += 2;
+ } else if (xorValue >= 16) {
+ result += 3;
+ } else if (xorValue >= 8) {
+ result += 4;
+ } else if (xorValue >= 4) {
+ result += 5;
+ } else if (xorValue >= 2) {
+ result += 6;
+ } else if (xorValue >= 1) {
+ result += 7;
+ }
+ }
+
+ return result;
+};
+
+Clipperz.ByteArray.exception = {
+ InvalidValue: new MochiKit.Base.NamedError("Clipperz.ByteArray.exception.InvalidValue")
+};
+
+//#############################################################################
+
+Clipperz.ByteArrayIterator = function(args) {
+ args = args || {};
+
+ this._byteArray = args.byteArray;
+ this._blockSize = args.blockSize;
+ this._finalPadding = args.finalPadding || false;
+
+ this._currentPosition = 0;
+
+ return this;
+}
+
+Clipperz.ByteArrayIterator.prototype = MochiKit.Base.update(null, {
+
+ //-------------------------------------------------------------------------
+
+ 'toString': function() {
+ return "Clipperz.ByteArrayIterator";
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'blockSize': function() {
+ var result;
+
+ result = this._blockSize;
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'currentPosition': function() {
+ var result;
+
+ result = this._currentPosition;
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'byteArray': function() {
+ var result;
+
+ result = this._byteArray;
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'finalPadding': function() {
+ var result;
+
+ result = this._finalPadding;
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'nextBlock': function() {
+ var result;
+ var currentPosition;
+ var byteArrayLength;
+
+ currentPosition = this._currentPosition;
+ byteArrayLength = this.byteArray().length();
+
+ if (currentPosition < byteArrayLength) {
+ var i,c;
+
+ c = this.blockSize();
+ result = new Array(c);
+ for (i=0; i<c; i++) {
+ if (currentPosition < byteArrayLength) {
+ result[i] = this.byteArray().byteAtIndex(currentPosition);
+ currentPosition++;
+ } else if (this.finalPadding() == true) {
+ result[i] = 0;
+ }
+ }
+
+ this._currentPosition = currentPosition;
+ } else {
+ result = null;
+ }
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'nextBlockArray': function() {
+ var result;
+ var nextBlock;
+
+ nextBlock = this.nextBlock();
+
+ if (nextBlock != null) {
+ result = new Clipperz.ByteArray(nextBlock);
+ } else {
+ result = null;
+ }
+
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+
+});
diff --git a/frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/Curve.js b/frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/Curve.js
new file mode 100644
index 0000000..9c61bab
--- a/dev/null
+++ b/frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/Curve.js
@@ -0,0 +1,545 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+//try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
+// throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!";
+//}
+if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; }
+if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; }
+
+Clipperz.Crypto.ECC.BinaryField.Curve = function(args) {
+ args = args || {};
+
+ this._modulus = args.modulus;
+
+ this._a = args.a;
+ this._b = args.b;
+ this._G = args.G;
+ this._r = args.r;
+ this._h = args.h;
+
+ this._finiteField = null;
+
+ return this;
+}
+
+Clipperz.Crypto.ECC.BinaryField.Curve.prototype = MochiKit.Base.update(null, {
+
+ 'asString': function() {
+ return "Clipperz.Crypto.ECC.BinaryField.Curve";
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'modulus': function() {
+ return this._modulus;
+ },
+
+ 'a': function() {
+ return this._a;
+ },
+
+ 'b': function() {
+ return this._b;
+ },
+
+ 'G': function() {
+ return this._G;
+ },
+
+ 'r': function() {
+ return this._r;
+ },
+
+ 'h': function() {
+ return this._h;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'finiteField': function() {
+ if (this._finiteField == null) {
+ this._finiteField = new Clipperz.Crypto.ECC.BinaryField.FiniteField({modulus:this.modulus()})
+ }
+
+ return this._finiteField;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'negate': function(aPointA) {
+ var result;
+
+ result = new Clipperz.Crypto.ECC.Point({x:aPointA.x(), y:this.finiteField().add(aPointA.y(), aPointA.x())})
+
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'add': function(aPointA, aPointB) {
+ var result;
+
+//console.log(">>> ECC.BinaryField.Curve.add");
+ if (aPointA.isZero()) {
+//console.log("--- pointA == zero");
+ result = aPointB;
+ } else if (aPointB.isZero()) {
+//console.log("--- pointB == zero");
+ result = aPointA;
+ } else if ( (aPointA.x().compare(aPointB.x()) == 0) && ((aPointA.y().compare(aPointB.y()) != 0) || aPointB.x().isZero())) {
+//console.log("compare A.x - B.x: ", aPointA.x().compare(aPointB.x()));
+//console.log("compare A.y - B.y: ", (aPointA.y().compare(aPointB.y()) != 0));
+//console.log("compare B.x.isZero(): ", aPointB.x().isZero());
+
+//console.log("--- result = zero");
+ result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
+ } else {
+//console.log("--- result = ELSE");
+ var f2m;
+ var x, y;
+ var lambda;
+ var aX, aY, bX, bY;
+
+ aX = aPointA.x()._value;
+ aY = aPointA.y()._value;
+ bX = aPointB.x()._value;
+ bY = aPointB.y()._value;
+
+ f2m = this.finiteField();
+
+ if (aPointA.x().compare(aPointB.x()) != 0) {
+//console.log(" a.x != b.x");
+ lambda = f2m._fastMultiply(
+ f2m._add(aY, bY),
+ f2m._inverse(f2m._add(aX, bX))
+ );
+ x = f2m._add(this.a()._value, f2m._square(lambda));
+ f2m._overwriteAdd(x, lambda);
+ f2m._overwriteAdd(x, aX);
+ f2m._overwriteAdd(x, bX);
+ } else {
+//console.log(" a.x == b.x");
+ lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX)));
+//console.log(" lambda: " + lambda.asString(16));
+ x = f2m._add(this.a()._value, f2m._square(lambda));
+//console.log(" x (step 1): " + x.asString(16));
+ f2m._overwriteAdd(x, lambda);
+//console.log(" x (step 2): " + x.asString(16));
+ }
+
+ y = f2m._fastMultiply(f2m._add(bX, x), lambda);
+//console.log(" y (step 1): " + y.asString(16));
+ f2m._overwriteAdd(y, x);
+//console.log(" y (step 2): " + y.asString(16));
+ f2m._overwriteAdd(y, bY);
+//console.log(" y (step 3): " + y.asString(16));
+
+ result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)})
+ }
+//console.log("<<< ECC.BinaryField.Curve.add");
+
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'addTwice': function(aPointA) {
+ return this.add(aPointA, aPointA);
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'overwriteAdd': function(aPointA, aPointB) {
+ if (aPointA.isZero()) {
+// result = aPointB;
+ aPointA._x._value = aPointB._x._value;
+ aPointA._y._value = aPointB._y._value;
+ } else if (aPointB.isZero()) {
+// result = aPointA;
+ } else if ( (aPointA.x().compare(aPointB.x()) == 0) && ((aPointA.y().compare(aPointB.y()) != 0) || aPointB.x().isZero())) {
+// result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
+ aPointA._x = Clipperz.Crypto.ECC.BinaryField.Value.O;
+ aPointA._y = Clipperz.Crypto.ECC.BinaryField.Value.O;
+ } else {
+ var f2m;
+ var x, y;
+ var lambda;
+ var aX, aY, bX, bY;
+
+ aX = aPointA.x()._value;
+ aY = aPointA.y()._value;
+ bX = aPointB.x()._value;
+ bY = aPointB.y()._value;
+
+ f2m = this.finiteField();
+
+ if (aPointA.x().compare(aPointB.x()) != 0) {
+//console.log(" a.x != b.x");
+ lambda = f2m._fastMultiply(
+ f2m._add(aY, bY),
+ f2m._inverse(f2m._add(aX, bX))
+ );
+ x = f2m._add(this.a()._value, f2m._square(lambda));
+ f2m._overwriteAdd(x, lambda);
+ f2m._overwriteAdd(x, aX);
+ f2m._overwriteAdd(x, bX);
+ } else {
+//console.log(" a.x == b.x");
+ lambda = f2m._add(bX, f2m._fastMultiply(bY, f2m._inverse(bX)));
+//console.log(" lambda: " + lambda.asString(16));
+ x = f2m._add(this.a()._value, f2m._square(lambda));
+//console.log(" x (step 1): " + x.asString(16));
+ f2m._overwriteAdd(x, lambda);
+//console.log(" x (step 2): " + x.asString(16));
+ }
+
+ y = f2m._fastMultiply(f2m._add(bX, x), lambda);
+//console.log(" y (step 1): " + y.asString(16));
+ f2m._overwriteAdd(y, x);
+//console.log(" y (step 2): " + y.asString(16));
+ f2m._overwriteAdd(y, bY);
+//console.log(" y (step 3): " + y.asString(16));
+
+// result = new Clipperz.Crypto.ECC.BinaryField.Point({x:new Clipperz.Crypto.ECC.BinaryField.Value(x), y:new Clipperz.Crypto.ECC.BinaryField.Value(y)})
+ aPointA._x._value = x;
+ aPointA._y._value = y;
+
+ }
+//console.log("<<< ECC.BinaryField.Curve.add");
+
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'multiply': function(aValue, aPoint) {
+ var result;
+
+//console.profile();
+ result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
+
+ if (aValue.isZero() == false) {
+ var k, Q;
+ var i;
+ var countIndex; countIndex = 0;
+
+ if (aValue.compare(Clipperz.Crypto.ECC.BinaryField.Value.O) > 0) {
+ k = aValue;
+ Q = aPoint;
+ } else {
+MochiKit.Logging.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!");
+ k = aValue.negate();
+ Q = this.negate(aPoint);
+ }
+
+//console.log("k: " + k.toString(16));
+//console.log("k.bitSize: " + k.bitSize());
+ for (i=k.bitSize()-1; i>=0; i--) {
+ result = this.add(result, result);
+// this.overwriteAdd(result, result);
+ if (k.isBitSet(i)) {
+ result = this.add(result, Q);
+// this.overwriteAdd(result, Q);
+ }
+
+// if (countIndex==100) {console.log("multiply.break"); break;} else countIndex++;
+ }
+ }
+//console.profileEnd();
+
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'deferredMultiply': function(aValue, aPoint) {
+ var deferredResult;
+ var result;
+
+MochiKit.Logging.logDebug(">>> deferredMultiply - value: " + aValue + ", point: " + aPoint);
+//console.profile("ECC.Curve.multiply");
+ deferredResult = new MochiKit.Async.Deferred();
+//deferredResult.addCallback(function(res) {console.profile("ECC.Curve.deferredMultiply"); return res;} );
+//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 1: " + res); return res;});
+
+ result = new Clipperz.Crypto.ECC.BinaryField.Point({x:Clipperz.Crypto.ECC.BinaryField.Value.O, y:Clipperz.Crypto.ECC.BinaryField.Value.O});
+//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 2: " + res); return res;});
+
+ if (aValue.isZero() == false) {
+ var k, Q;
+ var i;
+ var countIndex; countIndex = 0;
+
+ if (aValue.compare(Clipperz.Crypto.ECC.BinaryField.Value.O) > 0) {
+ k = aValue;
+ Q = aPoint;
+ } else {
+MochiKit.Logging.logError("The Clipperz.Crypto.ECC.BinaryFields.Value does not work with negative values!!!!");
+ k = aValue.negate();
+ Q = this.negate(aPoint);
+ }
+
+//console.log("k: " + k.toString(16));
+//console.log("k.bitSize: " + k.bitSize());
+
+//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 3: " + res); return res;});
+ for (i=k.bitSize()-1; i>=0; i--) {
+//MochiKit.Logging.logDebug("====> " + i);
+//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 4 > i = " + i + ": " + res); return res;});
+ deferredResult.addMethod(this, "addTwice");
+//# result = this.add(result, result);
+// this.overwriteAdd(result, result);
+ if (k.isBitSet(i)) {
+ deferredResult.addMethod(this, "add", Q);
+//# result = this.add(result, Q);
+// this.overwriteAdd(result, Q);
+ }
+ if (i%20 == 0) {deferredResult.addCallback(MochiKit.Async.wait, 0.1);}
+
+// if (countIndex==100) {console.log("multiply.break"); break;} else countIndex++;
+//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 4 < i = " + i + ": " + res); return res;});
+ }
+//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 4: " + res); return res;});
+ }
+//#console.profileEnd();
+//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 5: " + res); return res;});
+//deferredResult.addBoth(function(res) {console.profileEnd(); return res;});
+//deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("# 6: " + res); return res;});
+ deferredResult.callback(result);
+
+//# return result;
+ return deferredResult;
+ },
+
+ //-----------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+});
+
+
+//#############################################################################
+
+Clipperz.Crypto.ECC.StandardCurves = {};
+
+MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
+/*
+ '_K571': null,
+ 'K571': function() {
+ if (Clipperz.Crypto.ECC.StandardCurves._K571 == null) {
+ Clipperz.Crypto.ECC.StandardCurves._K571 = new Clipperz.Crypto.ECC.BinaryField.Curve({
+ 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),
+ a: new Clipperz.Crypto.ECC.BinaryField.Value('0', 16),
+ b: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16),
+ G: new Clipperz.Crypto.ECC.BinaryField.Point({
+ 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),
+ 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)
+ }),
+ 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),
+ h: new Clipperz.Crypto.ECC.BinaryField.Value('4', 16)
+ });
+ }
+
+ return Clipperz.Crypto.ECC.StandardCurves._K571;
+ },
+
+
+
+ '_K283': null,
+ 'K283': function() { // f(z) = z^283 + z^12 + z^7 + z^5 + 1
+ if (Clipperz.Crypto.ECC.StandardCurves._K283 == null) {
+ Clipperz.Crypto.ECC.StandardCurves._K283 = new Clipperz.Crypto.ECC.BinaryField.Curve({
+ modulus: new Clipperz.Crypto.ECC.BinaryField.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16),
+ a: new Clipperz.Crypto.ECC.BinaryField.Value('0', 16),
+ b: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16),
+ G: new Clipperz.Crypto.ECC.BinaryField.Point({
+ x: new Clipperz.Crypto.ECC.BinaryField.Value('0503213f 78ca4488 3f1a3b81 62f188e5 53cd265f 23c1567a 16876913 b0c2ac24 58492836', 16),
+ y: new Clipperz.Crypto.ECC.BinaryField.Value('01ccda38 0f1c9e31 8d90f95d 07e5426f e87e45c0 e8184698 e4596236 4e341161 77dd2259', 16)
+ }),
+ r: new Clipperz.Crypto.ECC.BinaryField.Value('01ffffff ffffffff ffffffff ffffffff ffffe9ae 2ed07577 265dff7f 94451e06 1e163c61', 16),
+ h: new Clipperz.Crypto.ECC.BinaryField.Value('4', 16)
+ });
+ }
+
+ return Clipperz.Crypto.ECC.StandardCurves._K283;
+ },
+*/
+ //-----------------------------------------------------------------------------
+
+ '_B571': null,
+ 'B571': function() { // f(z) = z^571 + z^10 + z^5 + z^2 + 1
+ if (Clipperz.Crypto.ECC.StandardCurves._B571 == null) {
+ Clipperz.Crypto.ECC.StandardCurves._B571 = new Clipperz.Crypto.ECC.BinaryField.Curve({
+ modulus: new Clipperz.Crypto.ECC.BinaryField.Value('80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425', 16),
+ a: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16),
+ b: new Clipperz.Crypto.ECC.BinaryField.Value('02f40e7e2221f295de297117b7f3d62f5c6a97ffcb8ceff1cd6ba8ce4a9a18ad84ffabbd8efa59332be7ad6756a66e294afd185a78ff12aa520e4de739baca0c7ffeff7f2955727a', 16),
+ G: new Clipperz.Crypto.ECC.BinaryField.Point({
+ 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),
+ 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)
+ }),
+ 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),
+ h: new Clipperz.Crypto.ECC.BinaryField.Value('2', 16)
+
+// S: new Clipperz.Crypto.ECC.BinaryField.Value('2aa058f73a0e33ab486b0f610410c53a7f132310', 10),
+// n: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe661ce18ff55987308059b186823851ec7dd9ca1161de93d5174d66e8382e9bb2fe84e47', 16)
+ });
+
+ //-----------------------------------------------------------------------------
+ //
+ // Guide to Elliptic Curve Cryptography
+ // Darrel Hankerson, Alfred Menezes, Scott Vanstone
+ // - Pag: 56, Alorithm 2.45 (with a typo!!!)
+ //
+ //-----------------------------------------------------------------------------
+ //
+ // http://www.milw0rm.com/papers/136
+ //
+ // -------------------------------------------------------------------------
+ // Polynomial Reduction Algorithm Modulo f571
+ // -------------------------------------------------------------------------
+ //
+ // Input: Polynomial p(x) of degree 1140 or less, stored as
+ // an array of 2T machinewords.
+ // Output: p(x) mod f571(x)
+ //
+ // FOR i = T-1, ..., 0 DO
+ // SET X := P[i+T]
+ // P[i] := P[i] ^ (X<<5) ^ (X<<7) ^ (X<<10) ^ (X<<15)
+ // P[i+1] := P[i+1] ^ (X>>17) ^ (X>>22) ^ (X>>25) ^ (X>>27)
+ //
+ // SET X := P[T-1] >> 27
+ // P[0] := P[0] ^ X ^ (X<<2) ^ (X<<5) ^ (X<<10)
+ // P[T-1] := P[T-1] & 0x07ffffff
+ //
+ // RETURN P[T-1],...,P[0]
+ //
+ // -------------------------------------------------------------------------
+ //
+ Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module;
+ Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module = function(aValue) {
+ var result;
+
+ if (aValue.bitSize() > 1140) {
+ MochiKit.Logging.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation");
+ result = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule(aValue);
+ } else {
+ var C, T;
+ var i;
+
+//console.log(">>> binaryField.finiteField.(improved)module");
+// C = aValue.value().slice(0);
+ C = aValue._value.slice(0);
+ for (i=35; i>=18; i--) {
+ T = C[i];
+ C[i-18] = (((C[i-18] ^ (T<<5) ^ (T<<7) ^ (T<<10) ^ (T<<15)) & 0xffffffff) >>> 0);
+ C[i-17] = ((C[i-17] ^ (T>>>27) ^ (T>>>25) ^ (T>>>22) ^ (T>>>17)) >>> 0);
+ }
+ T = (C[17] >>> 27);
+ C[0] = ((C[0] ^ T ^ ((T<<2) ^ (T<<5) ^ (T<<10)) & 0xffffffff) >>> 0);
+ C[17] = (C[17] & 0x07ffffff);
+
+ for(i=18; i<=35; i++) {
+ C[i] = 0;
+ }
+
+ result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
+//console.log("<<< binaryField.finiteField.(improved)module");
+ }
+
+ return result;
+ };
+ }
+
+ return Clipperz.Crypto.ECC.StandardCurves._B571;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ '_B283': null,
+ 'B283': function() { // f(z) = z^283 + z^12 + z^7 + z^5 + 1
+ if (Clipperz.Crypto.ECC.StandardCurves._B283 == null) {
+ Clipperz.Crypto.ECC.StandardCurves._B283 = new Clipperz.Crypto.ECC.BinaryField.Curve({
+// modulus: new Clipperz.Crypto.ECC.BinaryField.Value('10000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16),
+ modulus: new Clipperz.Crypto.ECC.BinaryField.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16),
+ a: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16),
+ b: new Clipperz.Crypto.ECC.BinaryField.Value('027b680a c8b8596d a5a4af8a 19a0303f ca97fd76 45309fa2 a581485a f6263e31 3b79a2f5', 16),
+ G: new Clipperz.Crypto.ECC.BinaryField.Point({
+ x: new Clipperz.Crypto.ECC.BinaryField.Value('05f93925 8db7dd90 e1934f8c 70b0dfec 2eed25b8 557eac9c 80e2e198 f8cdbecd 86b12053', 16),
+ y: new Clipperz.Crypto.ECC.BinaryField.Value('03676854 fe24141c b98fe6d4 b20d02b4 516ff702 350eddb0 826779c8 13f0df45 be8112f4', 16)
+ }),
+ r: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffff ffffffff ffffffff ffffffff ffffef90 399660fc 938a9016 5b042a7c efadb307', 16),
+ h: new Clipperz.Crypto.ECC.BinaryField.Value('2', 16)
+
+// S: new Clipperz.Crypto.ECC.BinaryField.Value('2aa058f73a0e33ab486b0f610410c53a7f132310', 10),
+// n: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe661ce18ff55987308059b186823851ec7dd9ca1161de93d5174d66e8382e9bb2fe84e47', 16)
+ });
+
+ //-----------------------------------------------------------------------------
+ //
+ // Guide to Elliptic Curve Cryptography
+ // Darrel Hankerson, Alfred Menezes, Scott Vanstone
+ // - Pag: 56, Alorithm 2.43
+ //
+ //-----------------------------------------------------------------------------
+ Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module;
+ Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module = function(aValue) {
+ var result;
+
+ if (aValue.bitSize() > 564) {
+ MochiKit.Logging.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation");
+ result = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule(aValue);
+ } else {
+ var C, T;
+ var i;
+
+//console.log(">>> binaryField.finiteField.(improved)module");
+ C = aValue._value.slice(0);
+ for (i=17; i>=9; i--) {
+ T = C[i];
+ C[i-9] = (((C[i-9] ^ (T<<5) ^ (T<<10) ^ (T<<12) ^ (T<<17)) & 0xffffffff) >>> 0);
+ C[i-8] = ((C[i-8] ^ (T>>>27) ^ (T>>>22) ^ (T>>>20) ^ (T>>>15)) >>> 0);
+ }
+ T = (C[8] >>> 27);
+ C[0] = ((C[0] ^ T ^ ((T<<5) ^ (T<<7) ^ (T<<12)) & 0xffffffff) >>> 0);
+ C[8] = (C[8] & 0x07ffffff);
+
+ for(i=9; i<=17; i++) {
+ C[i] = 0;
+ }
+
+ result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
+//console.log("<<< binaryField.finiteField.(improved)module");
+ }
+
+ return result;
+ };
+ }
+
+ return Clipperz.Crypto.ECC.StandardCurves._B283;
+ },
+
+ //-----------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+});
+
+//#############################################################################
+
diff --git a/frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/FiniteField.js b/frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/FiniteField.js
new file mode 100644
index 0000000..4d1ca67
--- a/dev/null
+++ b/frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/FiniteField.js
@@ -0,0 +1,521 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+//try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
+// throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!";
+//}
+if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; }
+if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; }
+
+Clipperz.Crypto.ECC.BinaryField.FiniteField = function(args) {
+ args = args || {};
+ this._modulus = args.modulus;
+
+ return this;
+}
+
+Clipperz.Crypto.ECC.BinaryField.FiniteField.prototype = MochiKit.Base.update(null, {
+
+ 'asString': function() {
+ return "Clipperz.Crypto.ECC.BinaryField.FiniteField (" + this.modulus().asString() + ")";
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'modulus': function() {
+ return this._modulus;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ '_module': function(aValue) {
+ var result;
+ var modulusComparison;
+//console.log(">>> binaryField.finiteField.(standard)module");
+
+ modulusComparison = Clipperz.Crypto.ECC.BinaryField.Value._compare(aValue, this.modulus()._value);
+
+ if (modulusComparison < 0) {
+ result = aValue;
+ } else if (modulusComparison == 0) {
+ result = [0];
+ } else {
+ var modulusBitSize;
+ var resultBitSize;
+
+ result = aValue;
+
+ modulusBitSize = this.modulus().bitSize();
+ resultBitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(result);
+ while (resultBitSize >= modulusBitSize) {
+ Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(result, Clipperz.Crypto.ECC.BinaryField.Value._shiftLeft(this.modulus()._value, resultBitSize - modulusBitSize));
+ resultBitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(result);
+ }
+ }
+//console.log("<<< binaryField.finiteField.(standard)module");
+
+ return result;
+ },
+
+ 'module': function(aValue) {
+ return new Clipperz.Crypto.ECC.BinaryField.Value(this._module(aValue._value.slice(0)));
+ },
+
+ //-----------------------------------------------------------------------------
+
+ '_add': function(a, b) {
+ return Clipperz.Crypto.ECC.BinaryField.Value._xor(a, b);
+ },
+
+ '_overwriteAdd': function(a, b) {
+ Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(a, b);
+ },
+
+ 'add': function(a, b) {
+ return new Clipperz.Crypto.ECC.BinaryField.Value(this._add(a._value, b._value));
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'negate': function(aValue) {
+ return aValue.clone();
+ },
+
+ //-----------------------------------------------------------------------------
+
+ '_multiply': function(a, b) {
+ var result;
+ var valueToXor;
+ var i,c;
+
+ result = [0];
+ valueToXor = b;
+ c = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(a);
+ for (i=0; i<c; i++) {
+ if (Clipperz.Crypto.ECC.BinaryField.Value._isBitSet(a, i) === true) {
+ Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(result, valueToXor);
+ }
+ valueToXor = Clipperz.Crypto.ECC.BinaryField.Value._overwriteShiftLeft(valueToXor, 1);
+ }
+ result = this._module(result);
+
+ return result;
+ },
+
+ 'multiply': function(a, b) {
+ return new Clipperz.Crypto.ECC.BinaryField.Value(this._multiply(a._value, b._value));
+ },
+
+ //-----------------------------------------------------------------------------
+
+ '_fastMultiply': function(a, b) {
+ var result;
+ var B;
+ var i,c;
+
+ result = [0];
+ B = b.slice(0); // Is this array copy avoidable?
+ c = 32;
+ for (i=0; i<c; i++) {
+ var ii, cc;
+
+ cc = a.length;
+ for (ii=0; ii<cc; ii++) {
+ if (((a[ii] >>> i) & 0x01) == 1) {
+ Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor(result, B, ii);
+ }
+ }
+
+ if (i < (c-1)) {
+ B = Clipperz.Crypto.ECC.BinaryField.Value._overwriteShiftLeft(B, 1);
+ }
+ }
+ result = this._module(result);
+
+ return result;
+ },
+
+ 'fastMultiply': function(a, b) {
+ return new Clipperz.Crypto.ECC.BinaryField.Value(this._fastMultiply(a._value, b._value));
+ },
+
+ //-----------------------------------------------------------------------------
+ //
+ // Guide to Elliptic Curve Cryptography
+ // Darrel Hankerson, Alfred Menezes, Scott Vanstone
+ // - Pag: 49, Alorithm 2.34
+ //
+ //-----------------------------------------------------------------------------
+
+ '_square': function(aValue) {
+ var result;
+ var value;
+ var c,i;
+ var precomputedValues;
+
+ value = aValue;
+ result = new Array(value.length * 2);
+ precomputedValues = Clipperz.Crypto.ECC.BinaryField.FiniteField.squarePrecomputedBytes;
+
+ c = value.length;
+ for (i=0; i<c; i++) {
+ result[i*2] = precomputedValues[(value[i] & 0x000000ff)];
+ result[i*2] |= ((precomputedValues[(value[i] & 0x0000ff00) >>> 8]) << 16);
+
+ result[i*2 + 1] = precomputedValues[(value[i] & 0x00ff0000) >>> 16];
+ result[i*2 + 1] |= ((precomputedValues[(value[i] & 0xff000000) >>> 24]) << 16);
+ }
+
+ return this._module(result);
+ },
+
+ 'square': function(aValue) {
+ return new Clipperz.Crypto.ECC.BinaryField.Value(this._square(aValue._value));
+ },
+
+ //-----------------------------------------------------------------------------
+
+ '_inverse': function(aValue) {
+ var result;
+ var b, c;
+ var u, v;
+
+// b = Clipperz.Crypto.ECC.BinaryField.Value.I._value;
+ b = [1];
+// c = Clipperz.Crypto.ECC.BinaryField.Value.O._value;
+ c = [0];
+ u = this._module(aValue);
+ v = this.modulus()._value.slice(0);
+
+ while (Clipperz.Crypto.ECC.BinaryField.Value._bitSize(u) > 1) {
+ var bitDifferenceSize;
+
+ bitDifferenceSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(u) - Clipperz.Crypto.ECC.BinaryField.Value._bitSize(v);
+ if (bitDifferenceSize < 0) {
+ var swap;
+
+ swap = u;
+ u = v;
+ v = swap;
+
+ swap = c;
+ c = b;
+ b = swap;
+
+ bitDifferenceSize = -bitDifferenceSize;
+ }
+
+ u = this._add(u, Clipperz.Crypto.ECC.BinaryField.Value._shiftLeft(v, bitDifferenceSize));
+ b = this._add(b, Clipperz.Crypto.ECC.BinaryField.Value._shiftLeft(c, bitDifferenceSize));
+// this._overwriteAdd(u, Clipperz.Crypto.ECC.BinaryField.Value._shiftLeft(v, bitDifferenceSize));
+// this._overwriteAdd(b, Clipperz.Crypto.ECC.BinaryField.Value._shiftLeft(c, bitDifferenceSize));
+ }
+
+ result = this._module(b);
+
+ return result;
+ },
+
+ 'inverse': function(aValue) {
+ return new Clipperz.Crypto.ECC.BinaryField.Value(this._inverse(aValue._value));
+ },
+
+ //-----------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+});
+
+
+Clipperz.Crypto.ECC.BinaryField.FiniteField.squarePrecomputedBytes = [
+ 0x0000, // 0 = 0000 0000 -> 0000 0000 0000 0000
+ 0x0001, // 1 = 0000 0001 -> 0000 0000 0000 0001
+ 0x0004, // 2 = 0000 0010 -> 0000 0000 0000 0100
+ 0x0005, // 3 = 0000 0011 -> 0000 0000 0000 0101
+ 0x0010, // 4 = 0000 0100 -> 0000 0000 0001 0000
+ 0x0011, // 5 = 0000 0101 -> 0000 0000 0001 0001
+ 0x0014, // 6 = 0000 0110 -> 0000 0000 0001 0100
+ 0x0015, // 7 = 0000 0111 -> 0000 0000 0001 0101
+ 0x0040, // 8 = 0000 1000 -> 0000 0000 0100 0000
+ 0x0041, // 9 = 0000 1001 -> 0000 0000 0100 0001
+ 0x0044, // 10 = 0000 1010 -> 0000 0000 0100 0100
+ 0x0045, // 11 = 0000 1011 -> 0000 0000 0100 0101
+ 0x0050, // 12 = 0000 1100 -> 0000 0000 0101 0000
+ 0x0051, // 13 = 0000 1101 -> 0000 0000 0101 0001
+ 0x0054, // 14 = 0000 1110 -> 0000 0000 0101 0100
+ 0x0055, // 15 = 0000 1111 -> 0000 0000 0101 0101
+
+ 0x0100, // 16 = 0001 0000 -> 0000 0001 0000 0000
+ 0x0101, // 17 = 0001 0001 -> 0000 0001 0000 0001
+ 0x0104, // 18 = 0001 0010 -> 0000 0001 0000 0100
+ 0x0105, // 19 = 0001 0011 -> 0000 0001 0000 0101
+ 0x0110, // 20 = 0001 0100 -> 0000 0001 0001 0000
+ 0x0111, // 21 = 0001 0101 -> 0000 0001 0001 0001
+ 0x0114, // 22 = 0001 0110 -> 0000 0001 0001 0100
+ 0x0115, // 23 = 0001 0111 -> 0000 0001 0001 0101
+ 0x0140, // 24 = 0001 1000 -> 0000 0001 0100 0000
+ 0x0141, // 25 = 0001 1001 -> 0000 0001 0100 0001
+ 0x0144, // 26 = 0001 1010 -> 0000 0001 0100 0100
+ 0x0145, // 27 = 0001 1011 -> 0000 0001 0100 0101
+ 0x0150, // 28 = 0001 1100 -> 0000 0001 0101 0000
+ 0x0151, // 28 = 0001 1101 -> 0000 0001 0101 0001
+ 0x0154, // 30 = 0001 1110 -> 0000 0001 0101 0100
+ 0x0155, // 31 = 0001 1111 -> 0000 0001 0101 0101
+
+ 0x0400, // 32 = 0010 0000 -> 0000 0100 0000 0000
+ 0x0401, // 33 = 0010 0001 -> 0000 0100 0000 0001
+ 0x0404, // 34 = 0010 0010 -> 0000 0100 0000 0100
+ 0x0405, // 35 = 0010 0011 -> 0000 0100 0000 0101
+ 0x0410, // 36 = 0010 0100 -> 0000 0100 0001 0000
+ 0x0411, // 37 = 0010 0101 -> 0000 0100 0001 0001
+ 0x0414, // 38 = 0010 0110 -> 0000 0100 0001 0100
+ 0x0415, // 39 = 0010 0111 -> 0000 0100 0001 0101
+ 0x0440, // 40 = 0010 1000 -> 0000 0100 0100 0000
+ 0x0441, // 41 = 0010 1001 -> 0000 0100 0100 0001
+ 0x0444, // 42 = 0010 1010 -> 0000 0100 0100 0100
+ 0x0445, // 43 = 0010 1011 -> 0000 0100 0100 0101
+ 0x0450, // 44 = 0010 1100 -> 0000 0100 0101 0000
+ 0x0451, // 45 = 0010 1101 -> 0000 0100 0101 0001
+ 0x0454, // 46 = 0010 1110 -> 0000 0100 0101 0100
+ 0x0455, // 47 = 0010 1111 -> 0000 0100 0101 0101
+
+ 0x0500, // 48 = 0011 0000 -> 0000 0101 0000 0000
+ 0x0501, // 49 = 0011 0001 -> 0000 0101 0000 0001
+ 0x0504, // 50 = 0011 0010 -> 0000 0101 0000 0100
+ 0x0505, // 51 = 0011 0011 -> 0000 0101 0000 0101
+ 0x0510, // 52 = 0011 0100 -> 0000 0101 0001 0000
+ 0x0511, // 53 = 0011 0101 -> 0000 0101 0001 0001
+ 0x0514, // 54 = 0011 0110 -> 0000 0101 0001 0100
+ 0x0515, // 55 = 0011 0111 -> 0000 0101 0001 0101
+ 0x0540, // 56 = 0011 1000 -> 0000 0101 0100 0000
+ 0x0541, // 57 = 0011 1001 -> 0000 0101 0100 0001
+ 0x0544, // 58 = 0011 1010 -> 0000 0101 0100 0100
+ 0x0545, // 59 = 0011 1011 -> 0000 0101 0100 0101
+ 0x0550, // 60 = 0011 1100 -> 0000 0101 0101 0000
+ 0x0551, // 61 = 0011 1101 -> 0000 0101 0101 0001
+ 0x0554, // 62 = 0011 1110 -> 0000 0101 0101 0100
+ 0x0555, // 63 = 0011 1111 -> 0000 0101 0101 0101
+
+ 0x1000, // 64 = 0100 0000 -> 0001 0000 0000 0000
+ 0x1001, // 65 = 0100 0001 -> 0001 0000 0000 0001
+ 0x1004, // 66 = 0100 0010 -> 0001 0000 0000 0100
+ 0x1005, // 67 = 0100 0011 -> 0001 0000 0000 0101
+ 0x1010, // 68 = 0100 0100 -> 0001 0000 0001 0000
+ 0x1011, // 69 = 0100 0101 -> 0001 0000 0001 0001
+ 0x1014, // 70 = 0100 0110 -> 0001 0000 0001 0100
+ 0x1015, // 71 = 0100 0111 -> 0001 0000 0001 0101
+ 0x1040, // 72 = 0100 1000 -> 0001 0000 0100 0000
+ 0x1041, // 73 = 0100 1001 -> 0001 0000 0100 0001
+ 0x1044, // 74 = 0100 1010 -> 0001 0000 0100 0100
+ 0x1045, // 75 = 0100 1011 -> 0001 0000 0100 0101
+ 0x1050, // 76 = 0100 1100 -> 0001 0000 0101 0000
+ 0x1051, // 77 = 0100 1101 -> 0001 0000 0101 0001
+ 0x1054, // 78 = 0100 1110 -> 0001 0000 0101 0100
+ 0x1055, // 79 = 0100 1111 -> 0001 0000 0101 0101
+
+ 0x1100, // 80 = 0101 0000 -> 0001 0001 0000 0000
+ 0x1101, // 81 = 0101 0001 -> 0001 0001 0000 0001
+ 0x1104, // 82 = 0101 0010 -> 0001 0001 0000 0100
+ 0x1105, // 83 = 0101 0011 -> 0001 0001 0000 0101
+ 0x1110, // 84 = 0101 0100 -> 0001 0001 0001 0000
+ 0x1111, // 85 = 0101 0101 -> 0001 0001 0001 0001
+ 0x1114, // 86 = 0101 0110 -> 0001 0001 0001 0100
+ 0x1115, // 87 = 0101 0111 -> 0001 0001 0001 0101
+ 0x1140, // 88 = 0101 1000 -> 0001 0001 0100 0000
+ 0x1141, // 89 = 0101 1001 -> 0001 0001 0100 0001
+ 0x1144, // 90 = 0101 1010 -> 0001 0001 0100 0100
+ 0x1145, // 91 = 0101 1011 -> 0001 0001 0100 0101
+ 0x1150, // 92 = 0101 1100 -> 0001 0001 0101 0000
+ 0x1151, // 93 = 0101 1101 -> 0001 0001 0101 0001
+ 0x1154, // 94 = 0101 1110 -> 0001 0001 0101 0100
+ 0x1155, // 95 = 0101 1111 -> 0001 0001 0101 0101
+
+ 0x1400, // 96 = 0110 0000 -> 0001 0100 0000 0000
+ 0x1401, // 97 = 0110 0001 -> 0001 0100 0000 0001
+ 0x1404, // 98 = 0110 0010 -> 0001 0100 0000 0100
+ 0x1405, // 99 = 0110 0011 -> 0001 0100 0000 0101
+ 0x1410, // 100 = 0110 0100 -> 0001 0100 0001 0000
+ 0x1411, // 101 = 0110 0101 -> 0001 0100 0001 0001
+ 0x1414, // 102 = 0110 0110 -> 0001 0100 0001 0100
+ 0x1415, // 103 = 0110 0111 -> 0001 0100 0001 0101
+ 0x1440, // 104 = 0110 1000 -> 0001 0100 0100 0000
+ 0x1441, // 105 = 0110 1001 -> 0001 0100 0100 0001
+ 0x1444, // 106 = 0110 1010 -> 0001 0100 0100 0100
+ 0x1445, // 107 = 0110 1011 -> 0001 0100 0100 0101
+ 0x1450, // 108 = 0110 1100 -> 0001 0100 0101 0000
+ 0x1451, // 109 = 0110 1101 -> 0001 0100 0101 0001
+ 0x1454, // 110 = 0110 1110 -> 0001 0100 0101 0100
+ 0x1455, // 111 = 0110 1111 -> 0001 0100 0101 0101
+
+ 0x1500, // 112 = 0111 0000 -> 0001 0101 0000 0000
+ 0x1501, // 113 = 0111 0001 -> 0001 0101 0000 0001
+ 0x1504, // 114 = 0111 0010 -> 0001 0101 0000 0100
+ 0x1505, // 115 = 0111 0011 -> 0001 0101 0000 0101
+ 0x1510, // 116 = 0111 0100 -> 0001 0101 0001 0000
+ 0x1511, // 117 = 0111 0101 -> 0001 0101 0001 0001
+ 0x1514, // 118 = 0111 0110 -> 0001 0101 0001 0100
+ 0x1515, // 119 = 0111 0111 -> 0001 0101 0001 0101
+ 0x1540, // 120 = 0111 1000 -> 0001 0101 0100 0000
+ 0x1541, // 121 = 0111 1001 -> 0001 0101 0100 0001
+ 0x1544, // 122 = 0111 1010 -> 0001 0101 0100 0100
+ 0x1545, // 123 = 0111 1011 -> 0001 0101 0100 0101
+ 0x1550, // 124 = 0111 1100 -> 0001 0101 0101 0000
+ 0x1551, // 125 = 0111 1101 -> 0001 0101 0101 0001
+ 0x1554, // 126 = 0111 1110 -> 0001 0101 0101 0100
+ 0x1555, // 127 = 0111 1111 -> 0001 0101 0101 0101
+
+ 0x4000, // 128 = 1000 0000 -> 0100 0000 0000 0000
+ 0x4001, // 129 = 1000 0001 -> 0100 0000 0000 0001
+ 0x4004, // 130 = 1000 0010 -> 0100 0000 0000 0100
+ 0x4005, // 131 = 1000 0011 -> 0100 0000 0000 0101
+ 0x4010, // 132 = 1000 0100 -> 0100 0000 0001 0000
+ 0x4011, // 133 = 1000 0101 -> 0100 0000 0001 0001
+ 0x4014, // 134 = 1000 0110 -> 0100 0000 0001 0100
+ 0x4015, // 135 = 1000 0111 -> 0100 0000 0001 0101
+ 0x4040, // 136 = 1000 1000 -> 0100 0000 0100 0000
+ 0x4041, // 137 = 1000 1001 -> 0100 0000 0100 0001
+ 0x4044, // 138 = 1000 1010 -> 0100 0000 0100 0100
+ 0x4045, // 139 = 1000 1011 -> 0100 0000 0100 0101
+ 0x4050, // 140 = 1000 1100 -> 0100 0000 0101 0000
+ 0x4051, // 141 = 1000 1101 -> 0100 0000 0101 0001
+ 0x4054, // 142 = 1000 1110 -> 0100 0000 0101 0100
+ 0x4055, // 143 = 1000 1111 -> 0100 0000 0101 0101
+
+ 0x4100, // 144 = 1001 0000 -> 0100 0001 0000 0000
+ 0x4101, // 145 = 1001 0001 -> 0100 0001 0000 0001
+ 0x4104, // 146 = 1001 0010 -> 0100 0001 0000 0100
+ 0x4105, // 147 = 1001 0011 -> 0100 0001 0000 0101
+ 0x4110, // 148 = 1001 0100 -> 0100 0001 0001 0000
+ 0x4111, // 149 = 1001 0101 -> 0100 0001 0001 0001
+ 0x4114, // 150 = 1001 0110 -> 0100 0001 0001 0100
+ 0x4115, // 151 = 1001 0111 -> 0100 0001 0001 0101
+ 0x4140, // 152 = 1001 1000 -> 0100 0001 0100 0000
+ 0x4141, // 153 = 1001 1001 -> 0100 0001 0100 0001
+ 0x4144, // 154 = 1001 1010 -> 0100 0001 0100 0100
+ 0x4145, // 155 = 1001 1011 -> 0100 0001 0100 0101
+ 0x4150, // 156 = 1001 1100 -> 0100 0001 0101 0000
+ 0x4151, // 157 = 1001 1101 -> 0100 0001 0101 0001
+ 0x4154, // 158 = 1001 1110 -> 0100 0001 0101 0100
+ 0x4155, // 159 = 1001 1111 -> 0100 0001 0101 0101
+
+ 0x4400, // 160 = 1010 0000 -> 0100 0100 0000 0000
+ 0x4401, // 161 = 1010 0001 -> 0100 0100 0000 0001
+ 0x4404, // 162 = 1010 0010 -> 0100 0100 0000 0100
+ 0x4405, // 163 = 1010 0011 -> 0100 0100 0000 0101
+ 0x4410, // 164 = 1010 0100 -> 0100 0100 0001 0000
+ 0x4411, // 165 = 1010 0101 -> 0100 0100 0001 0001
+ 0x4414, // 166 = 1010 0110 -> 0100 0100 0001 0100
+ 0x4415, // 167 = 1010 0111 -> 0100 0100 0001 0101
+ 0x4440, // 168 = 1010 1000 -> 0100 0100 0100 0000
+ 0x4441, // 169 = 1010 1001 -> 0100 0100 0100 0001
+ 0x4444, // 170 = 1010 1010 -> 0100 0100 0100 0100
+ 0x4445, // 171 = 1010 1011 -> 0100 0100 0100 0101
+ 0x4450, // 172 = 1010 1100 -> 0100 0100 0101 0000
+ 0x4451, // 173 = 1010 1101 -> 0100 0100 0101 0001
+ 0x4454, // 174 = 1010 1110 -> 0100 0100 0101 0100
+ 0x4455, // 175 = 1010 1111 -> 0100 0100 0101 0101
+
+ 0x4500, // 176 = 1011 0000 -> 0100 0101 0000 0000
+ 0x4501, // 177 = 1011 0001 -> 0100 0101 0000 0001
+ 0x4504, // 178 = 1011 0010 -> 0100 0101 0000 0100
+ 0x4505, // 179 = 1011 0011 -> 0100 0101 0000 0101
+ 0x4510, // 180 = 1011 0100 -> 0100 0101 0001 0000
+ 0x4511, // 181 = 1011 0101 -> 0100 0101 0001 0001
+ 0x4514, // 182 = 1011 0110 -> 0100 0101 0001 0100
+ 0x4515, // 183 = 1011 0111 -> 0100 0101 0001 0101
+ 0x4540, // 184 = 1011 1000 -> 0100 0101 0100 0000
+ 0x4541, // 185 = 1011 1001 -> 0100 0101 0100 0001
+ 0x4544, // 186 = 1011 1010 -> 0100 0101 0100 0100
+ 0x4545, // 187 = 1011 1011 -> 0100 0101 0100 0101
+ 0x4550, // 188 = 1011 1100 -> 0100 0101 0101 0000
+ 0x4551, // 189 = 1011 1101 -> 0100 0101 0101 0001
+ 0x4554, // 190 = 1011 1110 -> 0100 0101 0101 0100
+ 0x4555, // 191 = 1011 1111 -> 0100 0101 0101 0101
+
+ 0x5000, // 192 = 1100 0000 -> 0101 0000 0000 0000
+ 0x5001, // 193 = 1100 0001 -> 0101 0000 0000 0001
+ 0x5004, // 194 = 1100 0010 -> 0101 0000 0000 0100
+ 0x5005, // 195 = 1100 0011 -> 0101 0000 0000 0101
+ 0x5010, // 196 = 1100 0100 -> 0101 0000 0001 0000
+ 0x5011, // 197 = 1100 0101 -> 0101 0000 0001 0001
+ 0x5014, // 198 = 1100 0110 -> 0101 0000 0001 0100
+ 0x5015, // 199 = 1100 0111 -> 0101 0000 0001 0101
+ 0x5040, // 200 = 1100 1000 -> 0101 0000 0100 0000
+ 0x5041, // 201 = 1100 1001 -> 0101 0000 0100 0001
+ 0x5044, // 202 = 1100 1010 -> 0101 0000 0100 0100
+ 0x5045, // 203 = 1100 1011 -> 0101 0000 0100 0101
+ 0x5050, // 204 = 1100 1100 -> 0101 0000 0101 0000
+ 0x5051, // 205 = 1100 1101 -> 0101 0000 0101 0001
+ 0x5054, // 206 = 1100 1110 -> 0101 0000 0101 0100
+ 0x5055, // 207 = 1100 1111 -> 0101 0000 0101 0101
+
+ 0x5100, // 208 = 1101 0000 -> 0101 0001 0000 0000
+ 0x5101, // 209 = 1101 0001 -> 0101 0001 0000 0001
+ 0x5104, // 210 = 1101 0010 -> 0101 0001 0000 0100
+ 0x5105, // 211 = 1101 0011 -> 0101 0001 0000 0101
+ 0x5110, // 212 = 1101 0100 -> 0101 0001 0001 0000
+ 0x5111, // 213 = 1101 0101 -> 0101 0001 0001 0001
+ 0x5114, // 214 = 1101 0110 -> 0101 0001 0001 0100
+ 0x5115, // 215 = 1101 0111 -> 0101 0001 0001 0101
+ 0x5140, // 216 = 1101 1000 -> 0101 0001 0100 0000
+ 0x5141, // 217 = 1101 1001 -> 0101 0001 0100 0001
+ 0x5144, // 218 = 1101 1010 -> 0101 0001 0100 0100
+ 0x5145, // 219 = 1101 1011 -> 0101 0001 0100 0101
+ 0x5150, // 220 = 1101 1100 -> 0101 0001 0101 0000
+ 0x5151, // 221 = 1101 1101 -> 0101 0001 0101 0001
+ 0x5154, // 222 = 1101 1110 -> 0101 0001 0101 0100
+ 0x5155, // 223 = 1101 1111 -> 0101 0001 0101 0101
+
+ 0x5400, // 224 = 1110 0000 -> 0101 0100 0000 0000
+ 0x5401, // 225 = 1110 0001 -> 0101 0100 0000 0001
+ 0x5404, // 226 = 1110 0010 -> 0101 0100 0000 0100
+ 0x5405, // 227 = 1110 0011 -> 0101 0100 0000 0101
+ 0x5410, // 228 = 1110 0100 -> 0101 0100 0001 0000
+ 0x5411, // 229 = 1110 0101 -> 0101 0100 0001 0001
+ 0x5414, // 230 = 1110 0110 -> 0101 0100 0001 0100
+ 0x5415, // 231 = 1110 0111 -> 0101 0100 0001 0101
+ 0x5440, // 232 = 1110 1000 -> 0101 0100 0100 0000
+ 0x5441, // 233 = 1110 1001 -> 0101 0100 0100 0001
+ 0x5444, // 234 = 1110 1010 -> 0101 0100 0100 0100
+ 0x5445, // 235 = 1110 1011 -> 0101 0100 0100 0101
+ 0x5450, // 236 = 1110 1100 -> 0101 0100 0101 0000
+ 0x5451, // 237 = 1110 1101 -> 0101 0100 0101 0001
+ 0x5454, // 238 = 1110 1110 -> 0101 0100 0101 0100
+ 0x5455, // 239 = 1110 1111 -> 0101 0100 0101 0101
+
+ 0x5500, // 240 = 1111 0000 -> 0101 0101 0000 0000
+ 0x5501, // 241 = 1111 0001 -> 0101 0101 0000 0001
+ 0x5504, // 242 = 1111 0010 -> 0101 0101 0000 0100
+ 0x5505, // 243 = 1111 0011 -> 0101 0101 0000 0101
+ 0x5510, // 244 = 1111 0100 -> 0101 0101 0001 0000
+ 0x5511, // 245 = 1111 0101 -> 0101 0101 0001 0001
+ 0x5514, // 246 = 1111 0110 -> 0101 0101 0001 0100
+ 0x5515, // 247 = 1111 0111 -> 0101 0101 0001 0101
+ 0x5540, // 248 = 1111 1000 -> 0101 0101 0100 0000
+ 0x5541, // 249 = 1111 1001 -> 0101 0101 0100 0001
+ 0x5544, // 250 = 1111 1010 -> 0101 0101 0100 0100
+ 0x5545, // 251 = 1111 1011 -> 0101 0101 0100 0101
+ 0x5550, // 252 = 1111 1100 -> 0101 0101 0101 0000
+ 0x5551, // 253 = 1111 1101 -> 0101 0101 0101 0001
+ 0x5554, // 254 = 1111 1110 -> 0101 0101 0101 0100
+ 0x5555 // 255 = 1111 1111 -> 0101 0101 0101 0101
+
+]
diff --git a/frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/Point.js b/frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/Point.js
new file mode 100644
index 0000000..fef3220
--- a/dev/null
+++ b/frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/Point.js
@@ -0,0 +1,62 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+//try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
+// throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!";
+//}
+if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; }
+if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; }
+
+Clipperz.Crypto.ECC.BinaryField.Point = function(args) {
+ args = args || {};
+ this._x = args.x;
+ this._y = args.y;
+
+ return this;
+}
+
+Clipperz.Crypto.ECC.BinaryField.Point.prototype = MochiKit.Base.update(null, {
+
+ 'asString': function() {
+ return "Clipperz.Crypto.ECC.BinaryField.Point (" + this.x() + ", " + this.y() + ")";
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'x': function() {
+ return this._x;
+ },
+
+ 'y': function() {
+ return this._y;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'isZero': function() {
+ return (this.x().isZero() && this.y().isZero())
+ },
+
+ //-----------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+});
diff --git a/frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/Value.js b/frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/Value.js
new file mode 100644
index 0000000..b046039
--- a/dev/null
+++ b/frontend/gamma/js/ClipperzCryptoLibrary/ECC/BinaryField/Value.js
@@ -0,0 +1,381 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+//try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
+// throw "Clipperz.Crypto.ECC depends on Clipperz.ByteArray!";
+//}
+if (typeof(Clipperz) == 'undefined') { Clipperz = {}; }
+if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; }
+if (typeof(Clipperz.Crypto.ECC) == 'undefined') { Clipperz.Crypto.ECC = {}; }
+if (typeof(Clipperz.Crypto.ECC.BinaryField) == 'undefined') { Clipperz.Crypto.ECC.BinaryField = {}; }
+
+Clipperz.Crypto.ECC.BinaryField.Value = function(aValue, aBase, aBitSize) {
+ if (aValue.constructor == String) {
+ var value;
+ var stringLength;
+ var numberOfWords;
+ var i,c;
+
+ if (aBase != 16) {
+ throw Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedBase;
+ }
+
+ value = aValue.replace(/ /g, '');
+ stringLength = value.length;
+ numberOfWords = Math.ceil(stringLength / 8);
+ this._value = new Array(numberOfWords);
+
+ c = numberOfWords;
+ for (i=0; i<c; i++) {
+ var word;
+
+ if (i < (c-1)) {
+ word = parseInt(value.substr(stringLength-((i+1)*8), 8), 16);
+ } else {
+ word = parseInt(value.substr(0, stringLength-(i*8)), 16);
+ }
+
+ this._value[i] = word;
+ }
+ } else if (aValue.constructor == Array) {
+ var itemsToCopy;
+
+ itemsToCopy = aValue.length;
+ while (aValue[itemsToCopy - 1] == 0) {
+ itemsToCopy --;
+ }
+
+ this._value = aValue.slice(0, itemsToCopy);
+ } else if (aValue.constructor == Number) {
+ this._value = [aValue];
+ } else {
+// throw Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedConstructorValueType;
+ }
+
+ this._bitSize == aBitSize || null;
+
+ return this;
+}
+
+Clipperz.Crypto.ECC.BinaryField.Value.prototype = MochiKit.Base.update(null, {
+
+ 'value': function() {
+ return this._value;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'wordSize': function() {
+ return this._value.length
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'clone': function() {
+ return new Clipperz.Crypto.ECC.BinaryField.Value(this._value.slice(0), null, this._bitSize);
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'isZero': function() {
+ return (this.compare(Clipperz.Crypto.ECC.BinaryField.Value.O) == 0);
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'asString': function(aBase) {
+ var result;
+ var i,c;
+
+ if (aBase != 16) {
+ throw Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedBase;
+ }
+
+ result = "";
+ c = this.wordSize();
+ for (i=0; i<c; i++) {
+ var wordAsString;
+
+// wordAsString = ("00000000" + this.value()[i].toString(16));
+ wordAsString = ("00000000" + this._value[i].toString(16));
+ wordAsString = wordAsString.substring(wordAsString.length - 8);
+ result = wordAsString + result;
+ }
+
+ result = result.replace(/^(00)*/, "");
+
+ if (result == "") {
+ result = "0";
+ }
+
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'shiftLeft': function(aNumberOfBitsToShift) {
+ // this method seems like it is never called. :-(
+ return new Clipperz.Crypto.ECC.BinaryField.Value(Clipperz.Crypto.ECC.BinaryField.Value._shiftLeft(this._value, aNumberOfBitsToShift));
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'bitSize': function() {
+ if (this._bitSize == null) {
+ this._bitSize = Clipperz.Crypto.ECC.BinaryField.Value._bitSize(this._value);
+ }
+
+ return this._bitSize;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'isBitSet': function(aBitPosition) {
+ return Clipperz.Crypto.ECC.BinaryField.Value._isBitSet(this._value, aBitPosition);
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'xor': function(aValue) {
+ return new Clipperz.Crypto.ECC.BinaryField.Value(Clipperz.Crypto.ECC.BinaryField.Value._xor(this._value, aValue._value));
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'compare': function(aValue) {
+ return Clipperz.Crypto.ECC.BinaryField.Value._compare(this._value, aValue._value);
+ },
+
+ //-----------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+});
+
+Clipperz.Crypto.ECC.BinaryField.Value.O = new Clipperz.Crypto.ECC.BinaryField.Value('0', 16);
+Clipperz.Crypto.ECC.BinaryField.Value.I = new Clipperz.Crypto.ECC.BinaryField.Value('1', 16);
+
+Clipperz.Crypto.ECC.BinaryField.Value._xor = function(a, b, aFirstItemOffset) {
+ var result;
+ var resultSize;
+ var i,c;
+ var firstItemOffset;
+
+ firstItemOffset = aFirstItemOffset || 0;
+ resultSize = Math.max((a.length - firstItemOffset), b.length) + firstItemOffset;
+
+ result = new Array(resultSize);
+
+ c = firstItemOffset;
+ for (i=0; i<c; i++) {
+ result[i] = a[i];
+ }
+
+ c = resultSize;
+ for (i=firstItemOffset; i<c; i++) {
+ result[i] = (((a[i] || 0) ^ (b[i - firstItemOffset] || 0)) >>> 0);
+ }
+
+ return result;
+};
+
+Clipperz.Crypto.ECC.BinaryField.Value._overwriteXor = function(a, b, aFirstItemOffset) {
+ var i,c;
+ var firstItemOffset;
+
+ firstItemOffset = aFirstItemOffset || 0;
+
+ c = Math.max((a.length - firstItemOffset), b.length) + firstItemOffset;
+ for (i=firstItemOffset; i<c; i++) {
+ a[i] = (((a[i] || 0) ^ (b[i - firstItemOffset] || 0)) >>> 0);
+ }
+};
+
+Clipperz.Crypto.ECC.BinaryField.Value._shiftLeft = function(aWordArray, aNumberOfBitsToShift) {
+ var numberOfWordsToShift;
+ var numberOfBitsToShift;
+ var result;
+ var overflowValue;
+ var nextOverflowValue;
+ var i,c;
+
+ numberOfWordsToShift = Math.floor(aNumberOfBitsToShift / 32);
+ numberOfBitsToShift = aNumberOfBitsToShift % 32;
+
+ result = new Array(aWordArray.length + numberOfWordsToShift);
+
+ c = numberOfWordsToShift;
+ for (i=0; i<c; i++) {
+ result[i] = 0;
+ }
+
+ overflowValue = 0;
+ nextOverflowValue = 0;
+
+ c = aWordArray.length;
+ for (i=0; i<c; i++) {
+ var value;
+ var resultWord;
+
+// value = this.value()[i];
+ value = aWordArray[i];
+
+ if (numberOfBitsToShift > 0) {
+ nextOverflowValue = (value >>> (32 - numberOfBitsToShift));
+ value = value & (0xffffffff >>> numberOfBitsToShift);
+ resultWord = (((value << numberOfBitsToShift) | overflowValue) >>> 0);
+ } else {
+ resultWord = value;
+ }
+
+ result[i+numberOfWordsToShift] = resultWord;
+ overflowValue = nextOverflowValue;
+ }
+
+ if (overflowValue != 0) {
+ result[aWordArray.length + numberOfWordsToShift] = overflowValue;
+ }
+
+ return result;
+};
+
+Clipperz.Crypto.ECC.BinaryField.Value._overwriteShiftLeft = function(aWordArray, aNumberOfBitsToShift) {
+ var numberOfWordsToShift;
+ var numberOfBitsToShift;
+ var result;
+ var overflowValue;
+ var i,c;
+
+ numberOfWordsToShift = Math.floor(aNumberOfBitsToShift / 32);
+ numberOfBitsToShift = aNumberOfBitsToShift % 32;
+
+ result = new Array(aWordArray.length + numberOfWordsToShift);
+
+ c = numberOfWordsToShift;
+ for (i=0; i<c; i++) {
+ result[i] = 0;
+ }
+
+ overflowValue = 0;
+ nextOverflowValue = 0;
+
+ c = aWordArray.length;
+ for (i=0; i<c; i++) {
+ var value;
+ var resultWord;
+
+// value = this.value()[i];
+ value = aWordArray[i];
+
+ if (numberOfBitsToShift > 0) {
+ var nextOverflowValue;
+
+ nextOverflowValue = (value >>> (32 - numberOfBitsToShift));
+ value = value & (0xffffffff >>> numberOfBitsToShift);
+ resultWord = (((value << numberOfBitsToShift) | overflowValue) >>> 0);
+ } else {
+ resultWord = value;
+ }
+
+ result[i+numberOfWordsToShift] = resultWord;
+ overflowValue = nextOverflowValue;
+ }
+
+ if (overflowValue != 0) {
+ result[aWordArray.length + numberOfWordsToShift] = overflowValue;
+ }
+
+ return result;
+};
+
+Clipperz.Crypto.ECC.BinaryField.Value._bitSize = function(aWordArray) {
+ var result;
+ var notNullElements;
+ var mostValuableWord;
+ var matchingBitsInMostImportantWord;
+ var mask;
+ var i,c;
+
+ notNullElements = aWordArray.length;
+
+ if ((aWordArray.length == 1) && (aWordArray[0] == 0)) {
+ result = 0;
+ } else {
+ notNullElements --;
+ while((notNullElements > 0) && (aWordArray[notNullElements] == 0)) {
+ notNullElements --;
+ }
+
+ result = notNullElements * 32;
+ mostValuableWord = aWordArray[notNullElements];
+
+ matchingBits = 32;
+ mask = 0x80000000;
+
+ while ((matchingBits > 0) && ((mostValuableWord & mask) == 0)) {
+ matchingBits --;
+ mask >>>= 1;
+ }
+
+ result += matchingBits;
+ }
+
+ return result;
+};
+
+Clipperz.Crypto.ECC.BinaryField.Value._isBitSet = function(aWordArray, aBitPosition) {
+ var result;
+ var byteIndex;
+ var bitIndexInSelectedByte;
+
+ byteIndex = Math.floor(aBitPosition / 32);
+ bitIndexInSelectedByte = aBitPosition % 32;
+
+ if (byteIndex <= aWordArray.length) {
+ result = ((aWordArray[byteIndex] & (1 << bitIndexInSelectedByte)) != 0);
+ } else {
+ result = false;
+ }
+
+ return result;
+};
+
+Clipperz.Crypto.ECC.BinaryField.Value._compare = function(a,b) {
+ var result;
+ var i,c;
+
+ result = MochiKit.Base.compare(a.length, b.length);
+
+ c = a.length;
+ for (i=0; (i<c) && (result==0); i++) {
+//console.log("compare[" + c + " - " + i + " - 1] " + this.value()[c-i-1] + ", " + aValue.value()[c-i-1]);
+// result = MochiKit.Base.compare(this.value()[c-i-1], aValue.value()[c-i-1]);
+ result = MochiKit.Base.compare(a[c-i-1], b[c-i-1]);
+ }
+
+ return result;
+};
+
+
+Clipperz.Crypto.ECC.BinaryField.Value['exception']= {
+ 'UnsupportedBase': new MochiKit.Base.NamedError("Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedBase"),
+ 'UnsupportedConstructorValueType': new MochiKit.Base.NamedError("Clipperz.Crypto.ECC.BinaryField.Value.exception.UnsupportedConstructorValueType")
+};
diff --git a/frontend/gamma/js/ClipperzCryptoLibrary/ECC/StandardCurves.js b/frontend/gamma/js/ClipperzCryptoLibrary/ECC/StandardCurves.js
new file mode 100644
index 0000000..ed971ae
--- a/dev/null
+++ b/frontend/gamma/js/ClipperzCryptoLibrary/ECC/StandardCurves.js
@@ -0,0 +1,234 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+//try { if (typeof(Clipperz.Crypto.ECC.BinaryField.Curve) == 'undefined') { throw ""; }} catch (e) {
+// throw "Clipperz.Crypto.ECC depends on Clipperz.Crypto.ECC.BinaryField.Curve!";
+//}
+//try { if (typeof(Clipperz.Crypto.ECC.Koblitz.Curve) == 'undefined') { throw ""; }} catch (e) {
+// throw "Clipperz.Crypto.ECC depends on Clipperz.Crypto.ECC.Koblitz.Curve!";
+//}
+
+Clipperz.Crypto.ECC.StandardCurves = {};
+
+MochiKit.Base.update(Clipperz.Crypto.ECC.StandardCurves, {
+
+ //==============================================================================
+
+ '_K571': null,
+ 'K571': function() { // f(z) = z^571 + z^10 + z^5 + z^2 + 1
+ if ((Clipperz.Crypto.ECC.StandardCurves._K571 == null) && (typeof(Clipperz.Crypto.ECC.Koblitz.Curve) != 'undefined')) {
+ Clipperz.Crypto.ECC.StandardCurves._K571 = new Clipperz.Crypto.ECC.Koblitz.Curve({
+ modulus: new Clipperz.Crypto.ECC.Koblitz.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000425', 16),
+ a: new Clipperz.Crypto.ECC.Koblitz.Value('0', 16),
+ b: new Clipperz.Crypto.ECC.Koblitz.Value('1', 16),
+ G: new Clipperz.Crypto.ECC.Koblitz.Point({
+ x: new Clipperz.Crypto.ECC.Koblitz.Value('026eb7a8 59923fbc 82189631 f8103fe4 ac9ca297 0012d5d4 60248048 01841ca4 43709584 93b205e6 47da304d b4ceb08c bbd1ba39 494776fb 988b4717 4dca88c7 e2945283 a01c8972', 16),
+ y: new Clipperz.Crypto.ECC.Koblitz.Value('0349dc80 7f4fbf37 4f4aeade 3bca9531 4dd58cec 9f307a54 ffc61efc 006d8a2c 9d4979c0 ac44aea7 4fbebbb9 f772aedc b620b01a 7ba7af1b 320430c8 591984f6 01cd4c14 3ef1c7a3', 16)
+ }),
+ r: new Clipperz.Crypto.ECC.Koblitz.Value('02000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 131850e1 f19a63e4 b391a8db 917f4138 b630d84b e5d63938 1e91deb4 5cfe778f 637c1001', 16),
+ h: new Clipperz.Crypto.ECC.Koblitz.Value('4', 16),
+ primeFactor: new Clipperz.Crypto.ECC.Koblitz.Value('02000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 131850e1 f19a63e4 b391a8db 917f4138 b630d84b e5d63938 1e91deb4 5cfe778f 637c1001', 16)
+ });
+ }
+
+ return Clipperz.Crypto.ECC.StandardCurves._K571;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ '_K283': null,
+ 'K283': function() { // f(z) = z^283 + z^12 + z^7 + z^5 + 1
+ if ((Clipperz.Crypto.ECC.StandardCurves._K283 == null) && (typeof(Clipperz.Crypto.ECC.Koblitz.Curve) != 'undefined')) {
+ Clipperz.Crypto.ECC.StandardCurves._K283 = new Clipperz.Crypto.ECC.Koblitz.Curve({
+ modulus: new Clipperz.Crypto.ECC.Koblitz.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16),
+ a: new Clipperz.Crypto.ECC.Koblitz.Value('0', 16),
+ b: new Clipperz.Crypto.ECC.Koblitz.Value('1', 16),
+ G: new Clipperz.Crypto.ECC.Koblitz.Point({
+ x: new Clipperz.Crypto.ECC.Koblitz.Value('0503213f 78ca4488 3f1a3b81 62f188e5 53cd265f 23c1567a 16876913 b0c2ac24 58492836', 16),
+ y: new Clipperz.Crypto.ECC.Koblitz.Value('01ccda38 0f1c9e31 8d90f95d 07e5426f e87e45c0 e8184698 e4596236 4e341161 77dd2259', 16)
+ }),
+ r: new Clipperz.Crypto.ECC.Koblitz.Value('01ffffff ffffffff ffffffff ffffffff ffffe9ae 2ed07577 265dff7f 94451e06 1e163c61', 16),
+ h: new Clipperz.Crypto.ECC.Koblitz.Value('4', 16),
+ primeFactor: new Clipperz.Crypto.ECC.Koblitz.Value('01ffffff ffffffff ffffffff ffffffff ffffe9ae 2ed07577 265dff7f 94451e06 1e163c61', 16)
+ });
+ }
+
+ return Clipperz.Crypto.ECC.StandardCurves._K283;
+ },
+
+ //==============================================================================
+
+ '_B571': null,
+ 'B571': function() { // f(z) = z^571 + z^10 + z^5 + z^2 + 1
+ if ((Clipperz.Crypto.ECC.StandardCurves._B571 == null) && (typeof(Clipperz.Crypto.ECC.BinaryField.Curve) != 'undefined')) {
+ Clipperz.Crypto.ECC.StandardCurves._B571 = new Clipperz.Crypto.ECC.BinaryField.Curve({
+ 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),
+ a: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16),
+ b: new Clipperz.Crypto.ECC.BinaryField.Value('02f40e7e 2221f295 de297117 b7f3d62f 5c6a97ff cb8ceff1 cd6ba8ce 4a9a18ad 84ffabbd 8efa5933 2be7ad67 56a66e29 4afd185a 78ff12aa 520e4de7 39baca0c 7ffeff7f 2955727a', 16),
+ G: new Clipperz.Crypto.ECC.BinaryField.Point({
+ 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),
+ 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)
+ }),
+ 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),
+ h: new Clipperz.Crypto.ECC.BinaryField.Value('2', 16)
+
+// S: new Clipperz.Crypto.ECC.BinaryField.Value('2aa058f73a0e33ab486b0f610410c53a7f132310', 10),
+// n: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe661ce18ff55987308059b186823851ec7dd9ca1161de93d5174d66e8382e9bb2fe84e47', 16)
+ });
+
+ //-----------------------------------------------------------------------------
+ //
+ // Guide to Elliptic Curve Cryptography
+ // Darrel Hankerson, Alfred Menezes, Scott Vanstone
+ // - Pag: 56, Alorithm 2.45 (with a typo!!!)
+ //
+ //-----------------------------------------------------------------------------
+ //
+ // http://www.milw0rm.com/papers/136
+ //
+ // -------------------------------------------------------------------------
+ // Polynomial Reduction Algorithm Modulo f571
+ // -------------------------------------------------------------------------
+ //
+ // Input: Polynomial p(x) of degree 1140 or less, stored as
+ // an array of 2T machinewords.
+ // Output: p(x) mod f571(x)
+ //
+ // FOR i = T-1, ..., 0 DO
+ // SET X := P[i+T]
+ // P[i] := P[i] ^ (X<<5) ^ (X<<7) ^ (X<<10) ^ (X<<15)
+ // P[i+1] := P[i+1] ^ (X>>17) ^ (X>>22) ^ (X>>25) ^ (X>>27)
+ //
+ // SET X := P[T-1] >> 27
+ // P[0] := P[0] ^ X ^ (X<<2) ^ (X<<5) ^ (X<<10)
+ // P[T-1] := P[T-1] & 0x07ffffff
+ //
+ // RETURN P[T-1],...,P[0]
+ //
+ // -------------------------------------------------------------------------
+ //
+ Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module;
+ Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().module = function(aValue) {
+ var result;
+
+ if (aValue.bitSize() > 1140) {
+ MochiKit.Logging.logWarning("ECC.StandarCurves.B571.finiteField().module: falling back to default implementation");
+ result = Clipperz.Crypto.ECC.StandardCurves._B571.finiteField().slowModule(aValue);
+ } else {
+ var C, T;
+ var i;
+
+//console.log(">>> binaryField.finiteField.(improved)module");
+// C = aValue.value().slice(0);
+ C = aValue._value.slice(0);
+ for (i=35; i>=18; i--) {
+ T = C[i];
+ C[i-18] = (((C[i-18] ^ (T<<5) ^ (T<<7) ^ (T<<10) ^ (T<<15)) & 0xffffffff) >>> 0);
+ C[i-17] = ((C[i-17] ^ (T>>>27) ^ (T>>>25) ^ (T>>>22) ^ (T>>>17)) >>> 0);
+ }
+ T = (C[17] >>> 27);
+ C[0] = ((C[0] ^ T ^ ((T<<2) ^ (T<<5) ^ (T<<10)) & 0xffffffff) >>> 0);
+ C[17] = (C[17] & 0x07ffffff);
+
+ for(i=18; i<=35; i++) {
+ C[i] = 0;
+ }
+
+ result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
+//console.log("<<< binaryField.finiteField.(improved)module");
+ }
+
+ return result;
+ };
+ }
+
+ return Clipperz.Crypto.ECC.StandardCurves._B571;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ '_B283': null,
+ 'B283': function() { // f(z) = z^283 + z^12 + z^7 + z^5 + 1
+ if ((Clipperz.Crypto.ECC.StandardCurves._B283 == null) && (typeof(Clipperz.Crypto.ECC.BinaryField.Curve) != 'undefined')) {
+ Clipperz.Crypto.ECC.StandardCurves._B283 = new Clipperz.Crypto.ECC.BinaryField.Curve({
+ modulus: new Clipperz.Crypto.ECC.BinaryField.Value('08000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 000010a1', 16),
+ a: new Clipperz.Crypto.ECC.BinaryField.Value('1', 16),
+ b: new Clipperz.Crypto.ECC.BinaryField.Value('027b680a c8b8596d a5a4af8a 19a0303f ca97fd76 45309fa2 a581485a f6263e31 3b79a2f5', 16),
+ G: new Clipperz.Crypto.ECC.BinaryField.Point({
+ x: new Clipperz.Crypto.ECC.BinaryField.Value('05f93925 8db7dd90 e1934f8c 70b0dfec 2eed25b8 557eac9c 80e2e198 f8cdbecd 86b12053', 16),
+ y: new Clipperz.Crypto.ECC.BinaryField.Value('03676854 fe24141c b98fe6d4 b20d02b4 516ff702 350eddb0 826779c8 13f0df45 be8112f4', 16)
+ }),
+ r: new Clipperz.Crypto.ECC.BinaryField.Value('03ffffff ffffffff ffffffff ffffffff ffffef90 399660fc 938a9016 5b042a7c efadb307', 16),
+ h: new Clipperz.Crypto.ECC.BinaryField.Value('2', 16)
+ });
+
+ //-----------------------------------------------------------------------------
+ //
+ // Guide to Elliptic Curve Cryptography
+ // Darrel Hankerson, Alfred Menezes, Scott Vanstone
+ // - Pag: 56, Alorithm 2.43
+ //
+ //-----------------------------------------------------------------------------
+ Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module;
+ Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().module = function(aValue) {
+ var result;
+
+ if (aValue.bitSize() > 564) {
+ MochiKit.Logging.logWarning("ECC.StandarCurves.B283.finiteField().module: falling back to default implementation");
+ result = Clipperz.Crypto.ECC.StandardCurves._B283.finiteField().slowModule(aValue);
+ } else {
+ var C, T;
+ var i;
+
+//console.log(">>> binaryField.finiteField.(improved)module");
+ C = aValue._value.slice(0);
+ for (i=17; i>=9; i--) {
+ T = C[i];
+ C[i-9] = (((C[i-9] ^ (T<<5) ^ (T<<10) ^ (T<<12) ^ (T<<17)) & 0xffffffff) >>> 0);
+ C[i-8] = ((C[i-8] ^ (T>>>27) ^ (T>>>22) ^ (T>>>20) ^ (T>>>15)) >>> 0);
+ }
+ T = (C[8] >>> 27);
+ C[0] = ((C[0] ^ T ^ ((T<<5) ^ (T<<7) ^ (T<<12)) & 0xffffffff) >>> 0);
+ C[8] = (C[8] & 0x07ffffff);
+
+ for(i=9; i<=17; i++) {
+ C[i] = 0;
+ }
+
+ result = new Clipperz.Crypto.ECC.BinaryField.Value(C);
+//console.log("<<< binaryField.finiteField.(improved)module");
+ }
+
+ return result;
+ };
+ }
+
+ return Clipperz.Crypto.ECC.StandardCurves._B283;
+ },
+
+ //==============================================================================
+ __syntaxFix__: "syntax fix"
+});
+
+
+
diff --git a/frontend/gamma/js/ClipperzCryptoLibrary/PRNG.js b/frontend/gamma/js/ClipperzCryptoLibrary/PRNG.js
new file mode 100644
index 0000000..18cc260
--- a/dev/null
+++ b/frontend/gamma/js/ClipperzCryptoLibrary/PRNG.js
@@ -0,0 +1,850 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
+ throw "Clipperz.Crypto.PRNG depends on Clipperz.ByteArray!";
+}
+
+try { if (typeof(Clipperz.Crypto.SHA) == 'undefined') { throw ""; }} catch (e) {
+ throw "Clipperz.Crypto.PRNG depends on Clipperz.Crypto.SHA!";
+}
+
+try { if (typeof(Clipperz.Crypto.AES) == 'undefined') { throw ""; }} catch (e) {
+ throw "Clipperz.Crypto.PRNG depends on Clipperz.Crypto.AES!";
+}
+
+if (typeof(Clipperz.Crypto.PRNG) == 'undefined') { Clipperz.Crypto.PRNG = {}; }
+
+//#############################################################################
+
+Clipperz.Crypto.PRNG.EntropyAccumulator = function(args) {
+ args = args || {};
+// MochiKit.Base.bindMethods(this);
+
+ this._stack = new Clipperz.ByteArray();
+ this._maxStackLengthBeforeHashing = args.maxStackLengthBeforeHashing || 256;
+ return this;
+}
+
+Clipperz.Crypto.PRNG.EntropyAccumulator.prototype = MochiKit.Base.update(null, {
+
+ 'toString': function() {
+ return "Clipperz.Crypto.PRNG.EntropyAccumulator";
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'stack': function() {
+ return this._stack;
+ },
+
+ 'setStack': function(aValue) {
+ this._stack = aValue;
+ },
+
+ 'resetStack': function() {
+ this.stack().reset();
+ },
+
+ 'maxStackLengthBeforeHashing': function() {
+ return this._maxStackLengthBeforeHashing;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'addRandomByte': function(aValue) {
+ this.stack().appendByte(aValue);
+
+ if (this.stack().length() > this.maxStackLengthBeforeHashing()) {
+ this.setStack(Clipperz.Crypto.SHA.sha_d256(this.stack()));
+ }
+ },
+
+ //-------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+});
+
+//#############################################################################
+
+Clipperz.Crypto.PRNG.RandomnessSource = function(args) {
+ args = args || {};
+ MochiKit.Base.bindMethods(this);
+
+ this._generator = args.generator || null;
+ this._sourceId = args.sourceId || null;
+ this._boostMode = args.boostMode || false;
+
+ this._nextPoolIndex = 0;
+
+ return this;
+}
+
+Clipperz.Crypto.PRNG.RandomnessSource.prototype = MochiKit.Base.update(null, {
+
+ 'generator': function() {
+ return this._generator;
+ },
+
+ 'setGenerator': function(aValue) {
+ this._generator = aValue;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'boostMode': function() {
+ return this._boostMode;
+ },
+
+ 'setBoostMode': function(aValue) {
+ this._boostMode = aValue;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'sourceId': function() {
+ return this._sourceId;
+ },
+
+ 'setSourceId': function(aValue) {
+ this._sourceId = aValue;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'nextPoolIndex': function() {
+ return this._nextPoolIndex;
+ },
+
+ 'incrementNextPoolIndex': function() {
+ this._nextPoolIndex = ((this._nextPoolIndex + 1) % this.generator().numberOfEntropyAccumulators());
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'updateGeneratorWithValue': function(aRandomValue) {
+ if (this.generator() != null) {
+ this.generator().addRandomByte(this.sourceId(), this.nextPoolIndex(), aRandomValue);
+ this.incrementNextPoolIndex();
+ }
+ },
+
+ //-------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+});
+
+//#############################################################################
+
+Clipperz.Crypto.PRNG.TimeRandomnessSource = function(args) {
+ args = args || {};
+// MochiKit.Base.bindMethods(this);
+
+ this._intervalTime = args.intervalTime || 1000;
+
+ Clipperz.Crypto.PRNG.RandomnessSource.call(this, args);
+
+ this.collectEntropy();
+ return this;
+}
+
+Clipperz.Crypto.PRNG.TimeRandomnessSource.prototype = MochiKit.Base.update(new Clipperz.Crypto.PRNG.RandomnessSource, {
+
+ 'intervalTime': function() {
+ return this._intervalTime;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'collectEntropy': function() {
+ var now;
+ var entropyByte;
+ var intervalTime;
+ now = new Date();
+ entropyByte = (now.getTime() & 0xff);
+
+ intervalTime = this.intervalTime();
+ if (this.boostMode() == true) {
+ intervalTime = intervalTime / 9;
+ }
+
+ this.updateGeneratorWithValue(entropyByte);
+ setTimeout(this.collectEntropy, intervalTime);
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'numberOfRandomBits': function() {
+ return 5;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'pollingFrequency': function() {
+ return 10;
+ },
+
+ //-------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+});
+
+//*****************************************************************************
+
+Clipperz.Crypto.PRNG.MouseRandomnessSource = function(args) {
+ args = args || {};
+
+ Clipperz.Crypto.PRNG.RandomnessSource.call(this, args);
+
+ this._numberOfBitsToCollectAtEachEvent = 4;
+ this._randomBitsCollector = 0;
+ this._numberOfRandomBitsCollected = 0;
+
+ MochiKit.Signal.connect(document, 'onmousemove', this, 'collectEntropy');
+
+ return this;
+}
+
+Clipperz.Crypto.PRNG.MouseRandomnessSource.prototype = MochiKit.Base.update(new Clipperz.Crypto.PRNG.RandomnessSource, {
+
+ //-------------------------------------------------------------------------
+
+ 'numberOfBitsToCollectAtEachEvent': function() {
+ return this._numberOfBitsToCollectAtEachEvent;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'randomBitsCollector': function() {
+ return this._randomBitsCollector;
+ },
+
+ 'setRandomBitsCollector': function(aValue) {
+ this._randomBitsCollector = aValue;
+ },
+
+ 'appendRandomBitsToRandomBitsCollector': function(aValue) {
+ var collectedBits;
+ var numberOfRandomBitsCollected;
+
+ numberOfRandomBitsCollected = this.numberOfRandomBitsCollected();
+ collectetBits = this.randomBitsCollector() | (aValue << numberOfRandomBitsCollected);
+ this.setRandomBitsCollector(collectetBits);
+ numberOfRandomBitsCollected += this.numberOfBitsToCollectAtEachEvent();
+
+ if (numberOfRandomBitsCollected == 8) {
+ this.updateGeneratorWithValue(collectetBits);
+ numberOfRandomBitsCollected = 0;
+ this.setRandomBitsCollector(0);
+ }
+
+ this.setNumberOfRandomBitsCollected(numberOfRandomBitsCollected)
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'numberOfRandomBitsCollected': function() {
+ return this._numberOfRandomBitsCollected;
+ },
+
+ 'setNumberOfRandomBitsCollected': function(aValue) {
+ this._numberOfRandomBitsCollected = aValue;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'collectEntropy': function(anEvent) {
+ var mouseLocation;
+ var randomBit;
+ var mask;
+
+ mask = 0xffffffff >>> (32 - this.numberOfBitsToCollectAtEachEvent());
+
+ mouseLocation = anEvent.mouse().client;
+ randomBit = ((mouseLocation.x ^ mouseLocation.y) & mask);
+ this.appendRandomBitsToRandomBitsCollector(randomBit)
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'numberOfRandomBits': function() {
+ return 1;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'pollingFrequency': function() {
+ return 10;
+ },
+
+ //-------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+});
+
+//*****************************************************************************
+
+Clipperz.Crypto.PRNG.KeyboardRandomnessSource = function(args) {
+ args = args || {};
+ Clipperz.Crypto.PRNG.RandomnessSource.call(this, args);
+
+ this._randomBitsCollector = 0;
+ this._numberOfRandomBitsCollected = 0;
+
+ MochiKit.Signal.connect(document, 'onkeypress', this, 'collectEntropy');
+
+ return this;
+}
+
+Clipperz.Crypto.PRNG.KeyboardRandomnessSource.prototype = MochiKit.Base.update(new Clipperz.Crypto.PRNG.RandomnessSource, {
+
+ //-------------------------------------------------------------------------
+
+ 'randomBitsCollector': function() {
+ return this._randomBitsCollector;
+ },
+
+ 'setRandomBitsCollector': function(aValue) {
+ this._randomBitsCollector = aValue;
+ },
+
+ 'appendRandomBitToRandomBitsCollector': function(aValue) {
+ var collectedBits;
+ var numberOfRandomBitsCollected;
+
+ numberOfRandomBitsCollected = this.numberOfRandomBitsCollected();
+ collectetBits = this.randomBitsCollector() | (aValue << numberOfRandomBitsCollected);
+ this.setRandomBitsCollector(collectetBits);
+ numberOfRandomBitsCollected ++;
+
+ if (numberOfRandomBitsCollected == 8) {
+ this.updateGeneratorWithValue(collectetBits);
+ numberOfRandomBitsCollected = 0;
+ this.setRandomBitsCollector(0);
+ }
+
+ this.setNumberOfRandomBitsCollected(numberOfRandomBitsCollected)
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'numberOfRandomBitsCollected': function() {
+ return this._numberOfRandomBitsCollected;
+ },
+
+ 'setNumberOfRandomBitsCollected': function(aValue) {
+ this._numberOfRandomBitsCollected = aValue;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'collectEntropy': function(anEvent) {
+/*
+ var mouseLocation;
+ var randomBit;
+
+ mouseLocation = anEvent.mouse().client;
+
+ randomBit = ((mouseLocation.x ^ mouseLocation.y) & 0x1);
+ this.appendRandomBitToRandomBitsCollector(randomBit);
+*/
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'numberOfRandomBits': function() {
+ return 1;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'pollingFrequency': function() {
+ return 10;
+ },
+
+ //-------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+});
+
+//#############################################################################
+
+Clipperz.Crypto.PRNG.Fortuna = function(args) {
+ var i,c;
+
+ args = args || {};
+
+ this._key = args.seed || null;
+ if (this._key == null) {
+ this._counter = 0;
+ this._key = new Clipperz.ByteArray();
+ } else {
+ this._counter = 1;
+ }
+
+ this._aesKey = null;
+
+ this._firstPoolReseedLevel = args.firstPoolReseedLevel || 32 || 64;
+ this._numberOfEntropyAccumulators = args.numberOfEntropyAccumulators || 32;
+
+ this._accumulators = [];
+ c = this.numberOfEntropyAccumulators();
+ for (i=0; i<c; i++) {
+ this._accumulators.push(new Clipperz.Crypto.PRNG.EntropyAccumulator());
+ }
+
+ this._randomnessSources = [];
+ this._reseedCounter = 0;
+
+ return this;
+}
+
+Clipperz.Crypto.PRNG.Fortuna.prototype = MochiKit.Base.update(null, {
+
+ 'toString': function() {
+ return "Clipperz.Crypto.PRNG.Fortuna";
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'key': function() {
+ return this._key;
+ },
+
+ 'setKey': function(aValue) {
+ this._key = aValue;
+ this._aesKey = null;
+ },
+
+ 'aesKey': function() {
+ if (this._aesKey == null) {
+ this._aesKey = new Clipperz.Crypto.AES.Key({key:this.key()});
+ }
+
+ return this._aesKey;
+ },
+
+ 'accumulators': function() {
+ return this._accumulators;
+ },
+
+ 'firstPoolReseedLevel': function() {
+ return this._firstPoolReseedLevel;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'reseedCounter': function() {
+ return this._reseedCounter;
+ },
+
+ 'incrementReseedCounter': function() {
+ this._reseedCounter = this._reseedCounter +1;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'reseed': function() {
+ var newKeySeed;
+ var reseedCounter;
+ var reseedCounterMask;
+ var i, c;
+
+ newKeySeed = this.key();
+ this.incrementReseedCounter();
+ reseedCounter = this.reseedCounter();
+
+ c = this.numberOfEntropyAccumulators();
+ reseedCounterMask = 0xffffffff >>> (32 - c);
+ for (i=0; i<c; i++) {
+ if ((i == 0) || ((reseedCounter & (reseedCounterMask >>> (c - i))) == 0)) {
+ newKeySeed.appendBlock(this.accumulators()[i].stack());
+ this.accumulators()[i].resetStack();
+ }
+ }
+
+ if (reseedCounter == 1) {
+ c = this.randomnessSources().length;
+ for (i=0; i<c; i++) {
+ this.randomnessSources()[i].setBoostMode(false);
+ }
+ }
+
+ this.setKey(Clipperz.Crypto.SHA.sha_d256(newKeySeed));
+ if (reseedCounter == 1) {
+//MochiKit.Logging.logDebug("### PRNG.readyToGenerateRandomBytes");
+Clipperz.log("### PRNG.readyToGenerateRandomBytes");
+ MochiKit.Signal.signal(this, 'readyToGenerateRandomBytes');
+ }
+ MochiKit.Signal.signal(this, 'reseeded');
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'isReadyToGenerateRandomValues': function() {
+ return this.reseedCounter() != 0;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'entropyLevel': function() {
+ return this.accumulators()[0].stack().length() + (this.reseedCounter() * this.firstPoolReseedLevel());
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'counter': function() {
+ return this._counter;
+ },
+
+ 'incrementCounter': function() {
+ this._counter += 1;
+ },
+
+ 'counterBlock': function() {
+ var result;
+
+ result = new Clipperz.ByteArray().appendWords(this.counter(), 0, 0, 0);
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'getRandomBlock': function() {
+ var result;
+
+ result = new Clipperz.ByteArray(Clipperz.Crypto.AES.encryptBlock(this.aesKey(), this.counterBlock().arrayValues()));
+ this.incrementCounter();
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'getRandomBytes': function(aSize) {
+ var result;
+
+ if (this.isReadyToGenerateRandomValues()) {
+ var i,c;
+ var newKey;
+
+ result = new Clipperz.ByteArray();
+
+ c = Math.ceil(aSize / (128 / 8));
+ for (i=0; i<c; i++) {
+ result.appendBlock(this.getRandomBlock());
+ }
+
+ if (result.length() != aSize) {
+ result = result.split(0, aSize);
+ }
+
+ newKey = this.getRandomBlock().appendBlock(this.getRandomBlock());
+ this.setKey(newKey);
+ } else {
+MochiKit.Logging.logWarning("Fortuna generator has not enough entropy, yet!");
+ throw Clipperz.Crypto.PRNG.exception.NotEnoughEntropy;
+ }
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'addRandomByte': function(aSourceId, aPoolId, aRandomValue) {
+ var selectedAccumulator;
+
+ selectedAccumulator = this.accumulators()[aPoolId];
+ selectedAccumulator.addRandomByte(aRandomValue);
+
+ if (aPoolId == 0) {
+ MochiKit.Signal.signal(this, 'addedRandomByte')
+ if (selectedAccumulator.stack().length() > this.firstPoolReseedLevel()) {
+ this.reseed();
+ }
+ }
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'numberOfEntropyAccumulators': function() {
+ return this._numberOfEntropyAccumulators;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'randomnessSources': function() {
+ return this._randomnessSources;
+ },
+
+ 'addRandomnessSource': function(aRandomnessSource) {
+ aRandomnessSource.setGenerator(this);
+ aRandomnessSource.setSourceId(this.randomnessSources().length);
+ this.randomnessSources().push(aRandomnessSource);
+
+ if (this.isReadyToGenerateRandomValues() == false) {
+ aRandomnessSource.setBoostMode(true);
+ }
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'deferredEntropyCollection': function(aValue) {
+ var result;
+
+//MochiKit.Logging.logDebug(">>> PRNG.deferredEntropyCollection");
+
+ if (this.isReadyToGenerateRandomValues()) {
+//MochiKit.Logging.logDebug("--- PRNG.deferredEntropyCollection - 1");
+ result = aValue;
+ } else {
+//MochiKit.Logging.logDebug("--- PRNG.deferredEntropyCollection - 2");
+ var deferredResult;
+
+// Clipperz.NotificationCenter.notify(this, 'updatedProgressState', 'collectingEntropy', true);
+
+ deferredResult = new Clipperz.Async.Deferred("PRNG.deferredEntropyCollection");
+// deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.1 - PRNG.deferredEntropyCollection - 1: " + res); return res;});
+ deferredResult.addCallback(MochiKit.Base.partial(MochiKit.Async.succeed, aValue));
+// deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.2 - PRNG.deferredEntropyCollection - 2: " + res); return res;});
+ MochiKit.Signal.connect(this,
+ 'readyToGenerateRandomBytes',
+ deferredResult,
+ 'callback');
+
+ result = deferredResult;
+ }
+//MochiKit.Logging.logDebug("<<< PRNG.deferredEntropyCollection - result: " + result);
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'fastEntropyAccumulationForTestingPurpose': function() {
+ while (! this.isReadyToGenerateRandomValues()) {
+ this.addRandomByte(Math.floor(Math.random() * 32), Math.floor(Math.random() * 32), Math.floor(Math.random() * 256));
+ }
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'dump': function(appendToDoc) {
+ var tbl;
+ var i,c;
+
+ tbl = document.createElement("table");
+ tbl.border = 0;
+ with (tbl.style) {
+ border = "1px solid lightgrey";
+ fontFamily = 'Helvetica, Arial, sans-serif';
+ fontSize = '8pt';
+ //borderCollapse = "collapse";
+ }
+ var hdr = tbl.createTHead();
+ var hdrtr = hdr.insertRow(0);
+ // document.createElement("tr");
+ {
+ var ntd;
+
+ ntd = hdrtr.insertCell(0);
+ ntd.style.borderBottom = "1px solid lightgrey";
+ ntd.style.borderRight = "1px solid lightgrey";
+ ntd.appendChild(document.createTextNode("#"));
+
+ ntd = hdrtr.insertCell(1);
+ ntd.style.borderBottom = "1px solid lightgrey";
+ ntd.style.borderRight = "1px solid lightgrey";
+ ntd.appendChild(document.createTextNode("s"));
+
+ ntd = hdrtr.insertCell(2);
+ ntd.colSpan = this.firstPoolReseedLevel();
+ ntd.style.borderBottom = "1px solid lightgrey";
+ ntd.style.borderRight = "1px solid lightgrey";
+ ntd.appendChild(document.createTextNode("base values"));
+
+ ntd = hdrtr.insertCell(3);
+ ntd.colSpan = 20;
+ ntd.style.borderBottom = "1px solid lightgrey";
+ ntd.appendChild(document.createTextNode("extra values"));
+
+ }
+
+ c = this.accumulators().length;
+ for (i=0; i<c ; i++) {
+ var currentAccumulator;
+ var bdytr;
+ var bdytd;
+ var ii, cc;
+
+ currentAccumulator = this.accumulators()[i]
+
+ bdytr = tbl.insertRow(true);
+
+ bdytd = bdytr.insertCell(0);
+ bdytd.style.borderRight = "1px solid lightgrey";
+ bdytd.style.color = "lightgrey";
+ bdytd.appendChild(document.createTextNode("" + i));
+
+ bdytd = bdytr.insertCell(1);
+ bdytd.style.borderRight = "1px solid lightgrey";
+ bdytd.style.color = "gray";
+ bdytd.appendChild(document.createTextNode("" + currentAccumulator.stack().length()));
+
+
+ cc = Math.max(currentAccumulator.stack().length(), this.firstPoolReseedLevel());
+ for (ii=0; ii<cc; ii++) {
+ var cellText;
+
+ bdytd = bdytr.insertCell(ii + 2);
+
+ if (ii < currentAccumulator.stack().length()) {
+ cellText = Clipperz.ByteArray.byteToHex(currentAccumulator.stack().byteAtIndex(ii));
+ } else {
+ cellText = "_";
+ }
+
+ if (ii == (this.firstPoolReseedLevel() - 1)) {
+ bdytd.style.borderRight = "1px solid lightgrey";
+ }
+
+ bdytd.appendChild(document.createTextNode(cellText));
+ }
+
+ }
+
+
+ if (appendToDoc) {
+ var ne = document.createElement("div");
+ ne.id = "entropyGeneratorStatus";
+ with (ne.style) {
+ fontFamily = "Courier New, monospace";
+ fontSize = "12px";
+ lineHeight = "16px";
+ borderTop = "1px solid black";
+ padding = "10px";
+ }
+ if (document.getElementById(ne.id)) {
+ MochiKit.DOM.swapDOM(ne.id, ne);
+ } else {
+ document.body.appendChild(ne);
+ }
+ ne.appendChild(tbl);
+ }
+
+ return tbl;
+ },
+
+ //-----------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+});
+
+//#############################################################################
+
+Clipperz.Crypto.PRNG.Random = function(args) {
+ args = args || {};
+// MochiKit.Base.bindMethods(this);
+
+ return this;
+}
+
+Clipperz.Crypto.PRNG.Random.prototype = MochiKit.Base.update(null, {
+
+ 'toString': function() {
+ return "Clipperz.Crypto.PRNG.Random";
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'getRandomBytes': function(aSize) {
+//Clipperz.Profile.start("Clipperz.Crypto.PRNG.Random.getRandomBytes");
+ var result;
+ var i,c;
+
+ result = new Clipperz.ByteArray()
+ c = aSize || 1;
+ for (i=0; i<c; i++) {
+ result.appendByte((Math.random()*255) & 0xff);
+ }
+
+//Clipperz.Profile.stop("Clipperz.Crypto.PRNG.Random.getRandomBytes");
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+});
+
+//#############################################################################
+
+_clipperz_crypt_prng_defaultPRNG = null;
+
+Clipperz.Crypto.PRNG.defaultRandomGenerator = function() {
+ if (_clipperz_crypt_prng_defaultPRNG == null) {
+ _clipperz_crypt_prng_defaultPRNG = new Clipperz.Crypto.PRNG.Fortuna();
+
+ //.............................................................
+ //
+ // TimeRandomnessSource
+ //
+ //.............................................................
+ {
+ var newRandomnessSource;
+
+ newRandomnessSource = new Clipperz.Crypto.PRNG.TimeRandomnessSource({intervalTime:111});
+ _clipperz_crypt_prng_defaultPRNG.addRandomnessSource(newRandomnessSource);
+ }
+
+ //.............................................................
+ //
+ // MouseRandomnessSource
+ //
+ //.............................................................
+ {
+ var newRandomnessSource;
+
+ newRandomnessSource = new Clipperz.Crypto.PRNG.MouseRandomnessSource();
+ _clipperz_crypt_prng_defaultPRNG.addRandomnessSource(newRandomnessSource);
+ }
+
+ //.............................................................
+ //
+ // KeyboardRandomnessSource
+ //
+ //.............................................................
+ {
+ var newRandomnessSource;
+
+ newRandomnessSource = new Clipperz.Crypto.PRNG.KeyboardRandomnessSource();
+ _clipperz_crypt_prng_defaultPRNG.addRandomnessSource(newRandomnessSource);
+ }
+
+ }
+
+ return _clipperz_crypt_prng_defaultPRNG;
+};
+
+//#############################################################################
+
+Clipperz.Crypto.PRNG.exception = {
+ NotEnoughEntropy: new MochiKit.Base.NamedError("Clipperz.Crypto.PRNG.exception.NotEnoughEntropy")
+};
+
+
+MochiKit.DOM.addLoadEvent(Clipperz.Crypto.PRNG.defaultRandomGenerator);
diff --git a/frontend/gamma/js/ClipperzCryptoLibrary/RSA.js b/frontend/gamma/js/ClipperzCryptoLibrary/RSA.js
new file mode 100644
index 0000000..5a480f1
--- a/dev/null
+++ b/frontend/gamma/js/ClipperzCryptoLibrary/RSA.js
@@ -0,0 +1,146 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+try { if (typeof(Clipperz.Crypto.BigInt) == 'undefined') { throw ""; }} catch (e) {
+ throw "Clipperz.Crypto.RSA depends on Clipperz.Crypto.BigInt!";
+}
+
+if (typeof(Clipperz.Crypto.RSA) == 'undefined') { Clipperz.Crypto.RSA = {}; }
+
+Clipperz.Crypto.RSA.VERSION = "0.1";
+Clipperz.Crypto.RSA.NAME = "Clipperz.RSA";
+
+//#############################################################################
+
+MochiKit.Base.update(Clipperz.Crypto.RSA, {
+
+ //-------------------------------------------------------------------------
+
+ 'publicKeyWithValues': function (e, d, n) {
+ var result;
+
+ result = {};
+
+ if (e.isBigInt) {
+ result.e = e;
+ } else {
+ result.e = new Clipperz.Crypto.BigInt(e, 16);
+ }
+
+ if (d.isBigInt) {
+ result.d = d;
+ } else {
+ result.d = new Clipperz.Crypto.BigInt(d, 16);
+ }
+
+ if (n.isBigInt) {
+ result.n = n;
+ } else {
+ result.n = new Clipperz.Crypto.BigInt(n, 16);
+ }
+
+ return result;
+ },
+
+ 'privateKeyWithValues': function(e, d, n) {
+ return Clipperz.Crypto.RSA.publicKeyWithValues(e, d, n);
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'encryptUsingPublicKey': function (aKey, aMessage) {
+ var messageValue;
+ var result;
+
+ messageValue = new Clipperz.Crypto.BigInt(aMessage, 16);
+ result = messageValue.powerModule(aKey.e, aKey.n);
+
+ return result.asString(16);
+ },
+
+ //.............................................................................
+
+ 'decryptUsingPublicKey': function (aKey, aMessage) {
+ return Clipperz.Crypto.RSA.encryptUsingPublicKey(aKey, aMessage);
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'encryptUsingPrivateKey': function (aKey, aMessage) {
+ var messageValue;
+ var result;
+
+ messageValue = new Clipperz.Crypto.BigInt(aMessage, 16);
+ result = messageValue.powerModule(aKey.d, aKey.n);
+
+ return result.asString(16);
+ },
+
+ //.............................................................................
+
+ 'decryptUsingPrivateKey': function (aKey, aMessage) {
+ return Clipperz.Crypto.RSA.encryptUsingPrivateKey(aKey, aMessage);
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'generatePublicKey': function(aNumberOfBits) {
+ var result;
+ var e;
+ var d;
+ var n;
+
+ e = new Clipperz.Crypto.BigInt("10001", 16);
+
+ {
+ var p, q;
+ var phi;
+
+ do {
+ p = Clipperz.Crypto.BigInt.randomPrime(aNumberOfBits);
+ } while (p.module(e).equals(1));
+
+ do {
+ q = Clipperz.Crypto.BigInt.randomPrime(aNumberOfBits);
+ } while ((q.equals(p)) || (q.module(e).equals(1)));
+
+ n = p.multiply(q);
+ phi = (p.subtract(1).multiply(q.subtract(1)));
+ d = e.powerModule(-1, phi);
+ }
+
+ result = Clipperz.Crypto.RSA.publicKeyWithValues(e, d, n);
+
+ return result;
+ },
+
+ //-------------------------------------------------------------------------
+
+ __syntaxFix__: "syntax fix"
+
+ //-------------------------------------------------------------------------
+
+});
+
+//#############################################################################
+
diff --git a/frontend/gamma/js/ClipperzCryptoLibrary/SHA.js b/frontend/gamma/js/ClipperzCryptoLibrary/SHA.js
new file mode 100644
index 0000000..f8bfe6e
--- a/dev/null
+++ b/frontend/gamma/js/ClipperzCryptoLibrary/SHA.js
@@ -0,0 +1,296 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
+ throw "Clipperz.Crypto.PRNG depends on Clipperz.ByteArray!";
+}
+
+if (typeof(Clipperz.Crypto) == 'undefined') { Clipperz.Crypto = {}; }
+if (typeof(Clipperz.Crypto.SHA) == 'undefined') { Clipperz.Crypto.SHA = {}; }
+
+Clipperz.Crypto.SHA.VERSION = "0.3";
+Clipperz.Crypto.SHA.NAME = "Clipperz.Crypto.SHA";
+
+MochiKit.Base.update(Clipperz.Crypto.SHA, {
+
+ '__repr__': function () {
+ return "[" + this.NAME + " " + this.VERSION + "]";
+ },
+
+ 'toString': function () {
+ return this.__repr__();
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'rotateRight': function(aValue, aNumberOfBits) {
+//Clipperz.Profile.start("Clipperz.Crypto.SHA.rotateRight");
+ var result;
+
+ result = (aValue >>> aNumberOfBits) | (aValue << (32 - aNumberOfBits));
+
+//Clipperz.Profile.stop("Clipperz.Crypto.SHA.rotateRight");
+ return result;
+ },
+
+ 'shiftRight': function(aValue, aNumberOfBits) {
+//Clipperz.Profile.start("Clipperz.Crypto.SHA.shiftRight");
+ var result;
+
+ result = aValue >>> aNumberOfBits;
+
+//Clipperz.Profile.stop("Clipperz.Crypto.SHA.shiftRight");
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'safeAdd': function() {
+//Clipperz.Profile.start("Clipperz.Crypto.SHA.safeAdd");
+ var result;
+ var i, c;
+
+ result = arguments[0];
+ c = arguments.length;
+ for (i=1; i<c; i++) {
+ var lowerBytesSum;
+
+ lowerBytesSum = (result & 0xffff) + (arguments[i] & 0xffff);
+ result = (((result >> 16) + (arguments[i] >> 16) + (lowerBytesSum >> 16)) << 16) | (lowerBytesSum & 0xffff);
+ }
+
+//Clipperz.Profile.stop("Clipperz.Crypto.SHA.safeAdd");
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'sha256_array': function(aValue) {
+//Clipperz.Profile.start("Clipperz.Crypto.SHA.sha256_array");
+ var result;
+ var message;
+ var h0, h1, h2, h3, h4, h5, h6, h7;
+ var k;
+ var messageLength;
+ var messageLengthInBits;
+ var _i, _c;
+ var charBits;
+ var rotateRight;
+ var shiftRight;
+ var safeAdd;
+ var bytesPerBlock;
+ var currentMessageIndex;
+
+ bytesPerBlock = 512/8;
+ rotateRight = Clipperz.Crypto.SHA.rotateRight;
+ shiftRight = Clipperz.Crypto.SHA.shiftRight;
+ safeAdd = Clipperz.Crypto.SHA.safeAdd;
+
+ charBits = 8;
+
+ h0 = 0x6a09e667;
+ h1 = 0xbb67ae85;
+ h2 = 0x3c6ef372;
+ h3 = 0xa54ff53a;
+ h4 = 0x510e527f;
+ h5 = 0x9b05688c;
+ h6 = 0x1f83d9ab;
+ h7 = 0x5be0cd19;
+
+ k = [ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
+ 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
+ 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
+ 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
+ 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
+ 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
+ 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
+ 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2];
+
+ message = aValue;
+ messageLength = message.length;
+
+ //Pre-processing:
+ message.push(0x80); // append a single "1" bit to message
+
+ _c = (512 - (((messageLength + 1) * charBits) % 512) - 64) / charBits;
+ if (_c < 0) {
+ _c = _c + (512 / charBits);
+ }
+
+ for (_i=0; _i<_c; _i++) {
+ message.push(0x00); // append "0" bits until message length ≡ 448 ≡ -64 (mod 512)
+ }
+
+ messageLengthInBits = messageLength * charBits;
+ message.push(0x00); // the 4 most high byte are alway 0 as message length is represented with a 32bit value;
+ message.push(0x00);
+ message.push(0x00);
+ message.push(0x00);
+ message.push((messageLengthInBits >> 24) & 0xff);
+ message.push((messageLengthInBits >> 16) & 0xff);
+ message.push((messageLengthInBits >> 8) & 0xff);
+ message.push( messageLengthInBits & 0xff);
+
+ currentMessageIndex = 0;
+ while(currentMessageIndex < message.length) {
+ var w;
+ var a, b, c, d, e, f, g, h;
+
+ w = Array(64);
+
+ _c = 16;
+ for (_i=0; _i<_c; _i++) {
+ var _j;
+
+ _j = currentMessageIndex + _i*4;
+ w[_i] = (message[_j] << 24) | (message[_j + 1] << 16) | (message[_j + 2] << 8) | (message[_j + 3] << 0);
+ }
+
+ _c = 64;
+ for (_i=16; _i<_c; _i++) {
+ var s0, s1;
+
+ s0 = (rotateRight(w[_i-15], 7)) ^ (rotateRight(w[_i-15], 18)) ^ (shiftRight(w[_i-15], 3));
+ s1 = (rotateRight(w[_i-2], 17)) ^ (rotateRight(w[_i-2], 19)) ^ (shiftRight(w[_i-2], 10));
+ w[_i] = safeAdd(w[_i-16], s0, w[_i-7], s1);
+ }
+
+ a=h0; b=h1; c=h2; d=h3; e=h4; f=h5; g=h6; h=h7;
+
+ _c = 64;
+ for (_i=0; _i<_c; _i++) {
+ var s0, s1, ch, maj, t1, t2;
+
+ s0 = (rotateRight(a, 2)) ^ (rotateRight(a, 13)) ^ (rotateRight(a, 22));
+ maj = (a & b) ^ (a & c) ^ (b & c);
+ t2 = safeAdd(s0, maj);
+ s1 = (rotateRight(e, 6)) ^ (rotateRight(e, 11)) ^ (rotateRight(e, 25));
+ ch = (e & f) ^ ((~e) & g);
+ t1 = safeAdd(h, s1, ch, k[_i], w[_i]);
+
+ h = g;
+ g = f;
+ f = e;
+ e = safeAdd(d, t1);
+ d = c;
+ c = b;
+ b = a;
+ a = safeAdd(t1, t2);
+ }
+
+ h0 = safeAdd(h0, a);
+ h1 = safeAdd(h1, b);
+ h2 = safeAdd(h2, c);
+ h3 = safeAdd(h3, d);
+ h4 = safeAdd(h4, e);
+ h5 = safeAdd(h5, f);
+ h6 = safeAdd(h6, g);
+ h7 = safeAdd(h7, h);
+
+ currentMessageIndex += bytesPerBlock;
+ }
+
+ result = new Array(256/8);
+ result[0] = (h0 >> 24) & 0xff;
+ result[1] = (h0 >> 16) & 0xff;
+ result[2] = (h0 >> 8) & 0xff;
+ result[3] = h0 & 0xff;
+
+ result[4] = (h1 >> 24) & 0xff;
+ result[5] = (h1 >> 16) & 0xff;
+ result[6] = (h1 >> 8) & 0xff;
+ result[7] = h1 & 0xff;
+
+ result[8] = (h2 >> 24) & 0xff;
+ result[9] = (h2 >> 16) & 0xff;
+ result[10] = (h2 >> 8) & 0xff;
+ result[11] = h2 & 0xff;
+
+ result[12] = (h3 >> 24) & 0xff;
+ result[13] = (h3 >> 16) & 0xff;
+ result[14] = (h3 >> 8) & 0xff;
+ result[15] = h3 & 0xff;
+
+ result[16] = (h4 >> 24) & 0xff;
+ result[17] = (h4 >> 16) & 0xff;
+ result[18] = (h4 >> 8) & 0xff;
+ result[19] = h4 & 0xff;
+
+ result[20] = (h5 >> 24) & 0xff;
+ result[21] = (h5 >> 16) & 0xff;
+ result[22] = (h5 >> 8) & 0xff;
+ result[23] = h5 & 0xff;
+
+ result[24] = (h6 >> 24) & 0xff;
+ result[25] = (h6 >> 16) & 0xff;
+ result[26] = (h6 >> 8) & 0xff;
+ result[27] = h6 & 0xff;
+
+ result[28] = (h7 >> 24) & 0xff;
+ result[29] = (h7 >> 16) & 0xff;
+ result[30] = (h7 >> 8) & 0xff;
+ result[31] = h7 & 0xff;
+
+//Clipperz.Profile.stop("Clipperz.Crypto.SHA.sha256_array");
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'sha256': function(aValue) {
+//Clipperz.Profile.start("Clipperz.Crypto.SHA.sha256");
+ var result;
+ var resultArray;
+ var valueArray;
+
+ valueArray = aValue.arrayValues();
+ resultArray = Clipperz.Crypto.SHA.sha256_array(valueArray);
+
+ result = new Clipperz.ByteArray(resultArray);
+
+//Clipperz.Profile.stop("Clipperz.Crypto.SHA.sha256");
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'sha_d256': function(aValue) {
+//Clipperz.Profile.start("Clipperz.Crypto.SHA.sha_d256");
+ var result;
+ var resultArray;
+ var valueArray;
+
+ valueArray = aValue.arrayValues();
+ resultArray = Clipperz.Crypto.SHA.sha256_array(valueArray);
+ resultArray = Clipperz.Crypto.SHA.sha256_array(resultArray);
+
+ result = new Clipperz.ByteArray(resultArray);
+
+//Clipperz.Profile.stop("Clipperz.Crypto.SHA.sha256");
+ return result;
+ },
+
+ //-----------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+
+});
diff --git a/frontend/gamma/js/ClipperzCryptoLibrary/SRP.js b/frontend/gamma/js/ClipperzCryptoLibrary/SRP.js
new file mode 100644
index 0000000..8cc80ba
--- a/dev/null
+++ b/frontend/gamma/js/ClipperzCryptoLibrary/SRP.js
@@ -0,0 +1,326 @@
+/*
+
+Copyright 2008-2013 Clipperz Srl
+
+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 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 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. If not, see http://www.gnu.org/licenses/.
+
+*/
+
+try { if (typeof(Clipperz.ByteArray) == 'undefined') { throw ""; }} catch (e) {
+ throw "Clipperz.Crypto.PRNG depends on Clipperz.ByteArray!";
+}
+
+try { if (typeof(Clipperz.Crypto.BigInt) == 'undefined') { throw ""; }} catch (e) {
+ throw "Clipperz.Crypto.SRP depends on Clipperz.Crypto.BigInt!";
+}
+
+try { if (typeof(Clipperz.Crypto.PRNG) == 'undefined') { throw ""; }} catch (e) {
+ throw "Clipperz.Crypto.SRP depends on Clipperz.Crypto.PRNG!";
+}
+
+if (typeof(Clipperz.Crypto.SRP) == 'undefined') { Clipperz.Crypto.SRP = {}; }
+
+Clipperz.Crypto.SRP.VERSION = "0.1";
+Clipperz.Crypto.SRP.NAME = "Clipperz.Crypto.SRP";
+
+//#############################################################################
+
+MochiKit.Base.update(Clipperz.Crypto.SRP, {
+
+ '_n': null,
+ '_g': null,
+ //-------------------------------------------------------------------------
+
+ 'n': function() {
+ if (Clipperz.Crypto.SRP._n == null) {
+ Clipperz.Crypto.SRP._n = new Clipperz.Crypto.BigInt("115b8b692e0e045692cf280b436735c77a5a9e8a9e7ed56c965f87db5b2a2ece3", 16);
+ }
+
+ return Clipperz.Crypto.SRP._n;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'g': function() {
+ if (Clipperz.Crypto.SRP._g == null) {
+ Clipperz.Crypto.SRP._g = new Clipperz.Crypto.BigInt(2); // eventually 5 (as suggested on the Diffi-Helmann documentation)
+ }
+
+ return Clipperz.Crypto.SRP._g;
+ },
+
+ //-----------------------------------------------------------------------------
+
+ 'exception': {
+ 'InvalidValue': new MochiKit.Base.NamedError("Clipperz.Crypto.SRP.exception.InvalidValue")
+ },
+
+ //-------------------------------------------------------------------------
+ __syntaxFix__: "syntax fix"
+
+});
+
+//#############################################################################
+//
+// S R P C o n n e c t i o n version 1.0
+//
+//=============================================================================
+Clipperz.Crypto.SRP.Connection = function (args) {
+ args = args || {};
+
+ this._C = args.C;
+ this._P = args.P;
+ this.hash = args.hash;
+
+ this._a = null;
+ this._A = null;
+
+ this._s = null;
+ this._B = null;
+
+ this._x = null;
+
+ this._u = null;
+ this._K = null;
+ this._M1 = null;
+ this._M2 = null;
+
+ this._sessionKey = null;
+
+ return this;
+}
+
+Clipperz.Crypto.SRP.Connection.prototype = MochiKit.Base.update(null, {
+
+ 'toString': function () {
+ return "Clipperz.Crypto.SRP.Connection (username: " + this.username() + "). Status: " + this.statusDescription();
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'C': function () {
+ return this._C;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'P': function () {
+ return this._P;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'a': function () {
+ if (this._a == null) {
+ this._a = new Clipperz.Crypto.BigInt(Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32).toHexString().substring(2), 16);
+// this._a = new Clipperz.Crypto.BigInt("37532428169486597638072888476611365392249575518156687476805936694442691012367", 10);
+//MochiKit.Logging.logDebug("SRP a: " + this._a);
+ }
+
+ return this._a;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'A': function () {
+ if (this._A == null) {
+ // Warning: this value should be strictly greater than zero: how should we perform this check?
+ this._A = Clipperz.Crypto.SRP.g().powerModule(this.a(), Clipperz.Crypto.SRP.n());
+
+ if (this._A.equals(0)) {
+MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'A' to 0.");
+ throw Clipperz.Crypto.SRP.exception.InvalidValue;
+ }
+//MochiKit.Logging.logDebug("SRP A: " + this._A);
+ }
+
+ return this._A;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 's': function () {
+ return this._s;
+//MochiKit.Logging.logDebug("SRP s: " + this._S);
+ },
+
+ 'set_s': function(aValue) {
+ this._s = aValue;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'B': function () {
+ return this._B;
+ },
+
+ 'set_B': function(aValue) {
+ // Warning: this value should be strictly greater than zero: how should we perform this check?
+ if (! aValue.equals(0)) {
+ this._B = aValue;
+//MochiKit.Logging.logDebug("SRP B: " + this._B);
+ } else {
+MochiKit.Logging.logError("Clipperz.Crypto.SRP.Connection: trying to set 'B' to 0.");
+ throw Clipperz.Crypto.SRP.exception.InvalidValue;
+ }
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'x': function () {
+ if (this._x == null) {
+ this._x = new Clipperz.Crypto.BigInt(this.stringHash(this.s().asString(16, 64) + this.P()), 16);
+//MochiKit.Logging.logDebug("SRP x: " + this._x);
+ }
+
+ return this._x;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'u': function () {
+ if (this._u == null) {
+ this._u = new Clipperz.Crypto.BigInt(this.stringHash(this.B().asString()), 16);
+//MochiKit.Logging.logDebug("SRP u: " + this._u);
+ }
+
+ return this._u;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'S': function () {
+ if (this._S == null) {
+ var bigint;
+ var srp;
+
+ bigint = Clipperz.Crypto.BigInt;
+ srp = Clipperz.Crypto.SRP;
+
+ this._S = bigint.powerModule(
+ bigint.subtract(this.B(), bigint.powerModule(srp.g(), this.x(), srp.n())),
+ bigint.add(this.a(), bigint.multiply(this.u(), this.x())),
+ srp.n()
+ )
+//MochiKit.Logging.logDebug("SRP S: " + this._S);
+ }
+
+ return this._S;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'K': function () {
+ if (this._K == null) {
+ this._K = this.stringHash(this.S().asString());
+//MochiKit.Logging.logDebug("SRP K: " + this._K);
+ }
+
+ return this._K;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'M1': function () {
+ if (this._M1 == null) {
+ this._M1 = this.stringHash(this.A().asString(10) + this.B().asString(10) + this.K());
+//MochiKit.Logging.logDebug("SRP M1: " + this._M1);
+ }
+
+ return this._M1;
+ },
+
+ //-------------------------------------------------------------------------
+
+ 'M2': function () {
+ if (this._M2 == null) {
+ this._M2 = this.stringHash(this.A().asString(10) + this.M1() + this.K());
+//MochiKit.Logging.logDebug("SRP M2: " + this._M2);
+ }
+
+ return this._M2;
+ },
+
+ //=========================================================================
+
+ 'serverSideCredentialsWithSalt': function(aSalt) {
+ var result;
+ var s, x, v;
+
+ s = aSalt;
+ x = this.stringHash(s + this.P());
+ v = Clipperz.Crypto.SRP.g().powerModule(new Clipperz.Crypto.BigInt(x, 16), Clipperz.Crypto.SRP.n());
+
+ result = {};
+ result['C'] = this.C();
+ result['s'] = s;
+ result['v'] = v.asString(16);
+
+ return result;
+ },
+
+ 'serverSideCredentials': function() {
+ var result;
+ var s;
+
+ s = Clipperz.Crypto.PRNG.defaultRandomGenerator().getRandomBytes(32).toHexString().substring(2);
+
+ result = this.serverSideCredentialsWithSalt(s);
+
+ return result;
+ },
+
+ //=========================================================================
+/*
+ 'computeServerSide_S': function(b) {
+ var result;
+ var v;
+ var bigint;
+ var srp;
+
+ bigint = Clipperz.Crypto.BigInt;
+ srp = Clipperz.Crypto.SRP;
+
+ v = new Clipperz.Crypto.BigInt(srpConnection.serverSideCredentialsWithSalt(this.s().asString(16, 64)).v, 16);
+// _S = (this.A().multiply(this.v().modPow(this.u(), this.n()))).modPow(this.b(), this.n());
+ result = bigint.powerModule(
+ bigint.multiply(
+ this.A(),
+ bigint.powerModule(v, this.u(), srp.n())
+ ), new Clipperz.Crypto.BigInt(b, 10), srp.n()
+ );
+
+ return result;
+ },
+*/
+ //=========================================================================
+
+ 'stringHash': function(aValue) {
+ var result;
+
+ result = this.hash(new Clipperz.ByteArray(aValue)).toHexString().substring(2);
+
+ return result;
+ },
+
+ //=========================================================================
+ __syntaxFix__: "syntax fix"
+
+});
+
+//#############################################################################
diff --git a/frontend/gamma/js/main.js b/frontend/gamma/js/main.js
index 934b325..6816754 100644
--- a/frontend/gamma/js/main.js
+++ b/frontend/gamma/js/main.js
@@ -1,25 +1,23 @@
/*
-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/.
*/
diff --git a/frontend/gamma/js/main.mobile.js b/frontend/gamma/js/main.mobile.js
index 60a32fa..2fdd920 100644
--- a/frontend/gamma/js/main.mobile.js
+++ b/frontend/gamma/js/main.mobile.js
@@ -1,25 +1,23 @@
/*
-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/.
*/