From 36c0d7597ef91f2816b026295a25a12ed1679a51 Mon Sep 17 00:00:00 2001 From: blavenie <benoit.lavenier@e-is.pro> Date: Tue, 14 Feb 2017 17:42:34 +0100 Subject: [PATCH] - Android/iOS : use cordova plugin for libsodium - fix #328 - Start implementation of #331 (secure storage) --- config.xml | 92 +- ionic.project | 2 +- www/index.html | 9 +- www/js/services/crypto-services.js | 790 +++++++++++++----- www/js/services/device-services.js | 15 +- www/js/services/settings-services.js | 5 +- www/js/services/storage-services.js | 117 ++- www/js/services/wallet-services.js | 2 + www/js/vendor/ecma-nacl.min.js | 3 - www/js/vendor/sha256.min.js | 9 + .../js/controllers/blockchain-controllers.js | 4 +- .../es/js/controllers/message-controllers.js | 2 +- .../es/js/controllers/wallet-controllers.js | 4 - .../es/js/services/message-services.js | 145 ++-- www/plugins/es/js/services/user-services.js | 84 +- www/plugins/es/templates/message/list.html | 7 +- ...tions.html => lookup_popover_actions.html} | 0 .../es/templates/message/view_message.html | 20 +- .../templates/wallet/view_wallet_extend.html | 7 - 19 files changed, 887 insertions(+), 430 deletions(-) delete mode 100644 www/js/vendor/ecma-nacl.min.js create mode 100644 www/js/vendor/sha256.min.js rename www/plugins/es/templates/message/{popover_actions.html => lookup_popover_actions.html} (100%) diff --git a/config.xml b/config.xml index e0738daa..c8aa375e 100644 --- a/config.xml +++ b/config.xml @@ -19,7 +19,6 @@ <preference name="webviewbounce" value="false" /> <preference name="UIWebViewBounce" value="false" /> <preference name="DisallowOverscroll" value="true" /> - <preference name="android-minSdkVersion" value="16" /> <preference name="SplashScreen" value="screen" /> <preference name="SplashScreenDelay" value="4000" /> <preference name="xwalkVersion" value="19" /> @@ -29,53 +28,54 @@ <param name="ios-package" onload="true" value="CDVStatusBar" /> </feature> <platform name="android"> - <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" /> - <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" /> - <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" /> - <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" /> - <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" /> - <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" /> - <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" /> - <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" /> - <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" /> - <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" /> - <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" /> - <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" /> - <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" /> - <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" /> - <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" /> - <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" /> - <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" /> - <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" /> + <preference name="android-minSdkVersion" value="19" /> + <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" /> + <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" /> + <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" /> + <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" /> + <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" /> + <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" /> + <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" /> + <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" /> + <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" /> + <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" /> + <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" /> + <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" /> + <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" /> + <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" /> + <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" /> + <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" /> + <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" /> + <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" /> </platform> <platform name="ios"> - <preference name="BackupWebStorage" value="local" /> - <icon height="57" src="resources/ios/icon/icon.png" width="57" /> - <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" /> - <icon height="40" src="resources/ios/icon/icon-40.png" width="40" /> - <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" /> - <icon height="50" src="resources/ios/icon/icon-50.png" width="50" /> - <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" /> - <icon height="60" src="resources/ios/icon/icon-60.png" width="60" /> - <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" /> - <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" /> - <icon height="72" src="resources/ios/icon/icon-72.png" width="72" /> - <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" /> - <icon height="76" src="resources/ios/icon/icon-76.png" width="76" /> - <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" /> - <icon height="29" src="resources/ios/icon/icon-small.png" width="29" /> - <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" /> - <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" /> - <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" /> - <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" /> - <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" /> - <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" /> - <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" /> - <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" /> - <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" /> - <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" /> - <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" /> - <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" /> + <preference name="BackupWebStorage" value="local" /> + <icon height="57" src="resources/ios/icon/icon.png" width="57" /> + <icon height="114" src="resources/ios/icon/icon@2x.png" width="114" /> + <icon height="40" src="resources/ios/icon/icon-40.png" width="40" /> + <icon height="80" src="resources/ios/icon/icon-40@2x.png" width="80" /> + <icon height="50" src="resources/ios/icon/icon-50.png" width="50" /> + <icon height="100" src="resources/ios/icon/icon-50@2x.png" width="100" /> + <icon height="60" src="resources/ios/icon/icon-60.png" width="60" /> + <icon height="120" src="resources/ios/icon/icon-60@2x.png" width="120" /> + <icon height="180" src="resources/ios/icon/icon-60@3x.png" width="180" /> + <icon height="72" src="resources/ios/icon/icon-72.png" width="72" /> + <icon height="144" src="resources/ios/icon/icon-72@2x.png" width="144" /> + <icon height="76" src="resources/ios/icon/icon-76.png" width="76" /> + <icon height="152" src="resources/ios/icon/icon-76@2x.png" width="152" /> + <icon height="29" src="resources/ios/icon/icon-small.png" width="29" /> + <icon height="58" src="resources/ios/icon/icon-small@2x.png" width="58" /> + <icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" /> + <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" /> + <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" /> + <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" /> + <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" /> + <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" /> + <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" /> + <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" /> + <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" /> + <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" /> + <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" /> </platform> <platform name="firefoxos"> <icon height="128" src="resources/firefoxos/img/logo_128.png" width="128" /> diff --git a/ionic.project b/ionic.project index 2aae2082..17284974 100644 --- a/ionic.project +++ b/ionic.project @@ -20,7 +20,7 @@ "browsers": [ { "platform": "android", - "browser": "crosswalk-lite", + "browser": "crosswalk", "version": "12.41.296.5" } ] diff --git a/www/index.html b/www/index.html index 9140667e..1e7c8e2e 100644 --- a/www/index.html +++ b/www/index.html @@ -43,10 +43,15 @@ <script src="lib/ionic/js/angular/angular-bind-notifier.min.js"></script> <!-- crypto libs --> - <script src="js/vendor/scrypt-em.js" async></script> - <script src="js/vendor/nacl_factory.js" async></script> <script src="js/vendor/base58.js" async></script> + <script src="js/vendor/nacl_factory.js" async></script> + <!--removeIf(device)--> + <script src="js/vendor/scrypt-em.js" async></script> <script src="js/vendor/base64.js" async></script> + <!--endRemoveIf(device)--> + <!--removeIf(no-device)--> + <script src="js/vendor/sha256.min.js" async></script> + <!--endRemoveIf(no-device)--> <!--removeIf(no-device)--> <script src="js/vendor/ng-cordova.min.js"></script> diff --git a/www/js/services/crypto-services.js b/www/js/services/crypto-services.js index ca73a2e1..fc4a8400 100644 --- a/www/js/services/crypto-services.js +++ b/www/js/services/crypto-services.js @@ -2,155 +2,168 @@ angular.module('cesium.crypto.services', ['ngResource', 'cesium.device.services']) -.factory('CryptoUtils', function($q, $timeout, Device) { - 'ngInject'; - - var async_load_scrypt = function(on_ready, options) { - if (scrypt_module_factory !== null){ - on_ready(scrypt_module_factory(options.requested_total_memory)); - } - else { - $timeout(function(){async_load_scrypt(on_ready, options);}, 100); - } - }, - - async_load_nacl = function(on_ready, options) { - if (nacl_factory !== null){ - nacl_factory.instantiate(on_ready, options); - } - else { - $timeout(function(){async_load_nacl(on_ready, options);}, 100); - } - }, - - async_load_base58 = function(on_ready) { - if (Base58 !== null){ - return on_ready(Base58); - } - else { - $timeout(function(){async_load_base58(on_ready);}, 100); - } - }, - - async_load_base64 = function(on_ready) { - if (Base64 !== null){ - on_ready(Base64); - } - else { - $timetout(function(){async_load_base64(on_ready);}, 100); - } - }; - - function CryptoUtils() { + .factory('CryptoUtils', function($q, $timeout, Device) { + 'ngInject'; + + // Const var - // Const - crypto_sign_BYTES= 64, - crypto_secretbox_KEYBYTES= 32, - SEED_LENGTH= 32, // Length of the key - SCRYPT_PARAMS= { - "N":4096, - "r":16, - "p":1 - }, - - // libraries handlers - scrypt, - nacl, - base58, - base64, - loadedLib = 0, - - // functions - decode_utf8 = function(s) { - var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length); - for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); - return b; - }, - encode_utf8 = function(s) { - return nacl.encode_utf8(s); - }, - encode_base58 = function(a) { - return base58.encode(a); - }, - decode_base58 = function(a) { - var i; - a = base58.decode(a); - var b = new Uint8Array(a.length); - for (i = 0; i < a.length; i++) b[i] = a[i]; - return b; - }, - hash_sha256 = function(message) { - return $q(function(resolve, reject) { - var msg = decode_utf8(message); - var hash = nacl.to_hex(nacl.crypto_hash_sha256(msg)); - resolve(hash.toUpperCase()); - }); - }, - random_nonce = function() { - return nacl.crypto_box_random_nonce(); - }, - /** - * Converts an array buffer to a string - * - * @private - * @param {ArrayBuffer} buf The buffer to convert - * @param {Function} callback The function to call when conversion is complete - */ - array_to_string = function(buf, callback) { - var bb = new Blob([new Uint8Array(buf)]); - var f = new FileReader(); - f.onload = function(e) { - callback(e.target.result); - }; - f.readAsText(bb); + crypto_sign_BYTES = 64, + crypto_secretbox_NONCEBYTES = 24, + SEED_LENGTH = 32, // Length of the key + SCRYPT_PARAMS = { + N: 4096, + r: 16, + p: 1 }, + // Web crypto API - see https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API + crypto = window.crypto || window.msCrypto || window.Crypto, - /** - * Create a key pair, from salt+password, and return a wallet object - */ - connect = function(salt, password) { - return $q(function(resolve, reject) { - var seed = scrypt.crypto_scrypt( - nacl.encode_utf8(password), - nacl.encode_utf8(salt), - 4096, 16, 1, SEED_LENGTH // TODO: put in var SCRYPT_PARAMS - ); - var signKeypair = nacl.crypto_sign_seed_keypair(seed); - var boxKeypair = nacl.crypto_box_seed_keypair(seed); - resolve({ - signPk: signKeypair.signPk, - signSk: signKeypair.signSk, - boxPk: boxKeypair.boxPk, - boxSk: boxKeypair.boxSk - }); - }); + async_load_base58 = function(on_ready) { + if (Base58 !== null){return on_ready(Base58);} + else {$timeout(function(){async_load_base58(on_ready);}, 100);} + }, + + async_load_scrypt = function(on_ready, options) { + if (scrypt_module_factory !== null){on_ready(scrypt_module_factory(options.requested_total_memory));} + else {$timeout(function(){async_load_scrypt(on_ready, options);}, 100);} + }, + + async_load_nacl_js = function(on_ready, options) { + if (nacl_factory !== null) {nacl_factory.instantiate(on_ready, options);} + else {$timeout(function(){async_load_nacl_js(on_ready, options);}, 100);} + }, + + async_load_base64 = function(on_ready) { + if (Base64 !== null) {on_ready(Base64);} + else {$timetout(function(){async_load_base64(on_ready);}, 100);} + }, + + async_load_sha256 = function(on_ready) { + if (sha256 !== null){return on_ready(sha256);} + else {$timeout(function(){async_load_sha256(on_ready);}, 100);} + }; + + if (crypto) { + console.debug('Web Crypto API (window.crypto) exists: getRandomValues=[{0}]'.format(!!crypto.getRandomValues)); + } + + function FullJSServiceFactory() { + + var + // libraries handlers + scrypt, + nacl, + base58, + base64, + loadedLib = 0, + + // functions + decode_utf8 = function(s) { + var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; + }, + encode_utf8 = function(s) { + return nacl.encode_utf8(s); + }, + encode_base58 = function(a) { + return base58.encode(a); + }, + decode_base58 = function(a) { + var i; + a = base58.decode(a); + var b = new Uint8Array(a.length); + for (i = 0; i < a.length; i++) b[i] = a[i]; + return b; + }, + hash_sha256 = function(message) { + return $q(function(resolve) { + var msg = decode_utf8(message); + var hash = nacl.to_hex(nacl.crypto_hash_sha256(msg)); + resolve(hash.toUpperCase()); + }); + }, + random_nonce = function() { + if (crypto && crypto.getRandomValues) { + var nonce = new Uint8Array(crypto_secretbox_NONCEBYTES); + crypto.getRandomValues(nonce); + return $q.when(nonce); + } + else { + // TODO + // var nonce = new Uint8Array(crypto_secretbox_NONCEBYTES); + // var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; + // for(var i = 0; i < length; i++) { + // text += possible.charAt(Math.floor(Math.random() * possible.length)); + // } + return $q.when(nacl.crypto_box_random_nonce()); + } }, - /** - * Verify a signature of a message, for a pubkey - */ - verify = function (message, signature, pubkey) { + /** + * Converts an array buffer to a string + * + * @private + * @param {ArrayBuffer} buf The buffer to convert + * @param {Function} callback The function to call when conversion is complete + */ + array_to_string = function(buf, callback) { + var bb = new Blob([new Uint8Array(buf)]); + var f = new FileReader(); + f.onload = function(e) { + callback(e.target.result); + }; + f.readAsText(bb); + }, + + /** + * Create key pairs (sign and box), from salt+password + */ + connect = function(salt, password) { return $q(function(resolve, reject) { - var msg = decode_utf8(message); - var sig = base64.decode(signature); - var pub = base58.decode(pubkey); - var m = new Uint8Array(crypto_sign_BYTES + msg.length); - var sm = new Uint8Array(crypto_sign_BYTES + msg.length); - var i; - for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i]; - for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i]; - - // Call to verification lib... - var verified = nacl.crypto_sign_open(sm, pub) !== null; - resolve(verified); + var seed = scrypt.crypto_scrypt( + nacl.encode_utf8(password), + nacl.encode_utf8(salt), + SCRYPT_PARAMS.N, + SCRYPT_PARAMS.r, + SCRYPT_PARAMS.p, + SEED_LENGTH); + var signKeypair = nacl.crypto_sign_seed_keypair(seed); + var boxKeypair = nacl.crypto_box_seed_keypair(seed); + resolve({ + signPk: signKeypair.signPk, + signSk: signKeypair.signSk, + boxPk: boxKeypair.boxPk, + boxSk: boxKeypair.boxSk + }); }); - }, + }, - /** - * Sign a message, from a key pair - */ - sign = function(message, keypair) { - return $q(function(resolve, reject) { + /** + * Verify a signature of a message, for a pubkey + */ + verify = function (message, signature, pubkey) { + return $q(function(resolve, reject) { + var msg = decode_utf8(message); + var sig = base64.decode(signature); + var pub = base58.decode(pubkey); + var m = new Uint8Array(crypto_sign_BYTES + msg.length); + var sm = new Uint8Array(crypto_sign_BYTES + msg.length); + var i; + for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i]; + for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i]; + + // Call to verification lib... + var verified = nacl.crypto_sign_open(sm, pub) !== null; + resolve(verified); + }); + }, + + /** + * Sign a message, from a key pair + */ + sign = function(message, keypair) { + return $q(function(resolve, reject) { var m = decode_utf8(message); var sk = keypair.signSk; var signedMsg = nacl.crypto_sign(m, sk); @@ -159,88 +172,84 @@ angular.module('cesium.crypto.services', ['ngResource', 'cesium.device.services' var signature = base64.encode(sig); resolve(signature); }); - }, - - /** - * Compute the box key pair, from a sign key pair - */ - box_keypair_from_sign = function(signKeyPair) { - return nacl.crypto_box_keypair_from_sign_sk(signKeyPair.signSk); - }, + }, - /** - * Compute the box public key, from a sign public key - */ - box_pk_from_sign = function(signPk) { - return nacl.crypto_box_pk_from_sign_pk(signPk); - }, + /** + * Compute the box key pair, from a sign key pair + */ + box_keypair_from_sign = function(signKeyPair) { + if (signKeyPair.bokSk && signKeyPair.boxPk) return $q.when(signKeyPair); + return $q.when(nacl.crypto_box_keypair_from_sign_sk(signKeyPair.signSk)); + }, - /** - * Encrypt a message, from a key pair - */ - box = function(message, nonce, recipientPk, senderSk) { - return $q(function(resolve, reject) { - if (!message) { - resolve(message); - return; - } - var messageBin = decode_utf8(message); - if (typeof recipientPk === "string") { - recipientPk = CryptoUtils.util.decode_base58(recipientPk); - } + /** + * Compute the box public key, from a sign public key + */ + box_pk_from_sign = function(signPk) { + return $q.when(nacl.crypto_box_pk_from_sign_pk(signPk)); + }, - //console.debug('Original message: ' + message); - message = nacl.encode_utf8(message); + /** + * Encrypt a message, from a key pair + */ + box = function(message, nonce, recipientPk, senderSk) { + return $q(function(resolve, reject) { + if (!message) { + resolve(message); + return; + } + var messageBin = decode_utf8(message); + if (typeof recipientPk === "string") { + recipientPk = decode_base58(recipientPk); + } - try { - var ciphertextBin = nacl.crypto_box(messageBin, nonce, recipientPk, senderSk); - var ciphertext = base64.encode(ciphertextBin); - //console.debug('Encrypted message: ' + ciphertext); - resolve(ciphertext); - } - catch(err) { - reject(err); - } - }); - }; + //console.debug('Original message: ' + message); + try { + var ciphertextBin = nacl.crypto_box(messageBin, nonce, recipientPk, senderSk); + var ciphertext = base64.encode(ciphertextBin); + //console.debug('Encrypted message: ' + ciphertext); + resolve(ciphertext); + } + catch(err) { + reject(err); + } + }); + }, - /** - * Decrypt a message, from a key pair - */ - box_open = function(cypherText, nonce, senderPk, recipientSk) { - return $q(function(resolve, reject) { - if (!cypherText) { - resolve(cypherText); - return; - } - var ciphertextBin = base64.decode(cypherText); - if (typeof senderPk === "string") { - senderPk = CryptoUtils.util.decode_base58(senderPk); - } + /** + * Decrypt a message, from a key pair + */ + box_open = function(cypherText, nonce, senderPk, recipientSk) { + return $q(function(resolve, reject) { + if (!cypherText) { + resolve(cypherText); + return; + } + var ciphertextBin = base64.decode(cypherText); + if (typeof senderPk === "string") { + senderPk = CryptoUtils.util.decode_base58(senderPk); + } - try { - var message = nacl.crypto_box_open(ciphertextBin, nonce, senderPk, recipientSk); - array_to_string(message, function(result) { - //console.debug('Decrypted text: ' + result); - resolve(result); - }); - } - catch(err) { - reject(err); - } + try { + var message = nacl.crypto_box_open(ciphertextBin, nonce, senderPk, recipientSk); + array_to_string(message, function(result) { + //console.debug('Decrypted text: ' + result); + resolve(result); + }); + } + catch(err) { + reject(err); + } - }); - }; + }); + }, - isLoaded = function() { - return loadedLib === 4; - }; + isLoaded = function() { + return loadedLib === 4; + }, - // We use 'Device.ready()' instead of '$ionicPlatform.ready()', because it could be call many times - Device.ready() - .then(function() { - console.debug('Loading NaCl...'); - var now = new Date().getTime(); + load = function() { + var deferred = $q.defer(); var naclOptions = {}; var scryptOptions = {}; if (ionic.Platform.grade.toLowerCase()!='a') { @@ -249,28 +258,35 @@ angular.module('cesium.crypto.services', ['ngResource', 'cesium.device.services' console.log('Reduce Scrypt memory because plateform grade is not [a] but [' + ionic.Platform.grade + ']'); scryptOptions.requested_total_memory = 16 * 1048576; // 16 Mo } - async_load_nacl(function(lib) { - nacl = lib; + var checkAllLibLoaded = function() { loadedLib++; - console.debug('Loaded NaCl in ' + (new Date().getTime() - now) + 'ms'); + if (isLoaded()) { + deferred.resolve(); + } + }; + async_load_nacl_js(function(lib) { + nacl = lib; + checkAllLibLoaded(); }, naclOptions); async_load_scrypt(function(lib) { scrypt = lib; - loadedLib++; + checkAllLibLoaded(); }, scryptOptions); async_load_base58(function(lib) { base58 = lib; - loadedLib++; + checkAllLibLoaded(); }); async_load_base64(function(lib) { base64 = lib; - loadedLib++; + checkAllLibLoaded(); }); - }); + return deferred.promise; + }; - // Service's exposed methods - return { + // Service's exposed methods + return { isLoaded: isLoaded, + load: load, util: { encode_utf8: encode_utf8, decode_utf8: decode_utf8, @@ -291,11 +307,327 @@ angular.module('cesium.crypto.services', ['ngResource', 'cesium.device.services' pack: box, open: box_open } - }; - } + }; + } + + /*** + * Factory for crypto, using Cordova plugin + */ + function CordovaServiceFactory() { + var + // libraries handlers + nacl, // the cordova plugin + nacl_js, // the full JS lib (need for random values) + base58, + sha256, + loadedLib = 0, + + // functions + decode_utf8 = function(s) { + return nacl.to_string(s); + }, + encode_utf8 = function(s) { + return nacl.from_string(s); + }, + encode_base58 = function(a) { + return base58.encode(a); + }, + decode_base58 = function(a) { + var i; + a = base58.decode(a); + var b = new Uint8Array(a.length); + for (i = 0; i < a.length; i++) b[i] = a[i]; + return b; + }, + hash_sha256 = function(message) { + return $q.when(sha256(message).toUpperCase()); + }, + random_nonce = function() { + if (crypto && crypto.getRandomValues) { + var nonce = new Uint8Array(crypto_secretbox_NONCEBYTES); + crypto.getRandomValues(nonce); + return $q.when(nonce); + } + else { + return $q.when(nacl_js.crypto_box_random_nonce()); + } + }, + /** + * Converts an array buffer to a string + * + * @private + * @param {ArrayBuffer} buf The buffer to convert + * @param {Function} callback The function to call when conversion is complete + */ + array_to_string = function(buf, callback) { + var bb = new Blob([new Uint8Array(buf)]); + var f = new FileReader(); + f.onload = function(e) { + callback(e.target.result); + }; + f.readAsText(bb); + }, + + /** + * Create key pairs (sign and box), from salt+password, using cordova + */ + connect = function(salt, password) { + var deferred = $q.defer(); + + nacl.crypto_pwhash_scryptsalsa208sha256_ll( + nacl.from_string(password), + nacl.from_string(salt), + SCRYPT_PARAMS.N, + SCRYPT_PARAMS.r, + SCRYPT_PARAMS.p, + SEED_LENGTH, + function (err, seed) { + if (err) { deferred.reject(err); return;} + nacl.crypto_sign_seed_keypair(seed, function (err, signKeypair) { + if (err) { deferred.reject(err); return;} + var result = { + signPk: signKeypair.pk, + signSk: signKeypair.sk + }; + box_keypair_from_sign(result) + .then(function(boxKeypair) { + result.boxPk = boxKeypair.pk; + result.boxSk = boxKeypair.sk; + deferred.resolve(result); + }) + .catch(function(err) { + deferred.reject(err); + }); + }); + + } + ); + + return deferred.promise; + }, + + /** + * Verify a signature of a message, for a pubkey + */ + verify = function (message, signature, pubkey) { + var deferred = $q.defer(); + nacl.crypto_sign_verify_detached( + nacl.from_base64(signature), + nacl.from_string(message), + nacl.from_base64(pubkey), + function(err, verified) { + if (err) { deferred.reject(err); return;} + deferred.resolve(verified); + }); + return deferred.promise; + }, + + /** + * Sign a message, from a key pair + */ + sign = function(message, keypair) { + var deferred = $q.defer(); + var nacl = window.plugins.MiniSodium; + + nacl.crypto_sign( + nacl.from_string(message), // message + keypair.signSk, // sk + function(err, signedMsg) { + if (err) { deferred.reject(err); return;} + var sig; + if (signedMsg.length > crypto_sign_BYTES) { + sig = new Uint8Array(crypto_sign_BYTES); + for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i]; + console.debug("//******** HAS REDUCE signedMsg ********* /// "); + } + else { + sig = signedMsg; + } + var signature = nacl.to_base64(sig); + deferred.resolve(signature); + }); + + return deferred.promise; + }, + + /** + * Compute the box key pair, from a sign key pair + */ + box_keypair_from_sign = function(signKeyPair) { + console.log("box_keypair_from_sign"); + if (signKeyPair.bokSk && signKeyPair.boxPk) return $q.when(signKeyPair); + var deferred = $q.defer(); + var result = {}; + nacl.crypto_sign_ed25519_pk_to_curve25519(signKeyPair.signPk, function(err, boxPk) { + if (err) { deferred.reject(err); return;} + result.boxPk = boxPk; + if (result.boxSk) deferred.resolve(result); + }); + nacl.crypto_sign_ed25519_sk_to_curve25519(signKeyPair.signSk, function(err, boxSk) { + if (err) { deferred.reject(err); return;} + result.boxSk = boxSk; + if (result.boxPk) deferred.resolve(result); + }); + + return deferred.promise; + }, + + /** + * Compute the box public key, from a sign public key + */ + box_pk_from_sign = function(signPk) { + var deferred = $q.defer(); + nacl.crypto_sign_ed25519_pk_to_curve25519(signPk, function(err, boxPk) { + if (err) { deferred.reject(err); return;} + deferred.resolve(boxPk); + }); + return deferred.promise; + }, + + /** + * Encrypt a message, from a key pair + */ + box = function(message, nonce, recipientPk, senderSk) { + if (!message) { + return $q.reject('No message'); + } + var deferred = $q.defer(); + var messageBin = encode_utf8(message); + if (typeof recipientPk === "string") { + recipientPk = decode_base58(recipientPk); + } + + //console.debug('Original message: ' + message); + + nacl.crypto_box_easy(messageBin, nonce, recipientPk, senderSk, function(err, ciphertextBin) { + if (err) { deferred.reject(err); return;} + var ciphertext = nacl.to_base64(ciphertextBin); + //console.debug('Encrypted message: ' + ciphertext); + deferred.resolve(ciphertext); + }); + return deferred.promise; + }; + + /** + * Decrypt a message, from a key pair + */ + box_open = function(cypherText, nonce, senderPk, recipientSk) { + console.log("box_open"); + if (!cypherText) { + return $q.reject('No cypherText'); + } + var deferred = $q.defer(); + + var ciphertextBin = nacl.from_base64(cypherText); + if (typeof senderPk === "string") { + senderPk = decode_base58(senderPk); + } + + nacl.crypto_box_open_easy(ciphertextBin, nonce, senderPk, recipientSk, function(err, message) { + if (err) { deferred.reject(err); return;} + array_to_string(message, function(result) { + //console.debug('Decrypted text: ' + result); + deferred.resolve(result); + }); + }); + + return deferred.promise; + }; + + isLoaded = function(){ + return loadedLib === 3; + }; + + load = function() { + var deferred = $q.defer(); + if (!window.plugins || !window.plugins.MiniSodium) { + deferred.reject("Cordova plugin 'MiniSodium' not found"); + } + else { + nacl = window.plugins.MiniSodium; + var checkAllLibLoaded = function() { + loadedLib++; + if (isLoaded()) { + deferred.resolve(); + } + }; + async_load_base58(function(lib) { + base58 = lib; + checkAllLibLoaded(); + }); + async_load_sha256(function(lib) { + sha256 = lib; + checkAllLibLoaded(); + }); + async_load_nacl_js(function(lib) { + nacl_js = lib; + checkAllLibLoaded(); + }); + + } + + return deferred.promise; + }; + + // Service's exposed methods + return { + isLoaded: isLoaded, + load: load, + util: { + encode_utf8: encode_utf8, + decode_utf8: decode_utf8, + encode_base58: encode_base58, + decode_base58: decode_base58, + hash: hash_sha256, + encode_base64: function() {return nacl.to_base64(arguments);}, + random_nonce: random_nonce + }, + connect: connect, + sign: sign, + verify: verify, + box: { + keypair: { + fromSignKeypair: box_keypair_from_sign, + pkFromSignPk: box_pk_from_sign + }, + pack: box, + open: box_open + } + }; + } + + var service = { + isLoaded: function(){return false;} + }; + + // We use 'Device.ready()' instead of '$ionicPlatform.ready()', because it could be call many times + Device.ready() + .then(function() { + var now = new Date().getTime(); + var serviceImpl; + var serviceImplName; + + // Use cordova implementaion, when possible + if (window.plugins && window.plugins.MiniSodium) { + serviceImplName = 'MiniSodium'; + serviceImpl = CordovaServiceFactory(); + } + else { + serviceImplName = 'full JS'; + serviceImpl = FullJSServiceFactory(); + } + + return serviceImpl.load() + .catch(function(err) { + console.error(err); + throw err; + }) + .then(function() { + angular.copy(serviceImpl, service); + console.debug('[crypto] Loaded \'{0}\' implementation in {1}ms'.format(serviceImplName, new Date().getTime() - now)); + }); + }); - var service = CryptoUtils(); - service.instance = CryptoUtils; - return service; -}) + return service; + }) ; diff --git a/www/js/services/device-services.js b/www/js/services/device-services.js index beca3344..2571d252 100644 --- a/www/js/services/device-services.js +++ b/www/js/services/device-services.js @@ -25,7 +25,9 @@ angular.module('cesium.device.services', ['ngResource', 'cesium.utils.services'] // Replace the '$ionicPlatform.ready()', to enable multiple calls ready = function () { if (!readyPromise) { - readyPromise = $ionicPlatform.ready(); + readyPromise = $ionicPlatform.ready().then(function(){ + console.debug('[ionic] Platform is ready'); + }); } return readyPromise; }; @@ -130,8 +132,17 @@ angular.module('cesium.device.services', ['ngResource', 'cesium.utils.services'] // On platform ready: check if device could be used ready().then(function() { enable = !!navigator.camera; + + if (enable){ + var enableBarcodeScanner = cordova && cordova.plugins && cordova.plugins.barcodeScanner; + console.debug(' barcodescanner: {0}'.format(enableBarcodeScanner)); + console.debug(' camera: {0}'.format(enable)); + } if (!enable) { - console.log('Device service disable (no camera)'); + console.debug('[device] No device detected'); + } + else { + console.debug('[device] Ready'); } }); diff --git a/www/js/services/settings-services.js b/www/js/services/settings-services.js index 90e46e0a..b97c46ed 100644 --- a/www/js/services/settings-services.js +++ b/www/js/services/settings-services.js @@ -210,9 +210,12 @@ angular.module('cesium.settings.services', ['ngResource', 'ngApi', 'cesium.confi service.instance = CSSettings; + service.restore() .then(function() { - service.api.data.raise.ready(); + Device.ready().then(function() { + service.api.data.raise.ready(); + }); }); return service; diff --git a/www/js/services/storage-services.js b/www/js/services/storage-services.js index f4e68fb3..5eb5fc16 100644 --- a/www/js/services/storage-services.js +++ b/www/js/services/storage-services.js @@ -1,20 +1,109 @@ -angular.module('cesium.storage.services', ['ngResource']) +angular.module('cesium.storage.services', ['ngResource', 'cesium.device.services']) -.factory('localStorage', function($window) { +.factory('localStorage', function($window, $q, Device) { 'ngInject'; - return { - put: function(key, value) { - $window.localStorage[key] = value; - }, - get: function(key, defaultValue) { - return $window.localStorage[key] || defaultValue; - }, - setObject: function(key, value) { - $window.localStorage[key] = JSON.stringify(value); - }, - getObject: function(key) { - return JSON.parse($window.localStorage[key] || '{}'); + + var + appName = "Cesium", + localStorage = $window.localStorage, + exports = { + unsecure: { + put: function(key, value) { + localStorage[key] = value; + }, + get: function(key, defaultValue) { + return localStorage[key] || defaultValue; + }, + setObject: function(key, value) { + localStorage[key] = JSON.stringify(value); + }, + getObject: function(key) { + return JSON.parse(localStorage[key] || '{}'); + } + }, + secure: { + storage: null + } + }; + + function replaceSecureStorage() { + exports.secure = exports.unsecure; + exports.secure.storage = null; + } + + // Set a value to the secure storage (or remove if value is not defined) + exports.secure.put = function(key, value) { + var deferred = $q.defer(); + if (angular.isDefined(value)) { + exports.secure.storage.set( + function (key) { deferred.resolve(); }, + function (err) { deferred.reject(err); }, + key, value); + } + // Remove + else { + exports.secure.storage.remove( + function (key) { deferred.resolve(); }, + function (err) { deferred.reject(err); }, + key); } + return deferred.promise; + }; + + // Get a value from the secure storage + exports.secure.get = function(key, defaultValue) { + var deferred = $q.defer(); + exports.secure.storage.get( + function (value) { + if (!value && defaultValue) { + deferred.resolve(defaultValue); + } + else { + deferred.resolve(value); + } + }, + function (err) { deferred.reject(err); }, + key); + return deferred.promise; + }; + + // Set a object to the secure storage + exports.secure.setObject = function(key, value) { + return exports.secure.set(key, JSON.stringify(value)); }; + + // Get a object from the secure storage + exports.secure.getObject = function(key) { + return exports.secure.get(key) + .then(function(value) { + return JSON.parse(localStorage[key] || '{}'); + }); + }; + + // Copy unsecure function as root exports function + _.forEach(_.keys(exports.unsecure), function(key) { + exports[key] = exports.unsecure[key]; + }); + + Device.ready().then(function() { + console.log($window.plugins && $window.plugins.SecureStorage); + if ($window.plugins) { + exports.secure.storage = new cordova.plugins.SecureStorage( + function () { + console.log('[storage] Secure storage initialized.'); + }, + function (error) { + console.error('[storage] Could not use secure storage: ' + error); + replaceSecureStorage(); + }, + appName); + } + else { + replaceSecureStorage(); + } + + }); + + return exports; }) ; diff --git a/www/js/services/wallet-services.js b/www/js/services/wallet-services.js index 19c96fe4..7f8088c3 100644 --- a/www/js/services/wallet-services.js +++ b/www/js/services/wallet-services.js @@ -20,6 +20,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser }, data = {}, + api = new Api(this, 'csWallet-' + id), resetData = function(init) { @@ -218,6 +219,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser store = function() { if (csSettings.data.useLocalStorage) { + if (isLogin() && csSettings.data.rememberMe) { var dataToStore = { keypair: data.keypair, diff --git a/www/js/vendor/ecma-nacl.min.js b/www/js/vendor/ecma-nacl.min.js deleted file mode 100644 index aeddf51d..00000000 --- a/www/js/vendor/ecma-nacl.min.js +++ /dev/null @@ -1,3 +0,0 @@ -require=function r(e,t,a){function n(i,f){if(!t[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(o)return o(i,!0);var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}var u=t[i]={exports:{}};e[i][0].call(u.exports,function(r){var t=e[i][1][r];return n(t?t:r)},u,u.exports,r,e,t,a)}return t[i].exports}for(var o="function"==typeof require&&require,i=0;i<a.length;i++)n(a[i]);return n}({1:[function(r,e,t){"use strict";function a(r,e){if(!(r instanceof Uint8Array))throw new TypeError("Key array k must be Uint8Array.");if(32!==r.length)throw new Error("Key array sk should have 32 elements (bytes) in it, but it is "+r.length+" elements long.");e||(e=f.makeFactory());var t=e.getUint8Array(32);return c.curve25519_base(t,r,e),e.wipeRecycled(),t}function n(r,e,t){if(!(r instanceof Uint8Array))throw new TypeError("Public key array pk must be Uint8Array.");if(32!==r.length)throw new Error("Public key array pk should have 32 elements (bytes) in it, but it is "+r.length+" elements long.");if(!(e instanceof Uint8Array))throw new TypeError("Secret key array sk must be Uint8Array.");if(32!==e.length)throw new Error("Secret key array sk should have 32 elements (bytes) in it, but it is "+e.length+" elements long.");t||(t=f.makeFactory());var a=new Uint8Array(32);return c.curve25519(a,e,r,t),s.hsalsa20(a,v,a,l),t.wipeRecycled(),a}function o(r,e,t,a,o){o||(o=f.makeFactory());var i=n(t,a,o),c=u.pack(r,e,i,o);return o.wipeRecycled(),c}function i(r,e,t,a,o){o||(o=f.makeFactory());var i=n(t,a,o),c=u.open(r,e,i,o);return o.wipeRecycled(),c}var f=r("../util/arrays"),c=r("./scalarmult"),s=r("./core"),u=r("./secret_box"),y=r("./stream"),l=y.SIGMA;t.generate_pubkey=a;var v=new Uint8Array(16);t.calc_dhshared_key=n,t.pack=o,t.open=i;var h;!function(r){r.pack=u.pack,r.open=u.open}(h=t.stream||(t.stream={})),Object.freeze(h);var m;!function(r){function e(r,e,t,a,o){o||(o=f.makeFactory());var i=n(t,a,o),c=u.formatWN.pack(r,e,i,o);return o.wipeRecycled(),c}function t(r,e,t,a){a||(a=f.makeFactory());var o=n(e,t,a),i=u.formatWN.open(r,o,a);return a.wipeRecycled(),i}function a(r,e,t,a,o){"number"!=typeof a&&(a=2),o||(o=f.makeFactory());var i=n(r,e,o),c=u.formatWN.makeEncryptor(i,t,a,o);return o.wipe(i),c}function o(r,e,t){t||(t=f.makeFactory());var a=n(r,e,t),o=u.formatWN.makeDecryptor(a,t);return t.wipe(a),o}r.pack=e,r.open=t,r.copyNonceFrom=u.formatWN.copyNonceFrom,r.makeEncryptor=a,r.makeDecryptor=o}(m=t.formatWN||(t.formatWN={})),Object.freeze(m),t.NONCE_LENGTH=24,t.KEY_LENGTH=32,t.JWK_ALG_NAME="NaCl-box-CXSP",Object.freeze(t)},{"../util/arrays":15,"./core":2,"./scalarmult":4,"./secret_box":5,"./stream":6}],2:[function(r,e,t){"use strict";function a(r,e,t,a){for(var n=a[0]|a[1]<<8|a[2]<<16|a[3]<<24,o=n,i=t[0]|t[1]<<8|t[2]<<16|t[3]<<24,f=i,c=t[4]|t[5]<<8|t[6]<<16|t[7]<<24,s=c,u=t[8]|t[9]<<8|t[10]<<16|t[11]<<24,y=u,l=t[12]|t[13]<<8|t[14]<<16|t[15]<<24,v=l,h=a[4]|a[5]<<8|a[6]<<16|a[7]<<24,m=h,g=e[0]|e[1]<<8|e[2]<<16|e[3]<<24,b=g,p=e[4]|e[5]<<8|e[6]<<16|e[7]<<24,w=p,A=e[8]|e[9]<<8|e[10]<<16|e[11]<<24,d=A,U=e[12]|e[13]<<8|e[14]<<16|e[15]<<24,k=U,_=a[8]|a[9]<<8|a[10]<<16|a[11]<<24,x=_,E=t[16]|t[17]<<8|t[18]<<16|t[19]<<24,F=E,z=t[20]|t[21]<<8|t[22]<<16|t[23]<<24,N=z,O=t[24]|t[25]<<8|t[26]<<16|t[27]<<24,T=O,I=t[28]|t[29]<<8|t[30]<<16|t[31]<<24,j=I,K=a[12]|a[13]<<8|a[14]<<16|a[15]<<24,S=K,R=0,G=20;G>0;G-=2)R=n+z,l^=R<<7|R>>>25,R=l+n,A^=R<<9|R>>>23,R=A+l,z^=R<<13|R>>>19,R=z+A,n^=R<<18|R>>>14,R=h+i,U^=R<<7|R>>>25,R=U+h,O^=R<<9|R>>>23,R=O+U,i^=R<<13|R>>>19,R=i+O,h^=R<<18|R>>>14,R=_+g,I^=R<<7|R>>>25,R=I+_,c^=R<<9|R>>>23,R=c+I,g^=R<<13|R>>>19,R=g+c,_^=R<<18|R>>>14,R=K+E,u^=R<<7|R>>>25,R=u+K,p^=R<<9|R>>>23,R=p+u,E^=R<<13|R>>>19,R=E+p,K^=R<<18|R>>>14,R=n+u,i^=R<<7|R>>>25,R=i+n,c^=R<<9|R>>>23,R=c+i,u^=R<<13|R>>>19,R=u+c,n^=R<<18|R>>>14,R=h+l,g^=R<<7|R>>>25,R=g+h,p^=R<<9|R>>>23,R=p+g,l^=R<<13|R>>>19,R=l+p,h^=R<<18|R>>>14,R=_+U,E^=R<<7|R>>>25,R=E+_,A^=R<<9|R>>>23,R=A+E,U^=R<<13|R>>>19,R=U+A,_^=R<<18|R>>>14,R=K+I,z^=R<<7|R>>>25,R=z+K,O^=R<<9|R>>>23,R=O+z,I^=R<<13|R>>>19,R=I+O,K^=R<<18|R>>>14;n+=o,i+=f,c+=s,u+=y,l+=v,h+=m,g+=b,p+=w,A+=d,U+=k,_+=x,E+=F,z+=N,O+=T,I+=j,K+=S,r[0]=n,r[1]=n>>>8,r[2]=n>>>16,r[3]=n>>>24,r[4]=i,r[5]=i>>>8,r[6]=i>>>16,r[7]=i>>>24,r[8]=c,r[9]=c>>>8,r[10]=c>>>16,r[11]=c>>>24,r[12]=u,r[13]=u>>>8,r[14]=u>>>16,r[15]=u>>>24,r[16]=l,r[17]=l>>>8,r[18]=l>>>16,r[19]=l>>>24,r[20]=h,r[21]=h>>>8,r[22]=h>>>16,r[23]=h>>>24,r[24]=g,r[25]=g>>>8,r[26]=g>>>16,r[27]=g>>>24,r[28]=p,r[29]=p>>>8,r[30]=p>>>16,r[31]=p>>>24,r[32]=A,r[33]=A>>>8,r[34]=A>>>16,r[35]=A>>>24,r[36]=U,r[37]=U>>>8,r[38]=U>>>16,r[39]=U>>>24,r[40]=_,r[41]=_>>>8,r[42]=_>>>16,r[43]=_>>>24,r[44]=E,r[45]=E>>>8,r[46]=E>>>16,r[47]=E>>>24,r[48]=z,r[49]=z>>>8,r[50]=z>>>16,r[51]=z>>>24,r[52]=O,r[53]=O>>>8,r[54]=O>>>16,r[55]=O>>>24,r[56]=I,r[57]=I>>>8,r[58]=I>>>16,r[59]=I>>>24,r[60]=K,r[61]=K>>>8,r[62]=K>>>16,r[63]=K>>>24}function n(r,e,t,a){for(var n=a[0]|a[1]<<8|a[2]<<16|a[3]<<24,o=t[0]|t[1]<<8|t[2]<<16|t[3]<<24,i=t[4]|t[5]<<8|t[6]<<16|t[7]<<24,f=t[8]|t[9]<<8|t[10]<<16|t[11]<<24,c=t[12]|t[13]<<8|t[14]<<16|t[15]<<24,s=a[4]|a[5]<<8|a[6]<<16|a[7]<<24,u=e[0]|e[1]<<8|e[2]<<16|e[3]<<24,y=e[4]|e[5]<<8|e[6]<<16|e[7]<<24,l=e[8]|e[9]<<8|e[10]<<16|e[11]<<24,v=e[12]|e[13]<<8|e[14]<<16|e[15]<<24,h=a[8]|a[9]<<8|a[10]<<16|a[11]<<24,m=t[16]|t[17]<<8|t[18]<<16|t[19]<<24,g=t[20]|t[21]<<8|t[22]<<16|t[23]<<24,b=t[24]|t[25]<<8|t[26]<<16|t[27]<<24,p=t[28]|t[29]<<8|t[30]<<16|t[31]<<24,w=a[12]|a[13]<<8|a[14]<<16|a[15]<<24,A=0,d=20;d>0;d-=2)A=n+g,c^=A<<7|A>>>25,A=c+n,l^=A<<9|A>>>23,A=l+c,g^=A<<13|A>>>19,A=g+l,n^=A<<18|A>>>14,A=s+o,v^=A<<7|A>>>25,A=v+s,b^=A<<9|A>>>23,A=b+v,o^=A<<13|A>>>19,A=o+b,s^=A<<18|A>>>14,A=h+u,p^=A<<7|A>>>25,A=p+h,i^=A<<9|A>>>23,A=i+p,u^=A<<13|A>>>19,A=u+i,h^=A<<18|A>>>14,A=w+m,f^=A<<7|A>>>25,A=f+w,y^=A<<9|A>>>23,A=y+f,m^=A<<13|A>>>19,A=m+y,w^=A<<18|A>>>14,A=n+f,o^=A<<7|A>>>25,A=o+n,i^=A<<9|A>>>23,A=i+o,f^=A<<13|A>>>19,A=f+i,n^=A<<18|A>>>14,A=s+c,u^=A<<7|A>>>25,A=u+s,y^=A<<9|A>>>23,A=y+u,c^=A<<13|A>>>19,A=c+y,s^=A<<18|A>>>14,A=h+v,m^=A<<7|A>>>25,A=m+h,l^=A<<9|A>>>23,A=l+m,v^=A<<13|A>>>19,A=v+l,h^=A<<18|A>>>14,A=w+p,g^=A<<7|A>>>25,A=g+w,b^=A<<9|A>>>23,A=b+g,p^=A<<13|A>>>19,A=p+b,w^=A<<18|A>>>14;r[0]=n,r[1]=n>>>8,r[2]=n>>>16,r[3]=n>>>24,r[4]=s,r[5]=s>>>8,r[6]=s>>>16,r[7]=s>>>24,r[8]=h,r[9]=h>>>8,r[10]=h>>>16,r[11]=h>>>24,r[12]=w,r[13]=w>>>8,r[14]=w>>>16,r[15]=w>>>24,r[16]=u,r[17]=u>>>8,r[18]=u>>>16,r[19]=u>>>24,r[20]=y,r[21]=y>>>8,r[22]=y>>>16,r[23]=y>>>24,r[24]=l,r[25]=l>>>8,r[26]=l>>>16,r[27]=l>>>24,r[28]=v,r[29]=v>>>8,r[30]=v>>>16,r[31]=v>>>24}t.salsa20=a,t.hsalsa20=n,Object.freeze(t)},{}],3:[function(r,e,t){"use strict";function a(r,e){for(var t=0,a=0;a<17;a+=1)t+=r[a]+e[a],t&=4294967295,r[a]=255&t,t>>>=8}function n(r){for(var e=0,t=0;t<16;t+=1)e+=r[t],e&=4294967295,r[t]=255&e,e>>>=8;for(e+=r[16],e&=4294967295,r[16]=3&e,e=5*(e>>>2),e&=4294967295,t=0;t<16;t+=1)e+=r[t],e&=4294967295,r[t]=255&e,e>>>=8;e+=r[16],e&=4294967295,r[16]=e}function o(r,e){var t=e.getUint32Array(17);t.set(r),a(r,u);var n=-(r[16]>>>7);n&=4294967295;for(var o=0;o<17;o+=1)r[o]^=n&(t[o]^r[o]);e.recycle(t)}function i(r,e,t){for(var a=t.getUint32Array(17),o=0,i=0;i<17;i+=1){o=0;for(var f=0;f<=i;f+=1)o+=r[f]*e[i-f],o&=4294967295;for(var f=i+1;f<17;f+=1)o+=320*r[f]*e[i+17-f],o&=4294967295;a[i]=o}r.set(a),n(r),t.recycle(a)}function f(r,e,t,n){var f=n.getUint32Array(17),c=n.getUint32Array(17),s=n.getUint32Array(17),u=e.length,y=0;f[0]=t[0],f[1]=t[1],f[2]=t[2],f[3]=15&t[3],f[4]=252&t[4],f[5]=t[5],f[6]=t[6],f[7]=15&t[7],f[8]=252&t[8],f[9]=t[9],f[10]=t[10],f[11]=15&t[11],f[12]=252&t[12],f[13]=t[13],f[14]=t[14],f[15]=15&t[15],f[16]=0;for(var l=0;l<17;l+=1)c[l]=0;for(var l=0;u>0;){for(l=0;l<17;l+=1)s[l]=0;for(l=0;l<16&&l<u;l+=1)s[l]=e[y+l];s[l]=1,y+=l,u-=l,a(c,s),i(c,f,n)}o(c,n);for(var l=0;l<16;l+=1)s[l]=t[l+16];s[16]=0,a(c,s);for(var l=0;l<16;l+=1)r[l]=c[l]}function c(r,e,t,a){var n=a.getUint8Array(16);f(n,e,t,a);var o=s.v16(r,n);return a.recycle(n),o}var s=r("../util/verify"),u=new Uint32Array([5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252]);t.poly1305=f,t.poly1305_verify=c,Object.freeze(t)},{"../util/verify":17}],4:[function(r,e,t){"use strict";function a(r,e,t){for(var a=0,n=0;n<31;n+=1)a+=e[n]+t[n],a&=4294967295,r[n]=255&a,a>>>=8;a+=e[31]+t[31],a&=4294967295,r[31]=a}function n(r,e,t){for(var a=218,n=0;n<31;n+=1)a+=e[n]+65280-t[n],a&=4294967295,r[n]=255&a,a>>>=8;a+=e[31]-t[31],a&=4294967295,r[31]=a}function o(r){for(var e=0,t=0;t<31;t+=1)e+=r[t],e&=4294967295,r[t]=255&e,e>>>=8;e+=r[31],e&=4294967295,r[31]=127&e,e=19*(e>>>7),e&=4294967295;for(var t=0;t<31;t+=1)e+=r[t],e&=4294967295,r[t]=255&e,e>>>=8;e+=r[31],e&=4294967295,r[31]=e}function i(r,e){var t=e.getUint32Array(32);t.set(r),a(r,r,m);var n=-(r[31]>>>7&1);n&=4294967295;for(var o=0;o<32;o+=1)r[o]^=n&(t[o]^r[o]);e.recycle(t)}function f(r,e,t){for(var a=0,n=0;n<32;n+=1){a=0;for(var i=0;i<=n;i+=1)a+=e[i]*t[n-i],a&=4294967295;for(var i=n+1;i<32;i+=1)a+=38*e[i]*t[n+32-i],a&=4294967295;r[n]=a}o(r)}function c(r,e){for(var t=0,a=0;a<31;a+=1)t+=121665*e[a],t&=4294967295,r[a]=255&t,t>>>=8;t+=121665*e[31],t&=4294967295,r[31]=127&t,t=19*(t>>>7),t&=4294967295;for(var a=0;a<31;a+=1)t+=r[a],t&=4294967295,r[a]=255&t,t>>>=8;t+=r[31],t&=4294967295,r[31]=t}function s(r,e){for(var t=0,a=0;a<32;a+=1){t=0;for(var n=0;n<a-n;n+=1)t+=e[n]*e[a-n],t&=4294967295;for(var n=a+1;n<a+32-n;n+=1)t+=38*e[n]*e[a+32-n],t&=4294967295;t*=2,t&=4294967295,0===(1&a)&&(t+=e[a/2]*e[a/2],t&=4294967295,t+=38*e[a/2+16]*e[a/2+16],t&=4294967295),r[a]=t}o(r)}function u(r,e,t,a,n){n&=4294967295;var o=0,i=n-1;i&=4294967295;for(var f=0;f<64;f+=1)o=i&(t[f]^a[f]),r[f]=a[f]^o,e[f]=t[f]^o}function y(r,e,t){for(var o=t.getUint32Array(64),i=t.getUint32Array(64),y=t.getUint32Array(64),l=t.getUint32Array(64),v=t.getUint32Array(64),h=t.getUint32Array(64),m=t.getUint32Array(64),g=t.getUint32Array(64),b=t.getUint32Array(64),p=t.getUint32Array(64),w=t.getUint32Array(64),A=t.getUint32Array(32),d=t.getUint32Array(32),U=t.getUint32Array(32),k=t.getUint32Array(32),_=0,x=0;x<32;x+=1)o[x]=r[x];o[32]=1;for(var x=33;x<64;x+=1)o[x]=0;i[0]=1;for(var x=1;x<64;x+=1)i[x]=0;for(var E=y.subarray(32,64),F=l.subarray(32,64),z=m.subarray(32,64),N=g.subarray(32,64),O=b.subarray(32,64),T=p.subarray(32,64),I=w.subarray(32,64),j=v.subarray(32,64),K=h.subarray(32,64),S=254;S>=0;S-=1)_=e[Math.floor(S/8)]>>>(7&S),_&=1,u(y,l,i,o,_),a(m,y,E),n(z,y,E),a(g,l,F),n(N,l,F),s(b,m),s(O,z),f(p,g,z),f(T,N,m),a(w,p,T),n(I,p,T),s(A,I),n(d,b,O),c(U,d),a(k,U,b),f(v,b,O),f(j,d,k),s(h,w),f(K,A,r),u(i,o,v,h,_);r.set(i),t.recycle(o,i,y,l,v,h,m,g,b,p,w,A,d,U,k)}function l(r,e,t){var a=t.getUint32Array(32),n=t.getUint32Array(32),o=t.getUint32Array(32),i=t.getUint32Array(32),c=t.getUint32Array(32),u=t.getUint32Array(32),y=t.getUint32Array(32),l=t.getUint32Array(32),v=t.getUint32Array(32),h=t.getUint32Array(32);s(a,e),s(h,a),s(v,h),f(n,v,e),f(o,n,a),s(v,o),f(i,v,n),s(v,i),s(h,v),s(v,h),s(h,v),s(v,h),f(c,v,i),s(v,c),s(h,v);for(var m=2;m<10;m+=2)s(v,h),s(h,v);f(u,h,c),s(v,u),s(h,v);for(var m=2;m<20;m+=2)s(v,h),s(h,v);f(v,h,u),s(h,v),s(v,h);for(var m=2;m<10;m+=2)s(h,v),s(v,h);f(y,v,c),s(v,y),s(h,v);for(var m=2;m<50;m+=2)s(v,h),s(h,v);f(l,h,y),s(h,l),s(v,h);for(var m=2;m<100;m+=2)s(h,v),s(v,h);f(h,v,l),s(v,h),s(h,v);for(var m=2;m<50;m+=2)s(v,h),s(h,v);f(v,h,y),s(h,v),s(v,h),s(h,v),s(v,h),s(h,v),f(r,h,o),t.recycle(a,n,o,i,c,u,y,l,v,h)}function v(r,e,t,a){var n=a.getUint32Array(96),o=a.getUint8Array(32);o.set(e),o[0]&=248,o[31]&=127,o[31]|=64;var c=n.subarray(32,64),s=n.subarray(64,96);n.set(t),y(n,o,a),l(c,c,a),f(s,n,c),i(s,a),r.set(s),a.recycle(n,o)}function h(r,e,t){v(r,e,g,t)}var m=new Uint32Array([19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128]);t.curve25519=v;var g=new Uint8Array(32);g[0]=9,t.curve25519_base=h,Object.freeze(t)},{}],5:[function(r,e,t){"use strict";function a(r,e,t){if(!(r instanceof Uint8Array))throw new TypeError("Message array m must be Uint8Array.");if(0===r.length)throw new Error("Message array should have at least one byte.");if(!(e instanceof Uint8Array))throw new TypeError("Nonce array n must be Uint8Array.");if(24!==e.length)throw new Error("Nonce array n should have 24 elements (bytes) in it, but it is "+e.length+" elements long.");if(!(t instanceof Uint8Array))throw new TypeError("Key array k must be Uint8Array.");if(32!==t.length)throw new Error("Key array k should have 32 elements (bytes) in it, but it is "+t.length+" elements long.")}function n(r,e,t,a,n){if(r.length<32+e.length)throw new Error("Given array c is too short for output.");c.xsalsa20_xor(r,e,32,t,a,n);var o=r.subarray(32),i=r.subarray(16,32),f=r.subarray(0,32);s.poly1305(i,o,f,n);for(var u=0;u<16;u+=1)r[u]=0}function o(r,e,t,o){a(r,e,t),o||(o=u.makeFactory());var i=new Uint8Array(r.length+32);return n(i,r,e,t,o),i=i.subarray(16),o.wipeRecycled(),i}function i(r,e,t,a){if(!(r instanceof Uint8Array))throw new TypeError("Cipher array c must be Uint8Array.");if(r.length<17)throw new Error("Cipher array c should have at least 17 elements (bytes) in it, but is only "+r.length+" elements long.");if(!(e instanceof Uint8Array))throw new TypeError("Nonce array n must be Uint8Array.");if(24!==e.length)throw new Error("Nonce array n should have 24 elements (bytes) in it, but it is "+e.length+" elements long.");if(!(t instanceof Uint8Array))throw new TypeError("Key array k must be Uint8Array.");if(32!==t.length)throw new Error("Key array k should have 32 elements (bytes) in it, but it is "+t.length+" elements long.");a||(a=u.makeFactory());var n=a.getUint8Array(32);c.xsalsa20(n,e,t,a);var o=r.subarray(0,16),i=r.subarray(16);if(!s.poly1305_verify(o,i,n,a)){var f=new Error("Cipher bytes fail verification.");throw f.failedCipherVerification=!0,f}var y=new Uint8Array(r.length+16);c.xsalsa20_xor(y,r,16,e,t,a);for(var l=0;l<32;l+=1)y[l]=0;return a.recycle(n),a.wipeRecycled(),y.subarray(32)}function f(r,e,t,o,i){if(a(e,t,o),r.length<40+e.length)throw new Error("Array c, for packing nonce and cipher, is too short.");i||(i=u.makeFactory()),n(r.subarray(8),e,t,o,i),r.set(t),i.wipeRecycled()}var c=r("./stream"),s=r("./onetimeauth"),u=r("../util/arrays"),y=r("../util/nonce");t.pack=o,t.open=i;var l,v=i;!function(r){function e(r,e,t,a){a||(a=u.makeFactory());var n=new Uint8Array(40+r.length);return f(n,r,e,t,a),a.wipeRecycled(),n}function t(r,e,t){if(r.length<41)throw new Error("Array c with nonce and cipher should have at least 41 elements (bytes) in it, but is only "+r.length+" elements long.");t||(t=u.makeFactory());var a=r.subarray(0,24);r=r.subarray(24);var n=v(r,a,e,t);return t.wipeRecycled(),n}function a(r){if(r.length<41)throw new Error("Array c with nonce and cipher should have at least 41 elements (bytes) in it, but is only "+r.length+" elements long.");return new Uint8Array(r.subarray(0,24))}function n(r,t,a,n){if(!(t instanceof Uint8Array))throw new TypeError("Nonce array nextNonce must be Uint8Array.");if(24!==t.length)throw new Error("Nonce array nextNonce should have 24 elements (bytes) in it, but it is "+t.length+" elements long.");if(!(r instanceof Uint8Array))throw new TypeError("Key array key must be Uint8Array.");if(32!==r.length)throw new Error("Key array key should have 32 elements (bytes) in it, but it is "+r.length+" elements long.");if("number"!=typeof a)a=1;else if(a<1||a>255)throw new Error("Given delta is out of bounds.");n||(n=u.makeFactory()),r=new Uint8Array(r),t=new Uint8Array(t);var o=0,i={pack:function(i){if(!r)throw new Error("This encryptor cannot be used, as it had already been destroyed.");if(o>0xfffffffffffff)throw new Error("This encryptor has been used 2^52 (too many) times. Further use may lead to duplication of nonces.");var f=e(i,t,r,n);return y.advance(t,a),o+=1,f},destroy:function(){r&&(n.wipe(r,t),r=null,t=null,n=null)},getDelta:function(){return a}};return Object.freeze(i),i}function o(r,e){if(!(r instanceof Uint8Array))throw new TypeError("Key array key must be Uint8Array.");if(32!==r.length)throw new Error("Key array key should have 32 elements (bytes) in it, but it is "+r.length+" elements long.");e||(e=u.makeFactory()),r=new Uint8Array(r);var a={open:function(a){if(!r)throw new Error("This encryptor cannot be used, as it had already been destroyed.");return t(a,r,e)},destroy:function(){r&&(e.wipe(r),r=null,e=null)}};return Object.freeze(a),a}r.pack=e,r.open=t,r.copyNonceFrom=a,r.makeEncryptor=n,r.makeDecryptor=o}(l=t.formatWN||(t.formatWN={})),Object.freeze(l),t.NONCE_LENGTH=24,t.KEY_LENGTH=32,t.POLY_LENGTH=16,t.JWK_ALG_NAME="NaCl-sbox-XSP",Object.freeze(t)},{"../util/arrays":15,"../util/nonce":16,"./onetimeauth":3,"./stream":6}],6:[function(r,e,t){"use strict";function a(r,e,a,n){n||(n=f.makeFactory());var o=n.getUint8Array(16),i=0;if(0!==r.length){o.set(e);for(var s=8;s<16;s+=1)o[s]=0;for(var u,y=0,l=r.length;l>=64;){u=new Uint8Array(r.buffer,y,64),c.salsa20(u,o,a,t.SIGMA),i=1;for(var s=8;s<16;s+=1)i+=o[s],i&=4294967295,o[s]=i,i>>>=8;l-=64,y+=64}if(l>0){var v=n.getUint8Array(64);c.salsa20(v,o,a,t.SIGMA);for(var s=0;s<l;s+=1)r[y+s]=v[s];n.recycle(v)}n.recycle(o)}}function n(r,e,a,n,o,i){i||(i=f.makeFactory());var s=i.getUint8Array(16),u=i.getUint8Array(64),y=0;if(0!==e.length){s.set(n);for(var l=8;l<16;l+=1)s[l]=0;var v=e.length+a;if(v<64){c.salsa20(u,s,o,t.SIGMA);for(var l=0;l<a;l+=1)r[l]=u[l];for(var l=a;l<v;l+=1)r[l]=e[l-a]^u[l]}else{var h=0,m=0;c.salsa20(u,s,o,t.SIGMA);for(var l=0;l<a;l+=1)r[l]=u[l];for(var l=a;l<64;l+=1)r[l]=e[l-a]^u[l];y=1;for(var l=8;l<16;l+=1)y+=s[l],y&=4294967295,s[l]=y,y>>>=8;for(v-=64,m=64-a,h=64;v>=64;){c.salsa20(u,s,o,t.SIGMA);for(var l=0;l<64;l+=1)r[h+l]=e[m+l]^u[l];y=1;for(var l=8;l<16;l+=1)y+=s[l],y&=4294967295,s[l]=y,y>>>=8;v-=64,m+=64,h+=64}if(v>0){c.salsa20(u,s,o,t.SIGMA);for(var l=0;l<v;l+=1)r[h+l]=e[m+l]^u[l]}i.recycle(s,u)}}}function o(r,e,n,o){var i=o.getUint8Array(32),f=e.subarray(16,24);c.hsalsa20(i,e,n,t.SIGMA),a(r,f,i,o),o.recycle(i)}function i(r,e,a,o,i,s){s||(s=f.makeFactory());var u=s.getUint8Array(32),y=o.subarray(16,24);c.hsalsa20(u,o,i,t.SIGMA),n(r,e,a,y,u,s),s.recycle(u)}var f=r("../util/arrays"),c=r("./core");t.SIGMA=new Uint8Array(16),function(){for(var r="expand 32-byte k",e=0;e<16;e+=1)t.SIGMA[e]=r.charCodeAt(e)}(),t.xsalsa20=o,t.xsalsa20_xor=i,Object.freeze(t)},{"../util/arrays":15,"./core":2}],7:[function(r,e,t){"use strict";function a(r,e,t,a){var n=r[e]+t[a],o=r[e+1]+t[a+1];r[e]=n+(o/4294967296|0),r[e+1]=o}function n(r,e,t,a){var n=e[t],o=e[t+1];r[0]=n>>>a,r[1]=n<<32-a|o>>>a}function o(r,e,t,a){r[e]=t[a+3]|t[a+2]<<8|t[a+1]<<16|t[a]<<24,r[e+1]=t[a+7]|t[a+6]<<8|t[a+5]<<16|t[a+4]<<24}function i(r,e,t,a){var n=t[a],o=t[a+1];r[e+7]=o,r[e+6]=o>>>8,r[e+5]=o>>>16,r[e+4]=o>>>24,r[e+3]=n,r[e+2]=n>>>8,r[e+1]=n>>>16,r[e]=n>>>24}function f(r,e,t,a){var n=e[t],o=e[t+1];a<=32?(r[0]^=o<<32-a|n>>>a,r[1]^=n<<32-a|o>>>a):(r[0]^=n<<64-a|o>>>a-32,r[1]^=o<<64-a|n>>>a-32)}function c(r,e,t,a,n){var o=e[t],i=e[t+1];r[0]=o&e[a]^~o&e[n],r[1]=i&e[a+1]^~i&e[n+1]}function s(r,e,t,a,n){var o=e[t],i=e[t+1],f=e[a],c=e[a+1],s=e[n],u=e[n+1];r[0]=o&f^o&s^f&s,r[1]=i&c^i&u^c&u}function u(r,e,t){r[0]=0,r[1]=0,f(r,e,t,28),f(r,e,t,34),f(r,e,t,39)}function y(r,e,t){r[0]=0,r[1]=0,f(r,e,t,14),f(r,e,t,18),f(r,e,t,41)}function l(r,e,t){n(r,e,t,7),f(r,e,t,1),f(r,e,t,8)}function v(r,e,t){n(r,e,t,6),f(r,e,t,19),f(r,e,t,61)}function h(r,e,t,n,o,i){v(i,r,t),a(r,e,i,0),a(r,e,r,n),l(i,r,o),a(r,e,i,0)}function m(r,e){h(r,0,28,18,2,e),h(r,2,30,20,4,e),h(r,4,0,22,6,e),h(r,6,2,24,8,e),h(r,8,4,26,10,e),h(r,10,6,28,12,e),h(r,12,8,30,14,e),h(r,14,10,0,16,e),h(r,16,12,2,18,e),h(r,18,14,4,20,e),h(r,20,16,6,22,e),h(r,22,18,8,24,e),h(r,24,20,10,26,e),h(r,26,22,12,28,e),h(r,28,24,14,30,e),h(r,30,26,16,0,e)}function g(r,e,t,n,o,i,f,l,v,h,m,g,b,p){y(p,r,i),a(r,v,p,0),c(p,r,i,f,l),a(r,v,p,0),a(r,v,g,b),a(r,v,h,m),a(r,o,r,v),u(p,r,e),a(r,v,p,0),s(p,r,e,t,n),a(r,v,p,0)}function b(r,e,t,a){g(r,0,2,4,6,8,10,12,14,e,0,k,2*t,a),g(r,14,0,2,4,6,8,10,12,e,2,k,2*(t+1),a),g(r,12,14,0,2,4,6,8,10,e,4,k,2*(t+2),a),g(r,10,12,14,0,2,4,6,8,e,6,k,2*(t+3),a),g(r,8,10,12,14,0,2,4,6,e,8,k,2*(t+4),a),g(r,6,8,10,12,14,0,2,4,e,10,k,2*(t+5),a),g(r,4,6,8,10,12,14,0,2,e,12,k,2*(t+6),a),g(r,2,4,6,8,10,12,14,0,e,14,k,2*(t+7),a),g(r,0,2,4,6,8,10,12,14,e,16,k,2*(t+8),a),g(r,14,0,2,4,6,8,10,12,e,18,k,2*(t+9),a),g(r,12,14,0,2,4,6,8,10,e,20,k,2*(t+10),a),g(r,10,12,14,0,2,4,6,8,e,22,k,2*(t+11),a),g(r,8,10,12,14,0,2,4,6,e,24,k,2*(t+12),a),g(r,6,8,10,12,14,0,2,4,e,26,k,2*(t+13),a),g(r,4,6,8,10,12,14,0,2,e,28,k,2*(t+14),a),g(r,2,4,6,8,10,12,14,0,e,30,k,2*(t+15),a)}function p(r,e,t){for(var n=t.getUint32Array(16),f=t.getUint32Array(16),c=t.getUint32Array(32),s=t.getUint32Array(2),u=e.length,y=0,l=0;l<8;l+=1)o(f,2*l,r,8*l);for(n.set(f);u>=128;){for(var l=0;l<16;l+=1)o(c,2*l,e,y+8*l);b(f,c,0,s),m(c,s),b(f,c,16,s),m(c,s),b(f,c,32,s),m(c,s),b(f,c,48,s),m(c,s),b(f,c,64,s);for(var l=0;l<8;l+=1)a(f,2*l,n,2*l);n.set(f),y+=128,u-=128}for(var l=0;l<8;l+=1)i(r,8*l,n,2*l);return t.recycle(f,c,s),u}function w(r,e,t,a){var n=a.getUint8Array(256),o=e.length,f=a.getUint32Array(2);f[0]=t/536870912|0,f[1]=t<<3;for(var c=0;c<o;c+=1)n[c]=e[c];if(n[o]=128,o<112){for(var c=o+1;c<120;c+=1)n[c]=0;i(n,120,f,0),p(r,n.subarray(0,128),a)}else{for(var c=o+1;c<248;c+=1)n[c]=0;i(n,248,f,0),p(r,n,a)}a.recycle(n,f)}function A(r,e){r.length>0xffffffffffff&&new Error("This implementation cannot handle byte arrays longer than 2^48 (256 TB)."),e||(e=U.makeFactory());var t=e.getUint8Array(64),a=r.length;t.set(_);var n=p(t,r,e);return r=r.subarray(a-n),w(t,r,a,e),e.wipeRecycled(),t}function d(r,e){void 0===r&&(r=!0),e||(e=U.makeFactory());var t=e.getUint8Array(128),a=0,n=0,o=null;return{update:function(r){if(!t)throw new Error("Cannot use destroyed hasher.");if(0!==r.length){if(n+=r.length,o||(o=e.getUint8Array(64),o.set(_)),a>0){for(var i=Math.min(r.length,128-a),f=0;f<i;f+=1)t[a+f]=r[f];if(a+i<128)return void(a+=i);if(p(o,t,e),a=0,r=r.subarray(i),0===r.length)return void e.wipe(t)}a=p(o,r,e),r=r.subarray(r.length-a);for(var f=0;f<a;f+=1)t[f]=r[f];for(var f=a;f<t.length;f+=1)t[f]=0}},digest:function(){if(!t)throw new Error("Cannot use destroyed hasher.");if(!o)throw new Error("No bytes were hashed so far.");w(o,t.subarray(0,a),n,e);var i=o;return o=null,e.wipe(t),n=0,a=0,e.wipeRecycled(),r&&this.destroy(),i},destroy:function(){t&&(e.recycle(t),o||(e.recycle(o),o=null),e.wipeRecycled(),t=null,e=null)}}}var U=r("../util/arrays"),k=new Uint32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]),_=new Uint8Array([106,9,230,103,243,188,201,8,187,103,174,133,132,202,167,59,60,110,243,114,254,148,248,43,165,79,245,58,95,29,54,241,81,14,82,127,173,230,130,209,155,5,104,140,43,62,108,31,31,131,217,171,251,65,189,107,91,224,205,25,19,126,33,121]);t.hash=A,t.makeHasher=d,Object.freeze(t)},{"../util/arrays":15}],8:[function(r,e,t){"use strict";function a(r,e,t,a,n){for(var o=0;o<n;o+=1)r[e+o]=t[a+o]}function n(r,e,t,a,n){for(var o=0;o<n;o+=1)r[e+o]^=t[a+o]}function o(r){for(var e=r[0]|r[1]<<8|r[2]<<16|r[3]<<24,t=e,a=r[4]|r[5]<<8|r[6]<<16|r[7]<<24,n=a,o=r[8]|r[9]<<8|r[10]<<16|r[11]<<24,i=o,f=r[12]|r[13]<<8|r[14]<<16|r[15]<<24,c=f,s=r[16]|r[17]<<8|r[18]<<16|r[19]<<24,u=s,y=r[20]|r[21]<<8|r[22]<<16|r[23]<<24,l=y,v=r[24]|r[25]<<8|r[26]<<16|r[27]<<24,h=v,m=r[28]|r[29]<<8|r[30]<<16|r[31]<<24,g=m,b=r[32]|r[33]<<8|r[34]<<16|r[35]<<24,p=b,w=r[36]|r[37]<<8|r[38]<<16|r[39]<<24,A=w,d=r[40]|r[41]<<8|r[42]<<16|r[43]<<24,U=d,k=r[44]|r[45]<<8|r[46]<<16|r[47]<<24,_=k,x=r[48]|r[49]<<8|r[50]<<16|r[51]<<24,E=x,F=r[52]|r[53]<<8|r[54]<<16|r[55]<<24,z=F,N=r[56]|r[57]<<8|r[58]<<16|r[59]<<24,O=N,T=r[60]|r[61]<<8|r[62]<<16|r[63]<<24,I=T,j=0,K=0;K<8;K+=2)j=e+x,s^=j<<7|j>>>25,j=s+e,b^=j<<9|j>>>23,j=b+s,x^=j<<13|j>>>19,j=x+b,e^=j<<18|j>>>14,j=y+a,w^=j<<7|j>>>25,j=w+y,F^=j<<9|j>>>23,j=F+w,a^=j<<13|j>>>19,j=a+F,y^=j<<18|j>>>14,j=d+v,N^=j<<7|j>>>25,j=N+d,o^=j<<9|j>>>23,j=o+N,v^=j<<13|j>>>19,j=v+o,d^=j<<18|j>>>14,j=T+k,f^=j<<7|j>>>25,j=f+T,m^=j<<9|j>>>23,j=m+f,k^=j<<13|j>>>19,j=k+m,T^=j<<18|j>>>14,j=e+f,a^=j<<7|j>>>25,j=a+e,o^=j<<9|j>>>23,j=o+a,f^=j<<13|j>>>19,j=f+o,e^=j<<18|j>>>14,j=y+s,v^=j<<7|j>>>25,j=v+y,m^=j<<9|j>>>23,j=m+v,s^=j<<13|j>>>19,j=s+m,y^=j<<18|j>>>14,j=d+w,k^=j<<7|j>>>25,j=k+d,b^=j<<9|j>>>23,j=b+k,w^=j<<13|j>>>19,j=w+b,d^=j<<18|j>>>14,j=T+N,x^=j<<7|j>>>25,j=x+T,F^=j<<9|j>>>23,j=F+x,N^=j<<13|j>>>19,j=N+F,T^=j<<18|j>>>14;e+=t,a+=n,o+=i,f+=c,s+=u,y+=l,v+=h,m+=g,b+=p,w+=A,d+=U,k+=_,x+=E,F+=z,N+=O,T+=I,r[0]=e,r[1]=e>>>8,r[2]=e>>>16,r[3]=e>>>24,r[4]=a,r[5]=a>>>8,r[6]=a>>>16,r[7]=a>>>24,r[8]=o,r[9]=o>>>8,r[10]=o>>>16,r[11]=o>>>24,r[12]=f,r[13]=f>>>8,r[14]=f>>>16,r[15]=f>>>24,r[16]=s,r[17]=s>>>8,r[18]=s>>>16,r[19]=s>>>24,r[20]=y,r[21]=y>>>8,r[22]=y>>>16,r[23]=y>>>24,r[24]=v,r[25]=v>>>8,r[26]=v>>>16,r[27]=v>>>24,r[28]=m,r[29]=m>>>8,r[30]=m>>>16,r[31]=m>>>24,r[32]=b,r[33]=b>>>8,r[34]=b>>>16,r[35]=b>>>24,r[36]=w,r[37]=w>>>8,r[38]=w>>>16,r[39]=w>>>24,r[40]=d,r[41]=d>>>8,r[42]=d>>>16,r[43]=d>>>24,r[44]=k,r[45]=k>>>8,r[46]=k>>>16,r[47]=k>>>24,r[48]=x,r[49]=x>>>8,r[50]=x>>>16,r[51]=x>>>24,r[52]=F,r[53]=F>>>8,r[54]=F>>>16,r[55]=F>>>24,r[56]=N,r[57]=N>>>8,r[58]=N>>>16,r[59]=N>>>24,r[60]=T,r[61]=T>>>8,r[62]=T>>>16,r[63]=T>>>24}function i(r,e,t,i){var f=i.getUint8Array(64);a(f,0,r,64*(2*t-1),64);for(var c=0;c<2*t;c+=1)n(f,0,r,64*c,64),o(f),a(e,64*c,f,0,64);for(var c=0;c<t;c+=1)a(r,64*c,e,2*c*64,64);for(var c=0;c<t;c+=1)a(r,64*(c+t),e,64*(2*c+1),64);i.recycle(f)}function f(r,e,t){var a=64*(2*e-1);return r[a]+(r[a+1]<<8)+(r[a+2]<<16)+(r[a+3]<<24)&t-1}function c(r,e,t,o,c,s,u){var y=c.subarray(0,128*e),l=c.subarray(128*e),v=s.deltaN;a(y,0,r,0,128*e);for(var h=0;h<t;h+=1)a(o,h*(128*e),y,0,128*e),i(y,l,e,u),h===v&&(s.addDelta(),v+=s.deltaN);v=s.deltaN;for(var m,h=0;h<t;h+=1)m=f(y,e,t),n(y,0,o,m*(128*e),128*e),i(y,l,e,u),h===v&&(s.addDelta(),v+=s.deltaN);a(r,0,y,0,128*e)}function s(r,e,t,a,n,o,i,f){if(f||(f=u.makeFactory()),t>=32||t<1)throw new Error("Parameter logN is out of bounds.");if(a<1||n<1||a*n>=1<<30)throw new Error("Parameters p and r are out of bounds.");var s,l,v,h=1<<t;try{s=f.getUint8Array(128*a*h),l=f.getUint8Array(128*a*n),v=f.getUint8Array(256*a)}catch(m){throw m.message="Cannot allocate memory for given parameters: "+m.message,m}y.PBKDF2_SHA256(r,e,1,l,f),i(3);for(var g={completed:3,deltaWork:1,deltaN:Math.floor(2*h*n/93),addDelta:function(){this.completed+=this.deltaWork,i(this.completed)}},b=0;b<n;b+=1)c(l.subarray(128*b*a),a,h,s,v,g,f);var p=f.getUint8Array(o);return y.PBKDF2_SHA256(r,l,1,p,f),i(99),f.wipe(s,l,v),f.wipeRecycled(),i(100),p}var u=r("../util/arrays"),y=r("./sha256");t.scrypt=s},{"../util/arrays":15,"./sha256":9}],9:[function(r,e,t){"use strict";function a(r,e,t){for(var a,n,o,i,f,c,s,u,y,l,v,h=t.getUint32Array(64),m=e.length,g=0;m>=64;){for(var b=0;b<16;b+=1)v=g+4*b,h[b]=(e[v]<<24)+(e[v+1]<<16)+(e[v+2]<<8)+e[v+3];for(var b=16;b<64;b+=1)v=h[b-2],y=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,v=h[b-15],l=(v>>>7|v<<25)^(v>>>18|v<<14)^v>>>3,h[b]=y+h[b-7]+l+h[b-16];a=r[0],n=r[1],o=r[2],i=r[3],f=r[4],c=r[5],s=r[6],u=r[7];for(var b=0;b<64;b+=1)y=u+h[b]+A[b],y+=(f>>>6|f<<26)^(f>>>11|f<<21)^(f>>>25|f<<7),y+=f&(c^s)^s,l=(a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10),l+=a&(n|o)|n&o,i+=y,u=y+l,y=u,u=s,s=c,c=f,f=i,i=o,o=n,n=a,a=y;r[0]+=a,r[1]+=n,r[2]+=o,r[3]+=i,r[4]+=f,r[5]+=c,r[6]+=s,r[7]+=u,g+=64,m-=64}return t.recycle(h),m}function n(r,e){for(var t,a=0;a<8;a+=1)t=e[a],r[4*a+3]=t,r[4*a+2]=t>>>8,r[4*a+1]=t>>>16,r[4*a]=t>>>24}function o(r,e,t,n){var o=n.getUint8Array(128),i=e.length,f=n.getUint32Array(2);f[0]=t/536870912|0,f[1]=t<<3;for(var c=0;c<i;c+=1)o[c]=e[c];if(o[i]=128,i<56){for(var c=i+1;c<56;c+=1)o[c]=0;o[56]=f[0]>>>24,o[57]=f[0]>>>16,o[58]=f[0]>>>8,o[59]=f[0],o[60]=f[1]>>>24,o[61]=f[1]>>>16,o[62]=f[1]>>>8,o[63]=f[1],a(r,o.subarray(0,64),n)}else{for(var c=i+1;c<120;c+=1)o[c]=0;o[120]=f[0]>>>24,o[121]=f[0]>>>16,o[122]=f[0]>>>8,o[123]=f[0],o[124]=f[1]>>>24,o[125]=f[1]>>>16,o[126]=f[1]>>>8,o[127]=f[1],a(r,o,n)}n.recycle(o,f)}function i(r){return{buf:r.getUint8Array(64),bufBytes:0,state:r.getUint32Array(8),count:0,arrFactory:r}}function f(){for(var r=[],e=0;e<arguments.length;e++)r[e-0]=arguments[e];for(var t,a=0;a<r.length;a+=1)t=r[a],t.arrFactory.recycle(t.state,t.buf),t.state=null,t.buf=null,t.arrFactory=null}function c(r){r.state.set(d),r.bufBytes=0,r.count=0}function s(r,e,t,n){if(0!==n){if(r.count+=n,r.bufBytes>0){for(var o=Math.min(n,64-r.bufBytes),i=0;i<o;i+=1)r.buf[r.bufBytes+i]=e[t+i];if(r.bufBytes+=o,r.bufBytes<64)return;if(a(r.state,r.buf,r.arrFactory),r.bufBytes=0,t+=o,n-=o,0===n)return}r.bufBytes=a(r.state,e.subarray(t,t+n),r.arrFactory),t+=n-r.bufBytes;for(var i=0;i<r.bufBytes;i+=1)r.buf[i]=e[t+i]}}function u(r,e){o(e.state,e.buf.subarray(0,e.bufBytes),e.count,e.arrFactory),e.count=0,e.bufBytes=0,n(r,e.state)}function y(r){return{ictx:i(r),octx:i(r),arrFactory:r}}function l(){for(var r=[],e=0;e<arguments.length;e++)r[e-0]=arguments[e];for(var t,a=0;a<r.length;a+=1)t=r[a],f(t.ictx,t.octx)}function v(r,e){r.ictx.state.set(e.ictx.state),r.ictx.count=e.ictx.count,r.ictx.buf.set(e.ictx.buf),r.ictx.bufBytes=e.ictx.bufBytes,r.octx.state.set(e.octx.state),r.octx.count=e.octx.count,r.octx.buf.set(e.octx.buf),r.octx.bufBytes=e.octx.bufBytes}function h(r,e,t,a,n){for(var o=0;o<n;o+=1)r[e+o]=t[a+o]}function m(r,e,t,a){var n=r.arrFactory.getUint8Array(64),o=r.arrFactory.getUint8Array(32);a>64&&(c(r.ictx),s(r.ictx,e,t,a),u(o,r.ictx),e=o,t=0,a=32),c(r.ictx);for(var i=0;i<a;i+=1)n[i]=54^e[i];for(var i=a;i<64;i+=1)n[i]=54;s(r.ictx,n,0,64),c(r.octx);for(var i=0;i<a;i+=1)n[i]=92^e[i];for(var i=a;i<64;i+=1)n[i]=92;s(r.octx,n,0,64),r.arrFactory.recycle(o,n)}function g(r,e,t,a){s(r.ictx,e,t,a)}function b(r,e){var t=e.arrFactory.getUint8Array(32);u(t,e.ictx),s(e.octx,t,0,32),u(r,e.octx),e.arrFactory.recycle(t)}function p(r,e,t){r[e+3]=t,r[e+2]=t>>>8,r[e+1]=t>>>16,r[e]=t>>>24}function w(r,e,t,a,n){var o=a.length,i=y(n),f=y(n),c=n.getUint8Array(4),s=n.getUint8Array(32),u=n.getUint8Array(32);m(i,r,0,r.length),g(i,e,0,e.length);for(var w=0;32*w<o;w+=1){p(c,0,w+1),v(f,i),g(f,c,0,4),b(s,f),h(u,0,s,0,32);for(var A=2;A<=t;A+=1){m(f,r,0,r.length),g(f,s,0,32),b(s,f);for(var d=0;d<32;d+=1)u[d]^=s[d]}var U=o-32*w;U>32&&(U=32),h(a,32*w,u,0,U)}l(i,f),n.recycle(c,s,u)}var A=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),d=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]); - t.makeSha256Ctx=i,t.recycleSha256Ctxs=f,t.SHA256_Init=c,t.SHA256_Update=s,t.SHA256_Final=u,t.be32enc=p,t.PBKDF2_SHA256=w,Object.freeze(t)},{}],10:[function(r,e,t){"use strict";function a(r){return r.getUint32Array(32)}function n(r,e){var t=e.getUint32Array(32);return t.set(r),t}function o(r,e){return r===e?1:0}function i(r,e){return r>=e?1:0}function f(r){return(r<<4)+(r<<1)+r}function c(r){return(r<<5)+(r<<2)+(r<<1)}function s(r){for(var e,t=0;t<4;t+=1){e=r[31]>>>7,r[31]&=127,e=f(e),r[0]+=e;for(var a=0;a<31;a+=1)e=r[a]>>>8,r[a+1]+=e,r[a]&=255}}function u(r){for(var e,t=0;t<2;t+=1){e=r[31]>>>7,r[31]&=127,e=f(e),r[0]+=e;for(var a=0;a<31;a+=1)e=r[a]>>>8,r[a+1]+=e,r[a]&=255}}function y(r){for(var e=o(r[31],127),t=30;t>0;t-=1)e&=o(r[t],255);e&=i(r[0],237),e=-e,r[31]-=127&e;for(var t=30;t>0;t-=1)r[t]-=255&e;r[0]-=237&e}function l(r,e){for(var t=0;t<32;t+=1)r[t]=e[t];r[31]&=127}function v(r,e,t){var a=n(e,t);y(a);for(var o=0;o<32;o+=1)r[o]=a[o];t.recycle(a)}function h(r,e,t){var a=n(r,t),o=n(e,t);y(a),y(o);for(var i=0;i<32;i+=1)if(a[i]!==o[i])return!1;return t.recycle(a,o),!0}function m(r,e,t){for(var a=0;a<32;a+=1)r[a]^=-t&(e[a]^r[a])}function g(r,e){var t=n(r,e);y(t);var a=1&t[0];return e.recycle(t),a}function b(r){r[0]=1;for(var e=1;e<32;e+=1)r[e]=0}function p(r){for(var e=0;e<32;e+=1)r[e]=0}function w(r,e,t){var a=n(e,t);p(r),d(r,r,a,t),t.recycle(a)}function A(r,e,t){for(var a=0;a<32;a+=1)r[a]=e[a]+t[a];s(r)}function d(r,e,t,n){var o=a(n);o[0]=e[0]+474;for(var i=1;i<31;i+=1)o[i]=e[i]+510;o[31]=e[31]+254;for(var i=0;i<32;i+=1)r[i]=o[i]-t[i];s(r),n.recycle(o)}function U(r,e,t,a){for(var n=a.getUint32Array(63),o=0;o<63;o+=1)n[o]=0;for(var o=0;o<32;o+=1)for(var i=0;i<32;i+=1)n[o+i]+=e[o]*t[i];for(var o=32;o<63;o+=1)r[o-32]=n[o-32]+c(n[o]);r[31]=n[31],u(r),a.recycle(n)}function k(r,e,t){U(r,e,e,t)}function _(r,e,t){var n=a(t),o=a(t),i=a(t),f=a(t),c=a(t),s=a(t),u=a(t),y=a(t),l=a(t),v=a(t);k(n,e,t),k(v,n,t),k(l,v,t),U(o,l,e,t),U(i,o,n,t),k(l,i,t),U(f,l,o,t),k(l,f,t),k(v,l,t),k(l,v,t),k(v,l,t),k(l,v,t),U(c,l,f,t),k(l,c,t),k(v,l,t);for(var h=2;h<10;h+=2)k(l,v,t),k(v,l,t);U(s,v,c,t),k(l,s,t),k(v,l,t);for(var h=2;h<20;h+=2)k(l,v,t),k(v,l,t);U(l,v,s,t),k(v,l,t),k(l,v,t);for(var h=2;h<10;h+=2)k(v,l,t),k(l,v,t);U(u,l,c,t),k(l,u,t),k(v,l,t);for(var h=2;h<50;h+=2)k(l,v,t),k(v,l,t);U(y,v,u,t),k(v,y,t),k(l,v,t);for(var h=2;h<100;h+=2)k(v,l,t),k(l,v,t);U(v,l,y,t),k(l,v,t),k(v,l,t);for(var h=2;h<50;h+=2)k(l,v,t),k(v,l,t);U(l,v,u,t),k(v,l,t),k(l,v,t),k(v,l,t),k(l,v,t),k(v,l,t),U(r,v,i,t),t.recycle(n,o,i,f,c,s,u,y,l,v)}function x(r,e,t){var n=a(t),o=a(t),i=a(t),f=a(t),c=a(t),s=a(t),u=a(t),y=a(t),l=a(t);k(n,e,t),k(l,n,t),k(l,l,t),U(o,l,e,t),U(i,o,n,t),k(l,i,t),U(f,l,o,t),k(l,f,t);for(var v=1;v<5;v+=1)k(l,l,t);U(c,l,f,t),k(l,c,t);for(var v=1;v<10;v+=1)k(l,l,t);U(s,l,c,t),k(l,s,t);for(var v=1;v<20;v+=1)k(l,l,t);U(l,l,s,t),k(l,l,t);for(var v=1;v<10;v+=1)k(l,l,t);U(u,l,c,t),k(l,u,t);for(var v=1;v<50;v+=1)k(l,l,t);U(y,l,u,t),k(l,y,t);for(var v=1;v<100;v+=1)k(l,l,t);U(l,l,y,t),k(l,l,t);for(var v=1;v<50;v+=1)k(l,l,t);U(l,l,u,t),k(l,l,t),k(l,l,t),U(r,l,e,t),t.recycle(n,o,i,f,c,s,u,y,l)}t.make_fe25519=a,t.unpack=l,t.pack=v,t.iseq_vartime=h,t.cmov=m,t.getparity=g,t.setone=b,t.setzero=p,t.neg=w,t.add=A,t.sub=d,t.mul=U,t.square=k,t.invert=_,t.pow2523=x,Object.freeze(t)},{}],11:[function(r,e,t){"use strict";function a(r){return{x:_.make_fe25519(r),y:_.make_fe25519(r),z:_.make_fe25519(r),t:_.make_fe25519(r)}}function n(r){return a(r)}function o(r){return a(r)}function i(r,e){r.x.set(e.x),r.y.set(e.y),r.z.set(e.z),r.t.set(e.t)}function f(r,e){r.x.set(e.x),r.y.set(e.y)}function c(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var a,n=0;n<e.length;n+=1)a=e[n],r.recycle(a.x,a.y)}function s(r){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];for(var a,n=0;n<e.length;n+=1)a=e[n],r.recycle(a.x,a.y,a.z),a.t&&r.recycle(a.t)}function u(r,e,t){_.mul(r.x,e.x,e.t,t),_.mul(r.y,e.y,e.z,t),_.mul(r.z,e.z,e.t,t)}function y(r,e,t){u(r,e,t),_.mul(r.t,e.x,e.y,t)}function l(r,e,t){var a=_.make_fe25519(t),n=_.make_fe25519(t),o=_.make_fe25519(t),i=_.make_fe25519(t),f=_.make_fe25519(t),c=_.make_fe25519(t),s=_.make_fe25519(t),u=_.make_fe25519(t),y=_.make_fe25519(t),l=_.make_fe25519(t),v=_.make_fe25519(t);_.mul(v,e.x,e.y,t),_.sub(a,r.y,r.x,t),_.add(n,r.y,r.x),_.sub(o,e.y,e.x,t),_.add(i,e.y,e.x),_.mul(a,a,o,t),_.mul(n,n,i,t),_.sub(s,n,a,t),_.add(l,n,a),_.mul(f,r.t,v,t),_.mul(f,f,N,t),_.add(c,r.z,r.z),_.sub(u,c,f,t),_.add(y,c,f),_.mul(r.x,s,u,t),_.mul(r.y,l,y,t),_.mul(r.z,y,u,t),_.mul(r.t,s,l,t),t.recycle(a,n,o,i,f,c,s,u,y,l,v)}function v(r,e,t,a){var n=_.make_fe25519(a),o=_.make_fe25519(a),i=_.make_fe25519(a),f=_.make_fe25519(a),c=_.make_fe25519(a);_.sub(n,e.y,e.x,a),_.sub(c,t.y,t.x,a),_.mul(n,n,c,a),_.add(o,e.x,e.y),_.add(c,t.x,t.y),_.mul(o,o,c,a),_.mul(i,e.t,t.t,a),_.mul(i,i,N,a),_.mul(f,e.z,t.z,a),_.add(f,f,f),_.sub(r.x,o,n,a),_.sub(r.t,f,i,a),_.add(r.z,f,i),_.add(r.y,o,n),a.recycle(n,o,i,f,c)}function h(r,e,t){var a=_.make_fe25519(t),n=_.make_fe25519(t),o=_.make_fe25519(t),i=_.make_fe25519(t);_.square(a,e.x,t),_.square(n,e.y,t),_.square(o,e.z,t),_.add(o,o,o),_.neg(i,a,t),_.add(r.x,e.x,e.y),_.square(r.x,r.x,t),_.sub(r.x,r.x,a,t),_.sub(r.x,r.x,n,t),_.add(r.z,i,n),_.sub(r.t,r.z,o,t),_.sub(r.y,i,n,t),t.recycle(a,n,o,i)}function m(r,e,t){_.cmov(r.x,e.x,t),_.cmov(r.y,e.y,t)}function g(r,e){return r===e?1:0}function b(r){return r<0?1:0}function p(r,e,t,a){var n=_.make_fe25519(a);f(r,T[5*e+0]),m(r,T[5*e+1],g(t,1)|g(t,-1)),m(r,T[5*e+2],g(t,2)|g(t,-2)),m(r,T[5*e+3],g(t,3)|g(t,-3)),m(r,T[5*e+4],g(t,-4)),_.neg(n,r.x,a),_.cmov(r.x,n,b(t)),a.recycle(n)}function w(r){_.setzero(r.x),_.setone(r.y),_.setone(r.z),_.setzero(r.t)}function A(r,e,t){var a=_.make_fe25519(t),n=_.make_fe25519(t),o=_.make_fe25519(t),i=_.make_fe25519(t),f=_.make_fe25519(t),c=_.make_fe25519(t),s=_.make_fe25519(t);_.setone(r.z);var u=e[31]>>>7;return _.unpack(r.y,e),_.square(o,r.y,t),_.mul(i,o,z,t),_.sub(o,o,r.z,t),_.add(i,r.z,i),_.square(f,i,t),_.square(c,f,t),_.mul(s,c,f,t),_.mul(a,s,o,t),_.mul(a,a,i,t),_.pow2523(a,a,t),_.mul(a,a,o,t),_.mul(a,a,i,t),_.mul(a,a,i,t),_.mul(r.x,a,i,t),_.square(n,r.x,t),_.mul(n,n,i,t),_.iseq_vartime(n,o,t)||_.mul(r.x,r.x,O,t),_.square(n,r.x,t),_.mul(n,n,i,t),!!_.iseq_vartime(n,o,t)&&(_.getparity(r.x,t)!==1-u&&_.neg(r.x,r.x,t),_.mul(r.t,r.x,r.y,t),t.recycle(a,n,o,i,f,c,s),!0)}function d(r,e,t){var a=_.make_fe25519(t),n=_.make_fe25519(t),o=_.make_fe25519(t);_.invert(o,e.z,t),_.mul(a,e.x,o,t),_.mul(n,e.y,o,t),_.pack(r,n,t),r[31]^=_.getparity(a,t)<<7,t.recycle(a,n,o)}function U(r,e,t,a,f,c){for(var l=n(c),m=new Array(16),g=0;g<16;g+=1)1===g&&4===g||(m[g]=o(c));var b=c.getUint8Array(127);w(m[0]),m[1]=e,h(l,e,c),y(m[2],l,c),v(l,m[1],m[2],c),y(m[3],l,c),m[4]=a,v(l,m[1],m[4],c),y(m[5],l,c),v(l,m[2],m[4],c),y(m[6],l,c),v(l,m[3],m[4],c),y(m[7],l,c),h(l,a,c),y(m[8],l,c),v(l,m[1],m[8],c),y(m[9],l,c),h(l,m[5],c),y(m[10],l,c),v(l,m[3],m[8],c),y(m[11],l,c),v(l,m[4],m[8],c),y(m[12],l,c),v(l,m[1],m[12],c),y(m[13],l,c),v(l,m[2],m[12],c),y(m[14],l,c),v(l,m[3],m[12],c),y(m[15],l,c),x.interleave2(b,t,f),i(r,m[b[126]]);for(var g=125;g>=0;g-=1)h(l,r,c),u(r,l,c),h(l,r,c),0!==b[g]&&(y(r,l,c),v(l,r,m[b[g]],c)),0!==g?u(r,l,c):y(r,l,c);s(c,l);for(var g=0;g<16;g+=1)1!==g&&4!==g&&s(c,m[g]);c.recycle(b)}function k(r,e,t){var a=new Int8Array(85),n=E.make_ge25519_aff(t);x.window3(a,e),p(r,0,a[0],t),_.setone(r.z),_.mul(r.t,r.x,r.y,t);for(var o=1;o<85;o+=1)p(n,o,a[o],t),l(r,n,t);c(t,n)}var _=r("./fe25519"),x=r("./sc25519"),E=r("./ge25519_base.data"),F=r("../util/arrays");t.make_ge25519=a,t.recycle_ge25519=s;var z=new Uint32Array([163,120,89,19,202,77,235,117,171,216,65,65,77,10,112,0,152,232,121,119,121,64,199,140,115,254,111,43,238,108,3,82]),N=new Uint32Array([89,241,178,38,148,155,214,235,86,177,131,130,154,20,224,0,48,209,243,238,242,128,142,25,231,252,223,86,220,217,6,36]),O=new Uint32Array([176,160,14,74,39,27,238,196,120,228,47,173,6,24,67,47,167,215,251,61,153,0,77,43,11,223,193,79,128,36,131,43]);t.base=a(F.makeFactory()),t.base.x.set([26,213,37,143,96,45,86,201,178,167,37,149,96,199,44,105,92,220,214,253,49,226,164,192,254,83,110,205,211,54,105,33]),t.base.y.set([88,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102]),t.base.z.set([1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),t.base.t.set([163,221,183,165,179,138,222,109,245,82,81,119,128,159,240,32,125,227,171,100,142,78,234,102,101,118,139,215,15,95,135,103]);var T=E.base_multiples_affine;t.unpackneg_vartime=A,t.pack=d,t.double_scalarmult_vartime=U,t.scalarmult_base=k,Object.freeze(t)},{"../util/arrays":15,"./fe25519":10,"./ge25519_base.data":12,"./sc25519":13}],12:[function(r,e,t){"use strict";function a(r){return{x:n.make_fe25519(r),y:n.make_fe25519(r)}}var n=r("./fe25519"),o=r("../util/arrays");t.make_ge25519_aff=a,t.base_multiples_affine=new Array(425),function(){for(var r=[[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[26,213,37,143,96,45,86,201,178,167,37,149,96,199,44,105,92,220,214,253,49,226,164,192,254,83,110,205,211,54,105,33],[88,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102,102]],[[14,206,67,40,78,161,197,131,95,164,215,21,69,142,13,8,172,231,51,24,125,59,4,61,108,4,90,159,76,56,171,54],[201,163,248,106,174,70,95,14,86,81,56,100,81,15,57,151,86,31,162,201,232,94,162,29,194,41,35,9,243,205,96,34]],[[92,226,248,211,95,72,98,172,134,72,98,129,25,152,67,99,58,200,218,62,116,174,244,31,73,143,146,34,74,156,174,103],[212,180,245,120,72,104,195,2,4,3,36,103,23,236,22,159,247,158,38,96,142,161,38,161,171,105,238,119,209,177,103,18]],[[112,248,201,196,87,166,58,73,71,21,206,147,193,158,115,26,249,32,53,122,184,212,37,131,70,241,207,86,219,168,61,32],[47,17,50,202,97,171,56,223,240,15,47,234,50,40,242,76,108,113,213,128,133,184,14,71,225,149,21,203,39,232,208,71]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[200,132,165,8,188,253,135,59,153,139,105,128,123,198,58,235,147,207,78,248,92,45,134,66,182,113,215,151,95,225,66,103],[180,185,55,252,169,91,47,30,147,228,30,98,252,60,120,129,143,243,138,102,9,111,173,110,121,115,229,201,0,6,211,33]],[[248,249,40,108,109,89,178,89,116,35,191,231,51,141,87,9,145,156,36,8,21,43,226,184,238,58,229,39,6,134,164,35],[235,39,103,193,55,171,122,216,39,156,7,142,255,17,106,176,120,110,173,58,46,15,152,159,114,195,127,130,242,150,150,112]],[[129,107,136,232,30,199,119,150,14,161,169,82,224,216,14,97,158,121,45,149,156,141,150,224,6,64,93,135,40,95,152,112],[241,121,123,237,79,68,178,231,8,13,194,8,18,210,159,223,205,147,32,138,207,51,202,109,137,185,119,200,147,27,78,96]],[[38,79,126,151,246,64,221,79,252,82,120,249,144,49,3,230,125,86,57,11,29,86,130,133,249,26,66,23,105,108,207,57],[105,210,6,58,79,57,45,249,56,64,140,76,231,5,18,180,120,139,248,192,236,147,222,122,107,206,44,225,14,169,52,68]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[11,164,60,176,15,122,81,241,120,214,217,106,253,70,232,184,168,121,29,135,249,144,242,156,19,41,248,11,32,100,250,5],[38,9,218,23,175,149,214,251,106,25,13,110,94,18,241,153,76,170,168,111,121,134,244,114,40,0,38,249,234,158,25,61]],[[135,221,207,240,91,73,162,93,64,122,35,38,164,122,131,138,183,139,210,26,191,234,2,36,8,95,123,169,177,190,157,55],[252,134,75,8,238,231,160,253,33,69,9,52,193,97,50,35,252,155,85,72,83,153,247,99,208,153,206,1,224,159,235,40]],[[71,252,171,90,23,240,133,86,58,48,134,32,40,75,142,68,116,58,110,2,241,50,143,159,63,8,53,233,202,22,95,110],[28,89,28,101,93,52,164,9,205,19,156,112,125,177,42,197,136,175,11,96,199,159,52,141,214,183,127,234,120,101,141,119]],[[86,165,194,12,221,188,184,32,109,87,97,181,251,120,181,212,73,84,144,38,193,203,233,230,191,236,29,78,237,7,126,94],[199,246,108,86,49,32,20,14,168,217,39,193,154,61,27,125,14,38,211,129,170,235,245,107,121,2,241,81,92,117,85,15]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[10,52,205,130,60,51,9,84,210,97,57,48,155,253,239,33,38,212,112,250,238,249,49,51,115,132,208,179,129,191,236,46],[232,147,139,0,100,247,156,184,116,224,230,73,72,77,77,72,182,25,161,64,183,217,50,65,124,130,55,161,45,220,210,84]],[[104,43,74,91,213,199,81,145,29,225,42,75,196,71,241,188,122,179,203,200,182,124,172,144,5,253,243,249,82,58,17,107],[61,193,39,243,89,67,149,144,197,150,121,245,244,149,101,41,6,156,81,5,24,218,184,46,121,126,105,89,113,1,235,26]],[[21,6,73,182,138,60,234,47,52,32,20,195,170,214,175,44,62,189,101,32,226,77,75,59,235,159,74,195,173,164,59,96],[188,88,230,192,149,42,42,129,154,122,243,210,6,190,72,188,12,197,70,224,106,212,172,15,217,204,130,52,44,175,219,31]],[[247,23,19,189,251,188,210,236,69,179,21,49,233,175,130,132,61,40,198,252,17,245,65,181,139,211,18,118,82,231,26,60],[78,54,17,7,162,21,32,81,196,42,195,98,139,94,127,166,15,249,69,133,108,17,134,183,126,229,215,249,195,145,28,5]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[234,214,222,41,58,0,185,2,89,203,38,196,186,153,177,151,47,142,0,146,38,79,82,235,71,27,137,139,36,192,19,125],[213,32,91,128,166,128,32,149,195,233,159,142,135,158,30,158,122,199,204,117,108,165,241,145,26,168,1,44,171,118,169,89]],[[222,201,177,49,16,22,170,53,20,106,212,181,52,130,113,210,74,93,154,31,83,38,60,229,142,141,51,127,255,169,213,23],[137,175,246,164,100,213,16,224,29,173,239,68,189,218,131,172,122,168,240,28,7,249,195,67,108,63,183,211,135,34,2,115]],[[100,29,73,19,47,113,236,105,135,208,66,238,19,236,227,237,86,123,191,189,140,47,125,123,157,40,236,142,118,47,111,8],[34,245,95,77,21,239,252,78,87,3,54,137,240,235,91,145,214,226,202,1,165,238,82,236,160,60,143,51,144,90,148,114]],[[138,75,231,56,188,218,194,176,133,225,74,254,45,68,132,203,32,107,45,191,17,156,215,190,211,62,95,191,104,188,168,7],[1,137,40,34,106,120,170,41,3,200,116,149,3,62,220,189,7,19,168,162,32,45,179,24,112,66,253,122,196,215,73,114]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[2,255,50,43,92,147,84,50,232,87,84,26,139,51,96,101,211,103,164,193,38,196,164,52,31,155,167,169,244,217,79,91],[70,141,176,51,84,38,91,104,223,187,197,236,194,249,60,90,55,193,142,39,71,170,73,90,248,251,104,4,35,209,235,64]],[[101,165,17,132,138,103,157,158,209,68,104,122,52,225,159,163,84,205,7,202,121,31,84,47,19,112,78,238,162,250,231,93],[54,236,84,248,206,228,133,223,246,111,29,144,8,188,232,192,146,45,67,107,146,169,142,171,10,46,28,30,100,35,159,44]],[[167,214,46,213,204,212,203,90,59,167,249,70,3,29,173,43,52,49,144,0,70,8,130,20,196,224,156,240,227,85,67,49],[96,214,221,120,230,212,34,66,31,0,249,177,106,99,226,146,89,209,26,183,0,84,41,201,193,246,111,122,197,60,95,101]],[[39,79,208,114,177,17,20,39,21,148,72,129,126,116,216,50,213,209,17,40,96,99,54,50,55,181,19,28,160,55,227,116],[241,37,78,17,150,103,230,28,194,178,83,226,218,133,238,178,159,89,243,186,189,250,207,110,249,218,164,179,2,143,100,8]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[52,148,242,100,84,71,55,7,64,138,32,186,74,85,215,63,71,186,37,35,20,176,44,232,85,168,166,239,81,189,111,106],[113,214,22,118,178,6,234,121,245,196,195,82,126,97,209,225,173,112,120,29,22,17,248,124,43,252,85,159,82,248,245,22]],[[52,150,154,246,197,224,20,3,36,14,76,173,158,154,112,35,150,178,241,46,157,195,50,155,84,165,115,222,136,177,62,36],[246,226,76,31,91,178,175,130,165,207,129,16,4,239,219,162,204,36,178,126,11,122,235,1,216,82,244,81,137,41,121,55]],[[116,222,18,243,104,183,102,195,238,104,220,129,181,85,153,171,217,40,99,109,139,64,105,117,108,205,92,42,126,50,123,41],[2,204,34,116,77,25,7,192,218,181,118,81,42,170,166,10,95,38,212,188,175,72,136,127,2,188,242,225,207,233,221,21]],[[237,181,154,140,154,221,39,244,127,71,217,82,167,205,101,165,49,34,237,166,99,91,128,74,173,77,237,191,238,73,179,6],[248,100,139,96,144,233,222,68,119,185,7,54,50,194,80,245,101,223,72,76,55,170,104,171,154,31,62,255,137,146,160,7]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[125,79,156,25,192,74,49,236,249,170,235,178,22,156,163,102,95,209,212,237,184,146,28,171,218,234,217,87,223,76,42,72],[75,176,78,110,17,59,81,189,106,253,228,37,165,95,17,63,152,146,81,20,198,95,60,11,168,247,194,129,67,222,145,115]],[[60,143,159,51,42,31,67,51,143,104,255,31,61,115,107,191,104,204,125,19,108,36,75,204,77,36,13,254,222,134,173,59],[121,81,129,1,220,115,83,224,110,155,234,104,63,92,20,132,83,141,75,192,159,159,137,43,140,186,134,250,242,205,227,45]],[[6,249,41,90,219,61,132,82,171,204,107,96,157,183,74,14,54,99,145,173,160,149,176,151,137,78,207,125,60,229,124,40],[46,105,152,253,198,189,204,202,223,154,68,126,157,202,137,109,191,39,194,248,205,70,0,43,181,88,78,183,137,9,233,45]],[[84,190,117,203,5,176,84,183,231,38,134,74,252,25,207,39,70,212,34,150,90,17,232,213,27,237,113,197,93,200,175,69],[64,123,119,87,73,158,128,57,35,238,129,11,34,207,219,122,47,20,184,87,143,161,57,30,119,252,11,166,191,138,12,108]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[119,58,212,216,39,207,232,161,114,157,202,221,13,150,218,121,237,86,66,21,96,199,28,107,38,48,246,106,149,103,243,10],[197,8,164,43,47,189,49,129,42,166,182,228,0,145,218,61,178,176,150,206,138,210,141,112,179,211,52,1,144,141,16,33]],[[51,13,231,186,79,7,223,141,234,125,160,197,214,177,176,229,87,27,91,245,69,19,20,100,90,235,92,252,84,1,118,43],[2,12,194,175,150,54,254,74,226,84,32,106,235,178,159,98,215,206,162,63,32,17,52,55,224,66,237,111,249,26,200,125]],[[216,185,17,232,54,63,66,193,202,220,211,241,200,35,61,79,81,123,157,141,216,228,160,170,243,4,214,17,147,200,53,69],[97,54,214,8,144,191,167,122,151,108,15,132,213,51,45,55,201,106,128,144,61,10,162,170,225,184,132,186,97,54,221,105]],[[107,219,91,156,198,146,188,35,175,197,184,117,248,66,250,214,182,132,148,99,152,147,72,120,56,205,187,24,52,195,219,103],[150,243,58,9,86,176,111,124,81,30,27,57,72,234,201,12,37,162,122,202,231,146,252,89,48,163,137,133,223,111,67,56]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[121,132,68,25,189,233,84,196,192,110,42,168,168,155,67,213,113,34,95,220,1,250,223,179,184,71,75,10,165,68,234,41],[5,144,80,175,99,95,157,158,225,157,56,151,31,108,172,48,70,178,106,25,209,75,219,187,140,218,46,171,200,90,119,108]],[[43,190,175,161,109,47,11,177,143,227,224,56,205,11,65,27,74,21,7,243,111,220,184,233,222,178,163,64,1,166,69,30],[118,10,218,141,44,7,63,137,125,4,173,67,80,110,210,71,203,138,230,133,26,36,243,210,96,253,223,115,164,13,115,14]],[[253,103,107,113,155,129,83,57,57,244,184,213,195,48,155,59,124,163,240,208,132,33,214,191,183,76,135,19,69,45,167,85],[93,4,179,64,40,149,45,48,131,236,94,228,255,117,254,121,38,157,29,54,205,10,21,210,36,20,119,113,215,138,27,4]],[[93,147,201,190,170,144,205,155,251,115,126,176,100,152,87,68,66,65,177,175,234,193,195,34,255,96,70,203,97,129,112,97],[13,130,185,254,33,205,196,245,152,12,78,114,238,135,73,248,161,149,223,143,45,189,33,6,124,21,232,18,109,147,214,56]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[145,247,81,217,239,125,66,1,19,233,184,127,166,73,23,100,33,128,131,44,99,76,96,9,89,145,146,119,57,81,244,72],[96,213,34,131,8,47,255,153,62,105,109,136,218,231,91,82,38,49,42,229,137,222,104,144,182,34,90,189,211,133,83,49]],[[216,206,220,249,60,75,162,29,44,47,54,190,122,252,205,188,220,249,48,189,255,5,199,228,142,23,98,248,77,160,86,121],[130,231,246,186,83,132,10,163,52,255,60,163,106,161,55,234,221,182,149,179,120,25,118,30,85,47,119,46,127,193,234,94]],[[131,225,110,169,7,51,62,131,255,203,28,159,177,163,180,201,225,7,151,255,248,35,143,206,64,253,46,94,219,22,67,45],[186,56,2,247,129,67,131,163,32,79,1,59,138,4,56,49,198,15,200,223,215,250,47,136,63,252,12,118,196,166,69,114]],[[187,12,188,106,164,151,23,147,45,111,222,114,16,28,8,44,15,128,50,104,39,212,171,221,197,88,97,19,109,17,30,77],[26,185,201,16,251,30,78,244,132,75,138,94,123,75,232,67,140,143,0,181,84,19,197,92,182,53,78,157,228,91,65,109]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[21,125,18,72,130,20,66,205,50,212,75,193,114,97,42,140,236,226,248,36,69,148,227,190,221,103,168,119,90,174,91,75],[203,119,154,32,222,184,35,217,160,15,140,123,165,203,174,182,236,66,103,14,88,164,117,152,33,113,132,179,224,118,148,115]],[[223,252,105,40,35,63,91,248,59,36,55,243,29,213,34,107,208,152,168,108,207,255,6,225,19,223,185,193,12,169,191,51],[217,129,218,178,79,130,157,67,129,9,241,210,1,239,172,244,45,125,1,9,241,255,165,159,229,202,39,99,219,32,177,83]],[[103,2,232,173,169,52,212,240,21,129,170,199,77,135,148,234,117,231,76,148,4,14,105,135,231,81,145,16,3,199,190,86],[50,251,134,236,51,107,46,81,43,200,250,108,112,71,126,206,5,12,113,243,180,86,166,220,204,120,7,117,208,221,178,106]],[[198,239,185,192,43,34,8,30,113,112,179,53,156,122,1,146,68,154,246,176,88,149,193,155,2,237,45,124,52,41,73,68],[69,98,29,46,255,42,28,33,164,37,123,13,140,21,57,252,143,124,165,125,30,37,163,69,214,171,189,203,197,94,120,119]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[208,211,66,237,29,0,60,21,44,156,119,129,210,115,209,6,213,196,127,148,187,146,45,44,75,69,75,233,42,137,107,43],[210,12,136,197,72,77,234,13,74,201,82,106,97,121,233,118,243,133,82,92,27,44,225,214,196,15,24,14,78,246,28,127]],[[180,4,46,66,203,31,43,17,81,123,8,172,170,62,158,82,96,183,194,97,87,140,132,213,24,166,25,252,183,117,145,27],[232,104,202,68,200,56,56,204,83,10,50,53,204,82,203,14,247,197,231,236,61,133,204,88,226,23,71,255,159,165,48,23]],[[227,174,200,193,113,117,49,0,55,65,92,14,57,218,115,160,199,151,54,108,91,242,238,100,10,61,137,30,29,73,140,55],[76,230,176,193,165,42,130,9,8,173,121,156,86,246,249,193,215,124,57,127,147,202,17,85,191,7,27,130,41,105,149,92]],[[135,238,166,86,158,194,154,86,36,66,133,77,152,49,30,96,77,135,133,4,174,70,18,249,142,127,228,127,246,28,55,1],[115,76,182,197,196,233,108,133,72,74,90,172,217,31,67,248,98,91,238,152,42,51,142,121,206,97,6,53,216,215,202,113]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[114,211,174,166,202,143,205,204,120,142,25,77,167,210,39,233,164,60,22,91,132,128,249,208,204,106,30,202,30,103,189,99],[123,110,42,210,135,72,255,161,202,233,21,133,220,219,44,57,18,145,169,32,170,79,41,244,21,122,210,245,50,204,96,4]],[[229,16,71,59,250,144,252,48,181,234,111,86,143,251,14,167,59,200,178,255,2,122,51,148,147,42,3,224,150,58,108,15],[90,99,103,225,155,71,120,159,56,121,172,151,102,29,94,81,238,36,66,232,88,75,138,3,117,134,55,134,226,151,78,61]],[[63,117,142,180,255,216,221,214,55,87,157,109,59,189,213,96,136,101,154,185,74,104,132,162,103,221,23,37,151,4,139,94],[187,64,94,188,22,146,5,196,192,78,114,144,14,171,207,138,237,239,185,45,59,248,67,91,186,45,235,47,82,210,209,90]],[[64,180,171,230,173,159,70,105,74,179,142,170,234,156,138,32,22,93,140,19,189,246,29,197,36,189,144,42,28,199,19,59],[84,220,22,13,24,190,53,100,97,82,2,128,175,5,247,166,66,211,143,46,121,38,168,187,178,23,72,178,122,10,137,20]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[32,168,136,227,145,192,110,187,138,39,130,81,131,178,40,169,131,235,166,169,77,23,89,34,84,0,80,69,203,72,75,24],[51,124,231,38,186,77,50,254,83,244,250,131,227,165,121,102,115,239,128,35,104,194,96,221,169,51,220,3,122,224,224,62]],[[52,92,19,251,192,227,120,43,84,88,34,155,118,129,127,147,156,37,60,210,233,150,33,38,8,245,237,149,17,174,4,90],[185,232,197,18,151,31,131,254,62,148,153,212,45,249,82,89,92,130,166,240,117,126,232,236,204,172,24,33,9,103,102,103]],[[179,64,41,209,203,27,8,158,156,183,83,185,59,113,8,149,18,26,88,175,126,130,82,67,79,17,57,244,147,26,38,5],[110,68,163,249,100,175,231,109,125,223,30,172,4,234,59,95,155,232,36,157,14,229,46,62,223,169,247,212,80,113,240,120]],[[62,168,56,194,87,86,66,154,177,226,248,69,170,17,72,95,23,196,84,39,220,93,170,221,65,188,223,129,185,83,238,82],[195,241,167,109,179,95,146,111,204,145,184,149,5,223,60,100,87,57,97,81,173,140,56,123,200,222,0,52,190,161,176,126]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[37,36,29,138,103,32,238,66,235,56,237,11,139,205,70,157,94,107,30,36,157,18,5,26,204,5,78,146,56,225,31,80],[78,238,28,145,230,17,189,142,85,26,24,117,102,175,77,123,15,174,109,133,202,130,88,33,156,24,224,237,236,34,128,47]],[[104,59,10,57,29,106,21,87,252,240,99,84,219,57,219,232,92,100,255,160,9,79,59,183,50,96,153,148,253,148,130,45],[36,246,90,68,241,85,44,219,234,124,132,124,1,172,227,253,201,39,193,90,185,222,79,90,144,221,198,103,170,111,138,58]],[[120,82,135,201,151,99,177,221,84,95,193,248,241,6,166,168,163,136,130,212,203,166,25,221,209,17,135,8,23,76,55,42],[161,12,243,8,67,217,36,30,131,167,223,145,202,189,105,71,141,27,226,185,78,181,225,118,179,28,147,3,206,95,179,90]],[[29,218,228,97,3,80,169,139,104,24,239,178,28,132,59,162,68,149,163,4,59,214,153,0,175,118,66,103,2,125,133,86],[206,114,14,41,132,178,125,210,69,190,87,6,237,127,207,237,205,239,25,214,188,21,121,100,210,24,227,32,103,58,84,11]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[82,253,4,197,251,153,231,232,251,140,225,66,3,239,157,217,158,77,247,128,207,46,204,155,69,201,123,122,188,55,168,82],[150,17,65,138,71,145,254,182,218,122,84,99,209,20,53,5,134,140,169,54,63,242,133,84,78,146,216,133,1,70,214,80]],[[83,205,243,134,64,230,57,66,149,214,203,69,26,32,200,69,75,50,105,4,177,175,32,70,199,107,35,91,105,238,48,63],[112,131,71,192,219,85,8,168,123,24,109,245,4,90,32,12,74,140,96,174,174,15,100,85,85,46,213,29,83,49,66,65]],[[202,252,136,107,150,120,10,139,131,220,188,175,64,182,141,127,239,180,209,63,204,162,116,201,194,146,85,0,171,219,191,79],[147,28,6,45,102,101,2,164,151,24,253,0,231,171,3,236,206,193,191,55,248,19,83,165,229,12,58,168,85,185,255,104]],[[228,230,109,48,125,48,53,194,120,135,249,252,107,90,195,183,101,216,46,199,165,12,198,220,18,170,214,79,197,56,188,14],[226,60,118,134,56,242,123,44,22,120,141,245,164,21,218,219,38,133,160,86,221,29,227,179,253,64,239,242,217,161,179,4]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[219,73,14,230,88,16,122,82,218,181,125,55,106,62,161,120,206,199,28,36,35,219,125,251,140,141,220,48,103,105,117,59],[169,234,109,22,22,96,244,96,135,25,68,140,74,139,62,251,22,0,0,84,166,158,159,239,207,217,210,76,116,49,208,52]],[[164,235,4,164,140,143,113,39,149,133,93,85,75,177,38,38,200,174,106,125,162,33,202,206,56,171,15,208,213,43,107,0],[229,103,12,241,58,154,234,9,57,239,209,48,188,51,186,177,106,197,39,8,127,84,128,61,171,246,21,122,194,64,115,114]],[[132,86,130,182,18,112,127,247,240,189,91,169,213,197,95,89,191,127,179,85,34,2,201,68,85,135,143,150,152,100,109,21],[176,139,170,30,236,199,165,143,31,146,4,198,5,246,223,161,204,31,129,245,14,156,87,220,227,187,6,135,30,254,35,108]],[[216,43,91,22,234,32,241,211,104,143,174,91,208,169,26,25,168,54,251,43,87,136,125,144,213,166,243,220,56,137,78,31],[204,25,218,155,59,67,72,33,46,35,77,61,174,248,140,252,221,166,116,55,101,202,238,26,25,142,159,100,111,12,139,90]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[37,185,194,240,114,184,21,22,204,141,60,111,37,237,244,70,46,12,96,15,226,132,52,85,137,89,52,27,245,141,254,8],[248,171,147,188,68,186,27,117,75,73,111,208,84,46,99,186,181,234,237,50,20,201,148,216,197,206,244,16,104,224,56,39]],[[116,28,20,155,212,100,97,113,90,182,33,51,79,247,142,186,165,72,154,199,250,154,240,180,98,173,242,94,204,3,36,26],[245,118,253,228,175,185,3,89,206,99,210,59,31,205,33,12,173,68,165,151,172,128,17,2,155,12,229,139,205,251,121,119]],[[21,190,154,13,186,56,114,32,138,245,190,89,147,121,183,246,106,12,56,39,26,96,244,134,59,171,90,0,160,206,33,125],[108,186,20,197,234,18,158,46,130,99,206,155,74,231,29,236,241,46,81,28,244,208,105,21,66,157,163,63,14,191,233,92]],[[228,13,244,189,238,49,16,237,203,18,134,173,212,47,144,55,50,195,11,115,236,151,133,164,1,28,118,53,254,117,221,113],[17,164,136,159,62,83,105,59,27,224,247,186,155,173,78,129,95,181,92,174,190,103,134,55,52,142,7,50,69,74,103,57]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[144,112,88,32,3,30,103,178,200,155,88,197,177,235,45,74,222,130,140,242,210,20,184,112,97,78,115,214,11,107,13,48],[129,252,85,92,191,167,196,189,226,240,75,143,233,125,153,250,211,171,188,199,131,43,4,127,12,25,67,3,61,7,202,64]],[[249,200,190,140,22,129,57,150,246,23,88,200,48,88,251,194,3,69,210,82,118,224,106,38,40,92,136,89,106,90,84,66],[7,181,46,44,103,21,155,251,131,105,30,15,218,214,41,177,96,224,178,186,105,162,158,189,189,224,28,189,205,6,100,112]],[[65,250,140,225,137,143,39,200,37,143,111,95,85,248,222,149,109,47,117,22,43,78,68,253,134,110,233,112,57,118,151,126],[23,98,107,20,161,124,208,121,110,216,138,165,109,140,147,210,63,236,68,141,110,145,1,140,143,238,1,143,192,180,133,14]],[[2,58,112,65,228,17,87,35,172,230,252,84,126,205,215,34,203,118,159,32,206,160,115,118,81,59,164,248,227,98,18,108],[127,0,156,38,13,111,72,127,58,1,237,197,150,176,31,79,168,2,98,39,138,80,141,154,139,82,15,30,207,65,56,25]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[245,108,212,47,15,105,15,135,63,97,101,30,53,52,133,186,2,48,172,37,61,226,98,241,204,233,27,194,239,106,66,87],[52,31,46,172,209,199,4,82,50,102,178,51,115,33,52,84,247,113,237,6,176,255,166,89,111,138,78,251,2,176,69,107]],[[245,72,11,3,197,34,125,128,8,83,254,50,177,161,138,116,111,189,63,133,244,207,245,96,175,65,126,62,70,163,90,32],[170,53,135,68,99,102,151,248,110,85,12,4,62,53,80,191,147,105,210,139,5,85,153,190,226,83,97,236,232,8,11,50]],[[179,16,69,2,105,89,46,151,217,100,248,219,37,128,220,196,213,98,60,237,101,145,173,209,87,129,148,170,161,41,252,104],[221,181,125,171,90,33,65,83,187,23,121,13,209,168,12,12,32,136,9,233,132,232,37,17,103,122,139,26,228,93,225,93]],[[55,234,254,101,59,37,232,225,194,197,2,164,190,152,10,43,97,193,155,226,213,146,230,158,125,31,202,67,136,139,44,89],[224,181,0,29,42,111,175,121,134,47,166,90,147,209,254,174,58,238,219,124,97,190,124,1,249,254,82,220,216,82,163,66]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[34,175,19,55,189,55,113,172,4,70,99,172,164,119,237,37,56,224,21,168,100,0,13,206,81,1,169,188,15,3,28,4],[137,249,128,7,207,63,179,233,231,69,68,61,42,124,233,228,22,92,94,101,28,199,125,198,122,251,67,238,37,118,70,114]],[[2,162,237,244,143,107,11,62,235,53,26,213,126,219,120,0,150,138,160,180,207,96,75,212,213,249,45,191,136,189,34,98],[19,83,228,130,87,250,30,143,6,43,144,186,8,182,16,84,79,124,27,38,237,218,107,221,37,208,78,234,66,187,37,3]],[[81,22,80,124,213,93,246,153,232,119,114,78,250,98,203,118,117,12,226,113,152,146,213,250,69,223,92,111,30,158,40,105],[13,172,102,109,195,139,186,22,181,226,160,13,12,189,164,142,24,108,242,220,249,220,74,134,37,149,20,203,216,26,4,15]],[[151,165,219,139,45,170,66,17,9,242,147,187,217,6,132,78,17,168,160,37,43,166,95,174,196,180,76,200,171,199,59,2],[238,201,41,15,223,17,133,237,206,13,98,44,143,75,249,4,233,6,114,29,55,32,80,201,20,235,236,57,167,151,43,77]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[105,209,57,189,251,51,190,196,240,92,239,240,86,104,252,151,71,200,114,182,83,164,10,152,165,180,55,113,207,102,80,109],[23,164,25,82,17,71,179,92,91,169,46,34,180,0,82,249,87,24,184,190,90,227,171,131,200,135,10,42,216,140,187,84]],[[169,98,147,133,190,232,115,74,14,176,181,45,148,80,170,211,178,234,157,98,118,59,7,52,78,45,112,200,154,21,102,107],[197,150,202,200,34,26,238,95,231,49,96,34,131,8,99,206,185,50,68,88,93,58,155,228,4,213,239,56,239,75,221,25]],[[77,194,23,117,161,104,205,195,198,3,68,227,120,9,145,71,63,15,228,146,88,250,125,31,32,148,88,94,188,25,2,111],[32,214,216,145,84,167,243,32,75,52,6,250,48,200,111,20,16,101,116,19,78,240,105,38,206,207,144,244,208,197,200,100]],[[38,162,80,2,36,114,241,240,78,45,147,213,8,231,174,56,247,24,165,50,52,194,240,166,236,185,97,123,100,153,172,113],[37,207,116,85,27,170,169,56,65,64,213,149,149,171,28,94,188,65,126,20,48,190,19,137,244,229,235,40,192,194,150,58]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[43,119,69,236,103,118,50,76,185,223,37,50,107,203,231,20,97,67,238,186,155,113,239,210,72,101,187,27,138,19,27,34],[132,173,12,24,56,90,186,208,152,89,191,55,176,79,151,96,32,179,155,151,246,8,108,164,255,251,183,250,149,178,81,121]],[[40,92,63,219,107,24,59,92,209,4,40,222,133,82,49,181,187,246,169,237,190,40,79,179,126,5,106,219,149,13,27,28],[213,197,195,154,10,208,49,62,7,54,142,192,138,98,177,202,214,14,30,157,239,171,152,77,187,108,5,224,228,93,189,87]],[[204,33,39,206,253,169,148,142,225,171,73,224,70,38,161,168,140,161,153,29,180,39,109,45,200,57,48,94,55,82,196,110],[169,133,244,231,176,21,51,132,27,20,26,2,217,59,173,15,67,108,234,62,15,126,218,221,107,76,127,110,212,107,191,15]],[[71,159,124,86,124,67,145,28,187,78,114,62,100,171,160,160,223,180,216,135,58,189,168,72,201,184,239,46,173,111,132,79],[45,45,240,27,126,42,108,248,169,106,225,240,153,161,103,154,212,19,202,202,186,39,146,170,161,93,80,222,204,64,38,10]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[159,62,242,178,144,206,219,100,62,3,221,55,54,84,112,118,36,181,105,3,252,160,43,116,178,5,14,204,216,31,106,31],[25,94,96,105,88,134,160,49,189,50,233,44,92,210,133,186,64,100,168,116,248,14,28,179,169,105,232,30,64,100,153,119]],[[108,50,79,253,187,92,187,141,100,102,74,113,31,121,163,173,141,249,212,236,207,103,112,250,5,74,15,110,175,135,10,111],[198,54,110,108,140,36,9,96,190,38,210,76,94,23,202,95,29,204,135,232,66,106,203,203,125,146,5,53,129,19,96,107]],[[244,21,205,15,10,175,78,107,81,253,20,196,46,19,134,116,68,203,102,107,182,157,116,86,50,172,141,142,140,140,140,57],[202,89,116,26,17,239,109,247,57,92,59,31,250,227,64,65,35,158,246,209,33,162,191,173,101,66,107,89,138,232,197,127]],[[100,5,122,132,74,19,195,246,176,110,154,107,83,107,50,218,217,116,117,196,186,100,61,59,8,221,16,70,239,199,144,31],[123,47,58,206,200,161,121,60,48,18,68,40,246,188,255,253,244,192,151,176,204,195,19,122,185,154,22,228,203,76,52,99]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[7,78,211,45,9,51,14,210,13,190,62,231,228,170,183,0,139,232,173,170,122,141,52,40,169,129,148,197,231,66,172,71],[36,137,122,143,181,155,240,194,3,100,208,30,245,164,178,243,116,233,26,22,253,203,21,234,235,16,108,53,209,193,166,40]],[[204,213,57,252,165,164,173,50,21,206,25,232,52,43,28,96,145,252,5,169,179,220,128,41,196,32,121,6,57,192,226,34],[187,168,225,137,112,87,24,84,60,246,13,130,18,5,135,150,6,57,227,248,179,149,229,215,38,191,9,90,148,249,28,99]],[[43,140,45,154,139,132,242,86,251,173,46,127,183,252,48,225,53,137,186,77,168,109,206,140,139,48,224,218,41,24,17,23],[25,166,90,101,147,195,181,49,34,79,243,246,15,235,40,195,124,235,206,134,236,103,118,110,53,69,123,216,107,146,1,101]],[[61,213,154,100,115,54,177,214,134,152,66,63,138,241,199,245,66,168,156,82,168,220,249,36,63,74,161,164,91,232,98,26],[197,189,200,20,213,13,235,225,165,230,131,17,9,0,29,85,131,81,126,117,0,129,185,203,216,197,229,161,217,23,109,31]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[234,249,228,233,225,82,63,81,25,13,221,217,157,147,49,135,35,9,213,131,235,146,9,118,110,227,248,192,162,102,181,54],[58,187,57,237,50,2,231,67,122,56,20,132,227,68,210,94,148,221,120,137,85,76,115,158,225,228,62,67,208,74,222,27]],[[178,231,143,227,163,197,203,114,238,121,65,248,223,238,101,197,69,119,39,60,189,88,211,117,226,4,75,187,101,243,200,15],[36,123,147,52,181,226,116,72,205,160,11,146,151,102,57,244,176,226,93,57,106,91,69,23,120,30,219,145,129,28,249,22]],[[22,223,209,90,213,233,78,88,149,147,95,81,9,195,42,201,212,85,72,121,164,163,178,195,98,170,140,232,173,71,57,27],[70,218,158,81,58,230,209,166,187,77,123,8,190,140,213,243,63,253,247,68,128,45,83,75,208,135,104,193,181,216,247,7]],[[244,16,70,190,183,210,209,206,94,118,162,215,3,220,228,129,90,246,60,222,174,122,157,33,52,165,246,169,115,226,141,96],[250,68,113,246,65,216,198,88,19,55,235,132,15,150,199,220,200,169,122,131,178,47,49,177,26,216,152,63,17,208,49,59]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[129,213,52,22,1,163,147,234,82,148,236,147,183,129,17,45,88,249,181,10,170,79,246,46,63,54,191,51,90,231,209,8],[26,207,66,174,204,181,119,57,196,91,91,208,38,89,39,208,85,113,18,157,136,61,156,234,65,106,240,80,147,147,221,71]],[[111,201,81,109,28,170,245,165,144,63,20,226,110,142,100,253,172,224,78,34,229,193,188,41,10,106,158,161,96,203,47,11],[220,57,50,243,161,68,233,197,195,120,251,149,71,52,53,52,232,37,222,147,198,180,118,109,134,19,198,233,104,181,1,99]],[[31,154,82,100,151,217,28,8,81,111,38,157,170,147,51,67,250,119,233,98,155,93,24,117,235,120,247,135,143,65,180,77],[19,168,130,62,233,19,173,235,1,202,207,218,205,247,108,199,122,220,30,110,200,78,85,98,128,234,120,12,134,185,64,81]],[[39,174,211,13,76,143,52,234,125,60,229,138,207,91,146,216,48,22,180,163,117,255,235,39,200,92,108,194,238,108,33,11],[195,186,18,83,42,170,119,173,25,120,85,138,46,96,135,194,110,145,56,145,63,122,197,36,143,81,197,222,176,83,48,86]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[2,254,84,18,24,202,125,165,104,67,163,109,20,42,106,165,142,50,231,99,79,227,198,68,62,171,99,202,23,134,116,63],[30,100,193,125,82,220,19,90,161,156,78,238,153,40,187,76,238,172,169,27,137,162,56,57,123,196,15,66,230,137,237,15]],[[243,60,140,128,131,16,138,55,80,156,180,223,63,140,247,35,7,214,255,160,130,108,117,59,228,181,187,228,230,80,240,8],[98,238,117,72,146,51,242,244,173,21,122,161,1,70,169,50,6,136,182,54,71,53,185,180,66,133,118,240,72,0,144,56]],[[81,21,157,195,149,209,57,187,100,157,21,129,193,104,208,182,164,44,125,94,2,57,0,224,59,164,204,202,29,129,36,16],[231,41,249,55,217,70,90,205,112,254,77,91,191,165,207,145,244,239,238,138,41,208,231,196,37,146,138,255,54,252,228,73]],[[189,0,185,4,125,53,252,235,208,11,5,50,82,122,137,36,117,80,225,99,2,130,142,231,133,12,242,86,68,55,131,37],[143,161,206,203,96,218,18,2,30,41,57,42,3,183,235,119,64,234,201,43,44,213,125,126,44,199,90,253,255,196,209,98]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[29,136,152,91,78,252,65,36,5,230,80,43,174,150,81,217,107,114,178,51,66,152,104,187,16,90,122,140,157,7,180,5],[47,97,159,215,168,63,131,140,16,105,144,230,207,210,99,163,228,84,126,229,105,19,28,144,87,170,233,83,34,67,41,35]],[[229,28,248,10,253,45,126,245,245,112,125,65,107,17,254,190,153,209,85,41,49,191,192,151,108,213,53,204,94,139,217,105],[142,78,159,37,248,129,84,45,14,213,84,129,155,166,146,206,75,233,143,36,59,202,224,68,171,54,254,251,135,212,38,62]],[[15,147,156,17,231,219,241,240,133,67,40,21,55,221,222,39,223,173,62,73,79,224,91,246,128,89,21,60,133,183,62,18],[245,255,204,240,180,18,3,95,201,132,203,29,23,224,188,204,3,98,169,139,148,166,170,24,203,39,141,73,166,23,21,7]],[[217,182,212,157,212,106,175,112,7,44,16,158,189,17,173,228,38,51,112,146,120,28,116,159,117,96,86,244,57,168,168,98],[59,191,85,53,97,139,68,151,232,58,85,193,200,59,253,149,41,17,96,150,30,203,17,157,194,3,138,27,198,214,69,61]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[126,14,80,178,204,13,107,166,113,91,66,237,189,175,172,240,252,18,162,63,78,218,232,17,243,35,225,4,98,3,28,78],[200,177,27,111,115,97,61,39,13,125,122,37,95,115,14,47,147,246,36,216,79,144,172,162,98,10,240,97,217,8,89,106]],[[111,45,85,248,47,142,240,24,59,234,221,38,114,209,245,254,229,184,230,211,16,72,70,73,58,159,94,69,107,144,232,127],[211,118,105,51,123,185,64,112,238,166,41,107,221,208,93,141,193,62,74,234,55,177,3,2,3,53,241,40,157,255,0,19]],[[122,219,18,210,138,130,3,27,30,175,249,75,156,190,174,124,228,148,42,35,179,98,134,231,253,35,170,153,189,43,17,108],[141,166,213,172,157,204,104,117,127,195,77,75,221,108,187,17,90,96,229,189,125,39,139,218,180,149,246,3,39,164,146,63]],[[34,214,181,23,132,191,18,204,35,20,74,223,20,49,188,161,172,110,171,250,87,17,83,179,39,230,249,71,51,68,52,30],[121,252,166,180,11,53,32,201,77,34,132,196,169,32,236,137,148,186,102,86,72,185,135,127,202,30,6,237,165,85,89,41]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[86,225,245,241,213,171,168,43,174,137,243,207,86,159,242,75,49,188,24,169,6,91,190,180,97,248,178,6,156,129,171,76],[31,104,118,1,22,56,43,15,119,151,146,103,78,134,106,139,229,232,12,247,54,57,181,51,230,207,94,189,24,251,16,31]],[[131,240,13,99,239,83,107,181,107,249,131,207,222,4,34,155,44,10,224,165,216,199,156,165,163,246,111,207,144,107,104,124],[51,21,215,127,26,213,33,88,196,24,165,240,204,115,168,253,250,24,209,3,145,141,82,210,163,164,211,177,234,29,15,0]],[[204,72,131,144,229,253,63,132,170,249,139,130,89,36,52,104,79,28,35,217,204,113,225,127,140,175,241,238,0,182,160,119],[245,26,97,247,55,157,0,244,242,105,111,75,1,133,25,69,77,127,2,124,106,5,71,108,31,129,32,212,232,80,39,114]],[[44,58,229,173,244,221,45,247,92,68,181,91,33,163,137,95,150,69,202,77,164,33,153,112,218,196,196,160,229,244,236,10],[7,104,33,101,233,8,160,11,106,74,186,181,128,175,208,27,197,245,75,115,80,96,45,113,105,97,14,192,32,64,48,25]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[208,117,87,59,235,92,20,86,80,201,79,184,184,30,163,244,171,245,169,32,21,148,130,218,150,28,155,89,140,255,244,81],[193,58,134,215,176,6,132,127,27,189,212,7,120,128,46,177,180,238,82,56,238,154,249,246,243,65,110,212,136,149,172,53]],[[65,151,191,113,106,155,114,236,243,248,107,230,14,108,105,165,47,104,82,216,97,129,192,99,63,166,60,19,144,230,141,86],[232,57,48,119,35,177,253,27,61,62,116,77,127,174,91,58,180,101,14,58,67,220,220,65,71,230,232,146,9,34,72,76]],[[133,87,159,181,200,6,178,159,71,63,240,250,230,169,177,155,111,150,125,249,164,101,9,117,50,166,108,127,71,75,47,79],[52,233,89,147,157,38,128,84,242,204,60,194,37,133,227,106,193,98,4,167,8,50,109,161,57,132,138,59,135,95,17,19]],[[218,3,52,102,196,12,115,110,188,36,181,249,112,129,82,233,244,124,35,221,159,184,70,239,29,34,85,125,113,196,66,51],[197,55,105,91,168,198,157,164,252,97,110,104,70,234,215,28,103,210,125,250,241,204,84,141,54,53,201,0,223,108,103,80]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[154,77,66,41,93,164,107,111,168,138,77,145,123,210,223,54,239,1,34,197,204,141,235,88,61,179,80,252,139,151,150,51],[147,51,7,200,74,202,208,177,171,189,221,167,124,172,62,69,203,204,7,145,191,53,157,203,125,18,60,17,89,19,207,92]],[[69,184,65,215,171,7,21,0,142,206,223,178,67,92,1,220,244,1,81,149,16,90,246,36,36,160,25,58,9,42,170,63],[220,142,235,198,191,221,17,123,231,71,230,206,231,182,197,232,138,220,75,87,21,59,102,202,137,163,253,172,13,225,29,122]],[[137,239,191,3,117,208,41,80,203,125,214,190,173,95,123,0,50,170,152,237,63,143,146,203,129,86,1,99,100,163,56,57],[139,164,214,80,180,170,93,100,100,118,46,161,166,179,184,124,122,86,245,92,78,132,92,251,221,202,72,139,72,185,186,52]],[[197,227,232,174,23,39,227,100,96,113,71,41,2,15,146,93,16,147,200,14,161,237,186,169,150,28,197,118,48,205,249,48],[149,176,189,140,188,167,79,126,253,78,58,191,95,4,121,128,43,90,159,79,104,33,25,113,198,32,1,66,170,223,174,44]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[144,110,126,75,113,147,192,114,237,235,113,36,151,38,156,254,203,62,89,25,168,15,117,125,190,24,230,150,30,149,112,96],[137,102,62,29,76,95,254,192,4,67,214,68,25,181,173,199,34,220,113,40,100,222,65,56,39,143,44,107,8,184,184,123]],[[61,112,39,157,217,175,177,39,175,227,93,30,58,48,84,97,96,232,195,38,58,188,126,245,129,221,100,1,4,235,192,30],[218,44,164,209,161,195,92,110,50,7,31,184,14,25,158,153,41,51,154,174,122,237,104,66,105,124,7,179,56,44,246,61]],[[100,170,181,136,121,101,56,140,148,214,98,55,125,100,205,58,235,255,232,129,9,199,106,80,9,13,40,3,13,154,147,10],[66,163,241,197,180,15,216,200,141,21,49,189,248,7,139,205,8,138,251,24,7,254,142,82,134,239,190,236,73,82,153,8]],[[15,169,213,1,170,72,79,40,102,50,26,186,124,234,17,128,23,24,155,86,136,37,6,105,18,44,234,86,105,65,36,25],[222,33,240,218,138,251,177,184,205,200,106,130,25,115,219,199,207,136,235,150,238,111,251,6,210,205,125,123,18,40,142,12]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[147,68,151,206,40,255,58,64,196,245,246,155,244,107,7,132,251,152,216,236,140,3,87,236,73,237,99,182,170,255,152,40],[61,22,53,243,70,188,179,244,198,182,79,250,244,160,19,230,87,69,147,185,188,214,89,231,119,148,108,171,150,59,79,9]],[[90,247,107,1,18,79,81,193,112,132,148,71,178,1,108,113,215,204,23,102,15,89,93,93,16,1,87,17,245,221,226,52],[38,217,31,92,88,172,139,3,210,195,133,15,58,195,127,109,142,134,205,82,116,143,85,119,23,183,142,183,136,234,218,27]],[[182,234,14,64,147,32,121,53,106,97,132,90,7,109,249,119,111,237,105,28,13,37,118,204,240,219,187,197,173,226,38,87],[207,232,14,107,150,125,237,39,209,60,169,217,80,169,152,132,94,134,239,214,240,248,14,137,5,47,217,95,21,95,115,121]],[[200,92,22,254,237,159,38,86,246,75,159,167,10,133,254,165,140,135,221,152,206,78,195,88,85,178,123,61,216,107,181,76],[101,56,160,21,250,167,180,143,235,196,134,155,48,165,94,77,234,138,154,159,26,216,91,83,20,25,37,99,180,111,31,93]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[172,143,188,30,125,139,90,11,141,175,118,46,113,227,59,111,83,47,62,144,149,212,53,20,79,140,60,206,87,28,118,73],[168,80,225,97,107,87,53,235,68,11,12,110,249,37,128,116,242,143,111,122,62,127,45,243,78,9,101,16,94,3,37,50]],[[169,96,220,15,100,229,29,226,141,79,121,47,14,36,2,0,5,119,67,37,61,106,199,183,191,4,8,101,244,57,75,101],[150,25,18,107,106,183,227,220,69,155,219,180,168,174,220,168,20,68,101,98,206,52,154,132,24,18,1,241,226,123,206,80]],[[65,33,48,83,27,71,1,183,24,216,130,87,189,163,96,240,50,246,91,240,48,136,145,89,253,144,162,185,85,147,33,52],[151,103,158,235,106,249,110,214,115,232,107,41,236,99,130,0,168,153,28,29,48,200,144,82,144,182,106,128,78,255,75,81]],[[15,125,99,140,110,92,222,48,223,101,250,46,176,163,37,5,84,189,37,186,6,174,223,139,217,27,234,56,179,5,22,9],[199,140,191,100,40,173,248,165,90,111,201,186,213,127,213,214,189,102,47,61,170,84,246,186,50,34,154,30,82,5,244,29]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[170,31,187,235,254,228,135,252,177,44,183,136,244,198,185,245,36,70,242,165,159,143,138,147,112,105,212,86,236,253,6,70],[78,102,207,78,52,206,12,217,166,80,214,94,149,175,233,88,250,238,155,184,165,15,53,224,67,130,109,101,230,217,0,15]],[[123,117,58,252,100,211,41,126,221,73,154,89,83,191,180,167,82,179,5,171,195,175,22,26,133,66,50,162,134,250,57,67],[14,75,163,99,138,254,165,88,241,19,189,157,170,127,118,64,112,129,16,117,153,187,190,11,22,233,186,98,52,204,7,109]],[[195,241,198,147,101,238,11,188,234,20,240,193,248,132,137,194,201,215,234,52,202,167,196,153,213,80,105,203,214,33,99,124],[153,235,124,49,115,100,103,127,12,102,170,140,105,145,226,38,211,35,226,118,93,50,82,223,93,197,143,183,124,132,179,112]],[[235,1,199,54,151,78,182,171,95,13,44,186,103,100,85,222,188,255,166,236,4,211,141,57,86,94,238,248,228,46,51,98],[101,239,184,159,200,75,167,253,33,73,155,146,53,130,214,10,155,242,121,241,71,47,106,126,159,207,24,2,60,251,27,62]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[47,139,200,64,81,209,172,26,11,228,169,162,66,33,25,47,123,151,191,247,87,109,63,61,79,15,226,178,129,0,158,123],[140,133,43,196,252,241,171,232,121,34,196,132,23,58,250,134,166,125,249,243,111,3,87,32,77,121,249,110,113,84,56,9]],[[64,41,116,168,47,94,249,121,164,243,62,185,253,51,49,172,154,105,136,30,119,33,45,243,145,82,38,21,178,166,207,126],[198,32,71,108,164,125,203,99,234,91,3,223,62,136,129,109,206,7,66,24,96,126,123,85,254,106,243,218,92,139,149,16]],[[98,228,13,3,180,215,205,250,189,70,223,147,113,16,44,168,59,182,9,5,112,132,67,41,168,89,245,142,16,228,215,32],[87,130,28,171,191,98,112,232,196,207,240,40,110,22,60,8,120,137,133,70,15,246,127,207,203,126,184,37,233,90,250,3]],[[251,149,146,99,80,252,98,240,164,94,140,24,194,23,36,183,120,194,169,231,106,50,214,41,133,175,203,141,145,19,218,107],[54,10,194,182,75,165,93,7,23,65,49,95,98,70,248,146,249,102,72,115,166,151,13,125,136,238,98,177,3,168,63,44]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[74,177,112,138,169,232,99,121,0,226,37,22,202,75,15,164,102,173,25,159,136,103,12,139,194,74,91,43,109,149,175,25],[139,157,182,204,96,180,114,79,23,105,90,74,104,52,171,161,69,50,60,131,135,114,48,84,119,104,174,251,181,139,34,94]],[[241,185,135,53,197,187,185,207,245,214,205,213,12,124,14,230,144,52,251,81,66,30,109,172,154,70,196,151,41,50,191,69],[102,158,198,36,192,237,165,93,136,212,240,115,151,123,234,127,66,255,33,160,155,47,154,253,83,87,7,132,72,136,157,82]],[[198,150,72,52,42,6,175,148,61,244,26,207,242,192,33,194,66,94,200,47,53,162,62,41,250,12,132,229,137,114,124,6],[50,101,3,229,137,166,110,179,91,142,202,235,254,34,86,139,93,20,75,77,249,190,181,245,230,92,123,139,244,19,17,52]],[[7,198,34,21,226,156,96,162,25,217,39,174,55,78,166,201,128,166,145,143,18,73,229,0,24,71,209,215,40,34,99,57],[232,226,0,126,242,158,30,153,57,149,4,189,30,103,123,178,38,172,230,170,226,70,213,228,232,134,189,171,124,85,89,111]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[36,100,110,155,53,113,120,206,51,3,33,51,54,241,115,155,185,21,139,44,105,207,77,237,79,77,87,20,19,130,164,77],[101,110,10,164,89,7,23,242,107,74,31,110,246,181,188,98,228,182,218,162,147,188,41,5,210,210,115,70,3,22,64,49]],[[76,115,109,21,189,161,77,92,19,11,36,6,152,120,28,91,235,31,24,84,67,217,85,102,218,41,33,232,184,60,66,34],[180,205,8,111,21,35,26,11,34,237,209,241,167,199,115,69,243,158,206,118,183,246,57,182,142,121,190,233,155,207,125,98]],[[146,91,252,114,253,186,241,253,166,124,149,227,97,63,233,3,212,43,212,32,217,219,77,50,62,245,17,100,227,180,190,50],[134,23,144,231,201,31,16,165,106,45,57,208,59,196,166,233,89,19,218,26,230,160,185,60,80,184,64,124,21,54,90,66]],[[180,11,50,171,220,4,81,85,33,30,11,117,153,137,115,53,58,145,43,254,231,73,234,118,193,249,70,185,83,2,35,4],[252,90,30,29,116,88,149,166,143,123,151,62,23,59,121,45,166,87,239,69,2,11,77,110,158,147,141,47,217,157,219,4]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[192,215,86,151,88,145,222,9,79,159,190,99,176,131,134,67,93,188,224,243,192,117,191,139,142,170,247,139,100,110,176,99],[22,174,139,224,155,36,104,92,68,194,208,8,183,123,98,253,127,216,212,183,80,253,44,27,191,65,149,217,142,216,23,27]],[[134,85,55,142,195,56,72,20,181,151,210,167,84,69,241,53,68,56,158,241,27,182,52,0,60,150,238,41,0,234,44,11],[234,218,153,158,25,131,102,109,233,118,135,80,209,253,60,96,135,198,65,217,142,219,94,222,170,154,211,40,218,149,234,71]],[[208,128,186,25,174,29,169,121,246,63,172,93,111,150,31,42,206,41,178,255,55,241,148,143,12,181,40,186,154,33,246,102],[2,251,84,184,5,243,129,82,105,52,70,157,134,118,143,215,248,106,102,255,230,167,144,247,94,205,106,155,85,252,157,72]],[[189,170,19,230,205,69,74,164,89,10,100,177,152,214,52,19,4,230,151,148,6,203,212,78,187,150,205,209,87,209,227,6],[122,108,69,39,196,147,127,125,124,98,80,56,58,107,181,136,198,217,241,120,25,185,57,147,61,201,224,156,60,206,245,114]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[36,234,35,125,86,44,226,89,14,133,96,4,136,90,116,30,75,239,19,218,76,255,131,69,133,63,8,149,44,32,19,31],[72,95,39,144,92,2,66,173,120,71,92,181,126,8,133,0,250,127,253,253,231,9,17,242,126,27,56,108,53,109,51,102]],[[147,3,54,129,172,228,32,9,53,76,69,178,30,76,20,33,230,233,138,123,141,254,30,198,62,193,53,250,231,112,78,29],[97,46,194,221,149,87,209,171,128,232,99,23,181,72,228,138,17,158,114,190,133,141,81,10,242,159,224,28,169,7,40,123]],[[187,113,20,94,38,140,61,200,233,124,211,214,209,47,7,109,230,223,251,121,214,153,89,150,72,64,15,58,123,178,160,114],[78,59,105,200,67,117,81,108,121,86,228,203,247,166,81,194,44,66,11,212,130,32,28,1,8,102,215,191,4,86,252,2]],[[36,232,183,96,174,71,128,252,229,35,231,194,201,133,230,152,160,41,78,225,132,57,45,149,44,243,69,60,255,175,39,76],[107,166,245,75,17,189,186,91,158,196,164,81,30,190,208,144,58,156,194,38,182,30,241,149,125,200,109,82,230,153,44,95]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[133,224,36,50,180,209,239,252,105,162,191,143,114,44,149,246,228,110,125,144,247,87,129,160,247,218,239,51,7,227,107,120],[54,39,62,198,18,7,171,78,190,105,157,179,190,8,124,42,71,8,253,212,205,14,39,52,91,152,52,47,119,95,58,101]],[[19,170,46,76,240,34,184,108,179,25,77,235,107,208,164,198,156,221,200,91,129,87,137,223,51,169,104,73,128,228,254,33],[0,23,144,48,233,211,96,48,49,194,114,137,122,54,165,189,57,131,133,80,161,93,108,65,29,181,44,7,64,119,11,80]],[[100,52,236,192,158,68,65,175,160,54,5,109,234,48,37,70,53,36,157,134,189,149,241,106,70,215,148,84,249,59,189,93],[119,91,226,55,199,225,124,19,140,159,123,123,42,206,66,163,185,42,153,168,192,216,60,134,176,251,233,118,119,247,245,86]],[[223,179,70,17,110,19,183,40,78,86,221,241,172,173,88,195,248,136,148,94,6,152,161,228,106,251,10,73,93,138,254,119],[70,2,245,165,175,197,117,109,186,69,53,10,254,201,172,34,145,141,33,149,51,3,192,138,22,243,57,224,1,15,83,60]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[52,117,55,31,52,78,169,29,104,103,248,73,152,150,252,76,101,151,247,2,74,82,108,1,189,72,187,27,237,164,226,83],[89,213,155,90,162,144,211,184,55,76,85,130,40,8,15,127,170,129,101,224,12,82,201,163,50,39,100,218,253,52,35,90]],[[181,176,12,77,179,123,35,200,31,138,57,102,230,186,76,16,55,202,156,124,5,158,255,192,248,142,177,143,111,103,24,38],[75,65,19,84,35,26,164,78,169,139,30,75,252,21,36,187,126,203,182,30,27,245,242,200,86,236,50,162,96,91,160,42]],[[164,41,71,134,46,146,79,17,79,243,178,92,213,62,166,185,200,226,51,17,31,1,143,176,155,199,165,255,131,15,30,40],[29,41,122,161,236,142,181,173,234,2,104,96,116,41,28,165,207,200,59,125,139,43,124,173,164,64,23,81,89,124,46,93]],[[10,108,79,188,62,50,231,74,26,19,193,73,56,191,247,194,211,143,107,173,82,247,207,188,39,203,64,103,118,205,109,86],[229,176,39,173,190,155,242,181,99,222,58,35,149,183,10,126,243,158,69,111,25,57,117,143,57,61,15,192,159,241,233,81]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[136,170,20,36,134,148,17,18,62,26,181,204,187,224,156,213,156,109,186,88,114,141,251,34,123,159,124,148,48,179,81,33],[246,116,61,242,175,208,30,3,124,35,107,201,252,37,112,144,220,154,164,251,73,252,61,10,53,56,111,228,126,80,1,42]],[[214,227,150,97,58,253,239,155,31,144,164,36,20,91,200,222,80,177,29,175,232,85,138,135,13,254,170,59,130,44,141,123],[133,12,175,248,131,68,73,217,69,207,247,72,217,83,180,241,101,160,225,195,179,21,237,137,155,79,98,179,87,165,69,28]],[[143,18,234,175,209,31,121,16,11,246,163,123,234,172,139,87,50,98,231,6,18,81,160,59,67,94,164,32,120,49,206,13],[132,124,194,166,145,35,206,189,220,249,206,213,117,48,34,230,249,67,98,13,247,117,157,127,140,255,125,228,114,172,159,28]],[[136,193,153,208,60,28,93,180,239,19,15,144,185,54,47,149,149,198,220,222,10,81,226,141,243,188,81,236,223,177,162,95],[46,104,161,35,125,155,64,105,133,123,66,191,144,75,214,64,47,215,82,82,178,33,222,100,189,136,195,109,165,250,129,63]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[251,253,71,123,138,102,158,121,46,100,130,239,247,33,236,246,216,134,9,49,124,221,3,106,88,160,119,183,155,140,135,31],[85,71,228,168,61,85,33,52,171,29,174,224,244,234,219,197,185,88,191,196,42,137,49,26,244,45,225,202,55,153,71,89]],[[199,202,99,193,73,169,53,69,85,126,218,100,50,7,80,247,50,172,222,117,88,155,17,178,58,31,245,247,121,4,230,8],[70,250,34,75,250,225,254,150,252,103,186,103,151,196,231,27,134,144,95,238,244,91,17,178,205,173,238,194,72,108,43,27]],[[227,57,98,180,79,49,4,201,218,213,115,81,87,197,184,243,163,67,112,228,97,129,132,226,187,191,79,158,164,94,116,6],[41,172,255,39,224,89,190,57,156,13,131,215,16,11,21,183,225,194,44,48,115,128,58,125,93,171,88,107,193,240,244,34]],[[254,127,251,53,125,198,1,35,40,196,2,172,31,66,180,157,252,0,148,165,238,202,218,151,9,65,119,135,93,123,135,120],[245,251,144,45,129,25,158,47,109,133,136,140,64,92,119,65,77,1,25,118,96,232,76,72,228,51,131,50,108,180,65,3]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[255,16,194,9,79,110,244,210,223,126,202,123,28,29,186,163,182,218,103,51,212,135,54,75,17,32,5,166,41,193,135,23],[246,150,202,47,218,56,167,27,252,202,125,254,8,137,226,71,43,106,93,75,250,161,180,222,182,194,49,81,245,224,164,11]],[[92,229,198,4,142,43,87,190,56,133,35,203,183,190,79,169,211,110,18,170,213,178,46,147,41,154,74,136,24,67,245,1],[80,252,219,162,89,33,141,189,126,51,174,47,135,26,208,151,199,13,77,99,1,239,5,132,236,64,221,168,10,79,112,11]],[[65,105,1,103,92,211,138,197,207,63,209,87,209,103,62,1,57,181,203,129,86,150,38,182,194,231,92,251,99,151,88,6],[12,14,243,186,240,229,186,178,87,119,198,32,155,137,36,190,242,156,138,186,105,193,241,176,79,42,5,154,238,16,126,54]],[[63,38,233,64,233,3,173,6,105,145,224,209,137,96,132,121,222,39,109,230,118,189,234,230,174,72,195,103,192,87,205,47],[127,193,220,185,199,188,134,61,85,75,40,122,251,77,199,248,188,103,42,96,77,143,7,11,26,23,191,250,172,167,61,26]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[145,63,237,94,24,120,63,35,44,13,140,68,0,232,251,233,142,214,209,54,88,87,158,174,75,92,11,7,188,107,85,43],[111,77,23,215,225,132,217,120,177,144,253,46,179,181,25,63,27,250,192,104,179,221,0,46,137,189,126,128,50,19,160,123]],[[26,111,64,175,68,68,176,67,143,13,208,30,196,11,25,93,142,254,193,243,197,92,145,248,4,78,190,144,180,71,92,63],[176,59,44,243,254,50,113,7,63,170,186,69,96,168,141,234,84,203,57,16,180,242,139,210,20,130,66,7,142,233,124,83]],[[176,174,193,141,201,143,185,122,119,239,186,121,160,60,168,245,106,226,63,93,0,227,75,69,36,123,67,120,85,29,43,30],[1,184,214,22,103,160,21,185,225,88,164,167,49,55,119,47,139,18,159,244,63,199,54,102,210,168,86,247,127,116,198,65]],[[93,248,180,168,48,221,204,56,165,211,202,216,209,248,178,49,145,212,114,5,87,74,59,130,74,198,104,32,226,24,65,97],[25,212,141,71,41,18,101,176,17,120,71,181,203,163,165,250,5,133,84,169,51,151,141,43,194,254,153,53,40,229,235,99]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[177,63,63,239,216,244,252,179,160,96,80,6,43,41,82,112,21,11,36,36,248,95,121,24,204,255,137,153,132,161,174,19],[68,31,184,194,1,193,48,25,85,5,96,16,164,108,45,103,112,229,37,27,242,191,221,251,112,43,161,140,156,148,132,8]],[[231,196,67,77,201,43,105,93,29,60,175,187,67,56,78,152,61,237,13,33,3,253,240,153,71,4,176,152,105,85,114,15],[94,223,21,83,59,134,128,176,241,112,104,143,102,124,14,73,26,216,107,254,78,239,202,71,212,3,193,55,80,156,193,22]],[[205,36,198,62,12,130,155,145,43,97,74,178,15,136,85,95,90,87,255,229,116,11,19,67,0,216,107,207,210,21,3,44],[220,255,21,97,47,74,47,98,242,4,47,181,12,183,30,63,116,26,15,215,234,205,217,125,246,18,14,47,219,90,59,22]],[[27,55,71,227,245,158,234,44,42,231,130,54,244,31,129,71,146,75,105,14,17,140,93,83,91,129,39,8,188,160,174,37],[105,50,161,5,17,66,0,210,89,172,77,98,139,19,226,80,93,160,157,155,253,187,18,65,117,65,158,204,220,199,220,93]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[217,227,56,6,70,112,130,94,40,73,121,255,37,210,78,41,141,6,176,35,174,155,102,228,125,192,112,145,163,252,236,78],[98,18,55,106,48,246,30,251,20,92,13,14,183,129,106,231,8,5,172,170,56,70,226,115,234,75,7,129,67,124,158,94]],[[252,249,33,79,46,118,155,31,40,96,119,67,50,157,190,23,48,42,198,24,146,102,98,48,152,64,17,166,127,24,132,40],[63,171,211,244,138,118,161,60,202,45,73,195,234,8,11,133,23,42,195,108,8,253,87,159,61,95,223,103,104,66,0,50]],[[81,96,27,6,79,138,33,186,56,168,186,214,64,246,233,155,118,77,86,33,91,10,155,46,79,61,129,50,8,159,151,91],[229,68,236,6,157,144,121,159,211,224,121,175,143,16,253,221,4,174,39,151,70,51,121,234,184,78,202,90,89,87,225,14]],[[26,218,243,165,65,67,40,252,126,231,113,234,198,59,89,204,46,211,64,236,179,19,111,68,205,19,178,55,242,110,217,28],[227,219,96,205,92,74,24,15,239,115,54,113,140,246,17,180,216,206,23,94,79,38,119,151,95,203,239,145,235,106,98,122]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[24,74,162,151,8,129,45,131,196,204,240,131,126,236,13,149,76,91,251,250,152,128,74,102,86,12,81,179,242,4,93,39],[59,185,184,6,90,46,254,195,130,55,156,163,17,31,156,166,218,99,72,155,173,222,45,166,188,110,50,218,39,101,221,87]],[[132,79,55,49,125,46,188,173,135,7,42,107,55,252,95,235,78,117,53,166,222,171,10,25,58,183,177,239,146,106,59,60],[59,178,148,109,57,96,172,238,231,129,26,59,118,135,92,5,148,42,69,185,128,233,34,177,7,203,64,158,112,73,109,18]],[[253,24,120,132,168,76,125,110,89,166,229,116,241,25,166,132,46,81,193,41,19,242,20,107,93,83,81,247,239,191,1,34],[164,75,98,76,230,253,114,7,242,129,252,242,189,18,124,104,118,42,186,245,101,177,31,23,10,56,176,191,192,248,244,42]],[[85,96,85,91,228,29,113,76,157,91,159,112,166,133,154,44,160,226,50,72,206,158,42,165,7,59,199,108,134,119,222,60],[247,24,122,150,126,67,87,169,85,252,78,182,114,0,242,228,215,82,211,211,182,133,246,113,199,68,63,127,215,179,242,121]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[70,202,167,85,123,121,243,202,90,101,246,237,80,20,123,228,196,42,101,158,226,249,202,167,34,38,83,203,33,91,167,49],[144,215,197,38,8,189,176,83,99,88,195,49,94,117,70,21,145,166,248,47,26,8,101,136,47,152,4,241,124,110,0,119]],[[129,33,97,9,246,78,241,146,238,99,97,115,135,199,84,14,66,75,201,71,209,184,126,145,117,55,153,40,184,221,127,80],[137,143,192,190,93,214,159,160,240,157,129,206,58,123,152,88,187,215,120,200,63,19,241,116,25,223,248,152,137,93,250,95]],[[158,53,133,148,71,31,144,21,38,208,132,237,138,128,247,99,66,134,39,215,244,117,88,220,156,192,34,126,32,53,253,31],[104,14,111,151,186,112,187,163,14,229,11,18,244,162,220,71,248,230,208,35,108,51,168,153,70,110,15,68,186,118,72,15]],[[163,42,97,55,226,89,18,14,39,186,100,67,174,192,66,105,121,164,30,41,139,21,235,248,175,212,162,104,51,181,122,36],[44,25,51,221,27,171,236,1,176,35,248,66,43,6,136,234,61,45,0,42,120,69,77,56,237,46,46,68,73,237,203,51]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[160,104,232,65,143,145,248,17,19,144,46,167,171,48,239,173,160,97,0,136,239,219,206,91,92,187,98,200,86,249,0,115],[63,96,193,130,45,163,40,88,36,158,159,227,112,204,9,78,26,63,17,17,21,7,60,164,65,224,101,163,10,65,109,17]],[[49,64,1,82,86,148,91,40,138,170,82,238,216,10,5,141,205,181,170,46,56,170,183,135,247,43,251,4,203,132,61,84],[32,239,89,222,164,43,147,110,46,236,66,154,212,45,244,70,88,39,43,24,143,131,61,105,158,212,62,182,197,253,88,3]],[[51,137,201,99,98,28,23,180,96,196,38,104,9,195,46,55,15,123,180,156,182,249,251,212,81,120,200,99,234,119,71,7],[50,180,24,71,121,203,212,90,7,20,15,160,213,172,208,65,64,171,97,35,229,42,42,111,247,168,212,118,239,231,69,108]],[[161,94,96,79,251,225,112,106,31,85,79,9,180,149,51,54,198,129,1,24,6,37,39,164,180,36,164,134,3,76,172,2],[119,56,222,215,96,72,7,240,116,168,255,84,229,48,67,255,119,251,33,7,255,178,7,107,228,229,48,252,25,108,163,1]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[19,197,44,172,211,131,130,124,41,247,5,165,0,182,31,134,85,244,214,47,12,153,208,101,155,107,70,13,67,248,22,40],[30,127,180,116,126,177,137,79,24,90,171,100,6,223,69,135,224,106,198,240,14,201,36,53,56,234,48,84,180,196,82,84]],[[233,159,220,63,193,137,68,116,39,228,193,144,255,74,167,60,238,205,244,29,37,148,127,99,22,72,188,100,254,149,196,12],[139,25,117,110,3,6,94,106,111,26,140,227,211,40,242,224,185,122,67,105,230,211,192,254,126,151,171,108,123,142,19,66]],[[212,202,112,61,171,251,95,94,0,12,204,119,34,248,120,85,174,98,53,251,154,198,3,228,12,238,171,199,192,137,135,84],[50,173,174,133,88,67,184,177,230,62,0,156,120,136,86,219,156,252,121,246,249,65,95,183,188,17,249,32,54,28,83,43]],[[90,32,91,161,165,68,145,36,2,99,18,100,184,85,246,222,44,219,71,184,198,10,195,0,120,147,216,245,245,24,40,10],[214,27,154,108,229,70,234,112,150,141,78,42,82,33,38,75,177,187,15,124,169,155,4,187,81,8,241,154,164,118,124,24]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[250,148,247,64,208,215,235,169,130,54,213,21,185,51,122,191,138,242,99,170,55,245,89,172,189,187,50,54,190,115,153,56],[44,179,218,122,216,61,153,202,210,244,218,153,142,79,152,183,244,174,62,159,142,53,96,164,51,117,164,4,147,177,107,77]],[[151,157,168,205,151,123,157,185,231,165,239,253,168,66,107,195,98,100,125,165,27,201,158,210,69,185,238,3,176,191,192,104],[237,183,132,44,246,211,161,107,36,109,135,86,151,89,121,98,159,172,237,243,201,137,33,46,4,179,204,47,190,214,10,75]],[[57,97,5,237,37,137,139,93,27,203,12,85,244,106,0,138,70,232,30,198,131,200,90,118,219,204,25,122,204,103,70,11],[83,207,194,161,173,106,243,205,143,201,222,28,248,108,143,248,118,66,231,254,178,114,33,10,102,116,143,183,235,228,111,1]],[[34,140,107,190,252,77,112,98,110,82,119,153,136,126,123,87,122,13,254,220,114,146,241,104,29,151,215,124,141,83,16,55],[83,136,119,2,202,39,168,229,69,226,168,72,42,171,24,202,234,45,42,84,23,55,50,9,220,224,74,183,125,130,16,125]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[138,100,30,20,10,87,212,218,92,150,155,1,76,103,191,139,48,254,8,219,13,213,168,215,9,17,133,162,211,69,251,126],[218,140,194,208,172,24,232,82,54,212,33,163,221,87,34,121,183,248,113,157,198,145,112,134,86,191,161,17,139,25,225,15]],[[24,50,152,44,143,145,174,18,240,140,234,243,60,185,93,228,105,237,178,71,24,189,206,22,82,92,35,226,165,37,82,93],[185,177,231,93,78,188,238,187,64,129,119,130,25,171,181,198,238,171,91,107,99,146,138,52,141,205,238,79,73,229,201,126]],[[33,172,139,34,205,195,154,233,94,120,189,222,186,173,171,191,117,65,9,197,88,164,125,146,176,127,242,161,209,192,179,109],[98,79,208,117,119,186,118,119,215,184,216,146,111,152,52,61,214,78,28,15,240,143,46,241,179,189,177,185,236,153,180,7]],[[96,87,46,154,114,29,107,110,88,51,36,140,72,57,70,142,137,106,136,81,35,98,181,50,9,54,227,87,245,152,222,111],[139,44,0,72,74,249,91,135,105,82,229,91,209,177,229,37,37,224,156,194,19,68,232,185,10,112,173,189,15,81,148,105]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[162,220,171,169,37,45,172,95,3,51,8,231,126,254,149,54,60,91,58,211,5,130,28,149,45,216,119,126,2,217,91,112],[194,254,27,12,103,205,214,224,81,142,44,224,121,136,240,207,65,74,173,35,212,70,202,148,161,195,235,40,6,250,23,20]],[[123,170,112,10,75,251,245,191,128,197,207,8,122,221,161,244,157,84,80,83,35,119,35,245,52,165,34,209,13,150,46,71],[204,183,50,137,87,208,152,117,228,55,153,169,232,186,237,186,235,199,79,21,118,7,12,76,239,159,82,252,4,93,88,16]],[[206,130,240,143,121,2,168,209,218,20,9,72,238,138,64,152,118,96,84,90,222,3,36,245,230,47,225,3,191,104,130,127],[100,233,40,199,164,207,42,249,144,100,114,44,139,235,236,160,242,125,53,181,144,77,127,91,74,73,228,184,59,200,161,47]],[[139,197,204,61,105,166,161,24,68,188,77,119,55,199,134,236,12,201,214,68,169,35,39,185,3,52,167,10,213,199,52,55],[249,126,62,102,238,249,153,40,255,173,17,216,226,102,197,205,15,13,11,106,252,124,36,168,79,168,94,128,69,139,108,65]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[239,30,236,247,141,119,242,234,219,96,3,33,192,255,94,103,195,113,11,33,180,65,160,104,56,198,1,163,211,81,60,60],[146,248,214,75,239,66,19,178,74,196,46,114,63,201,17,189,116,2,14,245,19,157,131,26,27,213,84,222,196,30,22,108]],[[39,82,228,99,170,148,230,195,40,156,198,86,172,250,182,189,226,204,118,198,39,39,162,142,120,43,132,114,16,189,78,42],[234,167,35,239,4,97,128,80,201,110,165,150,209,209,200,195,24,215,45,253,38,189,203,123,146,81,14,74,101,87,184,73]],[[171,85,54,195,236,99,85,17,85,246,165,199,1,95,254,121,216,10,247,3,216,152,153,245,208,0,84,107,102,40,245,37],[122,141,161,93,112,93,81,39,238,48,101,86,149,70,222,189,3,117,180,87,89,137,235,2,158,204,137,25,167,203,23,103]],[[106,235,252,154,154,16,206,219,58,28,60,106,157,234,70,188,69,73,172,227,65,18,124,240,247,79,249,247,255,44,137,4],[48,49,84,26,70,202,230,198,203,226,195,193,139,117,129,190,238,248,163,17,28,37,163,167,53,81,85,226,37,170,226,58]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[180,72,16,159,138,9,118,250,240,122,176,112,247,131,128,82,132,43,38,162,196,93,79,186,177,200,64,13,120,151,196,96],[212,177,108,8,199,64,56,115,95,11,243,118,93,178,165,47,87,87,7,237,8,162,108,79,8,2,181,14,238,68,250,34]],[[15,0,63,166,4,25,86,101,49,127,139,235,13,225,71,137,151,22,83,250,129,167,170,178,191,103,235,114,96,129,13,72],[126,19,51,205,168,132,86,30,103,175,107,67,172,23,175,22,192,82,153,73,91,135,115,126,181,67,218,107,29,15,45,85]],[[233,88,31,255,132,63,147,28,203,225,48,105,165,117,25,126,20,95,248,252,9,221,168,120,157,202,89,139,209,48,1,19],[255,118,3,197,75,137,153,112,0,89,112,156,213,217,17,137,90,70,254,239,220,217,85,43,69,167,176,45,251,36,194,41]],[[56,6,248,11,172,130,196,151,43,144,224,247,168,171,108,8,128,102,144,70,247,38,45,248,241,196,107,74,130,152,142,55],[142,180,238,184,212,63,178,27,224,10,61,117,52,40,162,142,196,146,123,254,96,110,109,184,49,29,98,13,120,20,66,17]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[94,168,216,4,155,115,201,201,220,13,115,191,10,10,115,255,24,31,156,81,170,198,241,131,37,253,171,163,17,211,1,36],[77,227,126,56,98,94,100,187,43,83,181,3,104,196,242,43,90,3,50,153,74,65,154,225,26,174,140,72,243,36,50,101]],[[232,221,173,58,140,234,244,179,178,229,115,242,237,139,191,237,177,12,12,251,43,241,1,72,232,38,3,142,39,77,150,114],[200,9,59,96,201,38,77,124,242,156,212,161,59,38,194,4,51,68,118,60,2,187,17,66,12,34,183,198,225,172,180,14]],[[111,133,231,239,222,103,48,252,191,90,224,123,122,42,84,107,93,98,133,161,248,22,136,236,97,185,150,181,239,45,67,77],[124,49,51,204,228,207,108,255,128,71,119,209,216,233,105,151,152,127,32,87,29,29,79,8,39,200,53,87,64,198,33,12]],[[210,142,155,250,66,142,223,143,199,134,249,164,202,112,0,157,33,191,236,87,98,48,88,140,13,53,219,93,139,106,160,90],[193,88,124,13,32,221,17,38,95,137,59,151,88,248,139,227,223,50,226,252,216,103,242,165,55,30,109,236,124,39,32,121]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[208,233,192,250,149,69,35,150,241,44,121,37,20,206,64,20,68,44,54,80,217,99,86,183,86,59,158,167,239,137,187,14],[206,127,220,10,204,130,28,10,120,113,232,116,141,1,48,15,167,17,76,223,56,215,167,13,248,72,82,0,128,123,95,14]],[[37,131,230,148,123,129,178,145,174,14,5,201,163,104,45,217,136,37,25,42,97,97,33,151,21,161,53,165,70,200,162,14],[27,3,13,139,90,27,151,75,242,22,49,61,31,51,160,80,58,24,190,19,161,118,193,186,27,241,5,123,51,168,130,59]],[[186,54,123,109,169,234,20,18,197,250,145,0,186,155,153,204,86,2,233,160,38,64,102,140,196,248,133,51,104,231,3,32],[80,91,255,169,178,241,241,120,207,20,164,169,252,9,70,148,84,101,13,156,95,114,33,226,151,165,45,129,206,74,95,121]],[[61,95,92,210,188,125,119,14,42,109,34,69,132,6,196,221,198,166,198,215,73,173,109,135,145,14,58,103,29,44,29,86],[254,122,116,207,212,210,229,25,222,208,219,112,35,105,230,109,236,236,204,9,51,106,119,220,107,34,118,93,146,9,172,45]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[35,21,23,235,211,219,18,94,1,240,145,171,44,65,206,172,237,27,75,45,188,219,23,102,137,70,173,75,30,111,11,20],[17,206,191,182,119,45,72,34,24,79,163,93,74,176,112,18,62,84,215,216,14,43,39,220,83,255,202,140,89,179,78,68]],[[7,118,97,15,102,178,33,57,126,192,236,69,40,130,161,41,50,68,53,19,94,97,94,84,203,124,239,246,65,207,159,10],[221,249,218,132,195,230,138,159,36,210,150,93,57,111,88,140,193,86,147,171,181,121,59,210,168,115,22,237,250,180,47,115]],[[139,177,149,229,146,80,53,17,118,172,244,77,36,195,50,230,235,254,44,135,196,241,86,196,117,36,122,86,133,90,58,19],[13,22,172,60,74,88,134,58,70,127,108,163,82,110,55,228,150,156,233,92,102,65,103,228,251,121,12,5,246,100,213,124]],[[40,193,225,84,115,242,191,118,116,25,25,27,228,185,168,70,101,115,243,119,155,41,116,91,198,137,108,44,124,248,179,15],[247,213,233,116,93,184,37,22,181,48,188,132,197,240,173,202,18,40,188,157,212,250,130,230,227,191,162,21,44,212,52,16]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[97,177,70,186,14,49,165,103,108,127,214,217,39,133,15,121,20,200,108,47,95,91,156,53,61,56,134,119,101,85,106,123],[211,176,58,102,96,27,67,241,38,88,153,9,143,45,163,20,113,133,219,237,246,38,213,97,154,115,172,14,234,172,183,12]],[[94,244,229,23,14,16,159,231,67,95,103,92,172,75,229,20,65,210,191,72,245,20,176,113,198,97,193,178,112,88,210,90],[45,186,22,7,146,148,220,189,80,43,201,127,66,0,186,97,237,248,67,237,245,249,64,96,178,176,130,203,237,117,199,101]],[[128,186,13,9,64,167,57,166,103,52,126,102,190,86,251,83,120,196,70,232,237,104,108,127,206,232,159,206,162,100,88,83],[232,193,169,194,123,89,33,51,226,67,115,43,172,45,193,137,59,21,226,213,192,151,138,253,111,54,51,183,185,195,136,9]],[[208,182,86,48,92,174,179,117,68,164,131,81,110,1,101,239,69,118,230,245,162,13,212,22,59,88,47,242,47,54,24,63],[253,47,224,155,30,140,197,24,169,202,212,43,53,182,149,10,159,126,251,196,239,136,123,35,67,236,47,13,15,122,252,92]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[141,210,218,199,68,214,122,219,38,125,29,184,225,222,157,122,125,23,126,28,55,4,141,45,124,94,24,56,30,175,199,27],[51,72,49,0,89,246,242,202,15,39,27,99,18,126,2,29,73,192,93,121,135,239,94,122,47,31,102,85,216,9,217,97]],[[84,131,2,24,130,147,153,7,208,167,218,216,117,137,250,242,217,163,184,107,90,53,40,210,107,89,194,248,69,226,188,6],[101,192,163,136,81,149,252,150,148,120,232,13,139,65,201,194,88,72,117,16,47,205,42,201,160,109,15,221,156,152,38,61]],[[47,102,41,27,4,137,189,126,238,110,221,183,14,239,176,12,180,252,127,194,201,58,60,100,239,69,68,175,138,144,101,118],[161,76,112,75,14,160,131,112,19,164,175,184,56,25,34,101,9,180,2,79,6,248,23,206,70,69,218,80,124,138,209,78]],[[247,212,22,108,78,149,157,93,15,145,43,82,254,92,52,229,48,230,164,59,243,243,52,8,169,74,160,181,110,179,9,10],[38,217,94,163,15,235,162,243,32,59,55,212,228,158,206,6,61,83,237,174,43,235,182,36,10,17,163,15,214,127,164,58]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[219,159,44,252,214,178,30,46,82,122,6,135,45,134,114,43,109,144,119,70,67,181,122,248,96,125,145,96,91,157,158,7],[151,135,199,4,28,56,1,57,88,199,133,163,252,100,0,100,37,162,191,80,148,202,38,49,69,10,36,210,81,41,81,22]],[[77,74,215,152,113,87,172,125,139,55,189,99,255,135,177,73,149,32,124,207,124,89,196,145,156,239,208,219,96,9,157,70],[203,120,148,144,228,69,179,246,217,246,87,116,213,248,131,79,57,201,189,136,194,87,33,31,36,50,104,248,199,33,95,11]],[[42,54,104,252,95,182,79,165,227,157,36,47,192,147,97,207,248,10,237,225,219,39,236,14,20,50,95,142,161,98,65,22],[149,33,1,206,149,91,14,87,199,185,98,181,40,202,17,236,180,70,6,115,38,255,251,102,125,238,95,178,86,253,42,8]],[[146,103,119,86,161,255,196,197,149,240,227,58,10,202,148,77,158,126,61,185,110,182,176,206,164,48,137,153,233,173,17,89],[246,72,149,161,111,95,183,165,187,48,0,28,210,138,214,37,38,27,178,13,55,106,5,244,157,62,23,42,67,210,58,6]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[50,153,147,209,154,114,243,169,22,189,180,76,221,249,212,178,100,154,211,5,228,163,115,28,203,126,87,103,255,4,179,16],[185,75,164,173,208,109,97,35,180,175,52,169,170,101,236,217,105,227,133,205,204,231,176,155,65,193,28,249,160,250,183,19]],[[4,253,136,60,12,208,9,82,81,79,6,25,204,195,187,222,128,197,51,188,249,243,23,54,221,198,222,232,155,93,121,27],[101,10,190,81,87,173,80,121,8,113,155,7,149,143,251,174,75,56,186,207,83,42,134,30,192,80,92,103,27,246,135,108]],[[79,0,178,102,85,237,74,237,141,225,102,24,178,20,116,141,253,26,54,15,38,92,139,137,243,171,242,243,36,103,253,112],[253,78,42,193,58,202,143,0,216,236,116,103,239,97,224,40,208,150,244,72,222,129,227,239,220,170,125,243,182,85,166,101]],[[235,203,197,112,145,49,16,147,13,200,208,239,98,232,111,130,227,105,61,145,127,49,225,38,53,60,74,47,171,196,154,94],[171,27,181,229,43,195,14,41,176,208,115,230,79,100,242,188,228,228,225,154,82,51,47,189,204,3,238,138,250,0,95,80]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[246,219,13,34,61,181,20,117,49,240,129,226,185,55,162,169,132,17,154,7,181,83,137,120,169,48,39,161,241,78,92,46],[139,0,84,251,77,220,203,23,53,64,255,183,140,254,74,228,78,153,78,168,116,84,93,92,150,163,18,85,54,49,23,92]],[[206,36,239,123,134,242,15,119,232,92,125,135,56,45,239,175,242,140,114,46,235,182,85,75,110,241,78,138,14,154,108,76],[37,234,134,194,209,79,183,62,168,92,141,102,129,37,237,197,76,5,185,216,214,112,190,115,130,232,161,229,30,113,213,38]],[[78,109,195,167,79,34,69,38,162,126,22,247,247,99,220,134,1,42,113,56,92,51,195,206,48,255,249,44,145,113,138,114],[140,68,9,40,213,35,201,143,243,132,69,198,154,94,255,210,199,87,147,163,193,105,221,98,15,218,92,48,89,93,233,76]],[[146,126,80,39,114,215,12,214,105,150,129,53,132,148,53,139,108,170,98,134,110,28,21,243,108,179,255,101,27,162,155,89],[226,169,101,136,196,80,250,187,59,110,95,68,1,202,151,212,221,246,205,63,63,229,151,103,43,140,102,15,53,155,245,7]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[241,89,39,216,219,90,17,94,130,243,56,255,28,237,254,63,100,84,63,127,209,129,237,239,101,197,203,253,225,128,205,17],[224,219,34,40,230,255,97,157,65,20,45,59,38,34,223,241,52,129,233,69,238,15,152,139,166,63,239,247,67,25,241,67]],[[238,243,0,161,80,222,192,182,1,227,140,60,77,49,210,176,88,205,237,16,74,122,239,128,169,25,50,243,216,51,140,6],[203,125,79,255,48,216,18,59,57,28,6,249,76,52,53,113,181,22,148,103,223,238,17,222,164,29,136,147,53,169,50,16]],[[233,195,188,123,92,252,178,249,201,47,229,186,58,11,171,100,56,111,91,75,147,218,100,236,77,61,160,245,187,186,71,72],[96,188,69,31,35,162,59,112,118,230,151,153,79,119,84,103,48,154,231,102,214,205,46,81,36,44,66,74,17,254,111,126]],[[135,192,177,240,163,111,12,147,169,10,114,239,92,190,101,53,167,106,78,44,191,33,35,232,47,151,199,62,200,23,172,30],[123,239,33,229,64,204,30,220,214,189,151,122,124,117,134,122,37,90,110,124,229,81,60,27,91,130,154,7,96,161,25,4]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[150,136,166,171,143,227,58,73,248,254,52,231,106,178,254,64,38,116,87,76,246,212,153,206,93,123,47,103,214,90,228,78],[92,130,179,189,85,37,246,106,147,164,2,198,125,92,177,43,91,255,251,86,248,1,65,144,198,182,172,79,254,167,65,112]],[[219,250,155,44,212,35,103,44,138,99,108,7,38,72,79,194,3,210,83,32,40,237,101,113,71,169,22,22,18,188,40,51],[57,192,250,250,205,51,67,199,151,118,155,147,145,114,235,197,24,103,76,17,240,244,229,115,178,92,27,194,38,63,191,43]],[[134,230,140,29,223,202,252,213,248,58,195,68,114,230,120,157,43,151,248,40,69,180,32,201,42,140,103,170,17,197,91,47],[23,15,134,82,215,157,195,68,81,118,50,101,180,55,129,153,70,55,98,237,207,100,157,114,64,122,76,11,118,42,251,86]],[[51,167,144,124,195,111,23,165,160,103,114,23,234,126,99,20,131,222,193,113,45,65,50,122,243,209,43,216,42,166,70,54],[172,204,107,124,249,184,139,8,92,208,125,143,115,234,32,218,134,202,0,199,173,115,77,233,232,169,218,31,3,6,221,36]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[156,178,97,10,152,42,165,215,238,169,172,101,203,10,30,226,190,220,133,89,15,156,166,87,52,165,135,235,123,30,12,60],[47,189,132,99,13,181,160,240,75,158,147,198,52,154,52,255,115,25,47,110,84,69,44,146,49,118,52,241,178,38,232,116]],[[10,103,144,109,12,76,204,192,230,189,167,94,85,140,205,88,155,17,162,187,75,177,67,4,60,85,237,35,254,205,177,83],[5,251,117,245,1,175,56,114,88,252,4,41,52,122,103,162,8,80,110,208,43,115,213,184,228,48,150,173,69,223,166,92]],[[13,136,26,144,126,220,216,254,193,47,93,103,238,103,47,237,111,85,67,95,135,20,53,66,211,117,174,213,211,133,26,118],[135,200,160,110,225,176,173,106,74,52,113,237,124,214,68,3,101,74,92,92,4,245,36,63,176,22,94,140,178,210,197,32]],[[152,131,194,55,160,65,168,72,92,95,191,200,250,36,224,89,44,189,246,129,126,136,230,202,4,216,93,96,187,116,167,11],[33,19,145,191,119,122,51,188,233,7,57,10,221,125,6,16,154,238,71,115,27,21,90,251,205,77,208,210,58,1,186,84]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[72,213,57,74,11,32,106,67,160,7,130,94,73,124,201,71,241,124,55,185,35,239,107,70,69,140,69,118,223,20,107,110],[66,201,202,41,76,118,55,218,138,45,124,58,88,242,3,180,181,185,26,19,45,222,95,107,157,186,82,201,93,179,243,48]],[[76,111,254,107,12,98,215,72,113,239,177,133,121,192,237,36,177,8,147,118,142,247,56,142,235,254,128,64,175,144,100,73],[74,136,218,193,152,68,60,83,78,219,75,185,18,95,205,8,4,239,117,231,177,58,229,7,250,202,101,123,114,16,100,127]],[[61,129,240,235,22,253,88,51,141,124,26,251,32,44,138,238,144,187,51,109,69,233,142,153,133,225,8,31,197,241,181,70],[228,231,67,75,160,63,43,6,186,23,174,61,230,206,189,184,237,116,17,53,236,150,254,49,227,14,122,78,201,29,203,32]],[[224,103,233,123,219,150,92,176,50,208,89,49,144,220,146,151,172,9,56,49,15,126,214,93,208,6,182,31,234,240,91,7],[129,159,199,222,107,65,34,53,20,103,119,62,144,129,176,217,133,76,202,155,63,4,89,214,170,23,195,136,52,55,186,67]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[76,182,105,200,129,149,148,51,146,52,233,60,132,13,61,90,55,156,34,160,170,101,206,180,194,45,102,103,2,255,116,16],[34,176,213,230,199,239,177,167,19,218,96,180,128,193,66,125,16,112,151,4,77,218,35,137,194,14,104,203,222,224,155,41]],[[51,254,66,42,54,43,46,54,100,92,139,204,129,106,21,8,161,39,232,87,229,120,142,242,88,25,18,66,174,196,99,62],[120,150,156,167,202,128,174,2,133,177,124,4,92,193,91,38,193,186,237,165,89,112,133,140,140,232,135,172,106,40,153,53]],[[159,4,8,40,190,135,218,128,40,56,222,159,205,228,227,98,251,46,70,141,1,179,6,81,212,25,59,17,250,226,173,30],[160,32,153,105,10,174,163,112,78,100,128,183,133,156,135,84,67,67,85,128,109,141,124,169,100,202,108,46,33,216,200,108]],[[145,74,7,173,8,117,193,79,164,178,195,111,70,62,177,206,82,171,103,9,84,72,107,108,215,29,113,118,203,255,221,49],[54,136,250,253,240,54,111,7,116,136,80,208,149,56,74,72,46,7,100,151,17,118,1,26,39,77,142,37,154,155,28,34]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[190,87,189,14,15,172,94,118,163,113,173,43,16,69,2,236,89,213,93,169,68,204,37,76,179,60,91,105,7,85,38,107],[48,107,212,167,81,41,227,249,122,117,42,130,47,214,29,153,43,128,213,103,30,21,157,202,253,235,172,151,53,9,127,63]],[[53,13,52,10,184,103,86,41,32,243,25,95,226,131,66,115,83,168,197,2,25,51,180,100,189,195,135,140,215,118,237,37],[71,57,55,118,13,29,12,245,90,109,67,136,153,21,180,82,15,42,179,176,63,166,179,38,179,199,69,245,146,95,155,23]],[[157,35,189,21,254,82,82,21,38,121,134,186,6,86,102,187,140,46,16,17,213,74,24,82,218,132,68,240,62,233,140,53],[173,160,65,236,200,77,185,210,110,150,78,91,197,194,160,27,207,12,191,23,102,87,193,23,144,69,113,194,225,36,235,39]],[[44,185,66,164,175,59,66,14,194,15,242,234,131,175,154,19,23,176,189,137,23,227,114,203,14,118,126,65,99,4,136,113],[117,120,56,134,87,221,159,238,84,112,101,191,241,44,224,57,13,227,137,253,142,147,79,67,220,213,91,222,249,152,229,123]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[231,59,101,17,223,178,242,99,148,18,111,92,158,119,193,182,216,171,88,122,29,149,115,221,231,227,111,242,3,29,219,118],[174,6,78,44,82,27,188,90,90,165,190,39,189,235,225,20,23,104,38,7,3,209,24,11,223,241,6,92,166,27,185,36]],[[197,102,128,19,14,72,140,135,49,132,180,96,237,197,236,182,197,5,51,95,47,125,64,182,50,29,56,116,27,241,9,61],[212,105,130,188,141,248,52,54,117,85,24,85,88,60,121,175,38,128,171,155,149,0,241,203,218,193,159,246,47,162,244,69]],[[23,190,235,133,237,158,205,86,245,23,69,66,180,31,68,76,5,116,21,71,0,198,106,61,36,9,13,88,177,66,215,4],[141,189,163,196,6,155,31,144,88,96,116,178,0,59,60,210,218,130,187,16,144,105,146,169,180,48,129,227,124,168,137,69]],[[63,220,5,203,65,60,200,35,4,44,56,153,227,104,85,249,211,50,199,191,250,212,27,93,222,220,16,66,192,66,217,117],[45,171,53,78,135,196,101,151,103,36,164,71,173,63,142,243,203,49,23,119,197,226,215,143,60,193,205,86,72,193,108,105]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[20,174,95,136,123,165,144,223,16,178,139,94,36,23,195,163,212,15,146,97,26,25,90,173,118,189,216,28,221,224,18,109],[142,189,112,143,2,163,36,77,90,103,196,218,247,32,15,129,91,122,5,36,103,131,11,42,128,231,253,116,75,158,92,13]],[[148,213,95,31,162,251,235,225,7,52,248,32,173,129,48,6,45,161,129,149,54,207,17,11,175,193,43,154,108,85,193,22],[54,79,241,94,116,53,19,40,215,17,207,184,222,147,179,5,184,181,115,233,235,173,25,30,137,15,139,21,213,140,227,35]],[[51,121,231,24,230,15,87,147,21,160,167,170,196,191,79,48,116,149,94,105,74,91,69,228,0,235,35,116,76,223,107,69],[151,41,108,196,66,11,221,192,41,92,155,52,151,208,199,121,128,99,116,228,142,55,176,43,124,232,104,108,195,130,151,87]],[[34,190,131,182,75,128,107,67,36,94,239,153,155,168,252,37,141,59,3,148,43,62,231,149,118,155,204,21,219,50,230,102],[132,240,74,19,166,214,250,147,70,7,246,126,92,109,94,246,166,231,72,240,6,234,255,144,193,204,76,25,156,60,78,83]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[42,80,227,7,21,89,242,139,129,242,243,211,108,153,140,112,103,236,204,238,158,89,69,89,125,71,117,105,245,36,147,93],[106,79,27,190,107,48,207,117,70,227,123,157,252,205,216,92,31,180,200,226,36,236,26,40,5,50,87,253,60,90,152,16]],[[163,219,247,48,216,194,154,225,211,206,34,229,128,30,217,228,31,171,192,113,26,134,14,39,153,91,250,118,153,176,8,60],[42,147,210,133,27,106,93,166,238,209,209,51,189,106,54,115,55,58,68,180,236,169,122,222,131,64,215,223,40,186,162,48]],[[211,181,109,5,63,159,243,21,141,124,202,201,252,138,124,148,176,99,54,155,120,209,145,31,147,216,87,67,222,118,163,67],[155,53,226,169,61,50,30,187,22,40,112,233,69,47,143,112,127,8,126,83,196,122,191,247,225,164,106,216,172,100,27,17]],[[178,235,71,70,24,62,31,153,12,204,241,44,224,231,143,224,1,126,101,184,12,208,251,200,185,144,152,51,97,59,216,39],[160,190,114,58,80,75,116,171,1,200,147,197,228,199,8,108,180,202,238,235,142,215,78,38,198,29,226,113,175,137,160,42]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[152,11,228,222,219,168,250,130,116,6,82,109,8,82,138,255,98,197,106,68,15,81,140,31,110,182,198,44,129,211,118,70],[244,41,116,46,128,167,26,143,246,189,214,142,191,193,149,42,235,160,127,69,160,80,20,5,177,87,76,116,183,226,137,125]],[[7,238,167,173,183,9,11,73,78,191,202,229,33,230,230,175,213,103,243,206,126,124,147,123,90,16,18,14,108,6,17,117],[213,252,134,163,59,163,62,10,251,11,247,54,177,91,218,112,183,0,167,218,136,143,132,168,188,28,57,184,101,243,77,96]],[[150,157,49,244,162,190,129,185,165,89,158,186,7,190,116,88,216,235,197,159,61,209,244,174,206,83,223,79,199,42,137,77],[41,216,242,170,233,14,247,46,95,157,138,91,9,237,201,36,34,244,15,37,143,28,132,110,52,20,108,234,179,134,93,4]],[[7,152,97,232,106,210,129,73,37,213,91,24,199,53,82,81,164,70,173,24,13,201,95,24,145,59,180,192,96,89,141,102],[3,27,121,83,110,36,174,87,217,88,9,133,72,162,211,181,226,77,17,130,230,134,60,233,177,0,25,194,87,247,102,122]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[15,227,137,3,215,34,149,159,202,180,141,158,109,151,255,141,33,89,7,239,3,45,94,248,68,70,231,133,128,197,137,80],[139,216,83,134,36,134,41,82,1,250,32,195,78,149,203,173,123,52,148,48,183,122,250,150,65,96,43,203,89,185,202,80]],[[194,91,155,120,35,27,58,136,148,95,10,155,152,43,110,83,17,246,255,198,125,66,204,2,128,64,13,30,251,175,97,7],[176,230,47,129,112,161,46,57,4,124,196,44,135,69,74,91,105,151,172,109,44,16,66,124,59,21,112,96,14,17,109,58]],[[155,24,128,94,219,5,189,198,183,60,194,64,77,93,206,151,138,52,21,171,40,93,16,240,55,12,204,22,250,31,51,13],[25,249,53,170,89,26,12,92,6,252,106,11,151,83,54,252,42,165,90,155,48,239,35,175,57,93,154,107,117,87,72,11]],[[38,220,118,59,252,249,156,63,137,11,98,83,175,131,1,46,188,106,198,3,13,117,42,13,230,148,84,207,179,229,150,37],[254,130,177,116,49,138,167,111,86,189,141,244,224,148,81,89,222,44,90,244,132,107,74,136,147,192,12,154,172,167,160,104]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[37,13,214,199,35,71,16,173,199,8,92,135,135,147,152,24,184,211,156,172,90,61,197,117,248,73,50,20,204,81,150,36],[101,156,93,240,55,4,240,52,105,42,240,165,100,202,222,43,91,21,16,210,171,6,221,196,176,182,91,193,23,223,143,2]],[[189,89,61,191,92,49,68,44,50,148,4,96,132,15,173,0,182,143,201,29,204,92,162,73,14,80,145,8,154,67,85,5],[93,147,85,223,155,18,25,236,147,133,66,158,102,15,157,175,153,175,38,137,188,97,253,255,206,75,244,51,149,201,53,88]],[[18,85,249,218,203,68,167,220,87,226,249,154,230,7,35,96,84,167,57,165,155,132,86,110,170,139,143,176,44,135,175,103],[0,169,76,178,18,248,50,168,122,0,75,73,50,186,31,93,68,142,68,122,220,17,251,57,8,87,135,165,18,66,147,14]],[[23,180,174,114,89,208,170,168,22,139,99,17,179,67,4,218,12,168,183,104,221,78,84,231,175,93,93,5,118,54,236,13],[109,124,130,50,56,85,87,116,91,125,195,196,251,6,41,240,19,85,84,198,167,220,76,159,152,73,32,168,195,141,250,72]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[135,71,157,233,37,213,227,71,120,223,133,167,133,94,122,76,95,121,26,243,162,178,40,160,156,221,48,64,212,56,189,40],[252,187,213,120,109,29,212,153,180,170,68,68,122,27,216,254,180,153,185,204,231,196,211,58,115,131,65,92,64,215,45,85]],[[38,225,123,95,229,220,63,125,161,167,38,68,34,35,192,143,125,241,181,17,71,123,25,212,117,111,30,165,39,254,200,14],[211,17,61,171,239,44,237,177,61,124,50,129,107,254,248,28,60,123,192,97,223,184,117,118,127,170,216,147,175,61,232,61]],[[253,91,78,141,182,126,130,155,239,206,4,105,81,82,255,239,160,82,181,121,23,94,47,222,214,60,45,160,67,180,11,25],[192,97,72,72,23,244,158,24,81,45,234,47,242,242,224,163,20,183,139,58,48,245,129,193,93,113,57,98,85,31,96,90]],[[229,137,138,118,108,219,77,10,91,114,157,89,110,99,99,24,124,227,250,226,219,161,141,244,165,215,22,178,208,179,63,57],[206,96,9,108,245,118,23,36,128,58,150,199,148,46,247,107,239,181,5,150,239,211,123,81,218,5,68,103,188,7,33,78]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[233,115,111,33,185,222,34,125,235,151,49,16,163,234,225,198,55,235,143,67,88,222,65,100,14,62,7,153,61,241,223,30],[248,173,67,194,23,6,226,228,169,134,205,24,215,120,200,116,102,210,9,24,165,241,202,166,98,146,193,203,0,235,66,46]],[[123,52,36,76,207,56,229,108,10,1,44,34,11,36,56,173,36,126,25,240,108,249,49,244,53,17,246,70,51,58,35,89],[32,11,161,8,25,173,57,84,234,62,35,9,182,226,210,188,77,252,156,240,19,22,34,63,185,210,17,134,144,85,206,60]],[[196,11,75,98,153,55,132,63,116,162,249,206,226,11,15,42,61,163,227,219,90,157,147,204,165,239,130,145,29,230,108,104],[163,100,23,155,139,200,58,97,230,157,198,237,123,3,82,38,157,58,179,19,204,138,253,44,26,29,237,19,208,85,87,14]],[[26,234,191,253,74,60,142,236,41,126,119,119,18,153,215,132,249,85,127,241,139,180,210,149,163,141,240,138,167,235,130,75],[44,40,244,58,246,222,10,224,65,68,35,248,63,3,100,159,195,85,76,198,193,148,28,36,93,95,146,69,150,87,55,20]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[193,205,144,102,185,118,160,91,165,133,117,35,249,137,165,130,178,111,177,235,196,105,111,24,90,237,148,61,157,217,44,26],[53,176,230,115,6,183,55,224,248,176,34,232,210,237,11,239,230,198,90,153,158,26,159,4,151,228,77,11,190,186,68,64]],[[193,86,150,145,95,31,187,84,111,136,137,10,178,214,65,66,106,130,238,20,170,118,48,101,15,103,57,166,81,124,73,36],[53,163,120,209,17,15,117,211,112,70,219,32,81,203,146,128,84,16,116,54,134,169,215,163,8,120,241,1,41,248,128,59]],[[219,167,157,157,191,160,204,237,83,162,162,25,57,72,131,25,55,88,209,4,40,64,247,138,194,8,183,165,66,207,83,76],[167,187,246,142,173,221,247,144,221,95,147,137,174,4,55,230,154,183,232,192,223,22,42,191,196,58,60,65,213,137,114,90]],[[31,150,255,52,44,19,33,203,10,137,133,190,179,112,158,30,222,151,175,150,48,247,72,137,64,141,7,241,37,240,48,88],[30,212,147,87,226,23,231,157,171,60,85,3,130,47,43,219,86,30,48,46,36,71,110,230,255,51,36,44,117,81,212,103]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[43,6,217,161,93,225,244,209,30,60,154,198,41,43,19,19,120,192,216,22,23,45,158,169,201,121,87,171,36,145,146,25],[105,251,161,156,166,117,73,125,96,115,64,66,196,19,10,149,121,30,4,131,148,153,155,30,12,232,31,84,239,203,192,82]],[[20,137,115,161,55,135,106,122,207,29,217,46,26,103,237,116,192,240,156,51,221,223,8,191,123,209,102,218,230,201,73,8],[233,221,94,85,176,10,222,33,76,90,46,212,128,58,87,146,122,241,196,44,64,175,47,201,146,3,229,90,188,220,244,9]],[[243,225,43,124,5,134,128,147,74,173,180,143,126,153,12,253,205,239,209,255,44,105,52,19,65,100,207,59,208,144,9,30],[157,69,214,128,230,69,170,244,21,170,92,52,135,153,162,140,38,132,98,125,182,41,192,82,234,245,129,24,15,53,169,14]],[[231,32,114,124,109,148,95,82,68,84,227,241,178,176,54,70,15,174,146,232,112,157,110,121,177,173,55,169,95,192,222,3],[21,85,55,198,28,39,28,109,20,79,202,164,196,136,37,70,57,252,90,229,254,41,17,105,245,114,132,77,120,159,148,21]],[[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]],[[236,211,255,87,11,176,178,220,248,79,226,18,213,54,190,107,9,67,109,163,77,144,45,184,116,232,113,69,25,139,12,106],[184,66,28,3,173,44,3,142,172,215,152,41,19,198,2,41,181,212,231,207,204,139,131,236,53,199,156,116,183,173,133,95]],[[120,132,225,86,69,105,104,90,79,184,177,41,255,51,3,49,183,203,150,37,230,230,65,152,26,187,3,86,242,178,145,52],[44,108,247,102,164,98,107,57,179,186,101,211,28,248,17,170,190,220,128,89,135,245,123,229,227,179,62,57,218,190,136,9]],[[139,241,160,245,220,41,180,226,7,198,122,0,208,137,23,81,212,187,212,34,234,126,125,124,36,234,242,232,34,18,149,6],[218,124,164,12,244,186,110,225,137,181,89,202,241,192,41,54,9,68,226,127,209,99,21,153,234,37,207,12,157,192,68,111]],[[29,134,78,207,247,55,16,37,143,18,251,25,251,224,237,16,200,226,245,117,177,51,192,150,13,251,21,108,13,7,95,5],[105,62,71,151,44,175,82,124,120,131,173,27,57,130,47,2,111,71,219,42,176,225,145,153,85,184,153,58,160,68,17,81]]],e=o.makeFactory(),n=0;n<425;n+=1)t.base_multiples_affine[n]=a(e), - t.base_multiples_affine[n].x.set(r[n][0]),t.base_multiples_affine[n].y.set(r[n][1]);r=null}(),Object.freeze(t)},{"../util/arrays":15,"./fe25519":10}],13:[function(r,e,t){"use strict";function a(r){return r.getUint32Array(32)}function n(r){return r.getUint32Array(16)}function o(r,e){return r<e?1:0}function i(r,e){for(var t,a,n=0,i=e.getUint8Array(32),f=0;f<32;f+=1)n+=m[f],t=o(r[f],n),i[f]=r[f]-n+(t<<8),n=t;a=t-1|0;for(var f=0;f<32;f+=1)r[f]^=a&(r[f]^i[f]);e.recycle(i)}function f(r,e,t){for(var a,n,f=t.getUint32Array(66),c=f.subarray(33),s=t.getUint32Array(33),u=t.getUint32Array(33),y=0,l=0;l<66;l+=1)f[l]=0;for(var l=0;l<33;l+=1)u[l]=0;for(var l=0;l<33;l+=1)for(var v=0;v<33;v+=1)l+v>=31&&(f[l+v]+=g[l]*e[v+31]);a=f[31]>>>8,f[32]+=a,a=f[32]>>>8,f[33]+=a;for(var l=0;l<33;l+=1)s[l]=e[l];for(var l=0;l<32;l+=1)for(var v=0;v<33;v+=1)l+v<33&&(u[l+v]+=m[l]*c[v]);for(var l=0;l<32;l+=1)a=u[l]>>>8,u[l+1]+=a,u[l]&=255;for(var l=0;l<32;l+=1)y+=u[l],n=o(s[l],y),r[l]=s[l]-y+(n<<8),y=n;i(r,t),i(r,t),t.recycle(f,s,u)}function c(r,e,t){for(var a=t.getUint32Array(64),n=0;n<32;n+=1)a[n]=e[n];for(var n=32;n<64;n+=1)a[n]=0;f(r,a,t),t.recycle(a)}function s(r,e,t){for(var a=t.getUint32Array(64),n=0;n<64;n+=1)a[n]=e[n];f(r,a,t),t.recycle(a)}function u(r,e){for(var t=0;t<32;t+=1)r[t]=e[t]}function y(r,e,t,a){for(var n,o=0;o<32;o+=1)r[o]=e[o]+t[o];for(var o=0;o<31;o+=1)n=r[o]>>>8,r[o+1]+=n,r[o]&=255;i(r,a)}function l(r,e,t,a){for(var n,o=a.getUint32Array(64),i=0;i<64;i+=1)o[i]=0;for(var i=0;i<32;i+=1)for(var c=0;c<32;c+=1)o[i+c]+=e[i]*t[c];for(var i=0;i<63;i+=1)n=o[i]>>>8,o[i+1]+=n,o[i]&=255;f(r,o,a),a.recycle(o)}function v(r,e){for(var t=0;t<10;t+=1)r[8*t+0]=7&e[3*t+0],r[8*t+1]=e[3*t+0]>>>3&7,r[8*t+2]=e[3*t+0]>>>6&7,r[8*t+2]^=e[3*t+1]<<2&7,r[8*t+3]=e[3*t+1]>>>1&7,r[8*t+4]=e[3*t+1]>>>4&7,r[8*t+5]=e[3*t+1]>>>7&7,r[8*t+5]^=e[3*t+2]<<1&7,r[8*t+6]=e[3*t+2]>>>2&7,r[8*t+7]=e[3*t+2]>>>5&7;r[8*t+0]=7&e[3*t+0],r[8*t+1]=e[3*t+0]>>>3&7,r[8*t+2]=e[3*t+0]>>>6&7,r[8*t+2]^=e[3*t+1]<<2&7,r[8*t+3]=e[3*t+1]>>>1&7,r[8*t+4]=e[3*t+1]>>>4&7;for(var a=0,t=0;t<84;t+=1)r[t]+=a,r[t+1]+=r[t]>>>3,r[t]&=7,a=r[t]>>>2,r[t]-=a<<3;r[84]+=a}function h(r,e,t){for(var a=0;a<31;a+=1)r[4*a]=3&e[a]^(3&t[a])<<2,r[4*a+1]=e[a]>>>2&3^(t[a]>>>2&3)<<2,r[4*a+2]=e[a]>>>4&3^(t[a]>>>4&3)<<2,r[4*a+3]=e[a]>>>6&3^(t[a]>>>6&3)<<2;r[124]=3&e[31]^(3&t[31])<<2,r[125]=e[31]>>>2&3^(t[31]>>>2&3)<<2,r[126]=e[31]>>>4&3^(t[31]>>>4&3)<<2}t.make_sc25519=a,t.make_shortsc25519=n;var m=new Uint8Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),g=new Uint8Array([27,19,44,10,163,229,156,237,167,41,99,8,93,33,6,33,235,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,15]);t.from32bytes=c,t.from64bytes=s,t.to32bytes=u,t.add=y,t.mul=l,t.window3=v,t.interleave2=h,Object.freeze(t)},{}],14:[function(r,e,t){"use strict";function a(r,e){if(!(r instanceof Uint8Array))throw new TypeError("Seed must be Uint8Array.");if(32!==r.length)throw new Error("Seed should have 32 elements (bytes) in it, but it is "+r.length+" elements long.");e||(e=l.makeFactory());var t=u.make_sc25519(e),a=s.make_ge25519(e),n=y.hash(r,e);n[0]&=248,n[31]&=127,n[31]|=64,u.from32bytes(t,n,e),s.scalarmult_base(a,t,e);var o=e.getUint8Array(32);s.pack(o,a,e);for(var i=e.getUint8Array(64),f=0;f<32;f+=1)i[f]=r[f];for(var f=32;f<64;f+=1)i[f]=o[f-32];return e.wipeRecycled(),{skey:i,pkey:o}}function n(r){if(1!==r.BYTES_PER_ELEMENT)throw new TypeError("Key array sk must be Uint8Array.");if(64!==r.length)throw new Error("Key array sk should have 64 elements (bytes) in it, but it is "+r.length+" elements long.");for(var e=new Uint8Array(32),t=32;t<64;t+=1)e[t-32]=r[t];return e}function o(r,e,t){if(!(e instanceof Uint8Array))throw new TypeError("Key array sk must be Uint8Array.");if(64!==e.length)throw new Error("Key array sk should have 64 elements (bytes) in it, but it is "+e.length+" elements long.");t||(t=l.makeFactory());var a=u.make_sc25519(t),n=u.make_sc25519(t),o=u.make_sc25519(t),i=s.make_ge25519(t),f=t.getUint8Array(32);f.set(e.subarray(32));var c=y.hash(e.subarray(0,32),t);c[0]&=248,c[31]&=127,c[31]|=64;var v=new Uint8Array(r.length+64);v.subarray(64).set(r),v.subarray(32,64).set(c.subarray(32));var h=y.hash(v.subarray(32),t);u.from64bytes(a,h,t),s.scalarmult_base(i,a,t),s.pack(v.subarray(0,32),i,t),v.set(f,32);var m=y.hash(v,t);return u.from64bytes(n,m,t),u.from32bytes(o,c,t),u.mul(n,n,o,t),u.add(n,n,a,t),u.to32bytes(v.subarray(32,64),n),t.recycle(c,h,m,a,n,o,f),t.wipeRecycled(),v}function i(r,e,t){if(!(e instanceof Uint8Array))throw new TypeError("Key array sk must be Uint8Array.");if(64!==e.length)throw new Error("Key array sk should have 64 elements (bytes) in it, but it is "+e.length+" elements long.");t||(t=l.makeFactory());var a=y.makeHasher(!1,t),n=u.make_sc25519(t),o=u.make_sc25519(t),i=u.make_sc25519(t),f=s.make_ge25519(t),c=t.getUint8Array(32);c.set(e.subarray(32)),a.update(e.subarray(0,32));var v=a.digest();v[0]&=248,v[31]&=127,v[31]|=64;var h=t.getUint8Array(64);h.subarray(32,64).set(v.subarray(32)),a.update(h.subarray(32)),a.update(r);var m=a.digest();u.from64bytes(n,m,t),s.scalarmult_base(f,n,t),s.pack(h.subarray(0,32),f,t),a.update(h.subarray(0,32)),a.update(c),a.update(r);var g=a.digest();return u.from64bytes(o,g,t),u.from32bytes(i,v,t),u.mul(o,o,i,t),u.add(o,o,n,t),u.to32bytes(h.subarray(32),o),t.recycle(v,m,g,n,o,i,c),a.destroy(),t.wipeRecycled(),h}function f(r,e,t){if(!(e instanceof Uint8Array))throw new TypeError("Key array pk must be Uint8Array.");if(32!==e.length)throw new Error("Key array pk should have 32 elements (bytes) in it, but it is "+e.length+" elements long.");t||(t=l.makeFactory());var a=t.getUint8Array(32),n=t.getUint8Array(32),o=s.make_ge25519(t),i=s.make_ge25519(t),f=u.make_sc25519(t),c=u.make_sc25519(t);if(r.length<64||224&r[63]||!s.unpackneg_vartime(o,e,t))return null;a.set(r.subarray(0,32)),u.from32bytes(c,r.subarray(32,64),t);var h=new Uint8Array(r.length);h.set(r),h.set(e,32);var m=y.hash(h,t);u.from64bytes(f,m,t),s.double_scalarmult_vartime(i,o,f,s.base,c,t),s.pack(n,i,t);for(var g=v.v32(a,n),b=0;b<64;b+=1)h[b]=0;return t.recycle(a,n,m,f,c),s.recycle_ge25519(t,o,i),t.wipeRecycled(),g?h.subarray(64):null}function c(r,e,t,a){if(!(t instanceof Uint8Array))throw new TypeError("Key array pk must be Uint8Array.");if(32!==t.length)throw new Error("Key array pk should have 32 elements (bytes) in it, but it is "+t.length+" elements long.");a||(a=l.makeFactory());var n=a.getUint8Array(32),o=a.getUint8Array(32),i=s.make_ge25519(a),f=s.make_ge25519(a),c=u.make_sc25519(a),h=u.make_sc25519(a);if(r.length<64||224&r[63]||!s.unpackneg_vartime(i,t,a))return!1;n.set(r.subarray(0,32)),u.from32bytes(h,r.subarray(32,64),a);var m=y.makeHasher(!0,a);m.update(r.subarray(0,32)),m.update(t),m.update(e);var g=m.digest();u.from64bytes(c,g,a),s.double_scalarmult_vartime(f,i,c,s.base,h,a),s.pack(o,f,a);var b=v.v32(n,o);return a.recycle(n,o,g,c,h),s.recycle_ge25519(a,i,f),m.destroy(),a.wipeRecycled(),b}var s=r("./ge25519"),u=r("./sc25519"),y=r("../hash/sha512"),l=r("../util/arrays"),v=r("../util/verify");t.generate_keypair=a,t.extract_pkey=n,t.sign=o,t.signature=i,t.open=f,t.verify=c,t.JWK_ALG_NAME="NaCl-sign-Ed25519",t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,Object.freeze(t)},{"../hash/sha512":7,"../util/arrays":15,"../util/verify":17,"./ge25519":11,"./sc25519":13}],15:[function(r,e,t){"use strict";function a(){var r=new i;return{getUint8Array:r.getUint8Array.bind(r),getUint32Array:r.getUint32Array.bind(r),recycle:r.recycle.bind(r),wipeRecycled:r.wipeRecycled.bind(r),clear:r.clear.bind(r),wipe:n}}function n(){for(var r=[],e=0;e<arguments.length;e++)r[e-0]=arguments[e];for(var t,a=0;a<r.length;a+=1)if(t=r[a])try{for(var n=0;n<t.length;n+=1)t[n]=0}catch(o){}}var o=function(){function r(r){this.arrFactory=null,this.pool=new Array(16),this.poolIndex=-1,this.wipedIndex=-1,this.numOfElemsInObj=r,Object.seal(this)}return r.makeUint8ArrayPool=function(e){var t=new r(e);return t.arrFactory=function(){return new Uint8Array(t.numOfElemsInObj)},t},r.makeUint32ArrayPool=function(e){var t=new r(e);return t.arrFactory=function(){return new Uint32Array(t.numOfElemsInObj)},t},r.prototype.get=function(){var r;return this.poolIndex<0?r=this.arrFactory():(r=this.pool[this.poolIndex],this.pool[this.poolIndex]=null,this.poolIndex-=1,this.poolIndex<this.wipedIndex&&(this.wipedIndex=this.poolIndex)),r},r.prototype.recycle=function(r){this.poolIndex+=1,this.pool[this.poolIndex]=r},r.prototype.wipe=function(){for(var r,e=this.wipedIndex+1;e<=this.poolIndex;e+=1){r=this.pool[e];for(var t=0;t<r.length;t+=1)r[t]=0}this.wipedIndex=this.poolIndex},r}();t.makeFactory=a;var i=function(){function r(){this.uint8s={},this.uint32s={},this.wipe=n,Object.freeze(this)}return r.prototype.getUint8Array=function(r){var e=this.uint8s[r];return e?e.get():new Uint8Array(r)},r.prototype.getUint32Array=function(r){var e=this.uint32s[r];return e?e.get():new Uint32Array(r)},r.prototype.recycleUint8Array=function(r){var e=this.uint8s[r.length];e||(e=o.makeUint8ArrayPool(r.length),this.uint8s[r.length]=e),e.recycle(r)},r.prototype.recycleUint32Array=function(r){var e=this.uint32s[r.length];e||(e=o.makeUint32ArrayPool(r.length),this.uint32s[r.length]=e),e.recycle(r)},r.prototype.recycle=function(){for(var r=[],e=0;e<arguments.length;e++)r[e-0]=arguments[e];for(var t,a=0;a<r.length;a+=1)if(t=r[a]){if(0!==t.byteOffset||t.length*t.BYTES_PER_ELEMENT!==t.buffer.byteLength)throw new TypeError("Given, as argument #"+(a+1)+" is a view of an array, and these are not supposed to be recycled.");if(t instanceof Uint8Array)this.recycleUint8Array(t);else{if(!(t instanceof Uint32Array))throw new TypeError("This works with typed arrays that have 1 or 4 bytes per element, while given at position "+a+" array claims to have "+t.BYTES_PER_ELEMENT);this.recycleUint32Array(t)}}},r.prototype.wipeRecycled=function(){for(var r in this.uint8s)this.uint8s[r].wipe();for(var r in this.uint32s)this.uint32s[r].wipe()},r.prototype.clear=function(){for(var r in this.uint8s)delete this.uint8s[r];for(var r in this.uint32s)delete this.uint32s[r]},r}();Object.freeze(i),Object.freeze(i.prototype),t.wipe=n,Object.freeze(t)},{}],16:[function(r,e,t){"use strict";function a(r){if(!(r[1]>1048575))return 4294967296*r[1]+r[0]}function n(r,e){var t=r[0]+e[0],a=r[1]+e[1]+(t/4294967296|0);return new Uint32Array([t,a])}function o(r,e){var t=r[1]-e[1],a=r[0]-e[0];return a<0&&(t-=1,a+=4294967296),new Uint32Array([a,t])}function i(r,e){var t=r[e+3]<<24|r[e+2]<<16|r[e+1]<<8|r[e],a=r[e+7]<<24|r[e+6]<<16|r[e+5]<<8|r[e+4];return new Uint32Array([t,a])}function f(r,e,t){r[e+7]=t[1]>>>24,r[e+6]=t[1]>>>16,r[e+5]=t[1]>>>8,r[e+4]=t[1],r[e+3]=t[0]>>>24,r[e+2]=t[0]>>>16,r[e+1]=t[0]>>>8,r[e]=t[0]}function c(r,e){if(24!==r.length)throw new Error("Nonce array n should have 24 elements (bytes) in it, but it is "+r.length+" elements long.");if(e<1||e>255)throw new Error("Given delta is out of limits.");for(var t=new Uint32Array([e,0]),a=0;a<3;a+=1)f(r,8*a,n(i(r,8*a),t))}function s(r){c(r,1)}function u(r){c(r,2)}function y(r,e,t){var a;if("number"==typeof e){if(e>0xfffffffffffff||e<0)throw new Error("Given delta is out of limits.");a=new Uint32Array([e,e/4294967296])}else a=e;for(var o=t?t.getUint8Array(24):new Uint8Array(24),c=0;c<3;c+=1)f(o,8*c,n(i(r,8*c),a));return o}function l(r,e){for(var t,a=o(i(e,0),i(r,0)),n=1;n<3;n+=1)if(t=o(i(e,8*n),i(r,8*n)),a[0]!==t[0]||a[1]!==t[1])return;return a}t.u64To52=a,t.advance=c,t.advanceOddly=s,t.advanceEvenly=u,t.calculateNonce=y,t.calculateDelta=l,Object.freeze(t)},{}],17:[function(r,e,t){"use strict";function a(r,e,t){for(var a=0,n=0;n<t;n+=1)a|=r[n]^e[n];return 0===a}function n(r,e){return a(r,e,16)}function o(r,e){return a(r,e,32)}t.verify=a,t.v16=n,t.v32=o,Object.freeze(t)},{}],"ecma-nacl":[function(r,e,t){"use strict";function a(r,e){return r.length===e.length&&f.verify(r,e,r.length)}t.secret_box=r("./boxes/secret_box"),t.box=r("./boxes/box"),t.nonce=r("./util/nonce"),t.signing=r("./signing/sign");var n,o=r("./hash/sha512");!function(r){var e;!function(r){r.hash=o.hash,r.makeHasher=o.makeHasher}(e=r.sha512||(r.sha512={}))}(n=t.hashing||(t.hashing={})),Object.freeze(n),Object.freeze(n.sha512);var i=r("./scrypt/scrypt");t.scrypt=i.scrypt,t.arrays=r("./util/arrays");var f=r("./util/verify");t.compareVectors=a,Object.freeze(t)},{"./boxes/box":1,"./boxes/secret_box":5,"./hash/sha512":7,"./scrypt/scrypt":8,"./signing/sign":14,"./util/arrays":15,"./util/nonce":16,"./util/verify":17}]},{},[]); diff --git a/www/js/vendor/sha256.min.js b/www/js/vendor/sha256.min.js new file mode 100644 index 00000000..d217181a --- /dev/null +++ b/www/js/vendor/sha256.min.js @@ -0,0 +1,9 @@ +/** + * [js-sha256]{@link https://github.com/emn178/js-sha256} + * + * @version 0.5.0 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2014-2017 + * @license MIT + */ +!function(){"use strict";function t(t,h){h?(c[0]=c[16]=c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=0,this.blocks=c):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}var h="object"==typeof window?window:{},i=!h.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;i&&(h=global);var s=!h.JS_SHA256_NO_COMMON_JS&&"object"==typeof module&&module.exports,e="function"==typeof define&&define.amd,r="undefined"!=typeof ArrayBuffer,n="0123456789abcdef".split(""),o=[-2147483648,8388608,32768,128],a=[24,16,8,0],f=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],u=["hex","array","digest","arrayBuffer"],c=[],p=function(h,i){return function(s){return new t(i,!0).update(s)[h]()}},d=function(h){var s=p("hex",h);i&&(s=y(s,h)),s.create=function(){return new t(h)},s.update=function(t){return s.create().update(t)};for(var e=0;e<u.length;++e){var r=u[e];s[r]=p(r,h)}return s},y=function(t,h){var i=require("crypto"),s=require("buffer").Buffer,e=h?"sha224":"sha256",n=function(h){if("string"==typeof h)return i.createHash(e).update(h,"utf8").digest("hex");if(r&&h instanceof ArrayBuffer)h=new Uint8Array(h);else if(void 0===h.length)return t(h);return i.createHash(e).update(new s(h)).digest("hex")};return n};t.prototype.update=function(t){if(!this.finalized){var i="string"!=typeof t;i&&r&&t instanceof h.ArrayBuffer&&(t=new Uint8Array(t));for(var s,e,n=0,o=t.length||0,f=this.blocks;o>n;){if(this.hashed&&(this.hashed=!1,f[0]=this.block,f[16]=f[1]=f[2]=f[3]=f[4]=f[5]=f[6]=f[7]=f[8]=f[9]=f[10]=f[11]=f[12]=f[13]=f[14]=f[15]=0),i)for(e=this.start;o>n&&64>e;++n)f[e>>2]|=t[n]<<a[3&e++];else for(e=this.start;o>n&&64>e;++n)s=t.charCodeAt(n),128>s?f[e>>2]|=s<<a[3&e++]:2048>s?(f[e>>2]|=(192|s>>6)<<a[3&e++],f[e>>2]|=(128|63&s)<<a[3&e++]):55296>s||s>=57344?(f[e>>2]|=(224|s>>12)<<a[3&e++],f[e>>2]|=(128|s>>6&63)<<a[3&e++],f[e>>2]|=(128|63&s)<<a[3&e++]):(s=65536+((1023&s)<<10|1023&t.charCodeAt(++n)),f[e>>2]|=(240|s>>18)<<a[3&e++],f[e>>2]|=(128|s>>12&63)<<a[3&e++],f[e>>2]|=(128|s>>6&63)<<a[3&e++],f[e>>2]|=(128|63&s)<<a[3&e++]);this.lastByteIndex=e,this.bytes+=e-this.start,e>=64?(this.block=f[16],this.start=e-64,this.hash(),this.hashed=!0):this.start=e}return this}},t.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,h=this.lastByteIndex;t[16]=this.block,t[h>>2]|=o[3&h],this.block=t[16],h>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[15]=this.bytes<<3,this.hash()}},t.prototype.hash=function(){var t,h,i,s,e,r,n,o,a,u,c,p=this.h0,d=this.h1,y=this.h2,l=this.h3,b=this.h4,v=this.h5,g=this.h6,w=this.h7,k=this.blocks;for(t=16;64>t;++t)e=k[t-15],h=(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3,e=k[t-2],i=(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10,k[t]=k[t-16]+h+k[t-7]+i<<0;for(c=d&y,t=0;64>t;t+=4)this.first?(this.is224?(o=300032,e=k[0]-1413257819,w=e-150054599<<0,l=e+24177077<<0):(o=704751109,e=k[0]-210244248,w=e-1521486534<<0,l=e+143694565<<0),this.first=!1):(h=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),i=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7),o=p&d,s=o^p&y^c,n=b&v^~b&g,e=w+i+n+f[t]+k[t],r=h+s,w=l+e<<0,l=e+r<<0),h=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),i=(w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7),a=l&p,s=a^l&d^o,n=w&b^~w&v,e=g+i+n+f[t+1]+k[t+1],r=h+s,g=y+e<<0,y=e+r<<0,h=(y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10),i=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),u=y&l,s=u^y&p^a,n=g&w^~g&b,e=v+i+n+f[t+2]+k[t+2],r=h+s,v=d+e<<0,d=e+r<<0,h=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),i=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),c=d&y,s=c^d&l^u,n=v&g^~v&w,e=b+i+n+f[t+3]+k[t+3],r=h+s,b=p+e<<0,p=e+r<<0;this.h0=this.h0+p<<0,this.h1=this.h1+d<<0,this.h2=this.h2+y<<0,this.h3=this.h3+l<<0,this.h4=this.h4+b<<0,this.h5=this.h5+v<<0,this.h6=this.h6+g<<0,this.h7=this.h7+w<<0},t.prototype.hex=function(){this.finalize();var t=this.h0,h=this.h1,i=this.h2,s=this.h3,e=this.h4,r=this.h5,o=this.h6,a=this.h7,f=n[t>>28&15]+n[t>>24&15]+n[t>>20&15]+n[t>>16&15]+n[t>>12&15]+n[t>>8&15]+n[t>>4&15]+n[15&t]+n[h>>28&15]+n[h>>24&15]+n[h>>20&15]+n[h>>16&15]+n[h>>12&15]+n[h>>8&15]+n[h>>4&15]+n[15&h]+n[i>>28&15]+n[i>>24&15]+n[i>>20&15]+n[i>>16&15]+n[i>>12&15]+n[i>>8&15]+n[i>>4&15]+n[15&i]+n[s>>28&15]+n[s>>24&15]+n[s>>20&15]+n[s>>16&15]+n[s>>12&15]+n[s>>8&15]+n[s>>4&15]+n[15&s]+n[e>>28&15]+n[e>>24&15]+n[e>>20&15]+n[e>>16&15]+n[e>>12&15]+n[e>>8&15]+n[e>>4&15]+n[15&e]+n[r>>28&15]+n[r>>24&15]+n[r>>20&15]+n[r>>16&15]+n[r>>12&15]+n[r>>8&15]+n[r>>4&15]+n[15&r]+n[o>>28&15]+n[o>>24&15]+n[o>>20&15]+n[o>>16&15]+n[o>>12&15]+n[o>>8&15]+n[o>>4&15]+n[15&o];return this.is224||(f+=n[a>>28&15]+n[a>>24&15]+n[a>>20&15]+n[a>>16&15]+n[a>>12&15]+n[a>>8&15]+n[a>>4&15]+n[15&a]),f},t.prototype.toString=t.prototype.hex,t.prototype.digest=function(){this.finalize();var t=this.h0,h=this.h1,i=this.h2,s=this.h3,e=this.h4,r=this.h5,n=this.h6,o=this.h7,a=[t>>24&255,t>>16&255,t>>8&255,255&t,h>>24&255,h>>16&255,h>>8&255,255&h,i>>24&255,i>>16&255,i>>8&255,255&i,s>>24&255,s>>16&255,s>>8&255,255&s,e>>24&255,e>>16&255,e>>8&255,255&e,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n];return this.is224||a.push(o>>24&255,o>>16&255,o>>8&255,255&o),a},t.prototype.array=t.prototype.digest,t.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),h=new DataView(t);return h.setUint32(0,this.h0),h.setUint32(4,this.h1),h.setUint32(8,this.h2),h.setUint32(12,this.h3),h.setUint32(16,this.h4),h.setUint32(20,this.h5),h.setUint32(24,this.h6),this.is224||h.setUint32(28,this.h7),t};var l=d();l.sha256=l,l.sha224=d(!0),s?module.exports=l:(h.sha256=l.sha256,h.sha224=l.sha224,e&&define(function(){return l}))}(); \ No newline at end of file diff --git a/www/plugins/es/js/controllers/blockchain-controllers.js b/www/plugins/es/js/controllers/blockchain-controllers.js index dc8ff935..5d4589b9 100644 --- a/www/plugins/es/js/controllers/blockchain-controllers.js +++ b/www/plugins/es/js/controllers/blockchain-controllers.js @@ -32,8 +32,8 @@ angular.module('cesium.es.blockchain.controllers', ['cesium.es.services']) PluginServiceProvider.extendState('app.network', { points: { 'buttons': { - templateUrl: "plugins/es/templates/blockchain/view_network_extend.html", - controller: 'ESNetworkViewCtrl' + templateUrl: "plugins/es/templates/network/view_network_extend.html", + controller: 'ESNetworkViewExtendCtrl' } } }) diff --git a/www/plugins/es/js/controllers/message-controllers.js b/www/plugins/es/js/controllers/message-controllers.js index 4e512248..c50f0983 100644 --- a/www/plugins/es/js/controllers/message-controllers.js +++ b/www/plugins/es/js/controllers/message-controllers.js @@ -240,7 +240,7 @@ function ESMessageListController($scope, $rootScope, $state, $timeout, $translat } -function ESMessageComposeController($scope, $controller, UIUtils) { +function ESMessageComposeController($scope, $controller, UIUtils, parameters) { 'ngInject'; // Initialize the super class and extend it. diff --git a/www/plugins/es/js/controllers/wallet-controllers.js b/www/plugins/es/js/controllers/wallet-controllers.js index 48042d2a..3be55be6 100644 --- a/www/plugins/es/js/controllers/wallet-controllers.js +++ b/www/plugins/es/js/controllers/wallet-controllers.js @@ -14,10 +14,6 @@ angular.module('cesium.es.wallet.controllers', ['cesium.es.services']) 'buttons': { templateUrl: "plugins/es/templates/wallet/view_wallet_extend.html", controller: 'ESWotIdentityViewCtrl' - }, - 'nav-buttons': { - templateUrl: "plugins/es/templates/wallet/view_wallet_extend.html", - controller: 'ESWotIdentityViewCtrl' } } }) diff --git a/www/plugins/es/js/services/message-services.js b/www/plugins/es/js/services/message-services.js index e5a76e98..db8a43bb 100644 --- a/www/plugins/es/js/services/message-services.js +++ b/www/plugins/es/js/services/message-services.js @@ -77,13 +77,15 @@ angular.module('cesium.es.message.services', ['ngResource', 'cesium.services', ' throw new Error('no keypair, and user not connected.'); } if (keypair.boxPk && keypair.boxSk) { - return keypair; + return $q.when(keypair); } - var boxKeypair = CryptoUtils.box.keypair.fromSignKeypair(keypair); - csWallet.data.keypair.boxSk = boxKeypair.boxSk; - csWallet.data.keypair.boxPk = boxKeypair.boxPk; - console.debug("[ES] Secret box keypair successfully computed"); - return csWallet.data.keypair; + return CryptoUtils.box.keypair.fromSignKeypair(keypair) + .then(function(boxKeypair) { + csWallet.data.keypair.boxSk = boxKeypair.boxSk; + csWallet.data.keypair.boxPk = boxKeypair.boxPk; + console.debug("[ES] Secret box keypair successfully computed"); + return csWallet.data.keypair; + }); } function countUnreadMessages(pubkey) { @@ -136,38 +138,34 @@ angular.module('cesium.es.message.services', ['ngResource', 'cesium.services', ' return $q.reject({message:'MESSAGE.ERROR.RECIPIENT_IS_MANDATORY'}); } - var boxKeypair = getBoxKeypair(keypair); - // Get recipient var recipientPk = CryptoUtils.util.decode_base58(message[recipientFieldName]); - var boxRecipientPk = CryptoUtils.box.keypair.pkFromSignPk(recipientPk); - - var cypherTitle; - var cypherContent; - var nonce = CryptoUtils.util.random_nonce(); - - var senderSk = boxKeypair.boxSk; return $q.all([ - // Encrypt title - CryptoUtils.box.pack(message.title, nonce, boxRecipientPk, senderSk) - .then(function(cypherText) { - cypherTitle = cypherText; - }), - // Encrypt content - CryptoUtils.box.pack(message.content, nonce, boxRecipientPk, senderSk) - .then(function(cypherText) { - cypherContent = cypherText; - }) - ]) - .then(function(){ - // Send message - return esHttp.record.post(host, port, boxPath)({ - issuer: message.issuer, - recipient: message.recipient, - title: cypherTitle, - content: cypherContent, - nonce: CryptoUtils.util.encode_base58(nonce) + getBoxKeypair(keypair), + CryptoUtils.box.keypair.pkFromSignPk(recipientPk), + CryptoUtils.util.random_nonce() + ]) + .then(function(res) { + var boxKeypair = res[0]; + var boxRecipientPk = res[1]; + var nonce = res[2]; + var senderSk = boxKeypair.boxSk; + return $q.all([ + // Encrypt title + CryptoUtils.box.pack(message.title, nonce, boxRecipientPk, senderSk), + // Encrypt content + CryptoUtils.box.pack(message.content, nonce, boxRecipientPk, senderSk) + ]) + .then(function(cypherTexts){ + // Send message + return esHttp.record.post(host, port, boxPath)({ + issuer: message.issuer, + recipient: message.recipient, + title: cypherTexts[0], + content: cypherTexts[1], + nonce: CryptoUtils.util.encode_base58(nonce) + }); }); }); } @@ -311,49 +309,54 @@ angular.module('cesium.es.message.services', ['ngResource', 'cesium.services', ' } function decryptMessages(messages, keypair) { - var jobs = []; + var now = new Date().getTime(); - var boxKeypair = getBoxKeypair(keypair); var issuerBoxPks = {}; // a map used as cache - messages = messages.reduce(function(result, message) { - var issuerBoxPk = issuerBoxPks[message.issuer]; - if (!issuerBoxPk) { - issuerBoxPk = CryptoUtils.box.keypair.pkFromSignPk(CryptoUtils.util.decode_base58(message.issuer)); - issuerBoxPks[message.issuer] = issuerBoxPk; // fill box pk cache - } - - var nonce = CryptoUtils.util.decode_base58(message.nonce); - - message.valid = true; - - // title - jobs.push(CryptoUtils.box.open(message.title, nonce, issuerBoxPk, boxKeypair.boxSk) - .then(function(title) { - message.title = title; - }) - .catch(function(err){ - console.warn('[ES] [message] invalid cypher title'); - message.valid = false; - })); - - // content - jobs.push(CryptoUtils.box.open(message.content, nonce, issuerBoxPk, boxKeypair.boxSk) - .then(function(content) { - message.content = content; - }) - .catch(function(err){ - console.warn('[ES] [message] invalid cypher content'); - message.valid = false; - })); - return result.concat(message); - }, []); - - return $q.all(jobs) + var jobs = [getBoxKeypair(keypair)]; + return $q.all(messages.reduce(function(jobs, message) { + if (issuerBoxPks[message.issuer]) return res; + return jobs.concat( + CryptoUtils.box.keypair.pkFromSignPk(CryptoUtils.util.decode_base58(message.issuer)) + .then(function(issuerBoxPk) { + issuerBoxPks[message.issuer] = issuerBoxPk; // fill box pk cache + })); + }, jobs)) + .then(function(res){ + var boxKeypair = res[0]; + return $q.all(messages.reduce(function(jobs, message) { + var issuerBoxPk = issuerBoxPks[message.issuer]; + var nonce = CryptoUtils.util.decode_base58(message.nonce); + message.valid = true; + + return jobs.concat( + // title + CryptoUtils.box.open(message.title, nonce, issuerBoxPk, boxKeypair.boxSk) + .then(function(title) { + message.title = title; + }) + .catch(function(err){ + console.warn('[ES] [message] invalid cypher title'); + message.valid = false; + }), + + // content + CryptoUtils.box.open(message.content, nonce, issuerBoxPk, boxKeypair.boxSk) + .then(function(content) { + message.content = content; + }) + .catch(function(err){ + console.warn('[ES] [message] invalid cypher content'); + message.valid = false; + }) + ); + }, [])); + }) .then(function() { console.debug('[ES] [message] All messages decrypted in ' + (new Date().getTime() - now) + 'ms'); return messages; }); + } function removeMessage(id, type) { @@ -457,7 +460,7 @@ angular.module('cesium.es.message.services', ['ngResource', 'cesium.services', ' } function addListeners() { - console.debug("[ES] Enable message extension"); + console.debug("[ES] [message] Enable"); // Extend csWallet.loadData() listeners = [ diff --git a/www/plugins/es/js/services/user-services.js b/www/plugins/es/js/services/user-services.js index bdc38ca4..7939c0a6 100644 --- a/www/plugins/es/js/services/user-services.js +++ b/www/plugins/es/js/services/user-services.js @@ -153,8 +153,20 @@ angular.module('cesium.es.user.services', ['cesium.services', 'cesium.es.http.se // Load settings function loadSettings(pubkey, keypair) { - return esHttp.get(host, port, '/user/settings/:id')({id: pubkey}) + return $q.all([ + CryptoUtils.box.keypair.fromSignKeypair(keypair), + esHttp.get(host, port, '/user/settings/:id')({id: pubkey}) + .catch(function(err){ + if (err && err.ucode && err.ucode == 404) { + return null; // not found + } + else { + throw err; + } + })]) .then(function(res) { + boxKeypair = res[0]; + res = res[1]; if (!res || !res._source) { return; } @@ -164,7 +176,6 @@ angular.module('cesium.es.user.services', ['cesium.services', 'cesium.es.http.se console.debug('[ES] [user] Local settings already up to date'); return; } - var boxKeypair = CryptoUtils.box.keypair.fromSignKeypair(keypair); var nonce = CryptoUtils.util.decode_base58(record.nonce); // Decrypt settings content return CryptoUtils.box.open(record.content, nonce, boxKeypair.boxPk, boxKeypair.boxSk) @@ -173,14 +184,6 @@ angular.module('cesium.es.user.services', ['cesium.services', 'cesium.es.http.se settings.time = record.time; return settings; }); - }) - .catch(function(err){ - if (err && err.ucode && err.ucode == 404) { - return null; // not found - } - else { - throw err; - } }); } @@ -203,7 +206,7 @@ angular.module('cesium.es.user.services', ['cesium.services', 'cesium.es.http.se console.debug('[ES] [user] Waiting crypto lib loading...'); $timeout(function() { onWalletLogin(data, deferred); - }, 200); + }, 50); return; } @@ -473,34 +476,39 @@ angular.module('cesium.es.user.services', ['cesium.services', 'cesium.es.http.se console.debug('[ES] [user] Saving user settings to ES...'); - var boxKeypair = CryptoUtils.box.keypair.fromSignKeypair(csWallet.data.keypair); - var nonce = CryptoUtils.util.random_nonce(); - - var record = { - issuer: csWallet.data.pubkey, - nonce: CryptoUtils.util.encode_base58(nonce), - time: esHttp.date.now() - }; - - var filteredData = copyUsingSpec(data, SETTINGS_SAVE_SPEC); - - var json = JSON.stringify(filteredData); + return $q.all([ + CryptoUtils.box.keypair.fromSignKeypair(csWallet.data.keypair), + CryptoUtils.util.random_nonce() + ]) + .then(function(res) { + var boxKeypair = res[0]; + var nonce = res[1]; + var record = { + issuer: csWallet.data.pubkey, + nonce: CryptoUtils.util.encode_base58(nonce), + time: esHttp.date.now() + }; - return CryptoUtils.box.pack(json, nonce, boxKeypair.boxPk, boxKeypair.boxSk) - .then(function(cypherText) { - record.content = cypherText; - return !data.time ? - // create - esHttp.record.post(host, port, '/user/settings')(record) : - // or update - esHttp.record.post(host, port, '/user/settings/:pubkey/_update')(record, {pubkey: record.issuer}); - }) - .then(function() { - // Change settings version - csSettings.data.time = record.time; - restoringSettings = true; - csSettings.store(); - console.debug('[ES] [user] User settings saved in ES'); + var filteredData = copyUsingSpec(data, SETTINGS_SAVE_SPEC); + + var json = JSON.stringify(filteredData); + + return CryptoUtils.box.pack(json, nonce, boxKeypair.boxPk, boxKeypair.boxSk) + .then(function(cypherText) { + record.content = cypherText; + return !data.time ? + // create + esHttp.record.post(host, port, '/user/settings')(record) : + // or update + esHttp.record.post(host, port, '/user/settings/:pubkey/_update')(record, {pubkey: record.issuer}); + }) + .then(function() { + // Change settings version + csSettings.data.time = record.time; + restoringSettings = true; + csSettings.store(); + console.debug('[ES] [user] User settings saved in ES'); + }); }) .catch(function(err) { console.error(err); diff --git a/www/plugins/es/templates/message/list.html b/www/plugins/es/templates/message/list.html index b80ae160..d0012c95 100644 --- a/www/plugins/es/templates/message/list.html +++ b/www/plugins/es/templates/message/list.html @@ -48,7 +48,7 @@ </a> </div> - <div class="center" ng-if="loading"> + <div class="center padding" ng-if="loading"> <ion-spinner icon="android"></ion-spinner> </div> </ion-list> @@ -68,10 +68,11 @@ <i ng-if="!msg.avatar" class="item-image icon" ng-class="{'ion-person': msg.uid, 'ion-email': !msg.uid}"></i> <i ng-if="msg.avatar" class="item-image avatar" style="background-image: url({{::msg.avatar.src}})"></i> - <h4 class="pull-right"> + <h4 class="pull-right hidden-xs hidden-sm"> <span class="dark"><i class="ion-clock"></i> {{::msg.time|formatFromNow}}</span> - <span class="gray">| {{::msg.time|formatDate}}</span> + <span class="gray ">| {{::msg.time|formatDate}}</span> </h4> + <h4 class="pull-right visible-xs visible-sm dark"><i class="ion-clock"></i> {{::msg.time|formatFromNow}}</h4> <h3> <a class="positive" ng-if="msg.name||msg.uid" diff --git a/www/plugins/es/templates/message/popover_actions.html b/www/plugins/es/templates/message/lookup_popover_actions.html similarity index 100% rename from www/plugins/es/templates/message/popover_actions.html rename to www/plugins/es/templates/message/lookup_popover_actions.html diff --git a/www/plugins/es/templates/message/view_message.html b/www/plugins/es/templates/message/view_message.html index 714dd955..d3adc2eb 100644 --- a/www/plugins/es/templates/message/view_message.html +++ b/www/plugins/es/templates/message/view_message.html @@ -47,9 +47,8 @@ <i ng-if="!formData.avatar" class="item-image" ng-class="{'ion-person': formData.uid, 'ion-email': !formData.uid}"></i> <i ng-if="formData.avatar" class="item-image avatar" style="background-image: url({{::formData.avatar.src}})"></i> - <h1 class="title" ng-bind-html="formData.title"></h1> + <h1 class="title hidden-xs hidden-sm" ng-bind-html="formData.title"></h1> <h4> - <i class="ion-clock"></i> {{type == 'inbox' ? 'MESSAGE.VIEW.SENDER': 'MESSAGE.VIEW.RECIPIENT'|translate}} <a class="positive" ui-sref="app.wot_identity({pubkey: (type == 'inbox') ? formData.issuer : formData.recipient, uid: formData.name||formData.uid})"> <span ng-if="formData.uid"> @@ -61,20 +60,29 @@ {{formData.issuer|formatPubkey}} </span> </a> - <span> + <span class="hidden-xs hidden-sm"> + <i class="ion-clock"></i> {{formData.time|formatFromNow}} - <span class="gray hidden-xs">| + <span class="gray">| {{formData.time | formatDate}} </span> </span> </h4> + <h5 class="gray visible-xs visible-sm"> + <i class="ion-clock"></i> {{formData.time | formatDate}} + </h5> </div> + <!-- content --> + <ion-item class="visible-xs visible-sm"> + <h1 class="title" ng-bind-html="formData.title"></h1> + </ion-item> + <!-- content --> <ion-item> - <h2> + <p class="dark"> <span class="text-keep-lines" ng-bind-html="formData.content"></span> - </h2> + </p> <div class="padding gray" ng-if="!formData.content" translate> MESSAGE.VIEW.NO_CONTENT diff --git a/www/plugins/es/templates/wallet/view_wallet_extend.html b/www/plugins/es/templates/wallet/view_wallet_extend.html index cec1a30b..7d069c1e 100644 --- a/www/plugins/es/templates/wallet/view_wallet_extend.html +++ b/www/plugins/es/templates/wallet/view_wallet_extend.html @@ -1,10 +1,3 @@ -<!-- Nav-Buttons section --> -<ng-if ng-if="enable && extensionPoint === 'nav-buttons'"> - <button class="button button-bar button-icon button-clear visible-xs visible-sm" - ui-sref="app.user_edit_profile"> - <i class="icon ion-android-create"></i> - </button> -</ng-if> <!-- Buttons section --> <ng-if ng-if="enable && extensionPoint === 'buttons'"> -- GitLab