(function webpackUniversalModuleDefinition(e,t){if(typeof exports==="object"&&typeof module==="object")module.exports=t();else if(typeof define==="function"&&define.amd)define([],t);else if(typeof exports==="object")exports["CryptoGost"]=t();else e["CryptoGost"]=t()})(this,function(){return function(e){var t={};function __webpack_require__(r){if(t[r]){return t[r].exports}var n=t[r]={i:r,l:false,exports:{}};e[r].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.m=e;__webpack_require__.c=t;__webpack_require__.d=function(e,t,r){if(!__webpack_require__.o(e,t)){Object.defineProperty(e,t,{enumerable:true,get:r})}};__webpack_require__.r=function(e){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})};__webpack_require__.t=function(e,t){if(t&1)e=__webpack_require__(e);if(t&8)return e;if(t&4&&typeof e==="object"&&e&&e.__esModule)return e;var r=Object.create(null);__webpack_require__.r(r);Object.defineProperty(r,"default",{enumerable:true,value:e});if(t&2&&typeof e!="string")for(var n in e)__webpack_require__.d(r,n,function(t){return e[t]}.bind(null,n));return r};__webpack_require__.n=function(e){var t=e&&e.__esModule?function getDefault(){return e["default"]}:function getModuleExports(){return e};__webpack_require__.d(t,"a",t);return t};__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};__webpack_require__.p="";return __webpack_require__(__webpack_require__.s=177)}([function(e,t){if(typeof Object.create==="function"){e.exports=function inherits(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{e.exports=function inherits(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}}},function(e,t,r){var n=r(2);var i=n.Buffer;function copyProps(e,t){for(var r in e){t[r]=e[r]}}if(i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow){e.exports=n}else{copyProps(n,t);t.Buffer=SafeBuffer}function SafeBuffer(e,t,r){return i(e,t,r)}copyProps(i,SafeBuffer);SafeBuffer.from=function(e,t,r){if(typeof e==="number"){throw new TypeError("Argument must not be a number")}return i(e,t,r)};SafeBuffer.alloc=function(e,t,r){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}var n=i(e);if(t!==undefined){if(typeof r==="string"){n.fill(t,r)}else{n.fill(t)}}else{n.fill(0)}return n};SafeBuffer.allocUnsafe=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return i(e)};SafeBuffer.allocUnsafeSlow=function(e){if(typeof e!=="number"){throw new TypeError("Argument must be a number")}return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(e){
/*!
 * The buffer module from node.js, for the browser.
 *
 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
 * @license  MIT
 */
var n=r(169);var i=r(168);var a=r(76);t.Buffer=Buffer;t.SlowBuffer=SlowBuffer;t.INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=e.TYPED_ARRAY_SUPPORT!==undefined?e.TYPED_ARRAY_SUPPORT:typedArraySupport();t.kMaxLength=kMaxLength();function typedArraySupport(){try{var e=new Uint8Array(1);e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return e.foo()===42&&typeof e.subarray==="function"&&e.subarray(1,1).byteLength===0}catch(e){return false}}function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()<t){throw new RangeError("Invalid typed array length")}if(Buffer.TYPED_ARRAY_SUPPORT){e=new Uint8Array(t);e.__proto__=Buffer.prototype}else{if(e===null){e=new Buffer(t)}e.length=t}return e}function Buffer(e,t,r){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(e,t,r)}if(typeof e==="number"){if(typeof t==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return allocUnsafe(this,e)}return from(this,e,t,r)}Buffer.poolSize=8192;Buffer._augment=function(e){e.__proto__=Buffer.prototype;return e};function from(e,t,r,n){if(typeof t==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&t instanceof ArrayBuffer){return fromArrayBuffer(e,t,r,n)}if(typeof t==="string"){return fromString(e,t,r)}return fromObject(e,t)}Buffer.from=function(e,t,r){return from(null,e,t,r)};if(Buffer.TYPED_ARRAY_SUPPORT){Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;if(typeof Symbol!=="undefined"&&Symbol.species&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true})}}function assertSize(e){if(typeof e!=="number"){throw new TypeError('"size" argument must be a number')}else if(e<0){throw new RangeError('"size" argument must not be negative')}}function alloc(e,t,r,n){assertSize(t);if(t<=0){return createBuffer(e,t)}if(r!==undefined){return typeof n==="string"?createBuffer(e,t).fill(r,n):createBuffer(e,t).fill(r)}return createBuffer(e,t)}Buffer.alloc=function(e,t,r){return alloc(null,e,t,r)};function allocUnsafe(e,t){assertSize(t);e=createBuffer(e,t<0?0:checked(t)|0);if(!Buffer.TYPED_ARRAY_SUPPORT){for(var r=0;r<t;++r){e[r]=0}}return e}Buffer.allocUnsafe=function(e){return allocUnsafe(null,e)};Buffer.allocUnsafeSlow=function(e){return allocUnsafe(null,e)};function fromString(e,t,r){if(typeof r!=="string"||r===""){r="utf8"}if(!Buffer.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}var n=byteLength(t,r)|0;e=createBuffer(e,n);var i=e.write(t,r);if(i!==n){e=e.slice(0,i)}return e}function fromArrayLike(e,t){var r=t.length<0?0:checked(t.length)|0;e=createBuffer(e,r);for(var n=0;n<r;n+=1){e[n]=t[n]&255}return e}function fromArrayBuffer(e,t,r,n){t.byteLength;if(r<0||t.byteLength<r){throw new RangeError("'offset' is out of bounds")}if(t.byteLength<r+(n||0)){throw new RangeError("'length' is out of bounds")}if(r===undefined&&n===undefined){t=new Uint8Array(t)}else if(n===undefined){t=new Uint8Array(t,r)}else{t=new Uint8Array(t,r,n)}if(Buffer.TYPED_ARRAY_SUPPORT){e=t;e.__proto__=Buffer.prototype}else{e=fromArrayLike(e,t)}return e}function fromObject(e,t){if(Buffer.isBuffer(t)){var r=checked(t.length)|0;e=createBuffer(e,r);if(e.length===0){return e}t.copy(e,0,0,r);return e}if(t){if(typeof ArrayBuffer!=="undefined"&&t.buffer instanceof ArrayBuffer||"length"in t){if(typeof t.length!=="number"||isnan(t.length)){return createBuffer(e,0)}return fromArrayLike(e,t)}if(t.type==="Buffer"&&a(t.data)){return fromArrayLike(e,t.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(e){if(e>=kMaxLength()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength().toString(16)+" bytes")}return e|0}function SlowBuffer(e){if(+e!=e){e=0}return Buffer.alloc(+e)}Buffer.isBuffer=function isBuffer(e){return!!(e!=null&&e._isBuffer)};Buffer.compare=function compare(e,t){if(!Buffer.isBuffer(e)||!Buffer.isBuffer(t)){throw new TypeError("Arguments must be Buffers")}if(e===t)return 0;var r=e.length;var n=t.length;for(var i=0,a=Math.min(r,n);i<a;++i){if(e[i]!==t[i]){r=e[i];n=t[i];break}}if(r<n)return-1;if(n<r)return 1;return 0};Buffer.isEncoding=function isEncoding(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};Buffer.concat=function concat(e,t){if(!a(e)){throw new TypeError('"list" argument must be an Array of Buffers')}if(e.length===0){return Buffer.alloc(0)}var r;if(t===undefined){t=0;for(r=0;r<e.length;++r){t+=e[r].length}}var n=Buffer.allocUnsafe(t);var i=0;for(r=0;r<e.length;++r){var o=e[r];if(!Buffer.isBuffer(o)){throw new TypeError('"list" argument must be an Array of Buffers')}o.copy(n,i);i+=o.length}return n};function byteLength(e,t){if(Buffer.isBuffer(e)){return e.length}if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer)){return e.byteLength}if(typeof e!=="string"){e=""+e}var r=e.length;if(r===0)return 0;var n=false;for(;;){switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case undefined:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return base64ToBytes(e).length;default:if(n)return utf8ToBytes(e).length;t=(""+t).toLowerCase();n=true}}}Buffer.byteLength=byteLength;function slowToString(e,t,r){var n=false;if(t===undefined||t<0){t=0}if(t>this.length){return""}if(r===undefined||r>this.length){r=this.length}if(r<=0){return""}r>>>=0;t>>>=0;if(r<=t){return""}if(!e)e="utf8";while(true){switch(e){case"hex":return hexSlice(this,t,r);case"utf8":case"utf-8":return utf8Slice(this,t,r);case"ascii":return asciiSlice(this,t,r);case"latin1":case"binary":return latin1Slice(this,t,r);case"base64":return base64Slice(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();n=true}}}Buffer.prototype._isBuffer=true;function swap(e,t,r){var n=e[t];e[t]=e[r];e[r]=n}Buffer.prototype.swap16=function swap16(){var e=this.length;if(e%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var t=0;t<e;t+=2){swap(this,t,t+1)}return this};Buffer.prototype.swap32=function swap32(){var e=this.length;if(e%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var t=0;t<e;t+=4){swap(this,t,t+3);swap(this,t+1,t+2)}return this};Buffer.prototype.swap64=function swap64(){var e=this.length;if(e%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var t=0;t<e;t+=8){swap(this,t,t+7);swap(this,t+1,t+6);swap(this,t+2,t+5);swap(this,t+3,t+4)}return this};Buffer.prototype.toString=function toString(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return utf8Slice(this,0,e);return slowToString.apply(this,arguments)};Buffer.prototype.equals=function equals(e){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return Buffer.compare(this,e)===0};Buffer.prototype.inspect=function inspect(){var e="";var r=t.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,r).match(/.{2}/g).join(" ");if(this.length>r)e+=" ... "}return"<Buffer "+e+">"};Buffer.prototype.compare=function compare(e,t,r,n,i){if(!Buffer.isBuffer(e)){throw new TypeError("Argument must be a Buffer")}if(t===undefined){t=0}if(r===undefined){r=e?e.length:0}if(n===undefined){n=0}if(i===undefined){i=this.length}if(t<0||r>e.length||n<0||i>this.length){throw new RangeError("out of range index")}if(n>=i&&t>=r){return 0}if(n>=i){return-1}if(t>=r){return 1}t>>>=0;r>>>=0;n>>>=0;i>>>=0;if(this===e)return 0;var a=i-n;var o=r-t;var s=Math.min(a,o);var f=this.slice(n,i);var c=e.slice(t,r);for(var u=0;u<s;++u){if(f[u]!==c[u]){a=f[u];o=c[u];break}}if(a<o)return-1;if(o<a)return 1;return 0};function bidirectionalIndexOf(e,t,r,n,i){if(e.length===0)return-1;if(typeof r==="string"){n=r;r=0}else if(r>2147483647){r=2147483647}else if(r<-2147483648){r=-2147483648}r=+r;if(isNaN(r)){r=i?0:e.length-1}if(r<0)r=e.length+r;if(r>=e.length){if(i)return-1;else r=e.length-1}else if(r<0){if(i)r=0;else return-1}if(typeof t==="string"){t=Buffer.from(t,n)}if(Buffer.isBuffer(t)){if(t.length===0){return-1}return arrayIndexOf(e,t,r,n,i)}else if(typeof t==="number"){t=t&255;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(i){return Uint8Array.prototype.indexOf.call(e,t,r)}else{return Uint8Array.prototype.lastIndexOf.call(e,t,r)}}return arrayIndexOf(e,[t],r,n,i)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,r,n,i){var a=1;var o=e.length;var s=t.length;if(n!==undefined){n=String(n).toLowerCase();if(n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le"){if(e.length<2||t.length<2){return-1}a=2;o/=2;s/=2;r/=2}}function read(e,t){if(a===1){return e[t]}else{return e.readUInt16BE(t*a)}}var f;if(i){var c=-1;for(f=r;f<o;f++){if(read(e,f)===read(t,c===-1?0:f-c)){if(c===-1)c=f;if(f-c+1===s)return c*a}else{if(c!==-1)f-=f-c;c=-1}}}else{if(r+s>o)r=o-s;for(f=r;f>=0;f--){var u=true;for(var d=0;d<s;d++){if(read(e,f+d)!==read(t,d)){u=false;break}}if(u)return f}}return-1}Buffer.prototype.includes=function includes(e,t,r){return this.indexOf(e,t,r)!==-1};Buffer.prototype.indexOf=function indexOf(e,t,r){return bidirectionalIndexOf(this,e,t,r,true)};Buffer.prototype.lastIndexOf=function lastIndexOf(e,t,r){return bidirectionalIndexOf(this,e,t,r,false)};function hexWrite(e,t,r,n){r=Number(r)||0;var i=e.length-r;if(!n){n=i}else{n=Number(n);if(n>i){n=i}}var a=t.length;if(a%2!==0)throw new TypeError("Invalid hex string");if(n>a/2){n=a/2}for(var o=0;o<n;++o){var s=parseInt(t.substr(o*2,2),16);if(isNaN(s))return o;e[r+o]=s}return o}function utf8Write(e,t,r,n){return blitBuffer(utf8ToBytes(t,e.length-r),e,r,n)}function asciiWrite(e,t,r,n){return blitBuffer(asciiToBytes(t),e,r,n)}function latin1Write(e,t,r,n){return asciiWrite(e,t,r,n)}function base64Write(e,t,r,n){return blitBuffer(base64ToBytes(t),e,r,n)}function ucs2Write(e,t,r,n){return blitBuffer(utf16leToBytes(t,e.length-r),e,r,n)}Buffer.prototype.write=function write(e,t,r,n){if(t===undefined){n="utf8";r=this.length;t=0}else if(r===undefined&&typeof t==="string"){n=t;r=this.length;t=0}else if(isFinite(t)){t=t|0;if(isFinite(r)){r=r|0;if(n===undefined)n="utf8"}else{n=r;r=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var i=this.length-t;if(r===undefined||r>i)r=i;if(e.length>0&&(r<0||t<0)||t>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!n)n="utf8";var a=false;for(;;){switch(n){case"hex":return hexWrite(this,e,t,r);case"utf8":case"utf-8":return utf8Write(this,e,t,r);case"ascii":return asciiWrite(this,e,t,r);case"latin1":case"binary":return latin1Write(this,e,t,r);case"base64":return base64Write(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase();a=true}}};Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(e,t,r){if(t===0&&r===e.length){return n.fromByteArray(e)}else{return n.fromByteArray(e.slice(t,r))}}function utf8Slice(e,t,r){r=Math.min(e.length,r);var n=[];var i=t;while(i<r){var a=e[i];var o=null;var s=a>239?4:a>223?3:a>191?2:1;if(i+s<=r){var f,c,u,d;switch(s){case 1:if(a<128){o=a}break;case 2:f=e[i+1];if((f&192)===128){d=(a&31)<<6|f&63;if(d>127){o=d}}break;case 3:f=e[i+1];c=e[i+2];if((f&192)===128&&(c&192)===128){d=(a&15)<<12|(f&63)<<6|c&63;if(d>2047&&(d<55296||d>57343)){o=d}}break;case 4:f=e[i+1];c=e[i+2];u=e[i+3];if((f&192)===128&&(c&192)===128&&(u&192)===128){d=(a&15)<<18|(f&63)<<12|(c&63)<<6|u&63;if(d>65535&&d<1114112){o=d}}}}if(o===null){o=65533;s=1}else if(o>65535){o-=65536;n.push(o>>>10&1023|55296);o=56320|o&1023}n.push(o);i+=s}return decodeCodePointsArray(n)}var o=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=o){return String.fromCharCode.apply(String,e)}var r="";var n=0;while(n<t){r+=String.fromCharCode.apply(String,e.slice(n,n+=o))}return r}function asciiSlice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i){n+=String.fromCharCode(e[i]&127)}return n}function latin1Slice(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i){n+=String.fromCharCode(e[i])}return n}function hexSlice(e,t,r){var n=e.length;if(!t||t<0)t=0;if(!r||r<0||r>n)r=n;var i="";for(var a=t;a<r;++a){i+=toHex(e[a])}return i}function utf16leSlice(e,t,r){var n=e.slice(t,r);var i="";for(var a=0;a<n.length;a+=2){i+=String.fromCharCode(n[a]+n[a+1]*256)}return i}Buffer.prototype.slice=function slice(e,t){var r=this.length;e=~~e;t=t===undefined?r:~~t;if(e<0){e+=r;if(e<0)e=0}else if(e>r){e=r}if(t<0){t+=r;if(t<0)t=0}else if(t>r){t=r}if(t<e)t=e;var n;if(Buffer.TYPED_ARRAY_SUPPORT){n=this.subarray(e,t);n.__proto__=Buffer.prototype}else{var i=t-e;n=new Buffer(i,undefined);for(var a=0;a<i;++a){n[a]=this[a+e]}}return n};function checkOffset(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}Buffer.prototype.readUIntLE=function readUIntLE(e,t,r){e=e|0;t=t|0;if(!r)checkOffset(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a<t&&(i*=256)){n+=this[e+a]*i}return n};Buffer.prototype.readUIntBE=function readUIntBE(e,t,r){e=e|0;t=t|0;if(!r){checkOffset(e,t,this.length)}var n=this[e+--t];var i=1;while(t>0&&(i*=256)){n+=this[e+--t]*i}return n};Buffer.prototype.readUInt8=function readUInt8(e,t){if(!t)checkOffset(e,1,this.length);return this[e]};Buffer.prototype.readUInt16LE=function readUInt16LE(e,t){if(!t)checkOffset(e,2,this.length);return this[e]|this[e+1]<<8};Buffer.prototype.readUInt16BE=function readUInt16BE(e,t){if(!t)checkOffset(e,2,this.length);return this[e]<<8|this[e+1]};Buffer.prototype.readUInt32LE=function readUInt32LE(e,t){if(!t)checkOffset(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};Buffer.prototype.readUInt32BE=function readUInt32BE(e,t){if(!t)checkOffset(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};Buffer.prototype.readIntLE=function readIntLE(e,t,r){e=e|0;t=t|0;if(!r)checkOffset(e,t,this.length);var n=this[e];var i=1;var a=0;while(++a<t&&(i*=256)){n+=this[e+a]*i}i*=128;if(n>=i)n-=Math.pow(2,8*t);return n};Buffer.prototype.readIntBE=function readIntBE(e,t,r){e=e|0;t=t|0;if(!r)checkOffset(e,t,this.length);var n=t;var i=1;var a=this[e+--n];while(n>0&&(i*=256)){a+=this[e+--n]*i}i*=128;if(a>=i)a-=Math.pow(2,8*t);return a};Buffer.prototype.readInt8=function readInt8(e,t){if(!t)checkOffset(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};Buffer.prototype.readInt16LE=function readInt16LE(e,t){if(!t)checkOffset(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};Buffer.prototype.readInt16BE=function readInt16BE(e,t){if(!t)checkOffset(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};Buffer.prototype.readInt32LE=function readInt32LE(e,t){if(!t)checkOffset(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};Buffer.prototype.readInt32BE=function readInt32BE(e,t){if(!t)checkOffset(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};Buffer.prototype.readFloatLE=function readFloatLE(e,t){if(!t)checkOffset(e,4,this.length);return i.read(this,e,true,23,4)};Buffer.prototype.readFloatBE=function readFloatBE(e,t){if(!t)checkOffset(e,4,this.length);return i.read(this,e,false,23,4)};Buffer.prototype.readDoubleLE=function readDoubleLE(e,t){if(!t)checkOffset(e,8,this.length);return i.read(this,e,true,52,8)};Buffer.prototype.readDoubleBE=function readDoubleBE(e,t){if(!t)checkOffset(e,8,this.length);return i.read(this,e,false,52,8)};function checkInt(e,t,r,n,i,a){if(!Buffer.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}Buffer.prototype.writeUIntLE=function writeUIntLE(e,t,r,n){e=+e;t=t|0;r=r|0;if(!n){var i=Math.pow(2,8*r)-1;checkInt(this,e,t,r,i,0)}var a=1;var o=0;this[t]=e&255;while(++o<r&&(a*=256)){this[t+o]=e/a&255}return t+r};Buffer.prototype.writeUIntBE=function writeUIntBE(e,t,r,n){e=+e;t=t|0;r=r|0;if(!n){var i=Math.pow(2,8*r)-1;checkInt(this,e,t,r,i,0)}var a=r-1;var o=1;this[t+a]=e&255;while(--a>=0&&(o*=256)){this[t+a]=e/o&255}return t+r};Buffer.prototype.writeUInt8=function writeUInt8(e,t,r){e=+e;t=t|0;if(!r)checkInt(this,e,t,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e&255;return t+1};function objectWriteUInt16(e,t,r,n){if(t<0)t=65535+t+1;for(var i=0,a=Math.min(e.length-r,2);i<a;++i){e[r+i]=(t&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}}Buffer.prototype.writeUInt16LE=function writeUInt16LE(e,t,r){e=+e;t=t|0;if(!r)checkInt(this,e,t,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8}else{objectWriteUInt16(this,e,t,true)}return t+2};Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,r){e=+e;t=t|0;if(!r)checkInt(this,e,t,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e&255}else{objectWriteUInt16(this,e,t,false)}return t+2};function objectWriteUInt32(e,t,r,n){if(t<0)t=4294967295+t+1;for(var i=0,a=Math.min(e.length-r,4);i<a;++i){e[r+i]=t>>>(n?i:3-i)*8&255}}Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,r){e=+e;t=t|0;if(!r)checkInt(this,e,t,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e&255}else{objectWriteUInt32(this,e,t,true)}return t+4};Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,r){e=+e;t=t|0;if(!r)checkInt(this,e,t,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e&255}else{objectWriteUInt32(this,e,t,false)}return t+4};Buffer.prototype.writeIntLE=function writeIntLE(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);checkInt(this,e,t,r,i-1,-i)}var a=0;var o=1;var s=0;this[t]=e&255;while(++a<r&&(o*=256)){if(e<0&&s===0&&this[t+a-1]!==0){s=1}this[t+a]=(e/o>>0)-s&255}return t+r};Buffer.prototype.writeIntBE=function writeIntBE(e,t,r,n){e=+e;t=t|0;if(!n){var i=Math.pow(2,8*r-1);checkInt(this,e,t,r,i-1,-i)}var a=r-1;var o=1;var s=0;this[t+a]=e&255;while(--a>=0&&(o*=256)){if(e<0&&s===0&&this[t+a+1]!==0){s=1}this[t+a]=(e/o>>0)-s&255}return t+r};Buffer.prototype.writeInt8=function writeInt8(e,t,r){e=+e;t=t|0;if(!r)checkInt(this,e,t,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e&255;return t+1};Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,r){e=+e;t=t|0;if(!r)checkInt(this,e,t,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8}else{objectWriteUInt16(this,e,t,true)}return t+2};Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,r){e=+e;t=t|0;if(!r)checkInt(this,e,t,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e&255}else{objectWriteUInt16(this,e,t,false)}return t+2};Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,r){e=+e;t=t|0;if(!r)checkInt(this,e,t,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else{objectWriteUInt32(this,e,t,true)}return t+4};Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,r){e=+e;t=t|0;if(!r)checkInt(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e&255}else{objectWriteUInt32(this,e,t,false)}return t+4};function checkIEEE754(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function writeFloat(e,t,r,n,a){if(!a){checkIEEE754(e,t,r,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(e,t,r,n,23,4);return r+4}Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,r){return writeFloat(this,e,t,true,r)};Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,r){return writeFloat(this,e,t,false,r)};function writeDouble(e,t,r,n,a){if(!a){checkIEEE754(e,t,r,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(e,t,r,n,52,8);return r+8}Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,r){return writeDouble(this,e,t,true,r)};Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,r){return writeDouble(this,e,t,false,r)};Buffer.prototype.copy=function copy(e,t,r,n){if(!r)r=0;if(!n&&n!==0)n=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(n>0&&n<r)n=r;if(n===r)return 0;if(e.length===0||this.length===0)return 0;if(t<0){throw new RangeError("targetStart out of bounds")}if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");if(n>this.length)n=this.length;if(e.length-t<n-r){n=e.length-t+r}var i=n-r;var a;if(this===e&&r<t&&t<n){for(a=i-1;a>=0;--a){e[a+t]=this[a+r]}}else if(i<1e3||!Buffer.TYPED_ARRAY_SUPPORT){for(a=0;a<i;++a){e[a+t]=this[a+r]}}else{Uint8Array.prototype.set.call(e,this.subarray(r,r+i),t)}return i};Buffer.prototype.fill=function fill(e,t,r,n){if(typeof e==="string"){if(typeof t==="string"){n=t;t=0;r=this.length}else if(typeof r==="string"){n=r;r=this.length}if(e.length===1){var i=e.charCodeAt(0);if(i<256){e=i}}if(n!==undefined&&typeof n!=="string"){throw new TypeError("encoding must be a string")}if(typeof n==="string"&&!Buffer.isEncoding(n)){throw new TypeError("Unknown encoding: "+n)}}else if(typeof e==="number"){e=e&255}if(t<0||this.length<t||this.length<r){throw new RangeError("Out of range index")}if(r<=t){return this}t=t>>>0;r=r===undefined?this.length:r>>>0;if(!e)e=0;var a;if(typeof e==="number"){for(a=t;a<r;++a){this[a]=e}}else{var o=Buffer.isBuffer(e)?e:utf8ToBytes(new Buffer(e,n).toString());var s=o.length;for(a=0;a<r-t;++a){this[a+t]=o[a%s]}}return this};var s=/[^+\/0-9A-Za-z-_]/g;function base64clean(e){e=stringtrim(e).replace(s,"");if(e.length<2)return"";while(e.length%4!==0){e=e+"="}return e}function stringtrim(e){if(e.trim)return e.trim();return e.replace(/^\s+|\s+$/g,"")}function toHex(e){if(e<16)return"0"+e.toString(16);return e.toString(16)}function utf8ToBytes(e,t){t=t||Infinity;var r;var n=e.length;var i=null;var a=[];for(var o=0;o<n;++o){r=e.charCodeAt(o);if(r>55295&&r<57344){if(!i){if(r>56319){if((t-=3)>-1)a.push(239,191,189);continue}else if(o+1===n){if((t-=3)>-1)a.push(239,191,189);continue}i=r;continue}if(r<56320){if((t-=3)>-1)a.push(239,191,189);i=r;continue}r=(i-55296<<10|r-56320)+65536}else if(i){if((t-=3)>-1)a.push(239,191,189)}i=null;if(r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return a}function asciiToBytes(e){var t=[];for(var r=0;r<e.length;++r){t.push(e.charCodeAt(r)&255)}return t}function utf16leToBytes(e,t){var r,n,i;var a=[];for(var o=0;o<e.length;++o){if((t-=2)<0)break;r=e.charCodeAt(o);n=r>>8;i=r%256;a.push(i);a.push(n)}return a}function base64ToBytes(e){return n.toByteArray(base64clean(e))}function blitBuffer(e,t,r,n){for(var i=0;i<n;++i){if(i+r>=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function isnan(e){return e!==e}}).call(this,r(7))},function(e,t,r){(function(e){(function(e,t){"use strict";function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}function inherits(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype;e.prototype=new r;e.prototype.constructor=e}function BN(e,t,r){if(BN.isBN(e)){return e}this.negative=0;this.words=null;this.length=0;this.red=null;if(e!==null){if(t==="le"||t==="be"){r=t;t=10}this._init(e||0,t||10,r||"be")}}if(typeof e==="object"){e.exports=BN}else{t.BN=BN}BN.BN=BN;BN.wordSize=26;var n;try{n=r(130).Buffer}catch(e){}BN.isBN=function isBN(e){if(e instanceof BN){return true}return e!==null&&typeof e==="object"&&e.constructor.wordSize===BN.wordSize&&Array.isArray(e.words)};BN.max=function max(e,t){if(e.cmp(t)>0)return e;return t};BN.min=function min(e,t){if(e.cmp(t)<0)return e;return t};BN.prototype._init=function init(e,t,r){if(typeof e==="number"){return this._initNumber(e,t,r)}if(typeof e==="object"){return this._initArray(e,t,r)}if(t==="hex"){t=16}assert(t===(t|0)&&t>=2&&t<=36);e=e.toString().replace(/\s+/g,"");var n=0;if(e[0]==="-"){n++}if(t===16){this._parseHex(e,n)}else{this._parseBase(e,t,n)}if(e[0]==="-"){this.negative=1}this.strip();if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initNumber=function _initNumber(e,t,r){if(e<0){this.negative=1;e=-e}if(e<67108864){this.words=[e&67108863];this.length=1}else if(e<4503599627370496){this.words=[e&67108863,e/67108864&67108863];this.length=2}else{assert(e<9007199254740992);this.words=[e&67108863,e/67108864&67108863,1];this.length=3}if(r!=="le")return;this._initArray(this.toArray(),t,r)};BN.prototype._initArray=function _initArray(e,t,r){assert(typeof e.length==="number");if(e.length<=0){this.words=[0];this.length=1;return this}this.length=Math.ceil(e.length/3);this.words=new Array(this.length);for(var n=0;n<this.length;n++){this.words[n]=0}var i,a;var o=0;if(r==="be"){for(n=e.length-1,i=0;n>=0;n-=3){a=e[n]|e[n-1]<<8|e[n-2]<<16;this.words[i]|=a<<o&67108863;this.words[i+1]=a>>>26-o&67108863;o+=24;if(o>=26){o-=26;i++}}}else if(r==="le"){for(n=0,i=0;n<e.length;n+=3){a=e[n]|e[n+1]<<8|e[n+2]<<16;this.words[i]|=a<<o&67108863;this.words[i+1]=a>>>26-o&67108863;o+=24;if(o>=26){o-=26;i++}}}return this.strip()};function parseHex(e,t,r){var n=0;var i=Math.min(e.length,r);for(var a=t;a<i;a++){var o=e.charCodeAt(a)-48;n<<=4;if(o>=49&&o<=54){n|=o-49+10}else if(o>=17&&o<=22){n|=o-17+10}else{n|=o&15}}return n}BN.prototype._parseHex=function _parseHex(e,t){this.length=Math.ceil((e.length-t)/6);this.words=new Array(this.length);for(var r=0;r<this.length;r++){this.words[r]=0}var n,i;var a=0;for(r=e.length-6,n=0;r>=t;r-=6){i=parseHex(e,r,r+6);this.words[n]|=i<<a&67108863;this.words[n+1]|=i>>>26-a&4194303;a+=24;if(a>=26){a-=26;n++}}if(r+6!==t){i=parseHex(e,t,r+6);this.words[n]|=i<<a&67108863;this.words[n+1]|=i>>>26-a&4194303}this.strip()};function parseBase(e,t,r,n){var i=0;var a=Math.min(e.length,r);for(var o=t;o<a;o++){var s=e.charCodeAt(o)-48;i*=n;if(s>=49){i+=s-49+10}else if(s>=17){i+=s-17+10}else{i+=s}}return i}BN.prototype._parseBase=function _parseBase(e,t,r){this.words=[0];this.length=1;for(var n=0,i=1;i<=67108863;i*=t){n++}n--;i=i/t|0;var a=e.length-r;var o=a%n;var s=Math.min(a,a-o)+r;var f=0;for(var c=r;c<s;c+=n){f=parseBase(e,c,c+n,t);this.imuln(i);if(this.words[0]+f<67108864){this.words[0]+=f}else{this._iaddn(f)}}if(o!==0){var u=1;f=parseBase(e,c,e.length,t);for(c=0;c<o;c++){u*=t}this.imuln(u);if(this.words[0]+f<67108864){this.words[0]+=f}else{this._iaddn(f)}}};BN.prototype.copy=function copy(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++){e.words[t]=this.words[t]}e.length=this.length;e.negative=this.negative;e.red=this.red};BN.prototype.clone=function clone(){var e=new BN(null);this.copy(e);return e};BN.prototype._expand=function _expand(e){while(this.length<e){this.words[this.length++]=0}return this};BN.prototype.strip=function strip(){while(this.length>1&&this.words[this.length-1]===0){this.length--}return this._normSign()};BN.prototype._normSign=function _normSign(){if(this.length===1&&this.words[0]===0){this.negative=0}return this};BN.prototype.inspect=function inspect(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var i=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"];var a=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5];var o=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];BN.prototype.toString=function toString(e,t){e=e||10;t=t|0||1;var r;if(e===16||e==="hex"){r="";var n=0;var s=0;for(var f=0;f<this.length;f++){var c=this.words[f];var u=((c<<n|s)&16777215).toString(16);s=c>>>24-n&16777215;if(s!==0||f!==this.length-1){r=i[6-u.length]+u+r}else{r=u+r}n+=2;if(n>=26){n-=26;f--}}if(s!==0){r=s.toString(16)+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}if(e===(e|0)&&e>=2&&e<=36){var d=a[e];var h=o[e];r="";var l=this.clone();l.negative=0;while(!l.isZero()){var p=l.modn(h).toString(e);l=l.idivn(h);if(!l.isZero()){r=i[d-p.length]+p+r}else{r=p+r}}if(this.isZero()){r="0"+r}while(r.length%t!==0){r="0"+r}if(this.negative!==0){r="-"+r}return r}assert(false,"Base should be between 2 and 36")};BN.prototype.toNumber=function toNumber(){var e=this.words[0];if(this.length===2){e+=this.words[1]*67108864}else if(this.length===3&&this.words[2]===1){e+=4503599627370496+this.words[1]*67108864}else if(this.length>2){assert(false,"Number can only safely store up to 53 bits")}return this.negative!==0?-e:e};BN.prototype.toJSON=function toJSON(){return this.toString(16)};BN.prototype.toBuffer=function toBuffer(e,t){assert(typeof n!=="undefined");return this.toArrayLike(n,e,t)};BN.prototype.toArray=function toArray(e,t){return this.toArrayLike(Array,e,t)};BN.prototype.toArrayLike=function toArrayLike(e,t,r){var n=this.byteLength();var i=r||Math.max(1,n);assert(n<=i,"byte array longer than desired length");assert(i>0,"Requested array length <= 0");this.strip();var a=t==="le";var o=new e(i);var s,f;var c=this.clone();if(!a){for(f=0;f<i-n;f++){o[f]=0}for(f=0;!c.isZero();f++){s=c.andln(255);c.iushrn(8);o[i-f-1]=s}}else{for(f=0;!c.isZero();f++){s=c.andln(255);c.iushrn(8);o[f]=s}for(;f<i;f++){o[f]=0}}return o};if(Math.clz32){BN.prototype._countBits=function _countBits(e){return 32-Math.clz32(e)}}else{BN.prototype._countBits=function _countBits(e){var t=e;var r=0;if(t>=4096){r+=13;t>>>=13}if(t>=64){r+=7;t>>>=7}if(t>=8){r+=4;t>>>=4}if(t>=2){r+=2;t>>>=2}return r+t}}BN.prototype._zeroBits=function _zeroBits(e){if(e===0)return 26;var t=e;var r=0;if((t&8191)===0){r+=13;t>>>=13}if((t&127)===0){r+=7;t>>>=7}if((t&15)===0){r+=4;t>>>=4}if((t&3)===0){r+=2;t>>>=2}if((t&1)===0){r++}return r};BN.prototype.bitLength=function bitLength(){var e=this.words[this.length-1];var t=this._countBits(e);return(this.length-1)*26+t};function toBitArray(e){var t=new Array(e.bitLength());for(var r=0;r<t.length;r++){var n=r/26|0;var i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}BN.prototype.zeroBits=function zeroBits(){if(this.isZero())return 0;var e=0;for(var t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);e+=r;if(r!==26)break}return e};BN.prototype.byteLength=function byteLength(){return Math.ceil(this.bitLength()/8)};BN.prototype.toTwos=function toTwos(e){if(this.negative!==0){return this.abs().inotn(e).iaddn(1)}return this.clone()};BN.prototype.fromTwos=function fromTwos(e){if(this.testn(e-1)){return this.notn(e).iaddn(1).ineg()}return this.clone()};BN.prototype.isNeg=function isNeg(){return this.negative!==0};BN.prototype.neg=function neg(){return this.clone().ineg()};BN.prototype.ineg=function ineg(){if(!this.isZero()){this.negative^=1}return this};BN.prototype.iuor=function iuor(e){while(this.length<e.length){this.words[this.length++]=0}for(var t=0;t<e.length;t++){this.words[t]=this.words[t]|e.words[t]}return this.strip()};BN.prototype.ior=function ior(e){assert((this.negative|e.negative)===0);return this.iuor(e)};BN.prototype.or=function or(e){if(this.length>e.length)return this.clone().ior(e);return e.clone().ior(this)};BN.prototype.uor=function uor(e){if(this.length>e.length)return this.clone().iuor(e);return e.clone().iuor(this)};BN.prototype.iuand=function iuand(e){var t;if(this.length>e.length){t=e}else{t=this}for(var r=0;r<t.length;r++){this.words[r]=this.words[r]&e.words[r]}this.length=t.length;return this.strip()};BN.prototype.iand=function iand(e){assert((this.negative|e.negative)===0);return this.iuand(e)};BN.prototype.and=function and(e){if(this.length>e.length)return this.clone().iand(e);return e.clone().iand(this)};BN.prototype.uand=function uand(e){if(this.length>e.length)return this.clone().iuand(e);return e.clone().iuand(this)};BN.prototype.iuxor=function iuxor(e){var t;var r;if(this.length>e.length){t=this;r=e}else{t=e;r=this}for(var n=0;n<r.length;n++){this.words[n]=t.words[n]^r.words[n]}if(this!==t){for(;n<t.length;n++){this.words[n]=t.words[n]}}this.length=t.length;return this.strip()};BN.prototype.ixor=function ixor(e){assert((this.negative|e.negative)===0);return this.iuxor(e)};BN.prototype.xor=function xor(e){if(this.length>e.length)return this.clone().ixor(e);return e.clone().ixor(this)};BN.prototype.uxor=function uxor(e){if(this.length>e.length)return this.clone().iuxor(e);return e.clone().iuxor(this)};BN.prototype.inotn=function inotn(e){assert(typeof e==="number"&&e>=0);var t=Math.ceil(e/26)|0;var r=e%26;this._expand(t);if(r>0){t--}for(var n=0;n<t;n++){this.words[n]=~this.words[n]&67108863}if(r>0){this.words[n]=~this.words[n]&67108863>>26-r}return this.strip()};BN.prototype.notn=function notn(e){return this.clone().inotn(e)};BN.prototype.setn=function setn(e,t){assert(typeof e==="number"&&e>=0);var r=e/26|0;var n=e%26;this._expand(r+1);if(t){this.words[r]=this.words[r]|1<<n}else{this.words[r]=this.words[r]&~(1<<n)}return this.strip()};BN.prototype.iadd=function iadd(e){var t;if(this.negative!==0&&e.negative===0){this.negative=0;t=this.isub(e);this.negative^=1;return this._normSign()}else if(this.negative===0&&e.negative!==0){e.negative=0;t=this.isub(e);e.negative=1;return t._normSign()}var r,n;if(this.length>e.length){r=this;n=e}else{r=e;n=this}var i=0;for(var a=0;a<n.length;a++){t=(r.words[a]|0)+(n.words[a]|0)+i;this.words[a]=t&67108863;i=t>>>26}for(;i!==0&&a<r.length;a++){t=(r.words[a]|0)+i;this.words[a]=t&67108863;i=t>>>26}this.length=r.length;if(i!==0){this.words[this.length]=i;this.length++}else if(r!==this){for(;a<r.length;a++){this.words[a]=r.words[a]}}return this};BN.prototype.add=function add(e){var t;if(e.negative!==0&&this.negative===0){e.negative=0;t=this.sub(e);e.negative^=1;return t}else if(e.negative===0&&this.negative!==0){this.negative=0;t=e.sub(this);this.negative=1;return t}if(this.length>e.length)return this.clone().iadd(e);return e.clone().iadd(this)};BN.prototype.isub=function isub(e){if(e.negative!==0){e.negative=0;var t=this.iadd(e);e.negative=1;return t._normSign()}else if(this.negative!==0){this.negative=0;this.iadd(e);this.negative=1;return this._normSign()}var r=this.cmp(e);if(r===0){this.negative=0;this.length=1;this.words[0]=0;return this}var n,i;if(r>0){n=this;i=e}else{n=e;i=this}var a=0;for(var o=0;o<i.length;o++){t=(n.words[o]|0)-(i.words[o]|0)+a;a=t>>26;this.words[o]=t&67108863}for(;a!==0&&o<n.length;o++){t=(n.words[o]|0)+a;a=t>>26;this.words[o]=t&67108863}if(a===0&&o<n.length&&n!==this){for(;o<n.length;o++){this.words[o]=n.words[o]}}this.length=Math.max(this.length,o);if(n!==this){this.negative=1}return this.strip()};BN.prototype.sub=function sub(e){return this.clone().isub(e)};function smallMulTo(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n;n=n-1|0;var i=e.words[0]|0;var a=t.words[0]|0;var o=i*a;var s=o&67108863;var f=o/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){var u=f>>>26;var d=f&67108863;var h=Math.min(c,t.length-1);for(var l=Math.max(0,c-e.length+1);l<=h;l++){var p=c-l|0;i=e.words[p]|0;a=t.words[l]|0;o=i*a+d;u+=o/67108864|0;d=o&67108863}r.words[c]=d|0;f=u|0}if(f!==0){r.words[c]=f|0}else{r.length--}return r.strip()}var s=function comb10MulTo(e,t,r){var n=e.words;var i=t.words;var a=r.words;var o=0;var s;var f;var c;var u=n[0]|0;var d=u&8191;var h=u>>>13;var l=n[1]|0;var p=l&8191;var v=l>>>13;var y=n[2]|0;var b=y&8191;var m=y>>>13;var g=n[3]|0;var w=g&8191;var C=g>>>13;var S=n[4]|0;var A=S&8191;var E=S>>>13;var B=n[5]|0;var _=B&8191;var P=B>>>13;var F=n[6]|0;var k=F&8191;var D=F>>>13;var I=n[7]|0;var x=I&8191;var M=I>>>13;var K=n[8]|0;var R=K&8191;var T=K>>>13;var N=n[9]|0;var U=N&8191;var O=N>>>13;var G=i[0]|0;var j=G&8191;var L=G>>>13;var H=i[1]|0;var q=H&8191;var z=H>>>13;var W=i[2]|0;var V=W&8191;var X=W>>>13;var Y=i[3]|0;var J=Y&8191;var Z=Y>>>13;var Q=i[4]|0;var $=Q&8191;var ee=Q>>>13;var te=i[5]|0;var re=te&8191;var ne=te>>>13;var ie=i[6]|0;var ae=ie&8191;var oe=ie>>>13;var se=i[7]|0;var fe=se&8191;var ce=se>>>13;var ue=i[8]|0;var de=ue&8191;var he=ue>>>13;var le=i[9]|0;var pe=le&8191;var ve=le>>>13;r.negative=e.negative^t.negative;r.length=19;s=Math.imul(d,j);f=Math.imul(d,L);f=f+Math.imul(h,j)|0;c=Math.imul(h,L);var ye=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(ye>>>26)|0;ye&=67108863;s=Math.imul(p,j);f=Math.imul(p,L);f=f+Math.imul(v,j)|0;c=Math.imul(v,L);s=s+Math.imul(d,q)|0;f=f+Math.imul(d,z)|0;f=f+Math.imul(h,q)|0;c=c+Math.imul(h,z)|0;var be=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(be>>>26)|0;be&=67108863;s=Math.imul(b,j);f=Math.imul(b,L);f=f+Math.imul(m,j)|0;c=Math.imul(m,L);s=s+Math.imul(p,q)|0;f=f+Math.imul(p,z)|0;f=f+Math.imul(v,q)|0;c=c+Math.imul(v,z)|0;s=s+Math.imul(d,V)|0;f=f+Math.imul(d,X)|0;f=f+Math.imul(h,V)|0;c=c+Math.imul(h,X)|0;var me=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(me>>>26)|0;me&=67108863;s=Math.imul(w,j);f=Math.imul(w,L);f=f+Math.imul(C,j)|0;c=Math.imul(C,L);s=s+Math.imul(b,q)|0;f=f+Math.imul(b,z)|0;f=f+Math.imul(m,q)|0;c=c+Math.imul(m,z)|0;s=s+Math.imul(p,V)|0;f=f+Math.imul(p,X)|0;f=f+Math.imul(v,V)|0;c=c+Math.imul(v,X)|0;s=s+Math.imul(d,J)|0;f=f+Math.imul(d,Z)|0;f=f+Math.imul(h,J)|0;c=c+Math.imul(h,Z)|0;var ge=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(ge>>>26)|0;ge&=67108863;s=Math.imul(A,j);f=Math.imul(A,L);f=f+Math.imul(E,j)|0;c=Math.imul(E,L);s=s+Math.imul(w,q)|0;f=f+Math.imul(w,z)|0;f=f+Math.imul(C,q)|0;c=c+Math.imul(C,z)|0;s=s+Math.imul(b,V)|0;f=f+Math.imul(b,X)|0;f=f+Math.imul(m,V)|0;c=c+Math.imul(m,X)|0;s=s+Math.imul(p,J)|0;f=f+Math.imul(p,Z)|0;f=f+Math.imul(v,J)|0;c=c+Math.imul(v,Z)|0;s=s+Math.imul(d,$)|0;f=f+Math.imul(d,ee)|0;f=f+Math.imul(h,$)|0;c=c+Math.imul(h,ee)|0;var we=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(we>>>26)|0;we&=67108863;s=Math.imul(_,j);f=Math.imul(_,L);f=f+Math.imul(P,j)|0;c=Math.imul(P,L);s=s+Math.imul(A,q)|0;f=f+Math.imul(A,z)|0;f=f+Math.imul(E,q)|0;c=c+Math.imul(E,z)|0;s=s+Math.imul(w,V)|0;f=f+Math.imul(w,X)|0;f=f+Math.imul(C,V)|0;c=c+Math.imul(C,X)|0;s=s+Math.imul(b,J)|0;f=f+Math.imul(b,Z)|0;f=f+Math.imul(m,J)|0;c=c+Math.imul(m,Z)|0;s=s+Math.imul(p,$)|0;f=f+Math.imul(p,ee)|0;f=f+Math.imul(v,$)|0;c=c+Math.imul(v,ee)|0;s=s+Math.imul(d,re)|0;f=f+Math.imul(d,ne)|0;f=f+Math.imul(h,re)|0;c=c+Math.imul(h,ne)|0;var Ce=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(Ce>>>26)|0;Ce&=67108863;s=Math.imul(k,j);f=Math.imul(k,L);f=f+Math.imul(D,j)|0;c=Math.imul(D,L);s=s+Math.imul(_,q)|0;f=f+Math.imul(_,z)|0;f=f+Math.imul(P,q)|0;c=c+Math.imul(P,z)|0;s=s+Math.imul(A,V)|0;f=f+Math.imul(A,X)|0;f=f+Math.imul(E,V)|0;c=c+Math.imul(E,X)|0;s=s+Math.imul(w,J)|0;f=f+Math.imul(w,Z)|0;f=f+Math.imul(C,J)|0;c=c+Math.imul(C,Z)|0;s=s+Math.imul(b,$)|0;f=f+Math.imul(b,ee)|0;f=f+Math.imul(m,$)|0;c=c+Math.imul(m,ee)|0;s=s+Math.imul(p,re)|0;f=f+Math.imul(p,ne)|0;f=f+Math.imul(v,re)|0;c=c+Math.imul(v,ne)|0;s=s+Math.imul(d,ae)|0;f=f+Math.imul(d,oe)|0;f=f+Math.imul(h,ae)|0;c=c+Math.imul(h,oe)|0;var Se=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(Se>>>26)|0;Se&=67108863;s=Math.imul(x,j);f=Math.imul(x,L);f=f+Math.imul(M,j)|0;c=Math.imul(M,L);s=s+Math.imul(k,q)|0;f=f+Math.imul(k,z)|0;f=f+Math.imul(D,q)|0;c=c+Math.imul(D,z)|0;s=s+Math.imul(_,V)|0;f=f+Math.imul(_,X)|0;f=f+Math.imul(P,V)|0;c=c+Math.imul(P,X)|0;s=s+Math.imul(A,J)|0;f=f+Math.imul(A,Z)|0;f=f+Math.imul(E,J)|0;c=c+Math.imul(E,Z)|0;s=s+Math.imul(w,$)|0;f=f+Math.imul(w,ee)|0;f=f+Math.imul(C,$)|0;c=c+Math.imul(C,ee)|0;s=s+Math.imul(b,re)|0;f=f+Math.imul(b,ne)|0;f=f+Math.imul(m,re)|0;c=c+Math.imul(m,ne)|0;s=s+Math.imul(p,ae)|0;f=f+Math.imul(p,oe)|0;f=f+Math.imul(v,ae)|0;c=c+Math.imul(v,oe)|0;s=s+Math.imul(d,fe)|0;f=f+Math.imul(d,ce)|0;f=f+Math.imul(h,fe)|0;c=c+Math.imul(h,ce)|0;var Ae=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(Ae>>>26)|0;Ae&=67108863;s=Math.imul(R,j);f=Math.imul(R,L);f=f+Math.imul(T,j)|0;c=Math.imul(T,L);s=s+Math.imul(x,q)|0;f=f+Math.imul(x,z)|0;f=f+Math.imul(M,q)|0;c=c+Math.imul(M,z)|0;s=s+Math.imul(k,V)|0;f=f+Math.imul(k,X)|0;f=f+Math.imul(D,V)|0;c=c+Math.imul(D,X)|0;s=s+Math.imul(_,J)|0;f=f+Math.imul(_,Z)|0;f=f+Math.imul(P,J)|0;c=c+Math.imul(P,Z)|0;s=s+Math.imul(A,$)|0;f=f+Math.imul(A,ee)|0;f=f+Math.imul(E,$)|0;c=c+Math.imul(E,ee)|0;s=s+Math.imul(w,re)|0;f=f+Math.imul(w,ne)|0;f=f+Math.imul(C,re)|0;c=c+Math.imul(C,ne)|0;s=s+Math.imul(b,ae)|0;f=f+Math.imul(b,oe)|0;f=f+Math.imul(m,ae)|0;c=c+Math.imul(m,oe)|0;s=s+Math.imul(p,fe)|0;f=f+Math.imul(p,ce)|0;f=f+Math.imul(v,fe)|0;c=c+Math.imul(v,ce)|0;s=s+Math.imul(d,de)|0;f=f+Math.imul(d,he)|0;f=f+Math.imul(h,de)|0;c=c+Math.imul(h,he)|0;var Ee=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(Ee>>>26)|0;Ee&=67108863;s=Math.imul(U,j);f=Math.imul(U,L);f=f+Math.imul(O,j)|0;c=Math.imul(O,L);s=s+Math.imul(R,q)|0;f=f+Math.imul(R,z)|0;f=f+Math.imul(T,q)|0;c=c+Math.imul(T,z)|0;s=s+Math.imul(x,V)|0;f=f+Math.imul(x,X)|0;f=f+Math.imul(M,V)|0;c=c+Math.imul(M,X)|0;s=s+Math.imul(k,J)|0;f=f+Math.imul(k,Z)|0;f=f+Math.imul(D,J)|0;c=c+Math.imul(D,Z)|0;s=s+Math.imul(_,$)|0;f=f+Math.imul(_,ee)|0;f=f+Math.imul(P,$)|0;c=c+Math.imul(P,ee)|0;s=s+Math.imul(A,re)|0;f=f+Math.imul(A,ne)|0;f=f+Math.imul(E,re)|0;c=c+Math.imul(E,ne)|0;s=s+Math.imul(w,ae)|0;f=f+Math.imul(w,oe)|0;f=f+Math.imul(C,ae)|0;c=c+Math.imul(C,oe)|0;s=s+Math.imul(b,fe)|0;f=f+Math.imul(b,ce)|0;f=f+Math.imul(m,fe)|0;c=c+Math.imul(m,ce)|0;s=s+Math.imul(p,de)|0;f=f+Math.imul(p,he)|0;f=f+Math.imul(v,de)|0;c=c+Math.imul(v,he)|0;s=s+Math.imul(d,pe)|0;f=f+Math.imul(d,ve)|0;f=f+Math.imul(h,pe)|0;c=c+Math.imul(h,ve)|0;var Be=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(Be>>>26)|0;Be&=67108863;s=Math.imul(U,q);f=Math.imul(U,z);f=f+Math.imul(O,q)|0;c=Math.imul(O,z);s=s+Math.imul(R,V)|0;f=f+Math.imul(R,X)|0;f=f+Math.imul(T,V)|0;c=c+Math.imul(T,X)|0;s=s+Math.imul(x,J)|0;f=f+Math.imul(x,Z)|0;f=f+Math.imul(M,J)|0;c=c+Math.imul(M,Z)|0;s=s+Math.imul(k,$)|0;f=f+Math.imul(k,ee)|0;f=f+Math.imul(D,$)|0;c=c+Math.imul(D,ee)|0;s=s+Math.imul(_,re)|0;f=f+Math.imul(_,ne)|0;f=f+Math.imul(P,re)|0;c=c+Math.imul(P,ne)|0;s=s+Math.imul(A,ae)|0;f=f+Math.imul(A,oe)|0;f=f+Math.imul(E,ae)|0;c=c+Math.imul(E,oe)|0;s=s+Math.imul(w,fe)|0;f=f+Math.imul(w,ce)|0;f=f+Math.imul(C,fe)|0;c=c+Math.imul(C,ce)|0;s=s+Math.imul(b,de)|0;f=f+Math.imul(b,he)|0;f=f+Math.imul(m,de)|0;c=c+Math.imul(m,he)|0;s=s+Math.imul(p,pe)|0;f=f+Math.imul(p,ve)|0;f=f+Math.imul(v,pe)|0;c=c+Math.imul(v,ve)|0;var _e=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(_e>>>26)|0;_e&=67108863;s=Math.imul(U,V);f=Math.imul(U,X);f=f+Math.imul(O,V)|0;c=Math.imul(O,X);s=s+Math.imul(R,J)|0;f=f+Math.imul(R,Z)|0;f=f+Math.imul(T,J)|0;c=c+Math.imul(T,Z)|0;s=s+Math.imul(x,$)|0;f=f+Math.imul(x,ee)|0;f=f+Math.imul(M,$)|0;c=c+Math.imul(M,ee)|0;s=s+Math.imul(k,re)|0;f=f+Math.imul(k,ne)|0;f=f+Math.imul(D,re)|0;c=c+Math.imul(D,ne)|0;s=s+Math.imul(_,ae)|0;f=f+Math.imul(_,oe)|0;f=f+Math.imul(P,ae)|0;c=c+Math.imul(P,oe)|0;s=s+Math.imul(A,fe)|0;f=f+Math.imul(A,ce)|0;f=f+Math.imul(E,fe)|0;c=c+Math.imul(E,ce)|0;s=s+Math.imul(w,de)|0;f=f+Math.imul(w,he)|0;f=f+Math.imul(C,de)|0;c=c+Math.imul(C,he)|0;s=s+Math.imul(b,pe)|0;f=f+Math.imul(b,ve)|0;f=f+Math.imul(m,pe)|0;c=c+Math.imul(m,ve)|0;var Pe=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(Pe>>>26)|0;Pe&=67108863;s=Math.imul(U,J);f=Math.imul(U,Z);f=f+Math.imul(O,J)|0;c=Math.imul(O,Z);s=s+Math.imul(R,$)|0;f=f+Math.imul(R,ee)|0;f=f+Math.imul(T,$)|0;c=c+Math.imul(T,ee)|0;s=s+Math.imul(x,re)|0;f=f+Math.imul(x,ne)|0;f=f+Math.imul(M,re)|0;c=c+Math.imul(M,ne)|0;s=s+Math.imul(k,ae)|0;f=f+Math.imul(k,oe)|0;f=f+Math.imul(D,ae)|0;c=c+Math.imul(D,oe)|0;s=s+Math.imul(_,fe)|0;f=f+Math.imul(_,ce)|0;f=f+Math.imul(P,fe)|0;c=c+Math.imul(P,ce)|0;s=s+Math.imul(A,de)|0;f=f+Math.imul(A,he)|0;f=f+Math.imul(E,de)|0;c=c+Math.imul(E,he)|0;s=s+Math.imul(w,pe)|0;f=f+Math.imul(w,ve)|0;f=f+Math.imul(C,pe)|0;c=c+Math.imul(C,ve)|0;var Fe=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(Fe>>>26)|0;Fe&=67108863;s=Math.imul(U,$);f=Math.imul(U,ee);f=f+Math.imul(O,$)|0;c=Math.imul(O,ee);s=s+Math.imul(R,re)|0;f=f+Math.imul(R,ne)|0;f=f+Math.imul(T,re)|0;c=c+Math.imul(T,ne)|0;s=s+Math.imul(x,ae)|0;f=f+Math.imul(x,oe)|0;f=f+Math.imul(M,ae)|0;c=c+Math.imul(M,oe)|0;s=s+Math.imul(k,fe)|0;f=f+Math.imul(k,ce)|0;f=f+Math.imul(D,fe)|0;c=c+Math.imul(D,ce)|0;s=s+Math.imul(_,de)|0;f=f+Math.imul(_,he)|0;f=f+Math.imul(P,de)|0;c=c+Math.imul(P,he)|0;s=s+Math.imul(A,pe)|0;f=f+Math.imul(A,ve)|0;f=f+Math.imul(E,pe)|0;c=c+Math.imul(E,ve)|0;var ke=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(ke>>>26)|0;ke&=67108863;s=Math.imul(U,re);f=Math.imul(U,ne);f=f+Math.imul(O,re)|0;c=Math.imul(O,ne);s=s+Math.imul(R,ae)|0;f=f+Math.imul(R,oe)|0;f=f+Math.imul(T,ae)|0;c=c+Math.imul(T,oe)|0;s=s+Math.imul(x,fe)|0;f=f+Math.imul(x,ce)|0;f=f+Math.imul(M,fe)|0;c=c+Math.imul(M,ce)|0;s=s+Math.imul(k,de)|0;f=f+Math.imul(k,he)|0;f=f+Math.imul(D,de)|0;c=c+Math.imul(D,he)|0;s=s+Math.imul(_,pe)|0;f=f+Math.imul(_,ve)|0;f=f+Math.imul(P,pe)|0;c=c+Math.imul(P,ve)|0;var De=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(De>>>26)|0;De&=67108863;s=Math.imul(U,ae);f=Math.imul(U,oe);f=f+Math.imul(O,ae)|0;c=Math.imul(O,oe);s=s+Math.imul(R,fe)|0;f=f+Math.imul(R,ce)|0;f=f+Math.imul(T,fe)|0;c=c+Math.imul(T,ce)|0;s=s+Math.imul(x,de)|0;f=f+Math.imul(x,he)|0;f=f+Math.imul(M,de)|0;c=c+Math.imul(M,he)|0;s=s+Math.imul(k,pe)|0;f=f+Math.imul(k,ve)|0;f=f+Math.imul(D,pe)|0;c=c+Math.imul(D,ve)|0;var Ie=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(Ie>>>26)|0;Ie&=67108863;s=Math.imul(U,fe);f=Math.imul(U,ce);f=f+Math.imul(O,fe)|0;c=Math.imul(O,ce);s=s+Math.imul(R,de)|0;f=f+Math.imul(R,he)|0;f=f+Math.imul(T,de)|0;c=c+Math.imul(T,he)|0;s=s+Math.imul(x,pe)|0;f=f+Math.imul(x,ve)|0;f=f+Math.imul(M,pe)|0;c=c+Math.imul(M,ve)|0;var xe=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(xe>>>26)|0;xe&=67108863;s=Math.imul(U,de);f=Math.imul(U,he);f=f+Math.imul(O,de)|0;c=Math.imul(O,he);s=s+Math.imul(R,pe)|0;f=f+Math.imul(R,ve)|0;f=f+Math.imul(T,pe)|0;c=c+Math.imul(T,ve)|0;var Me=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(Me>>>26)|0;Me&=67108863;s=Math.imul(U,pe);f=Math.imul(U,ve);f=f+Math.imul(O,pe)|0;c=Math.imul(O,ve);var Ke=(o+s|0)+((f&8191)<<13)|0;o=(c+(f>>>13)|0)+(Ke>>>26)|0;Ke&=67108863;a[0]=ye;a[1]=be;a[2]=me;a[3]=ge;a[4]=we;a[5]=Ce;a[6]=Se;a[7]=Ae;a[8]=Ee;a[9]=Be;a[10]=_e;a[11]=Pe;a[12]=Fe;a[13]=ke;a[14]=De;a[15]=Ie;a[16]=xe;a[17]=Me;a[18]=Ke;if(o!==0){a[19]=o;r.length++}return r};if(!Math.imul){s=smallMulTo}function bigMulTo(e,t,r){r.negative=t.negative^e.negative;r.length=e.length+t.length;var n=0;var i=0;for(var a=0;a<r.length-1;a++){var o=i;i=0;var s=n&67108863;var f=Math.min(a,t.length-1);for(var c=Math.max(0,a-e.length+1);c<=f;c++){var u=a-c;var d=e.words[u]|0;var h=t.words[c]|0;var l=d*h;var p=l&67108863;o=o+(l/67108864|0)|0;p=p+s|0;s=p&67108863;o=o+(p>>>26)|0;i+=o>>>26;o&=67108863}r.words[a]=s;n=o;o=i}if(n!==0){r.words[a]=n}else{r.length--}return r.strip()}function jumboMulTo(e,t,r){var n=new FFTM;return n.mulp(e,t,r)}BN.prototype.mulTo=function mulTo(e,t){var r;var n=this.length+e.length;if(this.length===10&&e.length===10){r=s(this,e,t)}else if(n<63){r=smallMulTo(this,e,t)}else if(n<1024){r=bigMulTo(this,e,t)}else{r=jumboMulTo(this,e,t)}return r};function FFTM(e,t){this.x=e;this.y=t}FFTM.prototype.makeRBT=function makeRBT(e){var t=new Array(e);var r=BN.prototype._countBits(e)-1;for(var n=0;n<e;n++){t[n]=this.revBin(n,r,e)}return t};FFTM.prototype.revBin=function revBin(e,t,r){if(e===0||e===r-1)return e;var n=0;for(var i=0;i<t;i++){n|=(e&1)<<t-i-1;e>>=1}return n};FFTM.prototype.permute=function permute(e,t,r,n,i,a){for(var o=0;o<a;o++){n[o]=t[e[o]];i[o]=r[e[o]]}};FFTM.prototype.transform=function transform(e,t,r,n,i,a){this.permute(a,e,t,r,n,i);for(var o=1;o<i;o<<=1){var s=o<<1;var f=Math.cos(2*Math.PI/s);var c=Math.sin(2*Math.PI/s);for(var u=0;u<i;u+=s){var d=f;var h=c;for(var l=0;l<o;l++){var p=r[u+l];var v=n[u+l];var y=r[u+l+o];var b=n[u+l+o];var m=d*y-h*b;b=d*b+h*y;y=m;r[u+l]=p+y;n[u+l]=v+b;r[u+l+o]=p-y;n[u+l+o]=v-b;if(l!==s){m=f*d-c*h;h=f*h+c*d;d=m}}}}};FFTM.prototype.guessLen13b=function guessLen13b(e,t){var r=Math.max(t,e)|1;var n=r&1;var i=0;for(r=r/2|0;r;r=r>>>1){i++}return 1<<i+1+n};FFTM.prototype.conjugate=function conjugate(e,t,r){if(r<=1)return;for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1];e[r-n-1]=i;i=t[n];t[n]=-t[r-n-1];t[r-n-1]=-i}};FFTM.prototype.normalize13b=function normalize13b(e,t){var r=0;for(var n=0;n<t/2;n++){var i=Math.round(e[2*n+1]/t)*8192+Math.round(e[2*n]/t)+r;e[n]=i&67108863;if(i<67108864){r=0}else{r=i/67108864|0}}return e};FFTM.prototype.convert13b=function convert13b(e,t,r,n){var i=0;for(var a=0;a<t;a++){i=i+(e[a]|0);r[2*a]=i&8191;i=i>>>13;r[2*a+1]=i&8191;i=i>>>13}for(a=2*t;a<n;++a){r[a]=0}assert(i===0);assert((i&~8191)===0)};FFTM.prototype.stub=function stub(e){var t=new Array(e);for(var r=0;r<e;r++){t[r]=0}return t};FFTM.prototype.mulp=function mulp(e,t,r){var n=2*this.guessLen13b(e.length,t.length);var i=this.makeRBT(n);var a=this.stub(n);var o=new Array(n);var s=new Array(n);var f=new Array(n);var c=new Array(n);var u=new Array(n);var d=new Array(n);var h=r.words;h.length=n;this.convert13b(e.words,e.length,o,n);this.convert13b(t.words,t.length,c,n);this.transform(o,a,s,f,n,i);this.transform(c,a,u,d,n,i);for(var l=0;l<n;l++){var p=s[l]*u[l]-f[l]*d[l];f[l]=s[l]*d[l]+f[l]*u[l];s[l]=p}this.conjugate(s,f,n);this.transform(s,f,h,a,n,i);this.conjugate(h,a,n);this.normalize13b(h,n);r.negative=e.negative^t.negative;r.length=e.length+t.length;return r.strip()};BN.prototype.mul=function mul(e){var t=new BN(null);t.words=new Array(this.length+e.length);return this.mulTo(e,t)};BN.prototype.mulf=function mulf(e){var t=new BN(null);t.words=new Array(this.length+e.length);return jumboMulTo(this,e,t)};BN.prototype.imul=function imul(e){return this.clone().mulTo(e,this)};BN.prototype.imuln=function imuln(e){assert(typeof e==="number");assert(e<67108864);var t=0;for(var r=0;r<this.length;r++){var n=(this.words[r]|0)*e;var i=(n&67108863)+(t&67108863);t>>=26;t+=n/67108864|0;t+=i>>>26;this.words[r]=i&67108863}if(t!==0){this.words[r]=t;this.length++}return this};BN.prototype.muln=function muln(e){return this.clone().imuln(e)};BN.prototype.sqr=function sqr(){return this.mul(this)};BN.prototype.isqr=function isqr(){return this.imul(this.clone())};BN.prototype.pow=function pow(e){var t=toBitArray(e);if(t.length===0)return new BN(1);var r=this;for(var n=0;n<t.length;n++,r=r.sqr()){if(t[n]!==0)break}if(++n<t.length){for(var i=r.sqr();n<t.length;n++,i=i.sqr()){if(t[n]===0)continue;r=r.mul(i)}}return r};BN.prototype.iushln=function iushln(e){assert(typeof e==="number"&&e>=0);var t=e%26;var r=(e-t)/26;var n=67108863>>>26-t<<26-t;var i;if(t!==0){var a=0;for(i=0;i<this.length;i++){var o=this.words[i]&n;var s=(this.words[i]|0)-o<<t;this.words[i]=s|a;a=o>>>26-t}if(a){this.words[i]=a;this.length++}}if(r!==0){for(i=this.length-1;i>=0;i--){this.words[i+r]=this.words[i]}for(i=0;i<r;i++){this.words[i]=0}this.length+=r}return this.strip()};BN.prototype.ishln=function ishln(e){assert(this.negative===0);return this.iushln(e)};BN.prototype.iushrn=function iushrn(e,t,r){assert(typeof e==="number"&&e>=0);var n;if(t){n=(t-t%26)/26}else{n=0}var i=e%26;var a=Math.min((e-i)/26,this.length);var o=67108863^67108863>>>i<<i;var s=r;n-=a;n=Math.max(0,n);if(s){for(var f=0;f<a;f++){s.words[f]=this.words[f]}s.length=a}if(a===0){}else if(this.length>a){this.length-=a;for(f=0;f<this.length;f++){this.words[f]=this.words[f+a]}}else{this.words[0]=0;this.length=1}var c=0;for(f=this.length-1;f>=0&&(c!==0||f>=n);f--){var u=this.words[f]|0;this.words[f]=c<<26-i|u>>>i;c=u&o}if(s&&c!==0){s.words[s.length++]=c}if(this.length===0){this.words[0]=0;this.length=1}return this.strip()};BN.prototype.ishrn=function ishrn(e,t,r){assert(this.negative===0);return this.iushrn(e,t,r)};BN.prototype.shln=function shln(e){return this.clone().ishln(e)};BN.prototype.ushln=function ushln(e){return this.clone().iushln(e)};BN.prototype.shrn=function shrn(e){return this.clone().ishrn(e)};BN.prototype.ushrn=function ushrn(e){return this.clone().iushrn(e)};BN.prototype.testn=function testn(e){assert(typeof e==="number"&&e>=0);var t=e%26;var r=(e-t)/26;var n=1<<t;if(this.length<=r)return false;var i=this.words[r];return!!(i&n)};BN.prototype.imaskn=function imaskn(e){assert(typeof e==="number"&&e>=0);var t=e%26;var r=(e-t)/26;assert(this.negative===0,"imaskn works only with positive numbers");if(this.length<=r){return this}if(t!==0){r++}this.length=Math.min(r,this.length);if(t!==0){var n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()};BN.prototype.maskn=function maskn(e){return this.clone().imaskn(e)};BN.prototype.iaddn=function iaddn(e){assert(typeof e==="number");assert(e<67108864);if(e<0)return this.isubn(-e);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<e){this.words[0]=e-(this.words[0]|0);this.negative=0;return this}this.negative=0;this.isubn(e);this.negative=1;return this}return this._iaddn(e)};BN.prototype._iaddn=function _iaddn(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++){this.words[t]-=67108864;if(t===this.length-1){this.words[t+1]=1}else{this.words[t+1]++}}this.length=Math.max(this.length,t+1);return this};BN.prototype.isubn=function isubn(e){assert(typeof e==="number");assert(e<67108864);if(e<0)return this.iaddn(-e);if(this.negative!==0){this.negative=0;this.iaddn(e);this.negative=1;return this}this.words[0]-=e;if(this.length===1&&this.words[0]<0){this.words[0]=-this.words[0];this.negative=1}else{for(var t=0;t<this.length&&this.words[t]<0;t++){this.words[t]+=67108864;this.words[t+1]-=1}}return this.strip()};BN.prototype.addn=function addn(e){return this.clone().iaddn(e)};BN.prototype.subn=function subn(e){return this.clone().isubn(e)};BN.prototype.iabs=function iabs(){this.negative=0;return this};BN.prototype.abs=function abs(){return this.clone().iabs()};BN.prototype._ishlnsubmul=function _ishlnsubmul(e,t,r){var n=e.length+r;var i;this._expand(n);var a;var o=0;for(i=0;i<e.length;i++){a=(this.words[i+r]|0)+o;var s=(e.words[i]|0)*t;a-=s&67108863;o=(a>>26)-(s/67108864|0);this.words[i+r]=a&67108863}for(;i<this.length-r;i++){a=(this.words[i+r]|0)+o;o=a>>26;this.words[i+r]=a&67108863}if(o===0)return this.strip();assert(o===-1);o=0;for(i=0;i<this.length;i++){a=-(this.words[i]|0)+o;o=a>>26;this.words[i]=a&67108863}this.negative=1;return this.strip()};BN.prototype._wordDiv=function _wordDiv(e,t){var r=this.length-e.length;var n=this.clone();var i=e;var a=i.words[i.length-1]|0;var o=this._countBits(a);r=26-o;if(r!==0){i=i.ushln(r);n.iushln(r);a=i.words[i.length-1]|0}var s=n.length-i.length;var f;if(t!=="mod"){f=new BN(null);f.length=s+1;f.words=new Array(f.length);for(var c=0;c<f.length;c++){f.words[c]=0}}var u=n.clone()._ishlnsubmul(i,1,s);if(u.negative===0){n=u;if(f){f.words[s]=1}}for(var d=s-1;d>=0;d--){var h=(n.words[i.length+d]|0)*67108864+(n.words[i.length+d-1]|0);h=Math.min(h/a|0,67108863);n._ishlnsubmul(i,h,d);while(n.negative!==0){h--;n.negative=0;n._ishlnsubmul(i,1,d);if(!n.isZero()){n.negative^=1}}if(f){f.words[d]=h}}if(f){f.strip()}n.strip();if(t!=="div"&&r!==0){n.iushrn(r)}return{div:f||null,mod:n}};BN.prototype.divmod=function divmod(e,t,r){assert(!e.isZero());if(this.isZero()){return{div:new BN(0),mod:new BN(0)}}var n,i,a;if(this.negative!==0&&e.negative===0){a=this.neg().divmod(e,t);if(t!=="mod"){n=a.div.neg()}if(t!=="div"){i=a.mod.neg();if(r&&i.negative!==0){i.iadd(e)}}return{div:n,mod:i}}if(this.negative===0&&e.negative!==0){a=this.divmod(e.neg(),t);if(t!=="mod"){n=a.div.neg()}return{div:n,mod:a.mod}}if((this.negative&e.negative)!==0){a=this.neg().divmod(e.neg(),t);if(t!=="div"){i=a.mod.neg();if(r&&i.negative!==0){i.isub(e)}}return{div:a.div,mod:i}}if(e.length>this.length||this.cmp(e)<0){return{div:new BN(0),mod:this}}if(e.length===1){if(t==="div"){return{div:this.divn(e.words[0]),mod:null}}if(t==="mod"){return{div:null,mod:new BN(this.modn(e.words[0]))}}return{div:this.divn(e.words[0]),mod:new BN(this.modn(e.words[0]))}}return this._wordDiv(e,t)};BN.prototype.div=function div(e){return this.divmod(e,"div",false).div};BN.prototype.mod=function mod(e){return this.divmod(e,"mod",false).mod};BN.prototype.umod=function umod(e){return this.divmod(e,"mod",true).mod};BN.prototype.divRound=function divRound(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=t.div.negative!==0?t.mod.isub(e):t.mod;var n=e.ushrn(1);var i=e.andln(1);var a=r.cmp(n);if(a<0||i===1&&a===0)return t.div;return t.div.negative!==0?t.div.isubn(1):t.div.iaddn(1)};BN.prototype.modn=function modn(e){assert(e<=67108863);var t=(1<<26)%e;var r=0;for(var n=this.length-1;n>=0;n--){r=(t*r+(this.words[n]|0))%e}return r};BN.prototype.idivn=function idivn(e){assert(e<=67108863);var t=0;for(var r=this.length-1;r>=0;r--){var n=(this.words[r]|0)+t*67108864;this.words[r]=n/e|0;t=n%e}return this.strip()};BN.prototype.divn=function divn(e){return this.clone().idivn(e)};BN.prototype.egcd=function egcd(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var n=new BN(1);var i=new BN(0);var a=new BN(0);var o=new BN(1);var s=0;while(t.isEven()&&r.isEven()){t.iushrn(1);r.iushrn(1);++s}var f=r.clone();var c=t.clone();while(!t.isZero()){for(var u=0,d=1;(t.words[0]&d)===0&&u<26;++u,d<<=1);if(u>0){t.iushrn(u);while(u-- >0){if(n.isOdd()||i.isOdd()){n.iadd(f);i.isub(c)}n.iushrn(1);i.iushrn(1)}}for(var h=0,l=1;(r.words[0]&l)===0&&h<26;++h,l<<=1);if(h>0){r.iushrn(h);while(h-- >0){if(a.isOdd()||o.isOdd()){a.iadd(f);o.isub(c)}a.iushrn(1);o.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);n.isub(a);i.isub(o)}else{r.isub(t);a.isub(n);o.isub(i)}}return{a,b:o,gcd:r.iushln(s)}};BN.prototype._invmp=function _invmp(e){assert(e.negative===0);assert(!e.isZero());var t=this;var r=e.clone();if(t.negative!==0){t=t.umod(e)}else{t=t.clone()}var n=new BN(1);var i=new BN(0);var a=r.clone();while(t.cmpn(1)>0&&r.cmpn(1)>0){for(var o=0,s=1;(t.words[0]&s)===0&&o<26;++o,s<<=1);if(o>0){t.iushrn(o);while(o-- >0){if(n.isOdd()){n.iadd(a)}n.iushrn(1)}}for(var f=0,c=1;(r.words[0]&c)===0&&f<26;++f,c<<=1);if(f>0){r.iushrn(f);while(f-- >0){if(i.isOdd()){i.iadd(a)}i.iushrn(1)}}if(t.cmp(r)>=0){t.isub(r);n.isub(i)}else{r.isub(t);i.isub(n)}}var u;if(t.cmpn(1)===0){u=n}else{u=i}if(u.cmpn(0)<0){u.iadd(e)}return u};BN.prototype.gcd=function gcd(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone();var r=e.clone();t.negative=0;r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++){t.iushrn(1);r.iushrn(1)}do{while(t.isEven()){t.iushrn(1)}while(r.isEven()){r.iushrn(1)}var i=t.cmp(r);if(i<0){var a=t;t=r;r=a}else if(i===0||r.cmpn(1)===0){break}t.isub(r)}while(true);return r.iushln(n)};BN.prototype.invm=function invm(e){return this.egcd(e).a.umod(e)};BN.prototype.isEven=function isEven(){return(this.words[0]&1)===0};BN.prototype.isOdd=function isOdd(){return(this.words[0]&1)===1};BN.prototype.andln=function andln(e){return this.words[0]&e};BN.prototype.bincn=function bincn(e){assert(typeof e==="number");var t=e%26;var r=(e-t)/26;var n=1<<t;if(this.length<=r){this._expand(r+1);this.words[r]|=n;return this}var i=n;for(var a=r;i!==0&&a<this.length;a++){var o=this.words[a]|0;o+=i;i=o>>>26;o&=67108863;this.words[a]=o}if(i!==0){this.words[a]=i;this.length++}return this};BN.prototype.isZero=function isZero(){return this.length===1&&this.words[0]===0};BN.prototype.cmpn=function cmpn(e){var t=e<0;if(this.negative!==0&&!t)return-1;if(this.negative===0&&t)return 1;this.strip();var r;if(this.length>1){r=1}else{if(t){e=-e}assert(e<=67108863,"Number is too big");var n=this.words[0]|0;r=n===e?0:n<e?-1:1}if(this.negative!==0)return-r|0;return r};BN.prototype.cmp=function cmp(e){if(this.negative!==0&&e.negative===0)return-1;if(this.negative===0&&e.negative!==0)return 1;var t=this.ucmp(e);if(this.negative!==0)return-t|0;return t};BN.prototype.ucmp=function ucmp(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;var t=0;for(var r=this.length-1;r>=0;r--){var n=this.words[r]|0;var i=e.words[r]|0;if(n===i)continue;if(n<i){t=-1}else if(n>i){t=1}break}return t};BN.prototype.gtn=function gtn(e){return this.cmpn(e)===1};BN.prototype.gt=function gt(e){return this.cmp(e)===1};BN.prototype.gten=function gten(e){return this.cmpn(e)>=0};BN.prototype.gte=function gte(e){return this.cmp(e)>=0};BN.prototype.ltn=function ltn(e){return this.cmpn(e)===-1};BN.prototype.lt=function lt(e){return this.cmp(e)===-1};BN.prototype.lten=function lten(e){return this.cmpn(e)<=0};BN.prototype.lte=function lte(e){return this.cmp(e)<=0};BN.prototype.eqn=function eqn(e){return this.cmpn(e)===0};BN.prototype.eq=function eq(e){return this.cmp(e)===0};BN.red=function red(e){return new Red(e)};BN.prototype.toRed=function toRed(e){assert(!this.red,"Already a number in reduction context");assert(this.negative===0,"red works only with positives");return e.convertTo(this)._forceRed(e)};BN.prototype.fromRed=function fromRed(){assert(this.red,"fromRed works only with numbers in reduction context");return this.red.convertFrom(this)};BN.prototype._forceRed=function _forceRed(e){this.red=e;return this};BN.prototype.forceRed=function forceRed(e){assert(!this.red,"Already a number in reduction context");return this._forceRed(e)};BN.prototype.redAdd=function redAdd(e){assert(this.red,"redAdd works only with red numbers");return this.red.add(this,e)};BN.prototype.redIAdd=function redIAdd(e){assert(this.red,"redIAdd works only with red numbers");return this.red.iadd(this,e)};BN.prototype.redSub=function redSub(e){assert(this.red,"redSub works only with red numbers");return this.red.sub(this,e)};BN.prototype.redISub=function redISub(e){assert(this.red,"redISub works only with red numbers");return this.red.isub(this,e)};BN.prototype.redShl=function redShl(e){assert(this.red,"redShl works only with red numbers");return this.red.shl(this,e)};BN.prototype.redMul=function redMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.mul(this,e)};BN.prototype.redIMul=function redIMul(e){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,e);return this.red.imul(this,e)};BN.prototype.redSqr=function redSqr(){assert(this.red,"redSqr works only with red numbers");this.red._verify1(this);return this.red.sqr(this)};BN.prototype.redISqr=function redISqr(){assert(this.red,"redISqr works only with red numbers");this.red._verify1(this);return this.red.isqr(this)};BN.prototype.redSqrt=function redSqrt(){assert(this.red,"redSqrt works only with red numbers");this.red._verify1(this);return this.red.sqrt(this)};BN.prototype.redInvm=function redInvm(){assert(this.red,"redInvm works only with red numbers");this.red._verify1(this);return this.red.invm(this)};BN.prototype.redNeg=function redNeg(){assert(this.red,"redNeg works only with red numbers");this.red._verify1(this);return this.red.neg(this)};BN.prototype.redPow=function redPow(e){assert(this.red&&!e.red,"redPow(normalNum)");this.red._verify1(this);return this.red.pow(this,e)};var f={k256:null,p224:null,p192:null,p25519:null};function MPrime(e,t){this.name=e;this.p=new BN(t,16);this.n=this.p.bitLength();this.k=new BN(1).iushln(this.n).isub(this.p);this.tmp=this._tmp()}MPrime.prototype._tmp=function _tmp(){var e=new BN(null);e.words=new Array(Math.ceil(this.n/13));return e};MPrime.prototype.ireduce=function ireduce(e){var t=e;var r;do{this.split(t,this.tmp);t=this.imulK(t);t=t.iadd(this.tmp);r=t.bitLength()}while(r>this.n);var n=r<this.n?-1:t.ucmp(this.p);if(n===0){t.words[0]=0;t.length=1}else if(n>0){t.isub(this.p)}else{t.strip()}return t};MPrime.prototype.split=function split(e,t){e.iushrn(this.n,0,t)};MPrime.prototype.imulK=function imulK(e){return e.imul(this.k)};function K256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}inherits(K256,MPrime);K256.prototype.split=function split(e,t){var r=4194303;var n=Math.min(e.length,9);for(var i=0;i<n;i++){t.words[i]=e.words[i]}t.length=n;if(e.length<=9){e.words[0]=0;e.length=1;return}var a=e.words[9];t.words[t.length++]=a&r;for(i=10;i<e.length;i++){var o=e.words[i]|0;e.words[i-10]=(o&r)<<4|a>>>22;a=o}a>>>=22;e.words[i-10]=a;if(a===0&&e.length>10){e.length-=10}else{e.length-=9}};K256.prototype.imulK=function imulK(e){e.words[e.length]=0;e.words[e.length+1]=0;e.length+=2;var t=0;for(var r=0;r<e.length;r++){var n=e.words[r]|0;t+=n*977;e.words[r]=t&67108863;t=n*64+(t/67108864|0)}if(e.words[e.length-1]===0){e.length--;if(e.words[e.length-1]===0){e.length--}}return e};function P224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}inherits(P224,MPrime);function P192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}inherits(P192,MPrime);function P25519(){MPrime.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}inherits(P25519,MPrime);P25519.prototype.imulK=function imulK(e){var t=0;for(var r=0;r<e.length;r++){var n=(e.words[r]|0)*19+t;var i=n&67108863;n>>>=26;e.words[r]=i;t=n}if(t!==0){e.words[e.length++]=t}return e};BN._prime=function prime(e){if(f[e])return f[e];var prime;if(e==="k256"){prime=new K256}else if(e==="p224"){prime=new P224}else if(e==="p192"){prime=new P192}else if(e==="p25519"){prime=new P25519}else{throw new Error("Unknown prime "+e)}f[e]=prime;return prime};function Red(e){if(typeof e==="string"){var t=BN._prime(e);this.m=t.p;this.prime=t}else{assert(e.gtn(1),"modulus must be greater than 1");this.m=e;this.prime=null}}Red.prototype._verify1=function _verify1(e){assert(e.negative===0,"red works only with positives");assert(e.red,"red works only with red numbers")};Red.prototype._verify2=function _verify2(e,t){assert((e.negative|t.negative)===0,"red works only with positives");assert(e.red&&e.red===t.red,"red works only with red numbers")};Red.prototype.imod=function imod(e){if(this.prime)return this.prime.ireduce(e)._forceRed(this);return e.umod(this.m)._forceRed(this)};Red.prototype.neg=function neg(e){if(e.isZero()){return e.clone()}return this.m.sub(e)._forceRed(this)};Red.prototype.add=function add(e,t){this._verify2(e,t);var r=e.add(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r._forceRed(this)};Red.prototype.iadd=function iadd(e,t){this._verify2(e,t);var r=e.iadd(t);if(r.cmp(this.m)>=0){r.isub(this.m)}return r};Red.prototype.sub=function sub(e,t){this._verify2(e,t);var r=e.sub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r._forceRed(this)};Red.prototype.isub=function isub(e,t){this._verify2(e,t);var r=e.isub(t);if(r.cmpn(0)<0){r.iadd(this.m)}return r};Red.prototype.shl=function shl(e,t){this._verify1(e);return this.imod(e.ushln(t))};Red.prototype.imul=function imul(e,t){this._verify2(e,t);return this.imod(e.imul(t))};Red.prototype.mul=function mul(e,t){this._verify2(e,t);return this.imod(e.mul(t))};Red.prototype.isqr=function isqr(e){return this.imul(e,e.clone())};Red.prototype.sqr=function sqr(e){return this.mul(e,e)};Red.prototype.sqrt=function sqrt(e){if(e.isZero())return e.clone();var t=this.m.andln(3);assert(t%2===1);if(t===3){var r=this.m.add(new BN(1)).iushrn(2);return this.pow(e,r)}var n=this.m.subn(1);var i=0;while(!n.isZero()&&n.andln(1)===0){i++;n.iushrn(1)}assert(!n.isZero());var a=new BN(1).toRed(this);var o=a.redNeg();var s=this.m.subn(1).iushrn(1);var f=this.m.bitLength();f=new BN(2*f*f).toRed(this);while(this.pow(f,s).cmp(o)!==0){f.redIAdd(o)}var c=this.pow(f,n);var u=this.pow(e,n.addn(1).iushrn(1));var d=this.pow(e,n);var h=i;while(d.cmp(a)!==0){var l=d;for(var p=0;l.cmp(a)!==0;p++){l=l.redSqr()}assert(p<h);var v=this.pow(c,new BN(1).iushln(h-p-1));u=u.redMul(v);c=v.redSqr();d=d.redMul(c);h=p}return u};Red.prototype.invm=function invm(e){var t=e._invmp(this.m);if(t.negative!==0){t.negative=0;return this.imod(t).redNeg()}else{return this.imod(t)}};Red.prototype.pow=function pow(e,t){if(t.isZero())return new BN(1).toRed(this);if(t.cmpn(1)===0)return e.clone();var r=4;var n=new Array(1<<r);n[0]=new BN(1).toRed(this);n[1]=e;for(var i=2;i<n.length;i++){n[i]=this.mul(n[i-1],e)}var a=n[0];var o=0;var s=0;var f=t.bitLength()%26;if(f===0){f=26}for(i=t.length-1;i>=0;i--){var c=t.words[i];for(var u=f-1;u>=0;u--){var d=c>>u&1;if(a!==n[0]){a=this.sqr(a)}if(d===0&&o===0){s=0;continue}o<<=1;o|=d;s++;if(s!==r&&(i!==0||u!==0))continue;a=this.mul(a,n[o]);s=0;o=0}f=26}return a};Red.prototype.convertTo=function convertTo(e){var t=e.umod(this.m);return t===e?t.clone():t};Red.prototype.convertFrom=function convertFrom(e){var t=e.clone();t.red=null;return t};BN.mont=function mont(e){return new Mont(e)};function Mont(e){Red.call(this,e);this.shift=this.m.bitLength();if(this.shift%26!==0){this.shift+=26-this.shift%26}this.r=new BN(1).iushln(this.shift);this.r2=this.imod(this.r.sqr());this.rinv=this.r._invmp(this.m);this.minv=this.rinv.mul(this.r).isubn(1).div(this.m);this.minv=this.minv.umod(this.r);this.minv=this.r.sub(this.minv)}inherits(Mont,Red);Mont.prototype.convertTo=function convertTo(e){return this.imod(e.ushln(this.shift))};Mont.prototype.convertFrom=function convertFrom(e){var t=this.imod(e.mul(this.rinv));t.red=null;return t};Mont.prototype.imul=function imul(e,t){if(e.isZero()||t.isZero()){e.words[0]=0;e.length=1;return e}var r=e.imul(t);var n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var i=r.isub(n).iushrn(this.shift);var a=i;if(i.cmp(this.m)>=0){a=i.isub(this.m)}else if(i.cmpn(0)<0){a=i.iadd(this.m)}return a._forceRed(this)};Mont.prototype.mul=function mul(e,t){if(e.isZero()||t.isZero())return new BN(0)._forceRed(this);var r=e.mul(t);var n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m);var i=r.isub(n).iushrn(this.shift);var a=i;if(i.cmp(this.m)>=0){a=i.isub(this.m)}else if(i.cmpn(0)<0){a=i.iadd(this.m)}return a._forceRed(this)};Mont.prototype.invm=function invm(e){var t=this.imod(e._invmp(this.m).mul(this.r2));return t._forceRed(this)}})(typeof e==="undefined"||e,this)}).call(this,r(131)(e))},function(e,t,r){"use strict";var n=t;n.version=r(124).version;n.utils=r(123);n.rand=r(54);n.curve=r(21);n.curves=r(118);n.ec=r(110);n.eddsa=r(106)},function(e,t){e.exports=assert;function assert(e,t){if(!e)throw new Error(t||"Assertion failed")}assert.equal=function assertEqual(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){"use strict";var n=r(5);var i=r(0);t.inherits=i;function toArray(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e==="string"){if(!t){for(var n=0;n<e.length;n++){var i=e.charCodeAt(n);var a=i>>8;var o=i&255;if(a)r.push(a,o);else r.push(o)}}else if(t==="hex"){e=e.replace(/[^a-z0-9]+/gi,"");if(e.length%2!==0)e="0"+e;for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}}else{for(n=0;n<e.length;n++)r[n]=e[n]|0}return r}t.toArray=toArray;function toHex(e){var t="";for(var r=0;r<e.length;r++)t+=zero2(e[r].toString(16));return t}t.toHex=toHex;function htonl(e){var t=e>>>24|e>>>8&65280|e<<8&16711680|(e&255)<<24;return t>>>0}t.htonl=htonl;function toHex32(e,t){var r="";for(var n=0;n<e.length;n++){var i=e[n];if(t==="little")i=htonl(i);r+=zero8(i.toString(16))}return r}t.toHex32=toHex32;function zero2(e){if(e.length===1)return"0"+e;else return e}t.zero2=zero2;function zero8(e){if(e.length===7)return"0"+e;else if(e.length===6)return"00"+e;else if(e.length===5)return"000"+e;else if(e.length===4)return"0000"+e;else if(e.length===3)return"00000"+e;else if(e.length===2)return"000000"+e;else if(e.length===1)return"0000000"+e;else return e}t.zero8=zero8;function join32(e,t,r,i){var a=r-t;n(a%4===0);var o=new Array(a/4);for(var s=0,f=t;s<o.length;s++,f+=4){var c;if(i==="big")c=e[f]<<24|e[f+1]<<16|e[f+2]<<8|e[f+3];else c=e[f+3]<<24|e[f+2]<<16|e[f+1]<<8|e[f];o[s]=c>>>0}return o}t.join32=join32;function split32(e,t){var r=new Array(e.length*4);for(var n=0,i=0;n<e.length;n++,i+=4){var a=e[n];if(t==="big"){r[i]=a>>>24;r[i+1]=a>>>16&255;r[i+2]=a>>>8&255;r[i+3]=a&255}else{r[i+3]=a>>>24;r[i+2]=a>>>16&255;r[i+1]=a>>>8&255;r[i]=a&255}}return r}t.split32=split32;function rotr32(e,t){return e>>>t|e<<32-t}t.rotr32=rotr32;function rotl32(e,t){return e<<t|e>>>32-t}t.rotl32=rotl32;function sum32(e,t){return e+t>>>0}t.sum32=sum32;function sum32_3(e,t,r){return e+t+r>>>0}t.sum32_3=sum32_3;function sum32_4(e,t,r,n){return e+t+r+n>>>0}t.sum32_4=sum32_4;function sum32_5(e,t,r,n,i){return e+t+r+n+i>>>0}t.sum32_5=sum32_5;function sum64(e,t,r,n){var i=e[t];var a=e[t+1];var o=n+a>>>0;var s=(o<n?1:0)+r+i;e[t]=s>>>0;e[t+1]=o}t.sum64=sum64;function sum64_hi(e,t,r,n){var i=t+n>>>0;var a=(i<t?1:0)+e+r;return a>>>0}t.sum64_hi=sum64_hi;function sum64_lo(e,t,r,n){var i=t+n;return i>>>0}t.sum64_lo=sum64_lo;function sum64_4_hi(e,t,r,n,i,a,o,s){var f=0;var c=t;c=c+n>>>0;f+=c<t?1:0;c=c+a>>>0;f+=c<a?1:0;c=c+s>>>0;f+=c<s?1:0;var u=e+r+i+o+f;return u>>>0}t.sum64_4_hi=sum64_4_hi;function sum64_4_lo(e,t,r,n,i,a,o,s){var f=t+n+a+s;return f>>>0}t.sum64_4_lo=sum64_4_lo;function sum64_5_hi(e,t,r,n,i,a,o,s,f,c){var u=0;var d=t;d=d+n>>>0;u+=d<t?1:0;d=d+a>>>0;u+=d<a?1:0;d=d+s>>>0;u+=d<s?1:0;d=d+c>>>0;u+=d<c?1:0;var h=e+r+i+o+f+u;return h>>>0}t.sum64_5_hi=sum64_5_hi;function sum64_5_lo(e,t,r,n,i,a,o,s,f,c){var u=t+n+a+s+c;return u>>>0}t.sum64_5_lo=sum64_5_lo;function rotr64_hi(e,t,r){var n=t<<32-r|e>>>r;return n>>>0}t.rotr64_hi=rotr64_hi;function rotr64_lo(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}t.rotr64_lo=rotr64_lo;function shr64_hi(e,t,r){return e>>>r}t.shr64_hi=shr64_hi;function shr64_lo(e,t,r){var n=e<<32-r|t>>>r;return n>>>0}t.shr64_lo=shr64_lo},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(1,eval)("this")}catch(e){if(typeof window==="object")r=window}e.exports=r},function(e,t,r){var n=r(1).Buffer;var i=r(37).Transform;var a=r(33).StringDecoder;var o=r(0);function CipherBase(e){i.call(this);this.hashMode=typeof e==="string";if(this.hashMode){this[e]=this._finalOrDigest}else{this.final=this._finalOrDigest}if(this._final){this.__final=this._final;this._final=null}this._decoder=null;this._encoding=null}o(CipherBase,i);CipherBase.prototype.update=function(e,t,r){if(typeof e==="string"){e=n.from(e,t)}var i=this._update(e);if(this.hashMode)return this;if(r){i=this._toString(i,r)}return i};CipherBase.prototype.setAutoPadding=function(){};CipherBase.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")};CipherBase.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")};CipherBase.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")};CipherBase.prototype._transform=function(e,t,r){var n;try{if(this.hashMode){this._update(e)}else{this.push(this._update(e))}}catch(e){n=e}finally{r(n)}};CipherBase.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)};CipherBase.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);if(e){t=this._toString(t,e,true)}return t};CipherBase.prototype._toString=function(e,t,r){if(!this._decoder){this._decoder=new a(t);this._encoding=t}if(this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);if(r){n+=this._decoder.end()}return n};e.exports=CipherBase},function(e,t){var r=e.exports={};var n;var i;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){n=setTimeout}else{n=defaultSetTimout}}catch(e){n=defaultSetTimout}try{if(typeof clearTimeout==="function"){i=clearTimeout}else{i=defaultClearTimeout}}catch(e){i=defaultClearTimeout}})();function runTimeout(e){if(n===setTimeout){return setTimeout(e,0)}if((n===defaultSetTimout||!n)&&setTimeout){n=setTimeout;return setTimeout(e,0)}try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}function runClearTimeout(e){if(i===clearTimeout){return clearTimeout(e)}if((i===defaultClearTimeout||!i)&&clearTimeout){i=clearTimeout;return clearTimeout(e)}try{return i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}var a=[];var o=false;var s;var f=-1;function cleanUpNextTick(){if(!o||!s){return}o=false;if(s.length){a=s.concat(a)}else{f=-1}if(a.length){drainQueue()}}function drainQueue(){if(o){return}var e=runTimeout(cleanUpNextTick);o=true;var t=a.length;while(t){s=a;a=[];while(++f<t){if(s){s[f].run()}}f=-1;t=a.length}s=null;o=false;runClearTimeout(e)}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1){for(var r=1;r<arguments.length;r++){t[r-1]=arguments[r]}}a.push(new Item(e,t));if(a.length===1&&!o){runTimeout(drainQueue)}};function Item(e,t){this.fun=e;this.array=t}Item.prototype.run=function(){this.fun.apply(null,this.array)};r.title="browser";r.browser=true;r.env={};r.argv=[];r.version="";r.versions={};function noop(){}r.on=noop;r.addListener=noop;r.once=noop;r.off=noop;r.removeListener=noop;r.removeAllListeners=noop;r.emit=noop;r.prependListener=noop;r.prependOnceListener=noop;r.listeners=function(e){return[]};r.binding=function(e){throw new Error("process.binding is not supported")};r.cwd=function(){return"/"};r.chdir=function(e){throw new Error("process.chdir is not supported")};r.umask=function(){return 0}},function(e,t,r){"use strict";var n=r(24);var i=Object.keys||function(e){var t=[];for(var r in e){t.push(r)}return t};e.exports=Duplex;var a=r(17);a.inherits=r(0);var o=r(74);var s=r(34);a.inherits(Duplex,o);{var f=i(s.prototype);for(var c=0;c<f.length;c++){var u=f[c];if(!Duplex.prototype[u])Duplex.prototype[u]=s.prototype[u]}}function Duplex(e){if(!(this instanceof Duplex))return new Duplex(e);o.call(this,e);s.call(this,e);if(e&&e.readable===false)this.readable=false;if(e&&e.writable===false)this.writable=false;this.allowHalfOpen=true;if(e&&e.allowHalfOpen===false)this.allowHalfOpen=false;this.once("end",onend)}Object.defineProperty(Duplex.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function onend(){if(this.allowHalfOpen||this._writableState.ended)return;n.nextTick(onEndNT,this)}function onEndNT(e){e.end()}Object.defineProperty(Duplex.prototype,"destroyed",{get:function(){if(this._readableState===undefined||this._writableState===undefined){return false}return this._readableState.destroyed&&this._writableState.destroyed},set:function(e){if(this._readableState===undefined||this._writableState===undefined){return}this._readableState.destroyed=e;this._writableState.destroyed=e}});Duplex.prototype._destroy=function(e,t){this.push(null);this.end();n.nextTick(t,e)}},function(e,t,r){var n=r(1).Buffer;function Hash(e,t){this._block=n.alloc(e);this._finalSize=t;this._blockSize=e;this._len=0}Hash.prototype.update=function(e,t){if(typeof e==="string"){t=t||"utf8";e=n.from(e,t)}var r=this._block;var i=this._blockSize;var a=e.length;var o=this._len;for(var s=0;s<a;){var f=o%i;var c=Math.min(a-s,i-f);for(var u=0;u<c;u++){r[f+u]=e[s+u]}o+=c;s+=c;if(o%i===0){this._update(r)}}this._len+=a;return this};Hash.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128;this._block.fill(0,t+1);if(t>=this._finalSize){this._update(this._block);this._block.fill(0)}var r=this._len*8;if(r<=4294967295){this._block.writeUInt32BE(r,this._blockSize-4)}else{var n=(r&4294967295)>>>0;var i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8);this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return e?a.toString(e):a};Hash.prototype._update=function(){throw new Error("_update must be implemented by subclass")};e.exports=Hash},function(e,t,r){"use strict";(function(t,n){function oldBrowser(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}var i=r(1).Buffer;var a=t.crypto||t.msCrypto;if(a&&a.getRandomValues){e.exports=randomBytes}else{e.exports=oldBrowser}function randomBytes(e,r){if(e>65536)throw new Error("requested too many random bytes");var o=new t.Uint8Array(e);if(e>0){a.getRandomValues(o)}var s=i.from(o.buffer);if(typeof r==="function"){return n.nextTick(function(){r(null,s)})}return s}}).call(this,r(7),r(9))},function(e,t,r){var n=t;n.Reporter=r(99).Reporter;n.DecoderBuffer=r(49).DecoderBuffer;n.EncoderBuffer=r(49).EncoderBuffer;n.Node=r(98)},function(e,t,r){var n=t;n.bignum=r(3);n.define=r(102).define;n.base=r(13);n.constants=r(48);n.decoders=r(96);n.encoders=r(94)},function(e,t,r){"use strict";var n=r(6);var i=r(5);function BlockHash(){this.pending=null;this.pendingTotal=0;this.blockSize=this.constructor.blockSize;this.outSize=this.constructor.outSize;this.hmacStrength=this.constructor.hmacStrength;this.padLength=this.constructor.padLength/8;this.endian="big";this._delta8=this.blockSize/8;this._delta32=this.blockSize/32}t.BlockHash=BlockHash;BlockHash.prototype.update=function update(e,t){e=n.toArray(e,t);if(!this.pending)this.pending=e;else this.pending=this.pending.concat(e);this.pendingTotal+=e.length;if(this.pending.length>=this._delta8){e=this.pending;var r=e.length%this._delta8;this.pending=e.slice(e.length-r,e.length);if(this.pending.length===0)this.pending=null;e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this};BlockHash.prototype.digest=function digest(e){this.update(this._pad());i(this.pending===null);return this._digest(e)};BlockHash.prototype._pad=function pad(){var e=this.pendingTotal;var t=this._delta8;var r=t-(e+this.padLength)%t;var n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;e<<=3;if(this.endian==="big"){for(var a=8;a<this.padLength;a++)n[i++]=0;n[i++]=0;n[i++]=0;n[i++]=0;n[i++]=0;n[i++]=e>>>24&255;n[i++]=e>>>16&255;n[i++]=e>>>8&255;n[i++]=e&255}else{n[i++]=e&255;n[i++]=e>>>8&255;n[i++]=e>>>16&255;n[i++]=e>>>24&255;n[i++]=0;n[i++]=0;n[i++]=0;n[i++]=0;for(a=8;a<this.padLength;a++)n[i++]=0}return n}},function(e,t,r){(function(t){e.exports=function xor(e,r){var n=Math.min(e.length,r.length);var i=new t(n);for(var a=0;a<n;++a){i[a]=e[a]^r[a]}return i}}).call(this,r(2).Buffer)},function(e,t,r){(function(e){function isArray(e){if(Array.isArray){return Array.isArray(e)}return objectToString(e)==="[object Array]"}t.isArray=isArray;function isBoolean(e){return typeof e==="boolean"}t.isBoolean=isBoolean;function isNull(e){return e===null}t.isNull=isNull;function isNullOrUndefined(e){return e==null}t.isNullOrUndefined=isNullOrUndefined;function isNumber(e){return typeof e==="number"}t.isNumber=isNumber;function isString(e){return typeof e==="string"}t.isString=isString;function isSymbol(e){return typeof e==="symbol"}t.isSymbol=isSymbol;function isUndefined(e){return e===void 0}t.isUndefined=isUndefined;function isRegExp(e){return objectToString(e)==="[object RegExp]"}t.isRegExp=isRegExp;function isObject(e){return typeof e==="object"&&e!==null}t.isObject=isObject;function isDate(e){return objectToString(e)==="[object Date]"}t.isDate=isDate;function isError(e){return objectToString(e)==="[object Error]"||e instanceof Error}t.isError=isError;function isFunction(e){return typeof e==="function"}t.isFunction=isFunction;function isPrimitive(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"||typeof e==="symbol"||typeof e==="undefined"}t.isPrimitive=isPrimitive;t.isBuffer=e.isBuffer;function objectToString(e){return Object.prototype.toString.call(e)}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n=r(0);var i=r(38);var a=r(32);var o=r(31);var s=r(8);function Hash(e){s.call(this,"digest");this._hash=e}n(Hash,s);Hash.prototype._update=function(e){this._hash.update(e)};Hash.prototype._final=function(){return this._hash.digest()};e.exports=function createHash(e){e=e.toLowerCase();if(e==="md5")return new i;if(e==="rmd160"||e==="ripemd160")return new a;return new Hash(o(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}var n=t.NotSupportedError=function(e){_inherits(NotSupportedError,e);function NotSupportedError(){_classCallCheck(this,NotSupportedError);return _possibleConstructorReturn(this,(NotSupportedError.__proto__||Object.getPrototypeOf(NotSupportedError)).apply(this,arguments))}return NotSupportedError}(Error);var i=t.DataError=function(e){_inherits(DataError,e);function DataError(){_classCallCheck(this,DataError);return _possibleConstructorReturn(this,(DataError.__proto__||Object.getPrototypeOf(DataError)).apply(this,arguments))}return DataError}(Error);var a=t.OperationError=function(e){_inherits(OperationError,e);function OperationError(){_classCallCheck(this,OperationError);return _possibleConstructorReturn(this,(OperationError.__proto__||Object.getPrototypeOf(OperationError)).apply(this,arguments))}return OperationError}(Error)},function(e,t,r){(function(t){var n=r(103);var i=r(91);var a=r(90);var o=r(29);var s=r(65);e.exports=parseKeys;function parseKeys(e){var r;if(typeof e==="object"&&!t.isBuffer(e)){r=e.passphrase;e=e.key}if(typeof e==="string"){e=new t(e)}var i=a(e,r);var o=i.tag;var s=i.data;var f,c;switch(o){case"CERTIFICATE":c=n.certificate.decode(s,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":if(!c){c=n.PublicKey.decode(s,"der")}f=c.algorithm.algorithm.join(".");switch(f){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(c.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":c.subjectPrivateKey=c.subjectPublicKey;return{type:"ec",data:c};case"1.2.840.10040.4.1":c.algorithm.params.pub_key=n.DSAparam.decode(c.subjectPublicKey.data,"der");return{type:"dsa",data:c.algorithm.params};default:throw new Error("unknown key id "+f)}throw new Error("unknown key type "+o);case"ENCRYPTED PRIVATE KEY":s=n.EncryptedPrivateKey.decode(s,"der");s=decrypt(s,r);case"PRIVATE KEY":c=n.PrivateKey.decode(s,"der");f=c.algorithm.algorithm.join(".");switch(f){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(c.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:c.algorithm.curve,privateKey:n.ECPrivateKey.decode(c.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":c.algorithm.params.priv_key=n.DSAparam.decode(c.subjectPrivateKey,"der");return{type:"dsa",params:c.algorithm.params};default:throw new Error("unknown key id "+f)}throw new Error("unknown key type "+o);case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(s,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(s,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(s,"der")};case"EC PRIVATE KEY":s=n.ECPrivateKey.decode(s,"der");return{curve:s.parameters.value,privateKey:s.privateKey};default:throw new Error("unknown key type "+o)}}parseKeys.signature=n.signature;function decrypt(e,r){var n=e.algorithm.decrypt.kde.kdeparams.salt;var a=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10);var f=i[e.algorithm.decrypt.cipher.algo.join(".")];var c=e.algorithm.decrypt.cipher.iv;var u=e.subjectPrivateKey;var d=parseInt(f.split("-")[1],10)/8;var h=s.pbkdf2Sync(r,n,a,d);var l=o.createDecipheriv(f,h,c);var p=[];p.push(l.update(u));p.push(l.final());return t.concat(p)}}).call(this,r(2).Buffer)},function(e,t,r){"use strict";var n=t;n.base=r(122);n.short=r(121);n.mont=r(120);n.edwards=r(119)},function(e,t,r){var n=r(1).Buffer;var i=r(38);function EVP_BytesToKey(e,t,r,a){if(!n.isBuffer(e))e=n.from(e,"binary");if(t){if(!n.isBuffer(t))t=n.from(t,"binary");if(t.length!==8)throw new RangeError("salt should be Buffer with 8 byte length")}var o=r/8;var s=n.alloc(o);var f=n.alloc(a||0);var c=n.alloc(0);while(o>0||a>0){var u=new i;u.update(c);u.update(e);if(t)u.update(t);c=u.digest();var d=0;if(o>0){var h=s.length-o;d=Math.min(o,c.length);c.copy(s,h,0,d);o-=d}if(d<c.length&&a>0){var l=f.length-a;var p=Math.min(a,c.length-d);c.copy(f,l,d,d+p);a-=p}}c.fill(0);return{key:s,iv:f}}e.exports=EVP_BytesToKey},function(e,t,r){var n=r(1).Buffer;function asUInt32Array(e){if(!n.isBuffer(e))e=n.from(e);var t=e.length/4|0;var r=new Array(t);for(var i=0;i<t;i++){r[i]=e.readUInt32BE(i*4)}return r}function scrubVec(e){for(var t=0;t<e.length;e++){e[t]=0}}function cryptBlock(e,t,r,n,i){var a=r[0];var o=r[1];var s=r[2];var f=r[3];var c=e[0]^t[0];var u=e[1]^t[1];var d=e[2]^t[2];var h=e[3]^t[3];var l,p,v,y;var b=4;for(var m=1;m<i;m++){l=a[c>>>24]^o[u>>>16&255]^s[d>>>8&255]^f[h&255]^t[b++];p=a[u>>>24]^o[d>>>16&255]^s[h>>>8&255]^f[c&255]^t[b++];v=a[d>>>24]^o[h>>>16&255]^s[c>>>8&255]^f[u&255]^t[b++];y=a[h>>>24]^o[c>>>16&255]^s[u>>>8&255]^f[d&255]^t[b++];c=l;u=p;d=v;h=y}l=(n[c>>>24]<<24|n[u>>>16&255]<<16|n[d>>>8&255]<<8|n[h&255])^t[b++];p=(n[u>>>24]<<24|n[d>>>16&255]<<16|n[h>>>8&255]<<8|n[c&255])^t[b++];v=(n[d>>>24]<<24|n[h>>>16&255]<<16|n[c>>>8&255]<<8|n[u&255])^t[b++];y=(n[h>>>24]<<24|n[c>>>16&255]<<16|n[u>>>8&255]<<8|n[d&255])^t[b++];l=l>>>0;p=p>>>0;v=v>>>0;y=y>>>0;return[l,p,v,y]}var i=[0,1,2,4,8,16,32,64,128,27,54];var a=function(){var e=new Array(256);for(var t=0;t<256;t++){if(t<128){e[t]=t<<1}else{e[t]=t<<1^283}}var r=[];var n=[];var i=[[],[],[],[]];var a=[[],[],[],[]];var o=0;var s=0;for(var f=0;f<256;++f){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^c&255^99;r[o]=c;n[c]=o;var u=e[o];var d=e[u];var h=e[d];var l=e[c]*257^c*16843008;i[0][o]=l<<24|l>>>8;i[1][o]=l<<16|l>>>16;i[2][o]=l<<8|l>>>24;i[3][o]=l;l=h*16843009^d*65537^u*257^o*16843008;a[0][c]=l<<24|l>>>8;a[1][c]=l<<16|l>>>16;a[2][c]=l<<8|l>>>24;a[3][c]=l;if(o===0){o=s=1}else{o=u^e[e[e[h^u]]];s^=e[e[s]]}}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:a}}();function AES(e){this._key=asUInt32Array(e);this._reset()}AES.blockSize=4*4;AES.keySize=256/8;AES.prototype.blockSize=AES.blockSize;AES.prototype.keySize=AES.keySize;AES.prototype._reset=function(){var e=this._key;var t=e.length;var r=t+6;var n=(r+1)*4;var o=[];for(var s=0;s<t;s++){o[s]=e[s]}for(s=t;s<n;s++){var f=o[s-1];if(s%t===0){f=f<<8|f>>>24;f=a.SBOX[f>>>24]<<24|a.SBOX[f>>>16&255]<<16|a.SBOX[f>>>8&255]<<8|a.SBOX[f&255];f^=i[s/t|0]<<24}else if(t>6&&s%t===4){f=a.SBOX[f>>>24]<<24|a.SBOX[f>>>16&255]<<16|a.SBOX[f>>>8&255]<<8|a.SBOX[f&255]}o[s]=o[s-t]^f}var c=[];for(var u=0;u<n;u++){var d=n-u;var h=o[d-(u%4?0:4)];if(u<4||d<=4){c[u]=h}else{c[u]=a.INV_SUB_MIX[0][a.SBOX[h>>>24]]^a.INV_SUB_MIX[1][a.SBOX[h>>>16&255]]^a.INV_SUB_MIX[2][a.SBOX[h>>>8&255]]^a.INV_SUB_MIX[3][a.SBOX[h&255]]}}this._nRounds=r;this._keySchedule=o;this._invKeySchedule=c};AES.prototype.encryptBlockRaw=function(e){e=asUInt32Array(e);return cryptBlock(e,this._keySchedule,a.SUB_MIX,a.SBOX,this._nRounds)};AES.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e);var r=n.allocUnsafe(16);r.writeUInt32BE(t[0],0);r.writeUInt32BE(t[1],4);r.writeUInt32BE(t[2],8);r.writeUInt32BE(t[3],12);return r};AES.prototype.decryptBlock=function(e){e=asUInt32Array(e);var t=e[1];e[1]=e[3];e[3]=t;var r=cryptBlock(e,this._invKeySchedule,a.INV_SUB_MIX,a.INV_SBOX,this._nRounds);var i=n.allocUnsafe(16);i.writeUInt32BE(r[0],0);i.writeUInt32BE(r[3],4);i.writeUInt32BE(r[2],8);i.writeUInt32BE(r[1],12);return i};AES.prototype.scrub=function(){scrubVec(this._keySchedule);scrubVec(this._invKeySchedule);scrubVec(this._key)};e.exports.AES=AES},function(e,t,r){"use strict";(function(t){if(!t.version||t.version.indexOf("v0.")===0||t.version.indexOf("v1.")===0&&t.version.indexOf("v1.8.")!==0){e.exports={nextTick}}else{e.exports=t}function nextTick(e,r,n,i){if(typeof e!=="function"){throw new TypeError('"callback" argument must be a function')}var a=arguments.length;var o,s;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function afterTickOne(){e.call(null,r)});case 3:return t.nextTick(function afterTickTwo(){e.call(null,r,n)});case 4:return t.nextTick(function afterTickThree(){e.call(null,r,n,i)});default:o=new Array(a-1);s=0;while(s<o.length){o[s++]=arguments[s]}return t.nextTick(function afterTick(){e.apply(null,o)})}}}).call(this,r(9))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.getSeed=getSeed;t.randomSeed=randomSeed;var n=r(80);function getSeed(e){var t=new n.GostRandom;try{var r=new Uint8Array(Math.ceil(e/8));t.getRandomValues(r);return r}catch(e){throw new Error("Error occurred during random values generation")}}function randomSeed(e){try{var t=new n.GostRandom;return t.getRandomValues(e)}catch(e){throw new Error("Error occurred during random values generation")}}},function(e,t,r){var n=t;n.utils=r(6);n.common=r(15);n.sha=r(117);n.ripemd=r(113);n.hmac=r(112);n.sha1=n.sha.sha1;n.sha256=n.sha.sha256;n.sha224=n.sha.sha224;n.sha384=n.sha.sha384;n.sha512=n.sha.sha512;n.ripemd160=n.ripemd.ripemd160},function(e,t,r){(function(t){var n=r(3);var i=r(12);e.exports=crt;function blind(e){var t=getr(e);var r=t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed();return{blinder:r,unblinder:t.invm(e.modulus)}}function crt(e,r){var i=blind(r);var a=r.modulus.byteLength();var o=n.mont(r.modulus);var s=new n(e).mul(i.blinder).umod(r.modulus);var f=s.toRed(n.mont(r.prime1));var c=s.toRed(n.mont(r.prime2));var u=r.coefficient;var d=r.prime1;var h=r.prime2;var l=f.redPow(r.exponent1);var p=c.redPow(r.exponent2);l=l.fromRed();p=p.fromRed();var v=l.isub(p).imul(u).umod(d);v.imul(h);p.iadd(v);return new t(p.imul(i.unblinder).umod(r.modulus).toArray(false,a))}crt.getr=getr;function getr(e){var t=e.modulus.byteLength();var r=new n(i(t));while(r.cmp(e.modulus)>=0||!r.umod(e.prime1)||!r.umod(e.prime2)){r=new n(i(t))}return r}}).call(this,r(2).Buffer)},function(e,t,r){var n={ECB:r(141),CBC:r(140),CFB:r(139),CFB8:r(138),CFB1:r(137),OFB:r(136),CTR:r(61),GCM:r(61)};var i=r(59);for(var a in i){i[a].module=n[i[a].mode]}e.exports=i},function(e,t,r){var n=r(142);var i=r(134);var a=r(59);function getCiphers(){return Object.keys(a)}t.createCipher=t.Cipher=n.createCipher;t.createCipheriv=t.Cipheriv=n.createCipheriv;t.createDecipher=t.Decipher=i.createDecipher;t.createDecipheriv=t.Decipheriv=i.createDecipheriv;t.listCiphers=t.getCiphers=getCiphers},function(e,t,r){"use strict";t.utils=r(147);t.Cipher=r(146);t.DES=r(145);t.CBC=r(144);t.EDE=r(143)},function(e,t,r){var t=e.exports=function SHA(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};t.sha=r(156);t.sha1=r(155);t.sha224=r(154);t.sha256=r(70);t.sha384=r(153);t.sha512=r(69)},function(e,t,r){"use strict";var n=r(2).Buffer;var i=r(0);var a=r(75);var o=new Array(16);var s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13];var f=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11];var c=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6];var u=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];var d=[0,1518500249,1859775393,2400959708,2840853838];var h=[1352829926,1548603684,1836072691,2053994217,0];function RIPEMD160(){a.call(this,64);this._a=1732584193;this._b=4023233417;this._c=2562383102;this._d=271733878;this._e=3285377520}i(RIPEMD160,a);RIPEMD160.prototype._update=function(){var e=o;for(var t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);var r=this._a|0;var n=this._b|0;var i=this._c|0;var a=this._d|0;var l=this._e|0;var p=this._a|0;var v=this._b|0;var y=this._c|0;var b=this._d|0;var m=this._e|0;for(var g=0;g<80;g+=1){var w;var C;if(g<16){w=fn1(r,n,i,a,l,e[s[g]],d[0],c[g]);C=fn5(p,v,y,b,m,e[f[g]],h[0],u[g])}else if(g<32){w=fn2(r,n,i,a,l,e[s[g]],d[1],c[g]);C=fn4(p,v,y,b,m,e[f[g]],h[1],u[g])}else if(g<48){w=fn3(r,n,i,a,l,e[s[g]],d[2],c[g]);C=fn3(p,v,y,b,m,e[f[g]],h[2],u[g])}else if(g<64){w=fn4(r,n,i,a,l,e[s[g]],d[3],c[g]);C=fn2(p,v,y,b,m,e[f[g]],h[3],u[g])}else{w=fn5(r,n,i,a,l,e[s[g]],d[4],c[g]);C=fn1(p,v,y,b,m,e[f[g]],h[4],u[g])}r=l;l=a;a=rotl(i,10);i=n;n=w;p=m;m=b;b=rotl(y,10);y=v;v=C}var S=this._b+i+b|0;this._b=this._c+a+m|0;this._c=this._d+l+p|0;this._d=this._e+r+v|0;this._e=this._a+n+y|0;this._a=S};RIPEMD160.prototype._digest=function(){this._block[this._blockOffset++]=128;if(this._blockOffset>56){this._block.fill(0,this._blockOffset,64);this._update();this._blockOffset=0}this._block.fill(0,this._blockOffset,56);this._block.writeUInt32LE(this._length[0],56);this._block.writeUInt32LE(this._length[1],60);this._update();var e=n.alloc?n.alloc(20):new n(20);e.writeInt32LE(this._a,0);e.writeInt32LE(this._b,4);e.writeInt32LE(this._c,8);e.writeInt32LE(this._d,12);e.writeInt32LE(this._e,16);return e};function rotl(e,t){return e<<t|e>>>32-t}function fn1(e,t,r,n,i,a,o,s){return rotl(e+(t^r^n)+a+o|0,s)+i|0}function fn2(e,t,r,n,i,a,o,s){return rotl(e+(t&r|~t&n)+a+o|0,s)+i|0}function fn3(e,t,r,n,i,a,o,s){return rotl(e+((t|~r)^n)+a+o|0,s)+i|0}function fn4(e,t,r,n,i,a,o,s){return rotl(e+(t&n|r&~n)+a+o|0,s)+i|0}function fn5(e,t,r,n,i,a,o,s){return rotl(e+(t^(r|~n))+a+o|0,s)+i|0}e.exports=RIPEMD160},function(e,t,r){"use strict";var n=r(1).Buffer;var i=n.isEncoding||function(e){e=""+e;switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function _normalizeEncoding(e){if(!e)return"utf8";var t;while(true){switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase();t=true}}}function normalizeEncoding(e){var t=_normalizeEncoding(e);if(typeof t!=="string"&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}t.StringDecoder=StringDecoder;function StringDecoder(e){this.encoding=normalizeEncoding(e);var t;switch(this.encoding){case"utf16le":this.text=utf16Text;this.end=utf16End;t=4;break;case"utf8":this.fillLast=utf8FillLast;t=4;break;case"base64":this.text=base64Text;this.end=base64End;t=3;break;default:this.write=simpleWrite;this.end=simpleEnd;return}this.lastNeed=0;this.lastTotal=0;this.lastChar=n.allocUnsafe(t)}StringDecoder.prototype.write=function(e){if(e.length===0)return"";var t;var r;if(this.lastNeed){t=this.fillLast(e);if(t===undefined)return"";r=this.lastNeed;this.lastNeed=0}else{r=0}if(r<e.length)return t?t+this.text(e,r):this.text(e,r);return t||""};StringDecoder.prototype.end=utf8End;StringDecoder.prototype.text=utf8Text;StringDecoder.prototype.fillLast=function(e){if(this.lastNeed<=e.length){e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length);this.lastNeed-=e.length};function utf8CheckByte(e){if(e<=127)return 0;else if(e>>5===6)return 2;else if(e>>4===14)return 3;else if(e>>3===30)return 4;return e>>6===2?-1:-2}function utf8CheckIncomplete(e,t,r){var n=t.length-1;if(n<r)return 0;var i=utf8CheckByte(t[n]);if(i>=0){if(i>0)e.lastNeed=i-1;return i}if(--n<r||i===-2)return 0;i=utf8CheckByte(t[n]);if(i>=0){if(i>0)e.lastNeed=i-2;return i}if(--n<r||i===-2)return 0;i=utf8CheckByte(t[n]);if(i>=0){if(i>0){if(i===2)i=0;else e.lastNeed=i-3}return i}return 0}function utf8CheckExtraBytes(e,t,r){if((t[0]&192)!==128){e.lastNeed=0;return"�"}if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128){e.lastNeed=1;return"�"}if(e.lastNeed>2&&t.length>2){if((t[2]&192)!==128){e.lastNeed=2;return"�"}}}}function utf8FillLast(e){var t=this.lastTotal-this.lastNeed;var r=utf8CheckExtraBytes(this,e,t);if(r!==undefined)return r;if(this.lastNeed<=e.length){e.copy(this.lastChar,t,0,this.lastNeed);return this.lastChar.toString(this.encoding,0,this.lastTotal)}e.copy(this.lastChar,t,0,e.length);this.lastNeed-=e.length}function utf8Text(e,t){var r=utf8CheckIncomplete(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);e.copy(this.lastChar,0,n);return e.toString("utf8",t,n)}function utf8End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+"�";return t}function utf16Text(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319){this.lastNeed=2;this.lastTotal=4;this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1];return r.slice(0,-1)}}return r}this.lastNeed=1;this.lastTotal=2;this.lastChar[0]=e[e.length-1];return e.toString("utf16le",t,e.length-1)}function utf16End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function base64Text(e,t){var r=(e.length-t)%3;if(r===0)return e.toString("base64",t);this.lastNeed=3-r;this.lastTotal=3;if(r===1){this.lastChar[0]=e[e.length-1]}else{this.lastChar[0]=e[e.length-2];this.lastChar[1]=e[e.length-1]}return e.toString("base64",t,e.length-r)}function base64End(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed)return t+this.lastChar.toString("base64",0,3-this.lastNeed);return t}function simpleWrite(e){return e.toString(this.encoding)}function simpleEnd(e){return e&&e.length?this.write(e):""}},function(e,t,r){"use strict";(function(t,n,i){var a=r(24);e.exports=Writable;function WriteReq(e,t,r){this.chunk=e;this.encoding=t;this.callback=r;this.next=null}function CorkedRequest(e){var t=this;this.next=null;this.entry=null;this.finish=function(){onCorkedFinish(t,e)}}var o=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:a.nextTick;var s;Writable.WritableState=WritableState;var f=r(17);f.inherits=r(0);var c={deprecate:r(162)};var u=r(73);var d=r(1).Buffer;var h=i.Uint8Array||function(){};function _uint8ArrayToBuffer(e){return d.from(e)}function _isUint8Array(e){return d.isBuffer(e)||e instanceof h}var l=r(72);f.inherits(Writable,u);function nop(){}function WritableState(e,t){s=s||r(10);e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode;if(n)this.objectMode=this.objectMode||!!e.writableObjectMode;var i=e.highWaterMark;var a=e.writableHighWaterMark;var o=this.objectMode?16:16*1024;if(i||i===0)this.highWaterMark=i;else if(n&&(a||a===0))this.highWaterMark=a;else this.highWaterMark=o;this.highWaterMark=Math.floor(this.highWaterMark);this.finalCalled=false;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;this.destroyed=false;var f=e.decodeStrings===false;this.decodeStrings=!f;this.defaultEncoding=e.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(e){onwrite(t,e)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=new CorkedRequest(this)}WritableState.prototype.getBuffer=function getBuffer(){var e=this.bufferedRequest;var t=[];while(e){t.push(e);e=e.next}return t};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.","DEP0003")})}catch(e){}})();var p;if(typeof Symbol==="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]==="function"){p=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function(e){if(p.call(this,e))return true;if(this!==Writable)return false;return e&&e._writableState instanceof WritableState}})}else{p=function(e){return e instanceof this}}function Writable(e){s=s||r(10);if(!p.call(Writable,this)&&!(this instanceof s)){return new Writable(e)}this._writableState=new WritableState(e,this);this.writable=true;if(e){if(typeof e.write==="function")this._write=e.write;if(typeof e.writev==="function")this._writev=e.writev;if(typeof e.destroy==="function")this._destroy=e.destroy;if(typeof e.final==="function")this._final=e.final}u.call(this)}Writable.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function writeAfterEnd(e,t){var r=new Error("write after end");e.emit("error",r);a.nextTick(t,r)}function validChunk(e,t,r,n){var i=true;var o=false;if(r===null){o=new TypeError("May not write null values to stream")}else if(typeof r!=="string"&&r!==undefined&&!t.objectMode){o=new TypeError("Invalid non-string/buffer chunk")}if(o){e.emit("error",o);a.nextTick(n,o);i=false}return i}Writable.prototype.write=function(e,t,r){var n=this._writableState;var i=false;var a=!n.objectMode&&_isUint8Array(e);if(a&&!d.isBuffer(e)){e=_uint8ArrayToBuffer(e)}if(typeof t==="function"){r=t;t=null}if(a)t="buffer";else if(!t)t=n.defaultEncoding;if(typeof r!=="function")r=nop;if(n.ended)writeAfterEnd(this,r);else if(a||validChunk(this,n,e,r)){n.pendingcb++;i=writeOrBuffer(this,n,a,e,t,r)}return i};Writable.prototype.cork=function(){var e=this._writableState;e.corked++};Writable.prototype.uncork=function(){var e=this._writableState;if(e.corked){e.corked--;if(!e.writing&&!e.corked&&!e.finished&&!e.bufferProcessing&&e.bufferedRequest)clearBuffer(this,e)}};Writable.prototype.setDefaultEncoding=function setDefaultEncoding(e){if(typeof e==="string")e=e.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e;return this};function decodeChunk(e,t,r){if(!e.objectMode&&e.decodeStrings!==false&&typeof t==="string"){t=d.from(t,r)}return t}Object.defineProperty(Writable.prototype,"writableHighWaterMark",{enumerable:false,get:function(){return this._writableState.highWaterMark}});function writeOrBuffer(e,t,r,n,i,a){if(!r){var o=decodeChunk(t,n,i);if(n!==o){r=true;i="buffer";n=o}}var s=t.objectMode?1:n.length;t.length+=s;var f=t.length<t.highWaterMark;if(!f)t.needDrain=true;if(t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null};if(c){c.next=t.lastBufferedRequest}else{t.bufferedRequest=t.lastBufferedRequest}t.bufferedRequestCount+=1}else{doWrite(e,t,false,s,n,i,a)}return f}function doWrite(e,t,r,n,i,a,o){t.writelen=n;t.writecb=o;t.writing=true;t.sync=true;if(r)e._writev(i,t.onwrite);else e._write(i,a,t.onwrite);t.sync=false}function onwriteError(e,t,r,n,i){--t.pendingcb;if(r){a.nextTick(i,n);a.nextTick(finishMaybe,e,t);e._writableState.errorEmitted=true;e.emit("error",n)}else{i(n);e._writableState.errorEmitted=true;e.emit("error",n);finishMaybe(e,t)}}function onwriteStateUpdate(e){e.writing=false;e.writecb=null;e.length-=e.writelen;e.writelen=0}function onwrite(e,t){var r=e._writableState;var n=r.sync;var i=r.writecb;onwriteStateUpdate(r);if(t)onwriteError(e,r,n,t,i);else{var a=needFinish(r);if(!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest){clearBuffer(e,r)}if(n){o(afterWrite,e,r,a,i)}else{afterWrite(e,r,a,i)}}}function afterWrite(e,t,r,n){if(!r)onwriteDrain(e,t);t.pendingcb--;n();finishMaybe(e,t)}function onwriteDrain(e,t){if(t.length===0&&t.needDrain){t.needDrain=false;e.emit("drain")}}function clearBuffer(e,t){t.bufferProcessing=true;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount;var i=new Array(n);var a=t.corkedRequestsFree;a.entry=r;var o=0;var s=true;while(r){i[o]=r;if(!r.isBuf)s=false;r=r.next;o+=1}i.allBuffers=s;doWrite(e,t,true,t.length,i,"",a.finish);t.pendingcb++;t.lastBufferedRequest=null;if(a.next){t.corkedRequestsFree=a.next;a.next=null}else{t.corkedRequestsFree=new CorkedRequest(t)}t.bufferedRequestCount=0}else{while(r){var f=r.chunk;var c=r.encoding;var u=r.callback;var d=t.objectMode?1:f.length;doWrite(e,t,false,d,f,c,u);r=r.next;t.bufferedRequestCount--;if(t.writing){break}}if(r===null)t.lastBufferedRequest=null}t.bufferedRequest=r;t.bufferProcessing=false}Writable.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))};Writable.prototype._writev=null;Writable.prototype.end=function(e,t,r){var n=this._writableState;if(typeof e==="function"){r=e;e=null;t=null}else if(typeof t==="function"){r=t;t=null}if(e!==null&&e!==undefined)this.write(e,t);if(n.corked){n.corked=1;this.uncork()}if(!n.ending&&!n.finished)endWritable(this,n,r)};function needFinish(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function callFinal(e,t){e._final(function(r){t.pendingcb--;if(r){e.emit("error",r)}t.prefinished=true;e.emit("prefinish");finishMaybe(e,t)})}function prefinish(e,t){if(!t.prefinished&&!t.finalCalled){if(typeof e._final==="function"){t.pendingcb++;t.finalCalled=true;a.nextTick(callFinal,e,t)}else{t.prefinished=true;e.emit("prefinish")}}}function finishMaybe(e,t){var r=needFinish(t);if(r){prefinish(e,t);if(t.pendingcb===0){t.finished=true;e.emit("finish")}}return r}function endWritable(e,t,r){t.ending=true;finishMaybe(e,t);if(r){if(t.finished)a.nextTick(r);else e.once("finish",r)}t.ended=true;e.writable=false}function onCorkedFinish(e,t,r){var n=e.entry;e.entry=null;while(n){var i=n.callback;t.pendingcb--;i(r);n=n.next}if(t.corkedRequestsFree){t.corkedRequestsFree.next=e}else{t.corkedRequestsFree=e}}Object.defineProperty(Writable.prototype,"destroyed",{get:function(){if(this._writableState===undefined){return false}return this._writableState.destroyed},set:function(e){if(!this._writableState){return}this._writableState.destroyed=e}});Writable.prototype.destroy=l.destroy;Writable.prototype._undestroy=l.undestroy;Writable.prototype._destroy=function(e,t){this.end();t(e)}}).call(this,r(9),r(164).setImmediate,r(7))},function(e,t,r){t=e.exports=r(74);t.Stream=t;t.Readable=t;t.Writable=r(34);t.Duplex=r(10);t.Transform=r(71);t.PassThrough=r(161)},function(e,t){function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}e.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(e){if(!isNumber(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");this._maxListeners=e;return this};EventEmitter.prototype.emit=function(e){var t,r,n,i,a,o;if(!this._events)this._events={};if(e==="error"){if(!this._events.error||isObject(this._events.error)&&!this._events.error.length){t=arguments[1];if(t instanceof Error){throw t}else{var s=new Error('Uncaught, unspecified "error" event. ('+t+")");s.context=t;throw s}}}r=this._events[e];if(isUndefined(r))return false;if(isFunction(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1);r.apply(this,i)}}else if(isObject(r)){i=Array.prototype.slice.call(arguments,1);o=r.slice();n=o.length;for(a=0;a<n;a++)o[a].apply(this,i)}return true};EventEmitter.prototype.addListener=function(e,t){var r;if(!isFunction(t))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",e,isFunction(t.listener)?t.listener:t);if(!this._events[e])this._events[e]=t;else if(isObject(this._events[e]))this._events[e].push(t);else this._events[e]=[this._events[e],t];if(isObject(this._events[e])&&!this._events[e].warned){if(!isUndefined(this._maxListeners)){r=this._maxListeners}else{r=EventEmitter.defaultMaxListeners}if(r&&r>0&&this._events[e].length>r){this._events[e].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[e].length);if(typeof console.trace==="function"){console.trace()}}}return this};EventEmitter.prototype.on=EventEmitter.prototype.addListener;EventEmitter.prototype.once=function(e,t){if(!isFunction(t))throw TypeError("listener must be a function");var r=false;function g(){this.removeListener(e,g);if(!r){r=true;t.apply(this,arguments)}}g.listener=t;this.on(e,g);return this};EventEmitter.prototype.removeListener=function(e,t){var r,n,i,a;if(!isFunction(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;r=this._events[e];i=r.length;n=-1;if(r===t||isFunction(r.listener)&&r.listener===t){delete this._events[e];if(this._events.removeListener)this.emit("removeListener",e,t)}else if(isObject(r)){for(a=i;a-- >0;){if(r[a]===t||r[a].listener&&r[a].listener===t){n=a;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[e]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",e,t)}return this};EventEmitter.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[e])delete this._events[e];return this}if(arguments.length===0){for(t in this._events){if(t==="removeListener")continue;this.removeAllListeners(t)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[e];if(isFunction(r)){this.removeListener(e,r)}else if(r){while(r.length)this.removeListener(e,r[r.length-1])}delete this._events[e];return this};EventEmitter.prototype.listeners=function(e){var t;if(!this._events||!this._events[e])t=[];else if(isFunction(this._events[e]))t=[this._events[e]];else t=this._events[e].slice();return t};EventEmitter.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(isFunction(t))return 1;else if(t)return t.length}return 0};EventEmitter.listenerCount=function(e,t){return e.listenerCount(t)};function isFunction(e){return typeof e==="function"}function isNumber(e){return typeof e==="number"}function isObject(e){return typeof e==="object"&&e!==null}function isUndefined(e){return e===void 0}},function(e,t,r){e.exports=Stream;var n=r(36).EventEmitter;var i=r(0);i(Stream,n);Stream.Readable=r(35);Stream.Writable=r(160);Stream.Duplex=r(159);Stream.Transform=r(158);Stream.PassThrough=r(157);Stream.Stream=Stream;function Stream(){n.call(this)}Stream.prototype.pipe=function(e,t){var r=this;function ondata(t){if(e.writable){if(false===e.write(t)&&r.pause){r.pause()}}}r.on("data",ondata);function ondrain(){if(r.readable&&r.resume){r.resume()}}e.on("drain",ondrain);if(!e._isStdio&&(!t||t.end!==false)){r.on("end",onend);r.on("close",onclose)}var i=false;function onend(){if(i)return;i=true;e.end()}function onclose(){if(i)return;i=true;if(typeof e.destroy==="function")e.destroy()}function onerror(e){cleanup();if(n.listenerCount(this,"error")===0){throw e}}r.on("error",onerror);e.on("error",onerror);function cleanup(){r.removeListener("data",ondata);e.removeListener("drain",ondrain);r.removeListener("end",onend);r.removeListener("close",onclose);r.removeListener("error",onerror);e.removeListener("error",onerror);r.removeListener("end",cleanup);r.removeListener("close",cleanup);e.removeListener("close",cleanup)}r.on("end",cleanup);r.on("close",cleanup);e.on("close",cleanup);e.emit("pipe",r);return e}},function(e,t,r){"use strict";(function(t){var n=r(0);var i=r(75);var a=new Array(16);function MD5(){i.call(this,64);this._a=1732584193;this._b=4023233417;this._c=2562383102;this._d=271733878}n(MD5,i);MD5.prototype._update=function(){var e=a;for(var t=0;t<16;++t)e[t]=this._block.readInt32LE(t*4);var r=this._a;var n=this._b;var i=this._c;var o=this._d;r=fnF(r,n,i,o,e[0],3614090360,7);o=fnF(o,r,n,i,e[1],3905402710,12);i=fnF(i,o,r,n,e[2],606105819,17);n=fnF(n,i,o,r,e[3],3250441966,22);r=fnF(r,n,i,o,e[4],4118548399,7);o=fnF(o,r,n,i,e[5],1200080426,12);i=fnF(i,o,r,n,e[6],2821735955,17);n=fnF(n,i,o,r,e[7],4249261313,22);r=fnF(r,n,i,o,e[8],1770035416,7);o=fnF(o,r,n,i,e[9],2336552879,12);i=fnF(i,o,r,n,e[10],4294925233,17);n=fnF(n,i,o,r,e[11],2304563134,22);r=fnF(r,n,i,o,e[12],1804603682,7);o=fnF(o,r,n,i,e[13],4254626195,12);i=fnF(i,o,r,n,e[14],2792965006,17);n=fnF(n,i,o,r,e[15],1236535329,22);r=fnG(r,n,i,o,e[1],4129170786,5);o=fnG(o,r,n,i,e[6],3225465664,9);i=fnG(i,o,r,n,e[11],643717713,14);n=fnG(n,i,o,r,e[0],3921069994,20);r=fnG(r,n,i,o,e[5],3593408605,5);o=fnG(o,r,n,i,e[10],38016083,9);i=fnG(i,o,r,n,e[15],3634488961,14);n=fnG(n,i,o,r,e[4],3889429448,20);r=fnG(r,n,i,o,e[9],568446438,5);o=fnG(o,r,n,i,e[14],3275163606,9);i=fnG(i,o,r,n,e[3],4107603335,14);n=fnG(n,i,o,r,e[8],1163531501,20);r=fnG(r,n,i,o,e[13],2850285829,5);o=fnG(o,r,n,i,e[2],4243563512,9);i=fnG(i,o,r,n,e[7],1735328473,14);n=fnG(n,i,o,r,e[12],2368359562,20);r=fnH(r,n,i,o,e[5],4294588738,4);o=fnH(o,r,n,i,e[8],2272392833,11);i=fnH(i,o,r,n,e[11],1839030562,16);n=fnH(n,i,o,r,e[14],4259657740,23);r=fnH(r,n,i,o,e[1],2763975236,4);o=fnH(o,r,n,i,e[4],1272893353,11);i=fnH(i,o,r,n,e[7],4139469664,16);n=fnH(n,i,o,r,e[10],3200236656,23);r=fnH(r,n,i,o,e[13],681279174,4);o=fnH(o,r,n,i,e[0],3936430074,11);i=fnH(i,o,r,n,e[3],3572445317,16);n=fnH(n,i,o,r,e[6],76029189,23);r=fnH(r,n,i,o,e[9],3654602809,4);o=fnH(o,r,n,i,e[12],3873151461,11);i=fnH(i,o,r,n,e[15],530742520,16);n=fnH(n,i,o,r,e[2],3299628645,23);r=fnI(r,n,i,o,e[0],4096336452,6);o=fnI(o,r,n,i,e[7],1126891415,10);i=fnI(i,o,r,n,e[14],2878612391,15);n=fnI(n,i,o,r,e[5],4237533241,21);r=fnI(r,n,i,o,e[12],1700485571,6);o=fnI(o,r,n,i,e[3],2399980690,10);i=fnI(i,o,r,n,e[10],4293915773,15);n=fnI(n,i,o,r,e[1],2240044497,21);r=fnI(r,n,i,o,e[8],1873313359,6);o=fnI(o,r,n,i,e[15],4264355552,10);i=fnI(i,o,r,n,e[6],2734768916,15);n=fnI(n,i,o,r,e[13],1309151649,21);r=fnI(r,n,i,o,e[4],4149444226,6);o=fnI(o,r,n,i,e[11],3174756917,10);i=fnI(i,o,r,n,e[2],718787259,15);n=fnI(n,i,o,r,e[9],3951481745,21);this._a=this._a+r|0;this._b=this._b+n|0;this._c=this._c+i|0;this._d=this._d+o|0};MD5.prototype._digest=function(){this._block[this._blockOffset++]=128;if(this._blockOffset>56){this._block.fill(0,this._blockOffset,64);this._update();this._blockOffset=0}this._block.fill(0,this._blockOffset,56);this._block.writeUInt32LE(this._length[0],56);this._block.writeUInt32LE(this._length[1],60);this._update();var e=new t(16);e.writeInt32LE(this._a,0);e.writeInt32LE(this._b,4);e.writeInt32LE(this._c,8);e.writeInt32LE(this._d,12);return e};function rotl(e,t){return e<<t|e>>>32-t}function fnF(e,t,r,n,i,a,o){return rotl(e+(t&r|~t&n)+i+a|0,o)+t|0}function fnG(e,t,r,n,i,a,o){return rotl(e+(t&n|r&~n)+i+a|0,o)+t|0}function fnH(e,t,r,n,i,a,o){return rotl(e+(t^r^n)+i+a|0,o)+t|0}function fnI(e,t,r,n,i,a,o){return rotl(e+(r^(t|~n))+i+a|0,o)+t|0}e.exports=MD5}).call(this,r(2).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gostCodingInstance=undefined;t.GostCoding=GostCoding;var n=r(19);var i=ArrayBuffer;function buffer(e){if(e instanceof i)return e;else if(e&&e.buffer&&e.buffer instanceof i)return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(new Uint8Array(e,e.byteOffset,e.byteLength)).buffer;else throw new n.DataError("CryptoOperationData required")}function GostCoding(){}var a={decode:function decode(e){e=e.replace(/[^A-Za-z0-9\+\/]/g,"");var t=e.length,r=t*3+1>>2,n=new Uint8Array(r);for(var i,a,o=0,s=0,f=0;f<t;f++){a=f&3;var c=e.charCodeAt(f);c=c>64&&c<91?c-65:c>96&&c<123?c-71:c>47&&c<58?c+4:c===43?62:c===47?63:0;o|=c<<18-6*a;if(a===3||t-f===1){for(i=0;i<3&&s<r;i++,s++){n[s]=o>>>(16>>>i&24)&255}o=0}}return n.buffer},encode:function encode(e){var t=8,r=new Uint8Array(buffer(e));var n=2,i="";for(var a=r.length,o=0,s=0;s<a;s++){n=s%3;if(s>0&&s*4/3%(12*t)===0)i+="\r\n";o|=r[s]<<(16>>>n&24);if(n===2||a-s===1){for(var f=18;f>=0;f-=6){var c=o>>>f&63;c=c<26?c+65:c<52?c+71:c<62?c-4:c===62?43:c===63?47:65;i+=String.fromCharCode(c)}o=0}}return i.substr(0,i.length-2+n)+(n===2?"":n===1?"=":"==")}};GostCoding.prototype.Base64=a;var o=function(){var e={1026:128,1027:129,8218:130,1107:131,8222:132,8230:133,8224:134,8225:135,8364:136,8240:137,1033:138,8249:139,1034:140,1036:141,1035:142,1039:143,1106:144,8216:145,8217:146,8220:147,8221:148,8226:149,8211:150,8212:151,8482:153,1113:154,8250:155,1114:156,1116:157,1115:158,1119:159,160:160,1038:161,1118:162,1032:163,164:164,1168:165,166:166,167:167,1025:168,169:169,1028:170,171:171,172:172,173:173,174:174,1031:175,176:176,177:177,1030:178,1110:179,1169:180,181:181,182:182,183:183,1105:184,8470:185,1108:186,187:187,1112:188,1029:189,1109:190,1111:191};var t={};for(var r in e){var n=e[r];t[n]=r}return{decode:function decode(t,r){r=(r||"win1251").toLowerCase().replace("-","");var n=[];for(var i=0,a=t.length;i<a;i++){var o=t.charCodeAt(i);if(r==="utf8"){if(o<128){n.push(o)}else if(o<2048){n.push(192+(o>>>6));n.push(128+(o&63))}else if(o<65536){n.push(224+(o>>>12));n.push(128+(o>>>6&63));n.push(128+(o&63))}else if(o<2097152){n.push(240+(o>>>18));n.push(128+(o>>>12&63));n.push(128+(o>>>6&63));n.push(128+(o&63))}else if(o<67108864){n.push(248+(o>>>24));n.push(128+(o>>>18&63));n.push(128+(o>>>12&63));n.push(128+(o>>>6&63));n.push(128+(o&63))}else{n.push(252+(o>>>30));n.push(128+(o>>>24&63));n.push(128+(o>>>18&63));n.push(128+(o>>>12&63));n.push(128+(o>>>6&63));n.push(128+(o&63))}}else if(r==="unicode"||r==="ucs2"||r==="utf16"){if(o<55296||o>=57344&&o<=65536){n.push(o>>>8);n.push(o&255)}else if(o>=65536&&o<1114112){o-=65536;var s=((1047552&o)>>10)+55296;var f=(1023&o)+56320;n.push(s>>>8);n.push(s&255);n.push(f>>>8);n.push(f&255)}}else if(r==="utf32"||r==="ucs4"){n.push(o>>>24&255);n.push(o>>>16&255);n.push(o>>>8&255);n.push(o&255)}else if(r==="win1251"){if(o>=128){if(o>=1040&&o<1104)o-=848;else o=e[o]||0}n.push(o)}else n.push(o&255)}return new Uint8Array(n).buffer},encode:function encode(e,r){r=(r||"win1251").toLowerCase().replace("-","");var n=[],i=new Uint8Array(buffer(e));for(var a=0,o=i.length;a<o;a++){var s=i[a];if(r==="utf8"){s=s>=252&&s<254&&a+5<o?(s-252)*1073741824+(i[++a]-128<<24)+(i[++a]-128<<18)+(i[++a]-128<<12)+(i[++a]-128<<6)+i[++a]-128:s>>248&&s<252&&a+4<o?(s-248<<24)+(i[++a]-128<<18)+(i[++a]-128<<12)+(i[++a]-128<<6)+i[++a]-128:s>>240&&s<248&&a+3<o?(s-240<<18)+(i[++a]-128<<12)+(i[++a]-128<<6)+i[++a]-128:s>=224&&s<240&&a+2<o?(s-224<<12)+(i[++a]-128<<6)+i[++a]-128:s>=192&&s<224&&a+1<o?(s-192<<6)+i[++a]-128:s}else if(r==="unicode"||r==="ucs2"||r==="utf16"){s=(s<<8)+i[++a];if(s>=55296&&s<57344){var f=s-55296<<10;s=i[++a];s=(s<<8)+i[++a];var c=s-56320;s=f+c+65536}}else if(r==="utf32"||r==="ucs4"){s=(s<<8)+i[++a];s=(s<<8)+i[++a];s=(s<<8)+i[++a]}else if(r==="win1251"){if(s>=128){if(s>=192&&s<256)s+=848;else s=t[s]||0}}n.push(String.fromCharCode(s))}return n.join("")}}}();GostCoding.prototype.Chars=o;var s={decode:function decode(e,t){e=e.replace(/[^A-fa-f0-9]/g,"");var r=Math.ceil(e.length/2),n=new Uint8Array(r);e=(e.length%2>0?"0":"")+e;if(t&&(typeof t!=="string"||t.toLowerCase().indexOf("little")<0))for(var i=0;i<r;i++){n[i]=parseInt(e.substr((r-i-1)*2,2),16)}else for(var i=0;i<r;i++){n[i]=parseInt(e.substr(i*2,2),16)}return n.buffer},encode:function encode(e,t){var r=[],n=new Uint8Array(buffer(e)),i=n.length;if(t&&(typeof t!=="string"||t.toLowerCase().indexOf("little")<0))for(var a=0;a<i;a++){var o=i-a-1;r[o]=(o>0&&o%32===0?"\r\n":"")+("00"+n[a].toString(16)).slice(-2)}else for(var a=0;a<i;a++){r[a]=(a>0&&a%32===0?"\r\n":"")+("00"+n[a].toString(16)).slice(-2)}return r.join("")}};GostCoding.prototype.Hex=s;var f={decode:function decode(e){e=(e||"").replace(/[^\-A-fa-f0-9]/g,"");if(e.length===0)e="0";var t=false;if(e.charAt(0)==="-"){t=true;e=e.substring(1)}while(e.charAt(0)==="0"&&e.length>1){e=e.substring(1)}e=(e.length%2>0?"0":"")+e;if(!t&&!/^[0-7]/.test(e)||t&&!/^[0-7]|8[0]+$/.test(e))e="00"+e;var r=e.length/2,n=new Uint8Array(r),i=0;for(var a=r-1;a>=0;--a){var o=parseInt(e.substr(a*2,2),16);if(t&&o+i>0){o=256-o-i;i=1}n[a]=o}return n.buffer},encode:function encode(e){var t=new Uint8Array(buffer(e)),r=t.length;if(t.length===0)return"0x00";var n=[],i=t[0]>127,a=0;for(var o=r-1;o>=0;--o){var s=t[o];if(i&&s+a>0){s=256-s-a;a=1}n[o]=("00"+s.toString(16)).slice(-2)}n=n.join("");while(n.charAt(0)==="0"){n=n.substring(1)}return(i?"-":"")+"0x"+n}};GostCoding.prototype.Int16=f;var c=function(){function encodeBER(e,t,r){var a=e.object;if(a===undefined)a=e;var c=e.tagClass=e.tagClass||0;if(c===0){var u=e.tagNumber;if(typeof u==="undefined"){if(typeof a==="string"){if(a==="")u=5;else if(/^\-?0x[0-9a-fA-F]+$/.test(a))u=2;else if(/^(\d+\.)+\d+$/.test(a))u=6;else if(/^[01]+$/.test(a))u=3;else if(/^(true|false)$/.test(a))u=1;else if(/^[0-9a-fA-F]+$/.test(a))u=4;else u=19}else if(typeof a==="number"){u=2}else if(typeof a==="boolean"){u=1}else if(a instanceof Array){u=16}else if(a instanceof Date){u=24}else if(a instanceof i||a&&a.buffer instanceof i){u=4}else throw new n.DataError("Unrecognized type for "+a)}}var d=e.tagConstructed;if(typeof d==="undefined")d=e.tagConstructed=a instanceof Array;var h;if(a instanceof i||a&&a.buffer instanceof i){h=new Uint8Array(buffer(a));if(u===3){var l=new Uint8Array(buffer(h));h=new Uint8Array(l.length+1);h[0]=0;h.set(l,1)}}else if(d){if(a instanceof Array){var p=0,v=[],y=0;for(var b=0,m=a.length;b<m;b++){v[b]=encodeBER(a[b],t);p+=v[b].length}if(u===17)v.sort(function(e,t){for(var r=0,n=Math.min(e.length,t.length);r<n;r++){var i=e[r]-t[r];if(i!==0)return i}return e.length-t.length});if(t==="CER"){v[m]=new Uint8Array(2);p+=2}h=new Uint8Array(p);for(var b=0,m=v.length;b<m;b++){h.set(v[b],y);y=y+v[b].length}}else throw new n.DataError("Constracted block can't be primitive")}else{switch(u){case 1:h=new Uint8Array(1);h[0]=a?255:0;break;case 2:case 10:h=f.decode(typeof a==="number"?a.toString(16):a);break;case 3:if(typeof a==="string"){var g=7-(a.length+7)%8;var m=Math.ceil(a.length/8);h=new Uint8Array(m+1);h[0]=g;for(var b=0;b<m;b++){var w=0;for(var C=0;C<8;C++){var S=b*8+C;w=(w<<1)+(S<a.length?a.charAt(S)==="1"?1:0:0)}h[b+1]=w}}break;case 4:h=s.decode(typeof a==="number"?a.toString(16):a);break;case 6:var l=a.match(/\d+/g),A=[];for(var b=1;b<l.length;b++){var m=+l[b],E=[];if(b===1)m=m+l[0]*40;do{E.push(m&127);m=m>>>7}while(m);for(C=E.length-1;C>=0;--C){A.push(E[C]+(C===0?0:128))}}h=new Uint8Array(A);break;case 12:h=o.decode(a,"utf8");break;case 18:case 22:case 19:case 20:case 21:case 25:case 26:case 27:for(var b=0,m=a.length;b<m;b++){if(a.charCodeAt(b)>255)u=12}if(u===12)h=o.decode(a,"utf8");else h=o.decode(a,"ascii");break;case 23:case 24:var B=a.original;if(!B){var _=new Date(a);_.setMinutes(_.getMinutes()+_.getTimezoneOffset());var P=u===24?_.getMilliseconds().toString():"";while(P.length>0&&P.charAt(P.length-1)==="0"){P=P.substring(0,P.length-1)}if(P.length>0)P="."+P;B=(u===23?_.getYear().toString().slice(-2):_.getFullYear().toString())+("00"+(_.getMonth()+1)).slice(-2)+("00"+_.getDate()).slice(-2)+("00"+_.getHours()).slice(-2)+("00"+_.getMinutes()).slice(-2)+("00"+_.getSeconds()).slice(-2)+P+"Z"}h=o.decode(B,"ascii");break;case 28:h=o.decode(a,"utf32");break;case 30:h=o.decode(a,"utf16");break}}if(!h)h=new Uint8Array(0);if(h instanceof i)h=new Uint8Array(h);if(!d&&t==="CER"){var S;switch(u){case 3:S=1;case 4:case 12:case 18:case 19:case 20:case 21:case 22:case 25:case 26:case 27:case 28:case 30:S=S||0;var F=1e3;var p=0,v=[],y=0;for(var b=S,m=h.length;b<m;b+=F-S){v[b]=encodeBER({object:new Unit8Array(h.buffer,b,Math.min(F-S,m-b)),tagNumber:u,tagClass:0,tagConstructed:false},t);p+=v[b].length}v[m]=new Uint8Array(2);p+=2;h=new Uint8Array(p);for(var b=0,m=v.length;b<m;b++){h.set(v[b],y);y=y+v[b].length}}}if(c===0)e.tagNumber=u;else e.tagNumber=u=e.tagNumber||0;e.content=h;if(r)return h;var k=[],D=c===3?192:c===2?128:c===1?64:0;if(d)D|=32;if(u<31){D|=u&31;k.push(D)}else{D|=31;k.push(D);var m=u,I=[];do{I.push(m&127);m=m>>>7}while(m);for(var C=I.length-1;C>=0;--C){k.push(I[C]+(C===0?0:128))}}if(d&&t==="CER"){k.push(128)}else{var x=h.length;if(x>127){var M=x,K=[];do{K.push(M&255);M=M>>>8}while(M);k.push(K.length+128);for(var C=K.length-1;C>=0;--C){k.push(K[C])}}else{k.push(x)}}var R=e.header=new Uint8Array(k);var T=new Uint8Array(R.length+h.length);T.set(R,0);T.set(h,R.length);return T}function decodeBER(e,t){var r=t||0,a=r;var s,c,u,d,h,l,p,v;if(e.object){s=e.tagNumber;c=e.tagClass;u=e.tagConstructed;d=e.content;h=e.header;l=e.object instanceof i?new Uint8Array(e.object):null;p=e.object instanceof Array?e.object:null;v=l&&l.length||null}else{var y=e;var b=y[r++];s=b&31;c=b>>6;u=(b&32)!==0;if(s===31){s=0;do{if(s>9007199254740864)throw new n.DataError("Convertor not supported tag number more then (2^53 - 1) at position "+t);b=y[r++];s=(s<<7)+(b&127)}while(b&128)}b=y[r++];v=b&127;if(v!==b){if(v>6)throw new n.DataError("Length over 48 bits not supported at position "+t);if(v===0)v=null;else{b=0;for(var m=0;m<v;++m){b=(b<<8)+y[r++]}v=b}}a=r;p=null;if(u){p=[];if(v!==null){var g=a+v;while(r<g){var w=decodeBER(y,r);p.push(w);r+=w.header.length+w.content.length}if(r!==g)throw new n.DataError("Content size is not correct for container starting at offset "+a)}else{try{for(;;){var w=decodeBER(y,r);r+=w.header.length+w.content.length;if(w.tagClass===0&&w.tagNumber===0)break;p.push(w)}v=r-a}catch(e){throw new n.DataError("Exception "+e+" while decoding undefined length content at offset "+a)}}}h=new Uint8Array(y.buffer,t,a-t);d=new Uint8Array(y.buffer,a,v);l=d}if(p!==null&&c===0){var C;switch(s){case 3:C=1;case 4:case 12:case 18:case 19:case 20:case 21:case 22:case 25:case 26:case 27:case 28:case 30:C=C||0;if(p.length===0)throw new n.DataError("No constructed encoding content of string type at offset "+a);v=C;for(var m=0,S=p.length;m<S;m++){var w=p[m];if(w.tagClass!==c||w.tagNumber!==s||w.tagConstructed)throw new n.DataError("Invalid constructed encoding of string type at offset "+a);v+=w.content.length-C}l=new Uint8Array(v);for(var m=0,S=p.length,A=C;m<S;m++){var w=p[m];if(C>0)l.set(w.content.subarray(1),A);else l.set(w.content,A);A+=w.content.length-C}u=false;p=null;break}}var E="";if(p===null){if(v===null)throw new n.DataError("Invalid tag with undefined length at offset "+a);if(c===0){switch(s){case 1:E=l[0]!==0;break;case 2:case 10:if(v>6){E=f.encode(l)}else{var B=l[0];if(l[0]>127)B=B-256;for(var m=1;m<v;m++){B=B*256+l[m]}E=B}break;case 3:if(v>5){E=new Uint8Array(l.subarray(1)).buffer}else{var _=l[0],P=_,w=[];for(var m=v-1;m>=1;--m){var F=l[m];for(var A=P;A<8;++A){w.push(F>>A&1?"1":"0")}P=0}E=w.reverse().join("")}break;case 4:E=new Uint8Array(l).buffer;break;case 6:var w="",S=0,k=0;for(var m=0;m<v;++m){var B=l[m];S=(S<<7)+(B&127);k+=7;if(!(B&128)){if(w===""){var D=S<80?S<40?0:1:2;w=D+"."+(S-D*40)}else w+="."+S.toString();S=0;k=0}}if(k>0)throw new n.DataError("Incompleted OID at offset "+a);E=w;break;case 16:case 17:E=[];break;case 12:E=o.encode(l,"utf8");break;case 18:case 19:case 20:case 21:case 22:case 25:case 26:case 27:E=o.encode(l,"ascii");break;case 28:E=o.encode(l,"utf32");break;case 30:E=o.encode(l,"utf16");break;case 23:case 24:var I=s===23;var w=o.encode(l,"ascii"),D=(I?/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/:/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/).exec(w);if(!D)throw new n.DataError('Unrecognized time format "'+w+'" at offset '+a);if(I){D[1]=+D[1];D[1]+=D[1]<50?2e3:1900}var x=new Date(D[1],+D[2]-1,+D[3],+(D[4]||"0"),+(D[5]||"0"),+(D[6]||"0"),+(D[7]||"0")),M=x.getTimezoneOffset();if(D[8]||s===23){if(D[8].toUpperCase()!=="Z"&&D[9]){M=M+parseInt(D[9])}x.setMinutes(x.getMinutes()-M)}x.original=w;E=x;break}}else E=new Uint8Array(l).buffer}else E=p;return{tagConstructed:u,tagClass:c,tagNumber:s,header:h,content:d,object:E}}return{encode:function encode(e,t,r){return encodeBER(e,t,r).buffer},decode:function decode(e){return decodeBER(e.object?e:new Uint8Array(buffer(e)),0)}}}();GostCoding.prototype.BER=c;var u={encode:function encode(e,t){return(t?"-----BEGIN "+t.toUpperCase()+"-----\r\n":"")+a.encode(e instanceof i?e:c.encode(e))+(t?"\r\n-----END "+t.toUpperCase()+"-----":"")},decode:function decode(e,t,r,i){var o=/([A-Za-z0-9\+\/\s\=]+)/g,s=o.exec(e);if(s[1].length!==e.length)s=false;if(!s&&t){var f=new RegExp("-----\\s?BEGIN "+t.toUpperCase()+"-----([A-Za-z0-9\\+\\/\\s\\=]+)-----\\s?END "+t.toUpperCase()+"-----","g");s=f.exec(e)}if(!s){var u=new RegExp("-----\\s?BEGIN [A-Z0-9\\s]+"+"-----([A-Za-z0-9\\+\\/\\s\\=]+)-----\\s?END "+"[A-Z0-9\\s]+-----","g");s=u.exec(e)}var d=s&&s[1+(i||0)];if(!d)throw new n.DataError("Not valid PEM format");var h=a.decode(d);if(r)h=c.decode(h);return h}};GostCoding.prototype.PEM=u;var d=t.gostCodingInstance=new GostCoding},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GostDigest=GostDigest;var n=r(25);var i=r(41);var a=r(19);function arraycopy(e,t,r,n,i){for(var a=0;a<i;a++){r[n+a]=e[t+a]}}function swap(e){var t=new Uint8Array(e),r=new Uint8Array(t.length);for(var n=0,i=t.length;n<i;n++){r[i-n-1]=t[n]}return r.buffer}function b64decode(e){var t=e.length,r=t*3+1>>2,n=new Uint8Array(r);for(var i,a,o=0,s=0,f=0;f<t;f++){a=f&3;var c=e.charCodeAt(f);c=c>64&&c<91?c-65:c>96&&c<123?c-71:c>47&&c<58?c+4:c===43?62:c===47?63:0;o|=c<<18-6*a;if(a===3||t-f===1){for(i=0;i<3&&s<r;i++,s++){n[s]=o>>>(16>>>i&24)&255}o=0}}return n.buffer}function buffer(e){if(e instanceof ArrayBuffer)return e;else if(e&&e.buffer&&e.buffer instanceof ArrayBuffer)return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(new Uint8Array(e,e.byteOffset,e.byteLength)).buffer;else throw new a.DataError("ArrayBuffer or ArrayBufferView required")}var o=function(){var e=new Int32Array(16);var t=new Int32Array(16);t[0]=512;var r=function(e){var t=new Int32Array(b64decode(e)),r=new Array(12);for(var n=0;n<12;n++){r[n]=new Int32Array(t.buffer,n*64,16)}return r}("B0Wm8lllgN0jTXTMNnR2BRXTYKQIKkKiAWlnkpHgfEv8xIV1jbhOcRbQRS5DdmovH3xlwIEvy+vp2soe2lsIsbebsSFwBHnmVs3L1xui3VXKpwrbwmG1XFiZ1hJrF7WaMQG1Fg9e1WGYKyMKcur+89e1cA9GneNPGi+dqYq1o2+yCroK9ZYemTHbeoZD9LbCCdtiYDc6ycGxnjWQ5A/i03t7KbEUderyix+cUl9e8QY1hD1qKPw5Cscvzius3HT1LtHjhLy+DCLxN+iToepTNL4DUpMzE7fYddYD7YIs16k/NV5orRxynX08XDN+hY5I3eRxXaDhSPnSZhXos98f71f+bHz9WBdg9WPqqX6iVnoWGicjtwD/36P1OiVHF82/vf8PgNc1njVKEIYWHxwVf2MjqWwMQT+amUdHraxr6ktufWRGekBo+jVPkDZyxXG/tsa+wmYf8gq0t5oct6b6z8aO8Jq0mn8YbKRCUfnEZi3AOTB6O8Okb9nTOh2urk+uk9QUOk1WhojzSjyiTEUXNQQFSiiDaUcGNyyCLcWrkgnJk3oZMz5H08mHv+bHxp45VAkkv/6GrFHsxaruFg7H9B7nAr/UDX+k"+"2ahRWTXCrDYvxKXRK43RaZAGm5LLK4n0msTbTTtEtIke3jaccfi3TkFBbgwCqucDp8mTTUJbH5vbWiODUURhcmAqH8uS3DgOVJwHppqKK3uxzrLbC0QKgIQJDeC3Vdk8JEKJJRs6fTreXxbs2JpMlJsiMRZUWo837ZxFmPvHtHTDtjsV0fqYNvRSdjswbB56SzNprwJn558DYTMbiuH/H9t4iv8c50GJ8/PkskjlKjhSbwWApt6+qxst84HNpMprXdhvwEpZot6Ybkd9Hc2678q5SOrvcR2KeWaEFCGAASBhB6vru2v62JT+WmPNxgIw+4nI79CezXsg1xvxSpK8SJkbstnVF/T6UijhiKqkHeeGzJEYne+AXZufITDUEiD4dx3fvDI8pM16sUkEsIAT0roxFvFn5443");var n=function(e){return new Int32Array(b64decode(e))}("5vh+XFtxH9Alg3eACST6FshJ4H6FLqSoW0aGoY8GwWoLMumi13tBbqvaN6RngVxm9heWqBpoZnb13AtwY5GVS0hi84235kvx/1ximmi9hcXLgn2m/NdXlWbTba9pufCJNWyfdEg9g7B8vOyxI4yZoTanAqwxxHCNnrao0C+839aLGfpR5bOuN5zPtUCKEn0LvAx4tQggj1rlM+OEIojs7c7Cx9N3wV/S7HgXtlBdD165TMLAgzaHHYwgXbTLCwStdjyFWyigiS9YjRt59v8yVz/s9p5DEZM+D8DTn4A6GMnuAQom9fOtgxDv6PRBGXmmXc2hDH3pOhBKG+4dEkjpLFO/8tshhHM5tPUMz6aiPQlftLyc2EeYzeiKLYsHHFb5f3dxaVp1apzF8C5xoLoevKZj+atCFeZyLrGeIt5fu3gNuc4PJZS6FIJSDmOXZk2ELwMeagII6phcfyFEob5r8Ho3yxzRY2Lbg+COK0sxHGTPcEebq5YOMoVrqYa53ucetUeMh3r1bOm4/kKIX2HW/RvdAVaWYjjIYiFXkj74qS78l/9CEUR2+J19NQhWRSzrTJDJsOCnElYjCFAt+8sBbC16A/qnpkhF"+"9G6LOL/GxKu9vvj91HfeujqsTOvIB5t58JyxBeiHnQwn+moQrIpYy4lg58FAHQzqGm+BHko1aSiQxPsHc9GW/0NQGi9gnQqf96UW4MY/N5Yc5KazuNqSUhMkdSw44IqbpahkczvsFU8r8SRXVUmzP9dm2xVEDcXHp9F5455Ct5La3xUaYZl/04agNF7AJxQjONVRe22pOaRlGPB3EEADtAJ5HZClrqLdiNJniZxKXQqTD2bfCihlwk7p1CBFCbCLMlU4kWaFKSpBKQe/xTOoQrJ+K2JUTcZzbFMERWKV4Ada9AbpU1GQih8vO2vBI2Fvw3sJ3FJV5cY5Z9Ezsf5oRCmIOcfw5xHiQJuH9xlk+aLpOK3D20sHGQwLTkf5w+v0VTTVdtNriENGEKBa64sC2CDDzfWCMvJRbeGEDb7Cseeg6N4GsPodCHuFS1QNNDM7QuKaZ7zKW3/YpgiKxDfdDsY7s6nZQ+2BIXFNvV5lo7FnYe3nte6haSQx98jVc6v21R/GheGjZxpeBjzUBBDJLSg6uY8ssEACj+vAbLLy95AX1k8Rb6HTPOBzWfGpnuSqeE7WjHTNwAZuKhnVxztC2ocStBYccEXD"+"NxWC5O2TIW2s45BBSTn2/H7F8SGGIjt8wLCUBCusFvv510U3mlJ+v3N8Py6jtoFoM+e42brSeMqpoyo0wi/+u+SBY8z+370NjllAJG6lpnBRxu9LhCrR5CK60GUnnFCM2RSIwhhgjO4xnqVJH3zaF9OU4SgTTJxgCUv0MnLV47Ob9hKlpKrXkcy72kPSb/0PNN4fPJRq0lBPW1RomV7ha9+fr2/qj3eUJkjqWHDdCSu/x+Vtcdl8Z93msv9PIdVJPCdrRjroYAORdntPr4bHH2ihPng11LmgtowRXwMMn9QUHdLJFlggAZg9j33dUySsZKpwP8wXUlTCyYmUjgK0Jj5edtafRsLeUHRvA1h9gARF2z2CknLx5WBYSgKbVgvz+65Ypz/83GKhWl5ObK1M6EupblXOH7jMCPl0eq6CslPBAhRM9/tHG58EKJjz6442BosnrfLv+3rtypf+jApevneOBRP099jPMCwlAcMri/eNkt38F1xVTfhlxX9GBS9f6vMwG6Ky9CSqaLfsu9YNhpmPDzUBBHVMAAAAAAAAAADxLjFNNNDM7HEFIr4GGCO1rygNmTDABcGX/VziXWk8ZRmkHMYzzJoV"+"lYRBcvjHnrjcVDK3k3aEqZQ2wTokkM9YgCsT8zLI71nEQq45fO1PXPoc2O/jq42C8uWslU0pP9Fq2CPokHobfU0iSfg88EO2A8ud2Hn58z3eLS8nNtgmdCpDpB+JHuLfb5iZnRtsEzrUrUbNPfQ2+rs131AmmCXAlk/cqoE+bYXrQbBTfuWlxAVAunWLFghHpBrkO+e7RK/juMQp0GcXl4GZk7vun765rpqN0eyXVCHzVyzdkX5uMWOT19rir/jOR6IgEjfcUzijI0PeyQPuNXn8VsSompHmAbKASNxXUeASlvVk5Lfbe3X3GINRWXoS222VUr3OLjMenbsjHXQwj1INcpP90yLZ4gpEYQwwRnf+7uLStOrUJcow/e4ggAZ1YerKSkcBWhPnSv4UhyZOMCzIg7J78RmlFmTPWbP2gtyoEap8HnivWx1WJvtkjcOytz6RF99bzjTQX3zwarVvXf0lfwrNEycYV03I5nbFKp4HOaflLriqmlSGVT4PPNmjVv9IrqqSe36+dWUlrY4th30ObPn/28hBOx7MoxRQyplpE74w6YPoQK1REAmVbqccsbW2ui20NU5Eab3KTiWgBRWvUoHKD3Hh"+"dEWYy40OK/JZP5sxKqhjt++zim4ppPxja2qjoEwtSp09lesO5r8x46KRw5YVVL/VGBacju+by/URXWi8nU4oRrqHXxj6z3Qg0e38uLbiPr2wBzby8eNkroTZKc5libb+cLei9tpPclUOclPXXG1JKQTyOj1XQVmnCoBp6gssEI5J0HPFa7EaEYqrehk55P/XzQlaCw44rO/J+2A2WXn1SJK95pfWfzQix4kz4QUUvGHhwdm5dcm1StImYWDPG82AmkSS7Xj9hnGzzKsqiBqXk3LOv2Z/4dCI1tRbXZhalCfIEagFjD9V3mX1tDGWtQYZ90+WsdZwbkOFnR6Ly0PTNlqrioXM+j2E+ce/mcKV/P2iH9Wh3ktjD82z73Y7i0VtgD9Z+Hz3w4WyfHO+XzGRPJjjrGYzsEghv2FnTCa4+BgP+8mVxMEwyKqghiAQdhqYYFfzQiEBFqr2PHYMBlTMNS3bRcxmfZBCvPRalkvUA4Jo6KDD7zxvPae9ktJp/3O8KQriAgHtIoe33jTN6IWBj9kB7qfdYQWb1vonMhmgNVPVbxrodMzOyeoxJFwug/VUcDRVXaB75JnOJtKsVue+9/0WGFelBU44"+"ag59pFJ0NtFb2Go4HN6f8sr3dWIxdwwysJqu2eJ5yNBd7xCRxgZ02xEQRqJRXlBFI1Ns5HKYAvzFDLz39bY8+nOhaIfNFx8DfSlBr9nyjb0/Xj60Wk87nYTu/jYbZ3FAPbjj0+cHYnEaOij58g/SSH68fHW0nnYndOXyk8frVlwY3PWeT0eLpAxu9E+prctSxpmBLZjax2B4iwbcbkadDvxl+Op1IexOMKX3IZ6OC1Ur7D9lvKV7a93QSWm68bdemZBM2+OU6lcUsgHR5upA9ruwwIJBKErdUPIEY7+PHf/o1/k7k8usuE2Mto5HfIbowd0bOZImjj98WqESCdYvyy89mKvbNcmuZxNpViv9X/UVweFsNs7igB1+su3485sX2pTTfbAN/gGHe8PsdguK2suEld/hU65EBaJHc7e0ELMShXt4PDKr3463cNBoElE7U2c5udLj5mVYTVficbJkaNeJx4/JhJclqTW7+n0a4QKLFTej36ZBiNDNXZvDeN56Ssgsmk2Az7dCd38bg722IHLSiDodM711XnotS6tqj0H02qtruxyV2ZBc/+f9jTG2g6pkIhGbOB/ArvuEQgIsSaD5CMZjAzrj"+"pCivCASTiCat5Bw0GopTx65xIe535qhdxH9cSiWSnoy1OOmqVc3YYwY3eqna2OspoYroe7MnmJVu39pqNeSEFGt9nRmCUJSn1Bz6VaTobL/lyu3J6kLFnKNsNRwOb8F5UYHk3m+rv4n/8MUwGE0X1J1B6xWEBFiSHA1SUCjXOWHxeOwYDKiFapoFcQGO+BHNQJGifD7178wZrxUjn2Mp0jR0UO/5HrmQ4RtKB43Sd1m5Vh3l/GATMZEvH1otqZPAFlTctluiGRo+Ld4JimuZ64pm1x4PguP+jFGtt9VaCNdFM+UPiUH/fwLm3We9SFns4Giqul321S/CSCbj/0p1pWw5Bw2IrN34ZIZUjEaRpG/Rvr0mE1x8DLMPkwOPFTNKgtmEn8G/mmmcMguoVCD65PpSgkOv+QdnntTWz+loowi4Jf1YLESxR5t2kbxe3LO7x+phkEj+ZRYQY6YfgXryM0fVOGg0CaaTY8LOmExt7TAqn9/YbIHZHXseOwYDKmaUZmCJ6/vZ/YMKWY7mc3UgewdEmhQK/ElfLKilcbZZMjQfmG+KRbvC+zgapKBQs3LCVCOjrdgfrzoXJzwLi4a7bP6DJY3IabWi"+"KHkCv9HJgPH1qUvWazg3r4iACnmyyroSVVBDEAg7DUzfNpQOB7nusgTRp85nkLLFYSQT//EltNwm8SuXxSwST4YII1GmLyis75NjL5k35ec1B7BSKTob5ucsMK5XCpxw01hgQa4UJeDeRXSz151MxJK6IoBAxWha8AsMpdyMJxy+Eofx9pxabvOeMX+x4NyGSV0RQCDsNC1pm0B+PxjNS9yjqdRq1RUoDR0U8nmJaSQAAAAAAAAAAFk+t1+hlsYeLk54FgsRa9htSuewWIh/juZf0BOHLj4Gem3bu9MOxOKsl/yJyq7xsQnMszweGdvhifPqxGLuGGR3cM9JqoetxlbFfsplV/bWA5U92m1s+5o2ko2IRFbgfB7rjzeVn2CNMdYXnE6qqSNvrDrX5cAmYkMEn6ZTmRRWq9NmncBSuO6vAsFTp8IKKzzLA243I8AHk8nCPZDhyizDO8ZeL27X00z/VjOXWCSeselOZDJdaqY34W01lHJCCnn45mG+Yj94UhTZBALHRBNILvH98MiWWxP2m8XsFgmpDogpKBTlkr5OGYtUKhB9cszAD8vrr+cbG0nIRCIrcD4lZBZNqEDp1SDGUT4f9Plm"+"usMgP5EM6Kvy7dHCYcR+8IFMuUWs02Hzlf64lEo5IQVcnPAsFiLWrZcYZfP3cXjpvYe6K5vwofREQAWyWWVdCe11vkgkf7wLdZYSLhfP9Cq0SwkXhel6FZZrhU4nVdqf7uCDkkkTR5EyQypGI8ZSuahGW0etPkN0+LRfJBKxXoskF/bweGRLo/shYv5/3aURS7vMJ52kbcEBc+C90CSidiIgjFmivKCKj8SQbbg2803kuQ10OmZn6nFHteBwX0bvJ4LLKhUIsDnsBl719FsefSG1sYPP0FsQ2+czwGApXHefpzZyOUwBfs9VMhGGwxyB2HIOGg1Fp+07j5l6Pd+JWDr8ecft+ysu6aQZhkPvDs5fCc32e04tN09qa+n6NN8Etq3UcDihI/mNIk0KBX6qocliSLhcG/eo4/2XYDCaLrULKm5bo1GCDetCxOH+p1cilI1YKZodg3N/z5zIZLrUUaVbT7XUtypQCL9Tgc49eZdGptjV5C0E5dIrgPx+MIeWV7aed7VzVKA5aUQdgJfQtDMwyvvz4vDP4o533eC+jMNisS4lnElPRqbOcm+529HKQeJCwe7RTbp2Ay/0eqMPsEWyaKk6zeTM"+"r38L6IRUnQgEg1SzwUaCY5JUNcLIDv7S7k438n/f+6cWejOSDGDxTfsSO1LqA+WESgyrU/27kAed6vY4D3iKGctI7FWPDLMqtZ3Estb+9+Dc28oi9PPsthHfWBNUmpxA4z/e31aKztOgwcgSQyLpwwela4FY+m0NdyeVebHh893ZsYt0QirABLjsLZ//q8KU9Kz4qC11kU97v2mx7ytoeMT2L69Iesfhds6AnMZ+XQxnEdiPkuTBTGJ7mdkkPe3+I0qlw9+2i1GQmx8VJi2/bU9m6gVLYry1GuLPWlKqaui+oFP70M4BSO1oCMDmYxTJQ/4WzRWoJxDNBJIxoGlw9ue8imyXzEywM3zoNfyzucBl3vJYfMeA81IhTt5BMrtQlfFeQ5D0k9+HCDliXdLg8UExPBr7i2avkXIK8FGyEbxHfUJ+1O6lcy47TO72474lgmJ4NOsLzEOcA+PdeOckyCh3MorZhn35FLUZReJDsPJXSw+I9+uX4oi2+piapJQ6GcTwaMsWhYZQ7mQJrxH6733zF9XATqukelZ8VJi0xqm2u/uAT0IYjjzCK887xc0L0EM26qo5dxPwL6wb7DMTLCUG26fw00iN"+"1+Zda/LDGh5eubIWH/gg9YQuBlDEbg+fcWvrHZ6EMAGpM3WMqzFe1D/kFP2ieSJlJ8nxcB7wCTJzpMHKcKdxvpQYS6bnaz0OQNgp/4wUyH4PvsP6x3Z0yzYWqWNKapVyjxORGcJe+Tf1Re1NWuo/nugCSZZQujh7ZDfnvQtYLiLmVZ+J4FPiYYCtUuMFKI38bcVaI+NLmTXeFOD1GtCtCcY5BXimWYZeltdhcQlIfLHi1ss6IRVgAgHpFeV3n67RrbAhP2p33LeYgLduuaGmq12fjSSGRM+b/V5FNsVmJljxxrn+m6y9/erNY0G+mXnE76ciFwhAVXZRB3Hs2I5UPsK6UctnHwQ9CtSCrHGvWHn+eHoEXNrJNrI4rzOOBJrtvYZsyUly7iZhXabrvYECkDKV/dCLLBcR+DQEYHO/CurzCZMpdY/8QhyusT59z6k0uiMHSBGIgysk785Ch0zmXA5X1h+w6doas9G61vmbNDzAdXsciTxFgitRDbhAOpKXXHaYwfHbYUo+DQEY1eaMtNYPSI6FXLTPrpYeDfPLM9k6jlWrFKAO10IXAyhiN4nBg4tt0ZyUYpKJX+997Ts668/LuOZOSjFJ"+"Bkx+ZC9lw9w9Kz4qTFpj2lvT80CpIQxHtHTRV6FhWTGsWTTaHehyZm7jZRF693ZbyG7TZxawXESbpohcIB1JxbkFOHqINGxFExByxLq53f+/SUYep1GvmdUpd7wc4FuhsPeF5GAn21JUbTC6bld4jDBa1wdlD1auyYfGgmEv8pWlq4lE9fvFcX7VKOdZ8kTKjdy7zix9uIiqFUq+Mo2xuh5hm+mT7OiLCfK9nugTtxd0AapLKF0csyGFjxQxlcruSMOBhBOY0bj8t1DTsvmIiTmoapmNHOG5H4iODORzRlp4mVaDdpeHFgLPKtfuI0G/hccTtbPxoU7/kW/hK0Vn53waAjC30QV1DJj8yF7Km6Wj5/cg2p4GrWpgMaK7sfQ4lz50lH7X0mAs9GY5GMD/ml9Qp/NoZ44kNNmDtKRJ1M1orxt1VZK1h388PQIubeobq/xfW0USH2sNcektKVU1dN/99RBtTwPYCBuoe5+MGcbbfqGjrAmBu7vKEq1mFy36eXBDZgEIKccXkyZ3e/9fnAAAAAAAAAAA6yR2pMkG1xVyTdQvBzjfb7dS7mU43bZfN/+8hj31O6OO+oT8tcFX5unrXHMnJZaq"+"GwvavyU1xDmG4SyHKk1OIJlpoovOPgh6+vsut52cS1UFakFWttksslo65qXevqKWIqOwJqgpJYBTyFs7Nq0VgbEekAEXuHWDxR86Sj/laTDgGeHtzzYhveyBHSWR/LoYRFt9TE1SSh2o2mBp3K7wBVj1zHIwneMp1MBiWWt/9XDOIq0DOdWfmFkc2ZdHAk34i5DFqgMYe1T2Y9J/w1bQ8NhYnpE1tW7VNTCWUdPWehwS+WchzSZzLtKMHD1EGjasSSqUYWQHf2ktHXPcb19RS28KcPQNaNiKYLSzDsoerEHTZQnYM4WYfQs9l0kGMPaonszJCpbEZXeiDuLFrQGofOSatV4OcKPepEKcoYJka6Dal7RG25Yvaszth9TX9t4nKrgYXTelPEafJdzv4VvLpsGcbvn+o+tTp2SjkxvYhM4v0lkLgXwQ9FaiGm2AdDkz5XOgu3nvDQ8VXAygldweI2wsT8aU1DfkEDZN9iMFMpHdMt/Hg2xCZwMmPzKZvO9uZvjNauV7b52MNa4rW+IWWTGzwuISkPh/k70gJ7+RUANpRg6QIg0bVimeJ2+uGdMoY5KMPFOiQy9wgv746Rue0LxveSw+7UD3"+"TEDVN9LeU9t16L+uX8KyYk2pwNKlQf0KTo//4Dz9EmQmIOSVaW+n4+Hw9Ai4qY9s0aojD92m2cLH0BCd0cYoj4p50E90h9WFRpRXm6NxC6I4QX98+oNPaB1HpNsKUAflIGya8UYKZD+hKN33NL1HEoFERwZytyMt8uCGzAIQUpMYLeWNvIkrV8qh+bD4kx37a4kkR8wuWun53RGFBCCkO0vlvraKJD7WVYQlXxnI1l07Z0BOYz+gBqaNtnZsRyof94rHmrTJfiHDU0QuEICq7JpPnblXgucUBbp7yCybMiAxpUZl+LZeT7G2Ufd1R/TUi/oNhXukZoKFqWxaoWqYu5kPrvkI63nJoV43okf0pi12hX3NXSd0HvjFC4AKGCC8vmXcsgH3orRmbRuYb5Qm50zJIb9TxOZIlUEKD5PZykIgzcyqZHuk70KaQGCJChhxDE6k9psys4vM2jYt3jVM05bcI7x8Wy+pwwm7aKqFGrPSYTGnNkjgEwIdxSlB/E2yzVrat3BL5IqneWXZhO1x5jI4b9YXNLuk6C1t1TirckVcIUfqYXe0sV2hq3DPCRzorJB/znK4vf9XyF39lyJ4qKTkTGprb5QN"+"OFGZW08f3+RiV4zK7XG8ntmIK7DAHSwKkXudXRE8UDuiwx4RqHZDxuRjySOjmcHO9xaGxX6odtyHtKlz4JbVCa8NVn2dOlgUtAwqP1ncxvQ2AviEldEh3dPh3T2YNkhK+UXnGqRmiOV1GFR+sqWR9ZNmWHRQwB2JnqgQGGWMBltPVAgMvEYDoy0DhMZRN7893DJQeOyGHirqMKj8eVc/9yFNIDDKBQy2ZfAyK4AWwwxpvpbdGyRwh9uV7pmB4WG40fwYFNnKBfiCDtK7zA3nKWPXYFBDDxTHO8yw6KCdOg+OQHZNVz9UojnRdcHhYXe9EvWjfHNPH0urN8EvH9/CbVZIsWc5XNDxbATtFTe/QqftlxYdFDBAZX1sZ9qrcrgH7Bf6h7pO6Dzfr3nLAwT7wXM/BgVxvEY+eNYcEofpiifQfPSOd7StobnCYlNskN0m4kSbWGCAFgWPwJrX+UH8+/rYzqlL5G0Oo0PyiwYI65+bEmvQSRc0e5qSh0rnaZwiGwF8QsTmnuA6TFxyDuOSVktun14+o5naa6NT9FrYPTXn/uCQTBskJSLQCYMlh+ldhCmAwA8UMOLGs8Cghh4okwh0M6QZ1yny"+"NB89rdQtbG/uCj+u+7Kljkruc8SQ3TGDqrcttbGhajSpKgQGXiOP33tLNaFoa2/MaiO/bvSmlWwZHLlrhRrTUlXVmNTW3jUayWBN5fKufvMcpsKjqYHhct4vlVGtelOYMCWq/1bI9hYVUh2dHihg2VBv4xz6RQc6GJxV8StkewsBgOyarn6oWXzsi0AFDBBeI1DlGYv5QQTvitM0VcwN1wenvuFtZ3+S5eMluQ3naZdaBhWRom5jerYR7xYYIItGCfTfPrepgaseuweK6H2swLeRA4y2XiMfD9ONRXSwVmBn7fcCweqOvrpfS+CDEjjN48R3ws7+vlwNzkhsNUwb0oxds2QWwxkQJuqe0adicyQDnSmz74Ll658o/ILL8q4CqKronPBdJ4ZDGqz6J3SwKM9HH54xt6k4WBvQuOOSLsi8eBmbQAvvBpD7cce/QvhiHzvrEEYDBJloPnpHtVrY3piPQmOmldGQ2AjHKm5jhFMGJ1J7wxnXy+uwRGbXKZeu5n4MCuJljHwU0vEHsFbIgHEiwywwQAuMinrhH9Xaztug3ts46YoOdK0Qk1TcxhWmC+kaF/ZVzBmN3V/+uL2xSb/lMCiviQrt"+"1lum9bStemp5VvCIKZcifhDoZlUys1L5DlNh39rO/jnOx/MEn8kBYf9itWFnf18ul1zPJtIlh/BR7w+GVDuvYy8eQe8Qy/KPUnImNbu5SoiujbrnM0TwTUEHadNmiP2as6uU3jS7uWaAExeSjfGqm6VkoPDFETxU8THUvr2xoRd/caLz6o71tUCHhUnI9lXDfvFOaUTwXezURmPc9VE32PKs/Q1SM0T8AAAAAAAAAABfvG5ZjvVRWhbPNC7xqoUysDa9bds5XI0TdU/m3TG3Ervfp3otbJCUiefIrDpYKzA8aw4JzfpFncSuBYnH4mUhSXNad39f1GjK/WRWHSybGNoVAgMvn8nhiGckNpQmg2k3ghQeO6+JhJy11TEkcEvp19tKbxrT0jOm+YlDKpPZv501OauKDuOwU/LKrxXH4tFuGSg8dkMPFT3r4pNjhO3EXjyCwyCL+QMzuINMuUoT/WRw3rEuaGtVNZ/RN3pTxDZhyqV5AvNZdQQ6l1KC5Zp5/X9wSCaDEpzFLukTaZzNeCi5/w59rI0dVFV0TnignUPLfYjMs1IzQUS9EhtKE8+6TUnNJf26ThE+dssgjAYILz/2J7oieKB2"+"wolX8gT7supFPf6B5G1n45TB5pU9p2IbLINoXP9JF2TzLBGX/E3spSsk1r2SLmj2sit4RJrFET9I87bt0SF8MS6erXW+tVrWF0/YtF/ULWtO1OSWEjir+pLmtO7+vrXQRqDXMgvvgghHIDuopZEqUST3W/jmnj6W8LE4JBPPCU7+4ln7yQH3dydqcksJHNt9vfj1Ae51R19ZmzwiTeyGkW2EAY+Zwer+dJi45BzbOazgWV5xIXxbtyqkOic8UMCv9QtD7D9UO26Djj4hYnNPcMCUkttFB/9Ycr/qn9/C7mcRaIrPnM36oBqBkNhqmDa5esvZO8YVx5XHMyw6KGCAyoY0RelO6H1Q9pZqX9DW3oXprYFPltXaHHCiL7aePqPVCmn2jVgrZEC4Qo7Jwu51f2BKSeOsjfEsW4b5CwwQyyPh2bLrjwLz7ik5E5TT0iVEyOChf1zQ1qq1jMal96JurYGT+wgjjwLC1caPRlsvn4H8/5zSiP26xXcFkVfzWdxHHSYuOQf/SSv7WCIz5ZrFV92yvOJC+LZzJXe3Ykjgls9vmcSm2D2nTMEUfkHreVcB9IuvdpEqkzc+8p0kmywKGenhYyK2+GIv"+"VTaZQEd1f3qfTVbVpHsLM4IlZ0ZqoRdMuPUFfesIL7LMSMEL9EdfUzcwiNQnXew6lo9DJRgK7RAXPSMs9wFhUa5O0J+Ub8wT/UtHQcRTmHMbWz8N2ZM3ZS/8sJZ7ZEBS4CN20gqJhAyjrjpwMpsY10GcvSM13oUm+v6/EVt8MZkDlwdPhaqbDcWK1PtINrlwvsYL4/xBBKge/zbcS3CHchMf3DPthFO2CETjPjQXZNMP8RtuqzjNOWQ1Hwp3YbhaO1aU9QnPug4whXCEuHJF0Eevs70il6488rpcL29rVUp0vcR2H09w4c/fxkRx7cRe5hB4TB3ArxZ6yinWPBE/KC3tQRd2qFmvrF8hHpmj1e7UhPlJqH7zOzzjbKWW4BPk0SDwmDqdQyxrxARk3Fl1Y2nV9eXRlWyemulfBDaYuyTJ7MjaZqTvRNaVCMilsurGxAwiNcBQO4A4wZO6jGUhAxzux11GvJ6P0zEBGTdRWtHY4uVohuylD7E3EI1XecmRcJ87aQXKQgZP61CDFoDK7+xFavMkG9I4WNZzr+GBq74kL1Tnytm/jAIR8YENzBn9kLxNuw9DxgqVGERqnaB2HaG/y/E/VwEq"+"K95PiWHhcrUnuFOoT3MkgbCx5kPfH0thGMw4Qlw5rGjSt/fXvzfYITEDhkowFMcgFKokY3Kr+lxuYA21TrrFdDlHZXQEA6PzCcIV8Lxx5iMqWLlH6YfwRXtM3xi0d73Ylwm165Bsb+BzCDwmgGDZC/7cQA5B+QN+KElIxuRL6bhyjsroCAZb+wYzDp4XSSsaWVCFYWnnKU665PT85sQ2T8p7z5XjDnRJfX/RhqM+lsJSg2EQ2FrWkE36oQIbTNMSkTq7dYclRPrdRuy5FA8VGD1lmmsehpEUwj8sq9cZEJrXE/4GLdRoNtCmBlay+8HcIhxaed2QlJbv0m28obFJNQ537aAjXk/Jy/05W2to9rkN4OrvpvTUxAQi/x8ahTLn+Wm4Xt7WqpR/biAHrvKPPzrQYjuBqTj+ZiTui3qtoae2gujdyFZge6eMxW8oHiowx5slekX6oI1bQXTgZCsws19ji/9+rgJUS8mvnAwF+AjOWTCK+YtGro/FjanMVcOIgDSWx2dtDrHzPKrh5w3XurtiAjJuorS/1QIPhyAYccudXKdUqbcSzoQWadh96DxWimGEeF62c59CC7pssHQeK/EtW2Dqwc5H"+"dqw19xKDaRwsa7fZ/s7bX/zNsY9MNRqDH3nAEsMWBYLwq62uYqdMt+GlgByC7wb8Z6IYRfLLI1dRFGZfXfBNnb9A/S10J4ZYoDk9P7cxg9oFpAnRkuOwF6n7KM8LQGX5JamiKUK/PXzbdeInA0Y+ArMm4QxatdBs55aOgpWmLea5c/OzY26tQt9XHTgZwwzl7lSbcinXy8USmSr9ZeLRRvjvTpBWsChktwQeE0Aw4ovALt0q2tUJZ5MrSvSK6V0Hb+b7e8bcR4Qjmqy3VfYWZkAaS+29uAfWSF6o04mvYwWkG8IgrbSxPXU7MriXKfIRmX5YS7MyICkdaDGTztocf/9atsDJn4GOFrvV4n9n46GlnTTuJdIzzZj4roU7VKLZbfcK+ssQXnl5XS6ZubukJY5De2dEM0F4AYb2zohmgvDr8JKjuzR70rzX+mLxjR1VrdnX0BHFVx4L0+Rxsb3/3qpsL4CO6v70XuV9MfbIgKT1D6R/8ET8oBrdycNR9bWV6nZkbTNS+SIAAAAAAAAAAIWQnxb1jr6mRilFc6rxLMwKVRK/Odt9Lnjb2Fcx3SbVKc++CGwta0ghi102WDoPmxUs0q36zXis"+"g6ORiOLHlbzDudplX3+Sap7LoBssHYnDB7X4UJ8vqep+6NbJJpQNzza2fhqvO27KhgeYWXAkJav7eEnf0xqzaUx8V8yTKlHi2WQTpg6KJ/8mPqVmxxWmcWxx/DRDdtyJSk9ZUoRjevja8xTpiyC88lcnaMFKuWaHEIjbfGguyLuIcHX5U3pqYi56RljzAsKiYZEW2+WCCE2ofd4BgybnCdzAGnecaZfo7cOcPax9UMimCjOhoHiowMGoK+RSs4uXP3Rr6hNKiOmiKMy+uv2aJ6vq2U4GjHwE9IlSsXgiflBc9Iyw+wSZWWAX4BVt5Iq9RDi08qc9NTGMUormSf9YhbUV75JN/Pt2DGYcIS6SVjS0kxlcxZp5hpzaUZoh0ZA+MpSBBbW+XC0ZSs6M1F8umEONTKI4Epzbm2+pyr7+OdSBsmAJ7wuMQd7R6/aRpY4VTm2mTZ7mSB9UsG+OzxP9iknYXh0ByeH1r8gmURwJTuP2mKMwde5nrVrHgi7sTbJDjdR8KMGZ2nWJ9oM32xzoks3ON8V8Id2jUwWX3lA8VGBqQvKqVD/3k11yen5zYhup4jKHUwdFnfFWoZ4Pwt/kd8Yd07TNnCJ9"+"5Yd/A5hqNBuUnrKkFcb07WIGEZRgKJNAY4DnWuhOEbCL53K21tDxb1CSkJHVls9t6GeV7D6e4N98+SdIK1gUMshqPhTuwm20cRnNp42swPbkAYnNEAy265KtvDoCj9/3sqAXwtLTUpwgDav40FyNazSnj5ui93c347RxnY8jHwFFvkI8L1u3wfceVf79iOVdaFMDK1nz7m5ls+nE/wc6qncqwzma5evsh4Ful/hCp1sRDi2y4EhKSzMSd8s92N7dvVEMrHnrn6U1IXlVKpH1x4qwqWhG4GptQ8foC0vwszoIybNUaxYe5TnxwjXrqZC+wb7yN2YGx7IsIJIzYUVpqusBUjtvwyialGlTq5Nazt0nKDj2PhM0DosEVeyhK6BSd6GyxJeP+KKlUSLKE+VAhiJ2E1hi0/HN243f3gi3bP5dHhLInkoXig5WgWsDlphn7l95lTMD7Vmv7XSLq3jXHW2Sny35PlPu9dio+Lp5jCr2GbFpjjnPa5Xdry90kQTi7CqcgOCIZCfOXI/YgluV6sTg2Zk6xgJxRpnDpRcwdvk9GxUfUKKfQp7VBeorx1lGNGZaz9x/S5hhsftTKSNC98chwAgOhkEw"+"hpPNFpb9e3SHJzGScTaxS9NEbIpjoXIbZpo16KZoDkrKtljyOVCaFqTl3k70Loq5N6dDXug/CNkTTmI54mx/loJ5Gjwt9nSIP27wCoMpFjyOWn5C/etlkVyq7kx5gd21GfI0eFrx6A0lXd3j7Zi9cFCJijKpnMysKMpFGdpOZlauWYgPTLMdIg2XmPo31tsmMvlo8LT/zRqgDwlkTyWFRfo61RdeJN5y9GxUfF2yRhVxPoD7/w9+IHhDzytz0qr6vRfqNq7fYrT9ERus0W+Sz0q6p9vHLWfgs0FrXa1J+tO8oxaySRSoixXRUAaK7PkU4nwd6+Me/EBP5Ix1m+2iI37c/RQbUix4TlBw8XwmaBzmlsrBWBXzvDXSpks7tIGngAz/Kf59/fYe2frD1bqksGwmY6ke9ZnRA8EZkTRAQ0H3rU3tafIFVM2dlkm2G9aryMO95+rbE2jRMYmfsCr7ZR0Y41Lh+ufx2jkjWu98psGhu/XgqO5PepE3eAXPmgseMThxYYC/jlvZ+DrL2zzlgAJ15RXTi4l+Ry0/IfD7vMYtlG63ho6jlbo8JI0hlC4J5yI2Rb/eOYP/ZP65AuQbscl3QWMNENlX"+"w8sXIrWNTsyieuxxnK4MO5n+y1GkjBX7FGWsgm0nMyvhvQR6116/AXn3M6+UGWDFZy7JbEGjxHXCf+umUkaE82Tv0P1144c07Z5gBAdDrhj7jimTue8UTThFPrEMYlqBaXhIB0I1XBJIz0LOFKbunhysH9YGMS3Oe4LWukeS6budFBx7H4caB1YWuA3BHEouuEnBmPIfp3d8qRgByNmlBrE0jkh+wnOtQbINHph7OkR0YKtVo8+744TmKANFdvIKG4fRbYl6YXMP4n3v5F1SWIPN5rjKPb63DCNkftAdERl6Nio+oFkjhLYfQPPxiT8QddRX0UQEcdxFWNo0I3A1uNymEWWH/CBDjZtn08mrJtArC1yI7g4lF2/nejgqtdqQJpzEctnY/jFjxB5G+qjLibervHcWQvUvfR3khS8SbzmoxrowJDOboGAFB9fO6IjIj+6Cxhogr65XokSJJteAEfyl5yg2pFjwByvOu49LTL1Je75K820koTyv6Zu3aVV9EvqevQWntanowEuqW4Nr20JzFI+sO3kFkIOEgShRwSHlV9NQbFWw/XL/mWrLTz1hPtoMjmTi3APwhoNW5rlJ6QTq1yq7Cw/8"+"F6S1E1lncGrjyOFvBNU2f/hPMAKNr1cMGEbI/L06IjJbgSD39sqRCNRvojHs6j6mM02UdFM0ByVYQDlmworSSb7W86eanyH1aMy0g6X+li3QhXUbV+ExWv7QAj3lL9GOSw5bXyDmrd8aMy3pbrGrTKPOEPV7ZcYEEI97qNYsPNerB6OhEHPY4WsNrRKRvtVs8vNmQzUywJcuVXcmss7g1AAAAAAAAAAAywKkdt6bUCnk4y/Ui556wnNLZe4shPdeblOGvM1+EK8BtPyE58vKP8/oc1xlkF/VNhO/2g/0wuYRO4csMef26C/hi6JVBSrr6XS3LrxIoeQKvFZBuJ2Xm7RqpeYiArZuROwmsMS7/4emkDtbJ6UDx39oAZD8meZHl6hKOqcajZzdEu3hYDfqfMVUJR3dDchOiMVMfZVr4xNNkWlgSGYrXbCAcsyZCbmStd5ZYsXJfFGBuAOtGbY3ybL1l9lKgjDsCwiqxV9WXaTxMn/SAXKD1q2YkZ54815jarlRlnZ1H1Mk6SFnClN3T7n9PRwV1G1IkvZhlPvaSF9aNdxzEQFbN97T9HBUd6k9wAoOs4HNDY27iNgJxl/kNhYQSZe+rLpV"+"IbcKyVaTsoxZ9MXiJUEYdtXbXrULIfSZVdehnPVcCW+pcka0w/hRn4VS1IeivTg1VGNdGBKXw1Ajwu/chRg78p9h+W7MDJN5U0iTo53cj+1e3wtZqgpUy6wsbRqfOJRc1667oNiqfecqv6AMCcXvKNhMxk889y+/IAP2TbFYeLOnJMffwG7J+AafMj9ogIaCzClqzVHQHJQFXiuuXMDFw2Jw4sIdYwG2O4QnIDgiGcDS8JAOhGq4JFL8byd6F0XSxpU8jOlNiw/gCfj+MJV1PmVbLHmSKE0LmEo31UNH38Tqta6/iAjipZo/0sCQzFa6nKDg//hM0DhMJZXkr63hYt9nCPSzvGMCv2IPI31U68qTQp0QHBGCYAl9T9CM3dTajC+bVy5g7O9winx/GMS0Hzow26Tf6dP/QAbxmn+w8Htfa/fdTcGe9B9tBkcycW6P+fvMhmpknTMwjI3lZ3REZIlxsPlyoCks1hpHJD9ht9jv64UR1MgnZpYctr5A0UejqrNfJfe4Et52FU5AcEQynVE9drZOVwaT80eax9L5Cqibiy5EdwechSl+uZ09haxpfjfmLfx9QMN3byWk7pOeW+BFyFDdj7Wt"+"hu1bpxH/GVLpHQvZz2FrNTfgqyVuQI/7lgf2wDECWnoLAvXhFtI8nfPYSGv7UGUMYhz/J8QIdfV9QMtx+l/TSm2qZhbaopBin181SSPshOLshHw9xQfDswJaNmgEPOIFqL+ebE2sCxn6gIvi6b67lLW5nFJ3x0+jeNm8lfA5e8zjMuUM260mJMdPzhKTMnl+Fyns6y6nCavC1rn2mVTR+F2JjL+6uFUahZp2+xfditsb6FiGNi9/tfZBP4/xNs2K0xEPpbu341wKL+7VFMxNEegwEO3Nfxq5oedd5V9C1YHu3kpVwTshtvL1U1/5ThSADMG0bRiIdh684V/bZSmROy0l6JdacYHCcYF/HOLXpVQuUsXLXFMSS/n3pr7vnCgdnnIufSHy9W7OFw2bgdyn5g6bggUctJQbHnEvYjxJ1zMh5Fz6Qvn33MuOen+Lug9gjpiDGgEPtkZHTM8NjolbI6mShVhPsnqVjMK1cgUzVENC1bjphO/zpQEtGzQCHnGMV6Ziaq50GAv/GfwG49gTEjW6nU1qfG3+ydRMF4+G7WVQZSPmoC5SiAN3LVwGIpOJiwH0/gtpHsD42r2K7YJZkUxOOuyYW2e+"+"sQ3wgn+/lqlqaSea1Pja4eeGidzT1f8ugS4aKx+lU9H7rZDW66DKGBrFQ7I0MQ45FgT33yy5eCemJBxpURifAnU1E8zqr3xeZPKln8hMTvokfSseSJ9fWttk1xirR0xIefSnofInCkAVc9qDKpvrrjSXhnloYhxyUUg40qIwIwTwr2U3/XL2hR0GAj46a0S6Z4WIw85u3XNmqJP3zHCs/9TSTim17anfOFYyFHDqamwHw0GMDlpKgyvLsi9WNbrNBLRs0Ah42QoG7lq4DEQ7DzshH0h2yPnlCVjDiRLu3pjRSznNv4sBWTl7KSBy9Bvgh8BAkxPhaN6tJumIR8qjn04UDIScZ4W71f9VHbfz2FOgykbRXVykDc1gIMeH/jRvhLdtzxXD+1fe/aD8oSHkzkuNe2CWAS09msZCrSmKLGQIddi9EPCvFLNXxup7g3SsTWMh2JpFFjLtqWcJxxmyP/dsJLvzKLwGxmLVJpEsCPI84l7EeJKzZrl4KD9vTzm9wIyPnp1oM/1PORewnnn0N1k94G+ywIwQ1oh4QbHRS9oZsm7uMhOdsLSUh2Z12T4vglk3dxmHwFiQ6ax4PUZhdfGCfgP/bIcJ"+"lF3AqDU+uH9FFvllirW5Jj+Vc5h+sCDvuFUzC21RSDEq5qkbVCvLQWMx5BPGFgR5QI+OgYDTEaDv81FhwyVQOtBmIvm9lXDViHbZog1LjUmlUzE1VzoMi+Fo02TfkcQh9BsJ5/UKL48SsJsPJMGhLdpJzCypWT3EH1w0Vj5Xpr9U0U82qFaLgq983+BD9kGa6momhclD+Lzl3L+01+kdK7J63d55nQUga0Q8rtbmq217rpHJ9hvoRT64aKx8rlFjEce2UyLjMqTSPBSRuamS0I+1mC4DEcfKcKxkKODJ1NiJW8KWD1X8xXZCPpDsje/Xb/BQft6ecmc9z0XweozC6kqgYFSUH1yxWBD7W7De/Zxe/qHjvJrGk27dS0rcgAPrdBgI+OixDdIUXsG3KIWaIii8n3NQFylEJwoGQk69zNOXKu30Mxwr9gWZd+QKZqiGJVAwKkqBLtbdio2gpwN3R8UV+HqXDpt7MCPqqWAaxXi346o6c/utpg+2mTEequWXAAAAAAAAAAAxDvGdYgS09CKTcaZE22RVDeyvWRqWB5JcpJeLuKYklhwrGQo4dTU2QaKVtYLNYCwyedzBZCYnfcGhlKqfdkJx"+"E52AOybf0KGuUcTUQegwFtgT+kStZd/BrAvyvEXU0hMjvmqSRsUV2UnXTQiSPc84nQUDISfQZucvf97/Xk1jx6R+KgFVJH0HmbFv8S+ov+1GYdQ5jJcqr9/Qu8ijP5VC3KeWlKUdBsuwIOu2faHnJboPBWNpbao05PGkgNX3bKfEOONOlRDq95OegSQ7ZPL8je+uRgctJc8sCPOjWG/wTtelY3WzzzpWIMlHzkDnhlBD+KPdhvGCKVaLeV6sammHgAMBHx27Il31NhLT9xReAxifddowDew8lXDbnDcgyfO7Ih5Xa3PbuHL2UkDk9TbdRDviUYiryKriH/442bNXqP1Dym7n5PEXyqNhS4mkfuz+NOcy4cZinoN0LEMbmbHUzzoWr4PC1mqq5agESZDpHCYnHXZMo71fkcS3TD9YEPl8bdBF+EGixn8a/Rn+YzFPyPlXI42YnOmnCQddUwbujlX8VAKqSPoOSPpWPJAjvrRl376rylI/dmyHfSLYvOHuzE0784XgReO+u2mzYRVzPhDqrWcg/UMots6xDnHl3Cq9zETvZzfgt1I/FY6kErCNmJx0xS22zmGb61mZK5Rd6Ios78oJd29M"+"o71rjVt+N4TrRz2xy12JMMP7osKbSqB0nCgYFSXOF2toMxHy0MQ45F/Tute+hLcf/G7RWuX6gJs2zbARbF7+dymRhEdSCVjIopBwuVlgRghTEg66pgzBAToMBHx01ohpaR4KxtLaSWhz20l05utHUXqDiv30BZnJWkrNM7TiH5lgRslPwDSX8OarkujRy46iM1TH9WY4VvHZPuFwr3uuTWFr0nvCKuZ8krOaEDl6g3CryLMwS46YkL+WcodjCwKyW2fWB7b8bhXQMcOXzlU/5ha6WwGwBrUlqJut5ilucMhqH1Jdd9NDW24QNXBXPfoLZg77Khf8lat2Mnqel2NL9kutnWRiRYv18YMMrtvD90jFyPVCZpEx/5UEShzcSLDLiSli3zz4uGawueII6TDBNaFPs/BhGnZ8jSYF8hwWATbWtxki/sxUnjcIlDilkH2LC12jjlgD1JxaW8yc6m88vO2uJG07c//l0rh+D94i7c5eVKuxyoGF7B3n+I/oBWG5rV4ahwE1oIwvKtvWZc7MdleAtaeC9YNYPtyKLu3kez/J2Vw1Br7nD4O+ER1sTgXupgO5CVk2dBAQPIG0gJ/eXSxptgJ9DHdK"+"OZCA19XIeVMJ1B4WSHQGtM3WOxgmUF5f+Z3C9JsCmOic0FQKlDy2f7yoS3+JHxfFcj0ds7eN8qZ4qm5x5ztPLhQz5pmgcWcNhPIb5FRiB4KY3zMntNIPL/BJ3OLTdp5c22xgGZZW63pkh0ayB4tHgzLNI1mNy63PHqSVW/DH2oXpoUNAG51Gtf2Spdm77CG4yBOMeQ4Ljhsu4AuabXulYvhXEriTt/H86yj+2AvqlJ1WSmXrikDqTGyZiOhHSigjRTWJixIdjy2r2MAyMazL9Loukcq5hny9eWC+Pe+OJjoMEal3YC/W8MtQ4a0WyTUn6uIulANf/YkoZtEvXeLOGv8bGEGrm/OQn5M53oz+DUOWRyfIxIoL91JFAsaqrlMcm5xe86wQtBNPovpJQqsypT8WWmLlURIrx0FI2nbm49eSSEDl5GSyp9NyrkPWl4TaIztyoQXhGoakigSRSUGmOLS2hSXJ3nhl3eq6rKbPgAIKl3PCULa9iMKE/7tevTOTi6DfRyyPak4q72y3TZUcMkJ5g3IqMY1Bc/fN/784m7IHTAr5OCwCbIpqDwskOgNab9rlPF+Ikx/Gi5iWflOKw0T/WccaqOY5"+"4vzgzkOekimiDN4kedjNQBnon6LI69jp9Ea7z/OYJwxDs1M+IoTkVdgvDc2OlFBGUQZvErJs6CDnOVeva8VCbQgezlpAwW+gOxk9T8W/q3t/5mSI3xdNQg6YFO9wWATYgTeshXw518axczJE4YWoIWlcP4lvEfhn9s8GV+Pv9SQaq/J20Clj1S2jZk51uR5eAom9mBB30iiQwf199BNgjzxVN7b9k6kXqhIQfjkZouAGhtq1MJlreNqmsFWe44Juw04v91YIWodtU1ikT/9BN/xYdZWzWUisfKUJXMfV9n77FH9si3VKwL/rJquR3az5aJbvxWekkXPKmjHhHnxcM7vkQYaxMxWpDdt5O2iav+RwtKArp/ogjuR6OntzB/lRjOzVvhSjaCLu7Um5I7FE2Rdwi024s9wxYIghnydl/tOz+o/c8fJ6CZELLTH8pgmbD1LEo3jtbcxQzL9eutmBNGvVghF/ZipPlM6aUNT92d8rJbz7RSB1JmfEK2YfSfy/SSQg/HIyWd0DQ23UGMK7PB9uRRf4crORoIVjvGmvH2jUPqS67ruGtgHK0EwItWkUrJTKywmAyZhUw9hzmjc4ZCb+xcAtusrC"+"3qnXeL4NOz4ED2ctIO65UOWw6jd7spBF8wqxNsu0JWBiAZwHNxIs++hrkwwTKC+hzBzrVC7lN0tTj9KKohs6CBthIjrYnArBNsJEdK0lFJ96I9Pp90ydBr4h9ueZaMXtz1+GgDYnjHf3BdYb61qcME0rR9FS3OCNX557/cI07Pgkd3hYPc0Y6oZ7pnxEFdWqTOGXnVppiZkAAAAAAAAAAOxk9CEzxpbxtXxVacFrEXHBx5JvRn+Ir2VNlv4PPi6XFfk21ajEDhm4pyxSqfGulalRfaoh2xncWNJxBPoY7pRZGKFI8q2HgFzdFina9lfEgnTBUWT7bPrR+xPbxuBW8n1v2RDPYJ9qtj84vdmpqk09n+f69SbAA3S7xwaHFJne32MHNLa4Uio60+0DzQrCb/reryCDwCPUwA1CI07K4buFOMuoXNdulsQCJQ5uJFjrR7w0EwJqXQWv16cfEUJypJeN94TMP2LjuW38HqFEx4Ehss85FZbIrjGOTo2VCRbzzpVWzD6S5WM4WlCb3X0QRzWBKaC156+j5vOH42NwK3ngdV1WU+lAAXvpA6X/+fQSErU8LJDoDHUzB/MVhX7E24+vuGoMYdMe"+"2eXdgYYhOVJ3+KrSn9Yi4iW9qBQ1eHH+dXEXSo+h8MoTf+xgmF1lYTBEnsGdvH/npUDU3UH0zyzcIGrgrnrpFluRHNDi2lWosjBfkPlHEx00S/nsvVLGt10XxmXSQz7QGCJP7sBesf2eWemShEtkV5pWjr+kpd0Ho8YOaHFtpFR+LLTE16IkVoexdjBMoLy+QTrupjLzNn2ZFeNrvGdmO0DwPuo6Rl9pHC0ow+CwCK1OaCoFSh5bsQXFt2EoW9BE4b+NGltcKRXywGF6wwFMdLf16PHRHMNZY8tMSz+nRe+dGoRGnInfa+M2MIJLK/s91fR09uYO76L1jGuD+y1OGEZ25F8K3zQRIHgfdR0jobq9Ypszgap+0a4dd1MZ9xuw/tHIDaMumoRVCQg/koJRcCmsAWNVV6cOp8lpRVGDHQSOZWgmBNS6ChH2UfiIKrdJ133JbvZ5PYrvJ5n1KwQtzUju8LB6hzDJIvGi7Q1Uc5JhQvHTL9CXx0pnTShq8OLhgP18yXSMvtJxfnBnr09JmpOCkKns0duziOOykzRN0XInNBWMJQ+j1g");var i,a,o;function get8(e,t){return e[t>>2]>>((t&3)<<3)&255}function add512(e,t){var r=0,n,i;for(var a=0;a<16;a++){n=(e[a]&65535)+(t[a]&65535)+(r||0);i=(e[a]>>>16)+(t[a]>>>16)+(n>>>16);e[a]=n&65535|i<<16;r=i>>>16}}function get512(e){return new Int32Array(e.buffer,e.byteOffset,16)}function copy512(e,t){for(var r=0;r<16;r++){e[r]=t[r]}}function new512(){return new Int32Array(16)}function xor512(e,t){for(var r=0;r<16;r++){e[r]=e[r]^t[r]}}var s=new512();function XLPS(e,t){copy512(s,e);xor512(s,t);for(var r=0;r<8;r++){var i,a,o=get8(s,r)<<1;i=n[o];a=n[o+1];for(var f=1;f<8;f++){o=(f<<9)+(get8(s,(f<<3)+r)<<1);i=i^n[o];a=a^n[o+1]}e[r<<1]=i;e[(r<<1)+1]=a}}var f=new512(),c=new512();function g(e,t,n){var i;copy512(f,e);XLPS(f,t);copy512(c,f);XLPS(f,n);for(i=0;i<11;i++){XLPS(c,r[i]);XLPS(f,c)}XLPS(c,r[11]);xor512(f,c);xor512(e,f);xor512(e,n)}function stage2(e){var r=get512(e);g(o,a,r);add512(a,t);add512(i,r)}function stage3(t){var r=t.length;if(r>63)return;var n=new Int32Array(16);n[0]=r<<3;var s=new Uint8Array(64);for(var f=0;f<r;f++){s[f]=t[f]}s[r]=1;var c=get512(s),u=get512(n);g(o,a,c);add512(a,u);add512(i,c);g(o,e,a);g(o,e,i)}return function(e){i=new512();a=new512();o=new512();for(var t=0;t<16;t++){if(this.bitLength===256)o[t]=16843009}var r=new Uint8Array(buffer(e));var n=r.length;var s=n%64,f=(n-s)/64;for(var t=0;t<f;t++){stage2.call(this,new Uint8Array(r.buffer,t*64,64))}stage3.call(this,new Uint8Array(r.buffer,f*64,s));var c;if(this.bitLength===256){c=new Int32Array(8);for(var t=0;t<8;t++){c[t]=o[8+t]}}else{c=new Int32Array(16);for(var t=0;t<16;t++){c[t]=o[t]}}if(this.procreator==="SC"||this.procreator==="VN")return swap(c.buffer);else return c.buffer}}();var s=function(){var e,t,r,n;function P(e){var t=new Uint8Array(32);for(var r=0;r<8;r++){t[4*r]=e[r];t[1+4*r]=e[8+r];t[2+4*r]=e[16+r];t[3+4*r]=e[24+r]}return t}function A(e){var t=new Uint8Array(8);for(var r=0;r<8;r++){t[r]=e[r]^e[r+8]}arraycopy(e,8,e,0,24);arraycopy(t,0,e,24,8);return e}function fw(e){var t=new Uint16Array(e.buffer,0,16);var r=t[0]^t[1]^t[2]^t[3]^t[12]^t[15];arraycopy(t,1,t,0,15);t[15]=r}function encrypt(e,t,r,n,i){var a=new Uint8Array(8);arraycopy(n,i,a,0,8);var o=new Uint8Array(this.cipher.encrypt(e,a));arraycopy(o,0,t,r,8)}function process(n,i){var a=new Uint8Array(32),o=new Uint8Array(32),s=new Uint8Array(32),f=new Uint8Array(32);arraycopy(n,i,r,0,32);arraycopy(t,0,o,0,32);arraycopy(r,0,s,0,32);for(var c=0;c<32;c++){f[c]=o[c]^s[c]}encrypt.call(this,P(f),a,0,t,0);for(var u=1;u<4;u++){var d=A(o);for(var c=0;c<32;c++){o[c]=d[c]^e[u][c]}s=A(A(s));for(var c=0;c<32;c++){f[c]=o[c]^s[c]}encrypt.call(this,P(f),a,u*8,t,u*8)}for(var h=0;h<12;h++){fw(a)}for(var h=0;h<32;h++){a[h]=a[h]^r[h]}fw(a);for(var h=0;h<32;h++){a[h]=t[h]^a[h]}for(var h=0;h<61;h++){fw(a)}arraycopy(a,0,t,0,t.length)}function summing(e){var t=0;for(var r=0;r<n.length;r++){var i=(n[r]&255)+(e[r]&255)+t;n[r]=i;t=i>>>8}}var i=new Uint8Array([0,255,0,255,0,255,0,255,255,0,255,0,255,0,255,0,0,255,255,0,255,0,0,255,255,0,0,0,255,255,0,255]);return function(a){t=new Uint8Array(32);r=new Uint8Array(32);n=new Uint8Array(32);e=new Array(4);for(var o=0;o<4;o++){e[o]=new Uint8Array(32)}arraycopy(i,0,e[2],0,i.length);var s=new Uint8Array(buffer(a));var f=s.length;var c=f%32,u=(f-c)/32;for(var o=0;o<u;o++){var d=new Uint8Array(s.buffer,o*32,32);summing.call(this,d);process.call(this,d,0)}if(c>0){var d=new Uint8Array(s.buffer,u*32),h=new Uint8Array(32);arraycopy(d,0,h,0,c);summing.call(this,h);process.call(this,h,0)}var l=new Uint8Array(32),p=f*8,v=0;while(p>0){l[v++]=p&255;p=Math.floor(p/256)}process.call(this,l,0);process.call(this,n,0);var y=t.buffer;if(this.procreator==="SC")y=swap(y);return y}}();var f=function(){var e,t=new Uint32Array(80);function common(e,t,r,n,i){return i+t+r+n+(e<<5|e>>>27)>>>0}function f1(e,t,r,n,i,a){return common(e,i,a,1518500249,n^t&(r^n))}function f2(e,t,r,n,i,a){return common(e,i,a,1859775393,t^r^n)}function f3(e,t,r,n,i,a){return common(e,i,a,2400959708,t&r|n&(t|r))}function f4(e,t,r,n,i,a){return common(e,i,a,3395469782,t^r^n)}function cycle(e,t){var r=e[0],n=e[1],i=e[2],a=e[3],o=e[4];var s=f1;for(var f=0;f<80;f+=5){if(f===20){s=f2}else if(f===40){s=f3}else if(f===60){s=f4}o=s(r,n,i,a,o,t[f]);n=(n<<30|n>>>2)>>>0;a=s(o,r,n,i,a,t[f+1]);r=(r<<30|r>>>2)>>>0;i=s(a,o,r,n,i,t[f+2]);o=(o<<30|o>>>2)>>>0;n=s(i,a,o,r,n,t[f+3]);a=(a<<30|a>>>2)>>>0;r=s(n,i,a,o,r,t[f+4]);i=(i<<30|i>>>2)>>>0}e[0]+=r;e[1]+=n;e[2]+=i;e[3]+=a;e[4]+=o}function swap32(e){return(e&255)<<24|(e&65280)<<8|e>>8&65280|e>>24&255}return function(r){var n=new Uint8Array(buffer(r)),i=n.length;var a=i+9;if(a%64){a+=64-a%64}e=new Uint32Array(5);e[0]=1732584193;e[1]=4023233417;e[2]=2562383102;e[3]=271733878;e[4]=3285377520;for(var o=0;o<a;o+=64){for(var s=0;s<64;s++){var f=0,c=o+s;if(c<i){f=n[c]}else if(c===i){f=128}else{var u=a-c-1;if(u>=0&&u<4){f=i<<3>>>u*8&255}}if(s%4===0){t[s>>2]=f<<24}else{t[s>>2]|=f<<(3-s%4)*8}}for(var s=16;s<80;s++){var d=t[s-3]^t[s-8]^t[s-14]^t[s-16];t[s]=d<<1|d>>>31}cycle(e,t)}for(var s=0;s<5;s++){e[s]=swap32(e[s])}return e.buffer}}();function signHMAC(e,t){var r=this.digest===s?32:64,n=this.bitLength/8,i=buffer(e),a=buffer(t),o;if(i.byteLength===r)o=new Uint8Array(i);else{var o=new Uint8Array(r);if(i.byteLength>r){o.set(new Uint8Array(this.digest(i)))}else{o.set(new Uint8Array(i))}}var f=new Uint8Array(r+a.byteLength),c=new Uint8Array(r+n);for(var u=0;u<r;u++){f[u]=o[u]^54;c[u]=o[u]^92}f.set(new Uint8Array(a),r);c.set(new Uint8Array(this.digest(f)),r);return this.digest(c)}function verifyHMAC(e,t,r){var n=new Uint8Array(this.sign(e,r)),i=new Uint8Array(t);if(n.length!==i.length)return false;for(var a=0,o=n.length;a<o;a++){if(n[a]!==i[a])return false}return true}function generateKey(){return(0,n.getSeed)(this.bitLength).buffer}function deriveBitsPFXKDF(e,t){if(t%8>0)throw new a.DataError("Length must multiple of 8");var r=this.bitLength/8,n=this.digest===s?32:64,i=t/8,o=this.iterations;var f=this.diversifier,c=new Uint8Array(n);for(var u=0;u<n;u++){c[u]=f}var d=new Uint8Array(buffer(this.salt)),h=d.length,l=n*Math.ceil(h/n),p=new Uint8Array(l);for(var u=0;u<l;u++){p[u]=d[u%h]}var v=new Uint8Array(buffer(e)),y=v.length,b=n*Math.ceil(y/n),m=new Uint8Array(b);for(var u=0;u<b;u++){m[u]=v[u%y]}var g=new Uint8Array(l+b);arraycopy(p,0,g,0,l);arraycopy(m,0,g,l,b);var w=Math.ceil(i/r);var C=new Uint8Array(w*r);for(var u=0;u<w;u++){var S=new Uint8Array(n+l+b);arraycopy(c,0,S,0,n);arraycopy(g,0,S,n,l+b);for(var A=0;A<o;A++){S=new Uint8Array(this.digest(S))}arraycopy(S,0,C,u*r,r);var E=new Uint8Array(n);for(var A=0;A<n;A++){E[A]=S[A%r]}var B=(l+b)/n;for(A=0;A<B;A++){var _=1,P;for(var F=n-1;F>=0;--F){P=g[n*A+F]+E[F]+_;_=P>>>8;g[n*A+F]=P&255}}}var k=new Uint8Array(i);arraycopy(C,0,k,0,i);return k.buffer}function deriveBitsKDF(e,t){if(t%8>0)throw new a.DataError("Length must be multiple of 8");var r=t/8,n,i=new Uint8Array(buffer(this.context)),o=this.bitLength/8,s=Math.ceil(r/o);if(this.label)n=new Uint8Array(buffer(this.label));else n=new Uint8Array([38,189,184,120]);var f=new Uint8Array(r);for(var c=0;c<s;c++){var u=new Uint8Array(n.length+i.length+4);u[0]=c+1;u.set(n,1);u[n.length+1]=0;u.set(i,n.length+2);u[u.length-2]=t>>>8;u[u.length-1]=t&255;f.set(new Uint8Array(signHMAC.call(this,e,u),0,c<s-1?o:r-c*o),c*o)}return f.buffer}function deriveBitsPBKDF1(e,t){if(t<this.bitLength/2||t%8>0)throw new a.DataError("Length must be more than "+this.bitLength/2+" bits and multiple of 8");var r=this.bitLength/8,n=t/8,i=this.iterations,o=new Uint8Array(buffer(e)),s=new Uint8Array(buffer(this.salt)),f=s.length,c=o.length,u=new Uint8Array(c+f),d=new Uint8Array(n);if(n>r)throw new a.DataError("Invalid parameters: Length value");arraycopy(o,0,u,0,c);arraycopy(s,0,u,c,f);for(var h=0;h<i;h++){u=new Uint8Array(this.digest(u))}arraycopy(u,0,d,0,n);return d.buffer}function deriveBitsPBKDF2(e,t){var r=this.diversifier||1;t=t*r;if(t<this.bitLength/2||t%8>0)throw new a.DataError("Length must be more than "+this.bitLength/2+" bits and multiple of 8");var n=this.bitLength/8,i=t/8,o=this.iterations,s=new Uint8Array(buffer(e)),f=new Uint8Array(buffer(this.salt));var c=f.byteLength,u=new Uint8Array(c+4);arraycopy(f,0,u,0,c);if(i>(4294967295-1)*32)throw new a.DataError("Invalid parameters: Length value");var d=Math.ceil(i/n),h=new Uint8Array(i);for(var l=1;l<=d;l++){u[c]=l>>>24&255;u[c+1]=l>>>16&255;u[c+2]=l>>>8&255;u[c+3]=l&255;var p=new Uint8Array(signHMAC.call(this,s,u)),v=p;for(var y=1;y<o;y++){p=new Uint8Array(signHMAC.call(this,s,p));for(var b=0;b<n;b++){v[b]=p[b]^v[b]}}var m=(l-1)*n;arraycopy(v,0,h,m,Math.min(n,i-m))}if(r>1){var g=i/r,w=new Uint8Array(g);arraycopy(h,i-g,w,0,g);return w.buffer}else return h.buffer}function deriveBitsCP(e,t){if(t>this.bitLength||t%8>0)throw new a.DataError("Length can't be more than "+this.bitLength+" bits and multiple of 8");var r=this.digest===s?32:64,n=this.bitLength/8,i=e&&e.byteLength>0?new Uint8Array(buffer(e)):false,o=i?i.length:0,f=this.iterations,c=new Uint8Array(buffer(this.salt)),u=c.length,d=new Uint8Array(u+o);arraycopy(c,0,d,0,u);if(i)arraycopy(i,0,d,u,o);var h=new Uint8Array(this.digest(d)),l=new Uint8Array(r),p=new Uint8Array(r),v=new Uint8Array(r);var y="DENEFH028.760246785.IUEFHWUIO.EF";for(var b=0;b<y.length;b++){l[b]=y.charCodeAt(b)}d=new Uint8Array(2*(r+n));for(var m=0;m<f;m++){for(var b=0;b<r;b++){p[b]=l[b]^54;v[b]=l[b]^92;l[b]=0}arraycopy(p,0,d,0,r);arraycopy(h,0,d,r,n);arraycopy(v,0,d,r+n,r);arraycopy(h,0,d,r+n+r,n);arraycopy(new Uint8Array(this.digest(d)),0,l,0,n)}for(var b=0;b<n;b++){p[b]=l[b]^54;v[b]=l[b]^92;l[b]=0}d=new Uint8Array(2*n+u+o);arraycopy(p,0,d,0,n);arraycopy(c,0,d,n,u);arraycopy(v,0,d,n+u,n);if(i)arraycopy(i,0,d,n+u+n,o);h=this.digest(this.digest(d));if(t===this.bitLength)return h;else{var g=t/8,w=new Uint8Array(g);arraycopy(h,0,w,0,g);return w.buffer}}function deriveKey(e){return this.deriveBits(e,this.keySize*8)}function GostDigest(e){e=e||{};this.name=(e.name||"GOST R 34.10")+"-"+(e.version||2012)%100+((e.version||2012)>1?"-"+(e.length||256):"")+((e.mode||"HASH")!=="HASH"?"-"+e.mode:"")+(e.procreator?"/"+e.procreator:"")+(typeof e.sBox==="string"?"/"+e.sBox:"");this.procreator=e.procreator;this.bitLength=e.length||256;switch(e.version||2012){case 1:this.digest=f;this.bitLength=160;break;case 1994:this.digest=s;this.sBox=(e.sBox||(e.procreator==="SC"?"D-SC":"D-A")).toUpperCase();this.cipher=new i.GostCipher({name:"GOST 28147",block:"ECB",sBox:this.sBox,procreator:this.procreator});break;case 2012:this.digest=o;break;default:throw new a.NotSupportedError("Algorithm version "+e.version+" not supported")}this.keySize=e.keySize||(e.version<=2?this.bitLength/8:32);switch(e.mode||"HASH"){case"HASH":break;case"HMAC":this.sign=signHMAC;this.verify=verifyHMAC;this.generateKey=generateKey;break;case"KDF":this.deriveKey=deriveKey;this.deriveBits=deriveBitsKDF;this.label=e.label;this.context=e.context;break;case"PBKDF2":this.deriveKey=deriveKey;this.deriveBits=deriveBitsPBKDF2;this.generateKey=generateKey;this.salt=e.salt;this.iterations=e.iterations||2e3;this.diversifier=e.diversifier||1;break;case"PFXKDF":this.deriveKey=deriveKey;this.deriveBits=deriveBitsPFXKDF;this.generateKey=generateKey;this.salt=e.salt;this.iterations=e.iterations||2e3;this.diversifier=e.diversifier||1;break;case"CPKDF":this.deriveKey=deriveKey;this.deriveBits=deriveBitsCP;this.generateKey=generateKey;this.salt=e.salt;this.iterations=e.iterations||2e3;break;default:throw new a.NotSupportedError("Algorithm mode "+e.mode+" not supported")}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GostCipher=GostCipher;var n=r(19);var i=r(25);var a=ArrayBuffer;var o=function(){var e=new a(2);new DataView(e).setInt16(0,256,true);return new Int16Array(e)[0]===256}();var s=new Uint8Array([0,0,0,0,0,0,0,0]);var f={"E-TEST":[4,2,15,5,9,1,0,8,14,3,11,12,13,7,10,6,12,9,15,14,8,1,3,10,2,7,4,13,6,0,11,5,13,8,14,12,7,3,9,10,1,5,2,4,6,15,0,11,14,9,11,2,5,15,7,1,0,13,12,6,10,4,3,8,3,14,5,9,6,8,0,13,10,11,7,12,2,1,15,4,8,15,6,11,1,9,12,5,13,3,7,10,0,14,2,4,9,11,12,0,3,6,7,5,4,8,14,15,1,10,2,13,12,6,5,2,11,0,9,13,3,14,7,10,15,4,1,8],"E-A":[9,6,3,2,8,11,1,7,10,4,14,15,12,0,13,5,3,7,14,9,8,10,15,0,5,2,6,12,11,4,13,1,14,4,6,2,11,3,13,8,12,15,5,10,0,7,1,9,14,7,10,12,13,1,3,9,0,2,11,4,15,8,5,6,11,5,1,9,8,13,15,0,14,4,2,3,12,7,10,6,3,10,13,12,1,2,0,11,7,5,9,4,8,15,14,6,1,13,2,9,7,10,6,0,8,12,4,5,15,3,11,14,11,10,15,5,0,12,14,8,6,2,3,9,1,7,13,4],"E-B":[8,4,11,1,3,5,0,9,2,14,10,12,13,6,7,15,0,1,2,10,4,13,5,12,9,7,3,15,11,8,6,14,14,12,0,10,9,2,13,11,7,5,8,15,3,6,1,4,7,5,0,13,11,6,1,2,3,10,12,15,4,14,9,8,2,7,12,15,9,5,10,11,1,4,0,13,6,8,14,3,8,3,2,6,4,13,14,11,12,1,7,15,10,0,9,5,5,2,10,11,9,1,12,3,7,4,13,0,6,15,8,14,0,4,11,14,8,3,7,1,10,2,9,6,15,13,5,12],"E-C":[1,11,12,2,9,13,0,15,4,5,8,14,10,7,6,3,0,1,7,13,11,4,5,2,8,14,15,12,9,10,6,3,8,2,5,0,4,9,15,10,3,7,12,13,6,14,1,11,3,6,0,1,5,13,10,8,11,2,9,7,14,15,12,4,8,13,11,0,4,5,1,2,9,3,12,14,6,15,10,7,12,9,11,1,8,14,2,4,7,3,6,5,10,0,15,13,10,9,6,8,13,14,2,0,15,3,5,11,4,1,12,7,7,4,0,5,10,2,15,14,12,6,1,11,13,9,3,8],"E-D":[15,12,2,10,6,4,5,0,7,9,14,13,1,11,8,3,11,6,3,4,12,15,14,2,7,13,8,0,5,10,9,1,1,12,11,0,15,14,6,5,10,13,4,8,9,3,7,2,1,5,14,12,10,7,0,13,6,2,11,4,9,3,15,8,0,12,8,9,13,2,10,11,7,3,6,5,4,14,15,1,8,0,15,3,2,5,14,11,1,10,4,7,12,9,13,6,3,0,6,15,1,14,9,2,13,8,12,4,11,10,5,7,1,10,6,8,15,11,0,4,12,3,5,9,7,13,2,14],"E-SC":[3,6,1,0,5,7,13,9,4,11,8,12,14,15,2,10,7,1,5,2,8,11,9,12,13,0,3,10,15,14,4,6,15,1,4,6,12,8,9,2,14,3,7,10,11,13,5,0,3,4,15,12,5,9,14,0,6,8,7,10,1,11,13,2,6,9,0,7,11,8,4,12,2,14,10,15,1,13,5,3,6,1,2,15,0,11,9,12,7,13,10,5,8,4,14,3,0,2,14,12,9,1,4,7,3,15,6,8,10,13,11,5,5,2,11,8,4,12,7,1,10,6,14,0,9,3,13,15],"E-Z":[12,4,6,2,10,5,11,9,14,8,13,7,0,3,15,1,6,8,2,3,9,10,5,12,1,14,4,7,11,13,0,15,11,3,5,8,2,15,10,13,14,1,7,4,12,9,6,0,12,8,2,1,13,4,15,6,7,0,10,5,3,14,9,11,7,15,5,10,8,1,6,13,0,9,3,14,11,4,2,12,5,13,15,6,9,2,12,10,11,7,8,1,4,3,14,0,8,14,2,5,6,9,1,12,15,4,11,0,13,10,3,7,1,7,14,13,0,5,8,3,4,15,10,6,9,12,11,2],"D-TEST":[4,10,9,2,13,8,0,14,6,11,1,12,7,15,5,3,14,11,4,12,6,13,15,10,2,3,8,1,0,7,5,9,5,8,1,13,10,3,4,2,14,15,12,7,6,0,9,11,7,13,10,1,0,8,9,15,14,4,6,12,11,2,5,3,6,12,7,1,5,15,13,8,4,10,9,14,0,3,11,2,4,11,10,0,7,2,1,13,3,6,8,5,9,12,15,14,13,11,4,1,3,15,5,9,0,10,14,7,6,8,2,12,1,15,13,0,5,7,10,4,9,2,3,14,6,11,8,12],"D-A":[10,4,5,6,8,1,3,7,13,12,14,0,9,2,11,15,5,15,4,0,2,13,11,9,1,7,6,3,12,14,10,8,7,15,12,14,9,4,1,0,3,11,5,2,6,10,8,13,4,10,7,12,0,15,2,8,14,1,6,5,13,11,9,3,7,6,4,11,9,12,2,10,1,8,0,14,15,13,3,5,7,6,2,4,13,9,15,0,10,1,5,11,8,14,12,3,13,14,4,1,7,0,5,10,3,12,8,15,6,2,9,11,1,3,10,9,5,11,4,15,8,6,7,14,13,0,2,12],"D-SC":[11,13,7,0,5,4,1,15,9,14,6,10,3,12,8,2,1,2,7,9,13,11,15,8,14,12,4,0,5,6,10,3,5,1,13,3,15,6,12,7,9,8,11,2,4,14,0,10,13,1,11,4,9,12,14,0,7,5,8,15,6,2,10,3,2,13,10,15,9,11,3,7,8,12,5,14,6,0,1,4,0,4,6,12,5,3,8,13,10,11,15,2,1,9,7,14,1,3,12,8,10,6,11,0,2,14,7,9,15,4,5,13,10,11,6,0,1,3,4,7,14,13,5,15,8,2,9,12]};var c=new Uint8Array([105,0,114,34,100,201,4,35,141,58,219,150,70,233,42,196,24,254,172,148,0,237,7,18,192,134,220,194,239,76,169,43]);function signed(e){return e>=2147483648?e-4294967296:e}function unsigned(e){return e<0?e+4294967296:e}function buffer(e){if(e instanceof a)return e;else if(e&&e.buffer&&e.buffer instanceof a)return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(new Uint8Array(e,e.byteOffset,e.byteLength)).buffer;else throw new n.DataError("CryptoOperationData required")}function byteArray(e){return new Uint8Array(buffer(e))}function cloneArray(e){return new Uint8Array(byteArray(e))}function intArray(e){return new Int32Array(buffer(e))}function swap32(e){return(e&255)<<24|(e&65280)<<8|e>>8&65280|e>>24&255}var u=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);var d=function(){function gmul(e,t){var r=0,n,i;for(n=0;n<8;n++){if(t&1)r^=e;i=e&128;e=e<<1&255;if(i)e^=195;t>>=1}return r&255}var e=[1,16,32,133,148,192,194,251];var t=[];for(var r=0;r<8;r++){t[r]=[];for(var n=0;n<256;n++){t[r][n]=gmul(e[r],n)}}return t}();var h=[4,2,3,1,6,5,0,7,0,5,6,1,3,2,4,0];function funcR(e){var t=0;for(var r=0;r<16;r++){t^=d[h[r]][e[r]]}for(var r=16;r>0;--r){e[r]=e[r-1]}e[0]=t}function funcReverseR(e){var t=e[0];for(var r=0;r<15;r++){e[r]=e[r+1]}e[15]=t;var n=0;for(r=0;r<16;r++){n^=d[h[r]][e[r]]}e[15]=n}var l=[252,238,221,17,207,110,49,22,251,196,250,218,35,197,4,77,233,119,240,219,147,46,153,186,23,54,241,187,20,205,95,193,249,24,101,90,226,92,239,33,129,28,60,66,139,1,142,79,5,132,2,174,227,106,143,160,6,11,237,152,127,212,211,31,235,52,44,81,234,200,72,171,242,42,104,162,253,58,206,204,181,112,14,86,8,12,118,18,191,114,19,71,156,183,93,135,21,161,150,41,16,123,154,199,243,145,120,111,157,158,178,177,50,117,25,61,255,53,138,126,109,84,198,128,195,189,13,87,223,245,36,169,62,168,67,201,215,121,214,246,124,34,185,3,224,15,236,222,122,148,176,188,220,232,40,80,78,51,10,74,167,151,96,115,30,0,98,68,26,184,56,130,100,159,38,65,173,69,70,146,39,94,85,47,140,163,165,125,105,213,149,59,7,88,179,64,134,172,29,247,48,55,107,228,136,217,231,137,225,27,131,73,76,63,248,254,141,83,170,144,202,216,133,97,32,113,103,164,45,43,9,91,203,155,37,208,190,229,108,82,89,166,116,210,230,244,180,192,209,102,175,194,57,75,99,182];var p=function(){var e=[];for(var t=0,r=l.length;t<r;t++){e[l[t]]=t}return e}();function funcS(e){for(var t=0;t<16;++t){e[t]=l[e[t]]}}function funcReverseS(e){for(var t=0;t<16;++t){e[t]=p[e[t]]}}function funcX(e,t){for(var r=0;r<16;++r){e[r]^=t[r]}}function funcL(e){for(var t=0;t<16;++t){funcR(e)}}function funcReverseL(e){for(var t=0;t<16;++t){funcReverseR(e)}}function funcLSX(e,t){funcX(e,t);funcS(e);funcL(e)}function funcReverseLSX(e,t){funcX(e,t);funcReverseL(e);funcReverseS(e)}function funcF(e,t,r){var n=new Uint8Array(e);funcLSX(e,r);funcX(e,t);t.set(n)}function funcC(e,t){for(var r=0;r<15;r++){t[r]=0}t[15]=e;funcL(t)}function keySchedule128(e){var t=new Uint8Array(160),r=new Uint8Array(16);t.set(byteArray(e));for(var n=0;n<4;n++){var i=32*n,a=32*(n+1);t.set(new Uint8Array(t.buffer,i,32),a);for(var o=1;o<9;o++){funcC(n*8+o,r);funcF(new Uint8Array(t.buffer,a,16),new Uint8Array(t.buffer,a+16,16),r)}}return t}function process128(e,t,r,n){r=r||t.byteOffset;var i=new Uint8Array(t.buffer,r,16);if(n){for(var a=0;a<9;a++){funcReverseLSX(i,new Uint8Array(e.buffer,(9-a)*16,16))}funcX(i,new Uint8Array(e.buffer,0,16))}else{for(var a=0;a<9;a++){funcLSX(i,new Uint8Array(e.buffer,16*a,16))}funcX(i,new Uint8Array(e.buffer,16*9,16))}}function round(e,t,r){var n=t[0]+r&4294967295;var i=e[0+(n>>0*4&15)]<<0*4;i|=e[16+(n>>1*4&15)]<<1*4;i|=e[32+(n>>2*4&15)]<<2*4;i|=e[48+(n>>3*4&15)]<<3*4;i|=e[64+(n>>4*4&15)]<<4*4;i|=e[80+(n>>5*4&15)]<<5*4;i|=e[96+(n>>6*4&15)]<<6*4;i|=e[112+(n>>7*4&15)]<<7*4;n=i<<11|i>>>32-11;n^=t[1];t[1]=t[0];t[0]=n}function process89(e,t,r){r=r||t.byteOffset;var n=this.sBox,i=new Int32Array(t.buffer,r,2);for(var a=0;a<32;a++){round(n,i,e[a])}var o=i[0];i[0]=i[1];i[1]=o}function process15(e,t,r){r=r||t.byteOffset;var n=this.sBox,i=new Int32Array(t.buffer,r,2),a=swap32(i[0]);i[0]=swap32(i[1]);i[1]=a;for(var o=0;o<32;o++){round(n,i,e[o])}i[0]=swap32(i[0]);i[1]=swap32(i[1])}function keySchedule89(e,t){var r=new Int32Array(32),n=new Int32Array(buffer(e));for(var i=0;i<8;i++){r[i]=n[i]}if(t){for(var i=0;i<8;i++){r[i+8]=r[7-i]}for(var i=0;i<8;i++){r[i+16]=r[7-i]}}else{for(var i=0;i<8;i++){r[i+8]=r[i]}for(var i=0;i<8;i++){r[i+16]=r[i]}}for(var i=0;i<8;i++){r[i+24]=r[7-i]}return r}function keySchedule15(e,t){var r=new Int32Array(32),n=new Int32Array(buffer(e));for(var i=0;i<8;i++){r[i]=swap32(n[i])}if(t){for(var i=0;i<8;i++){r[i+8]=r[7-i]}for(var i=0;i<8;i++){r[i+16]=r[7-i]}}else{for(var i=0;i<8;i++){r[i+8]=r[i]}for(var i=0;i<8;i++){r[i+16]=r[i]}}for(var i=0;i<8;i++){r[i+24]=r[7-i]}return r}var v=function(){var e=new Uint8Array([217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173]);return function(t){var r=new Uint8Array(buffer(t)),n=Math.min(r.length,128),i=this.effectiveLength,a=Math.floor((i+7)/8),o=255%Math.pow(2,8+i-8*a);var s=new Uint8Array(128),f=new Uint16Array(s.buffer);for(var c=0;c<n;c++){s[c]=r[c]}for(var c=n;c<128;c++){s[c]=e[(s[c-1]+s[c-n])%256]}s[128-a]=e[s[128-a]&o];for(var c=127-a;c>=0;--c){s[c]=e[s[c+1]^s[c+a]]}return f}}();var y=function(){var e,t,r=new Uint16Array(4),n=new Uint16Array([1,2,3,5]),i;function rol(e,t){return(e<<t|e>>>16-t)&65535}function ror(e,t){return(e>>>t|e<<16-t)&65535}function mix(a){if(i){r[a]=ror(r[a],n[a]);r[a]=r[a]-e[t]-(r[(a+3)%4]&r[(a+2)%4])-(~r[(a+3)%4]&r[(a+1)%4]);t=t-1}else{r[a]=r[a]+e[t]+(r[(a+3)%4]&r[(a+2)%4])+(~r[(a+3)%4]&r[(a+1)%4]);t=t+1;r[a]=rol(r[a],n[a])}}function mash(t){if(i){r[t]=r[t]-e[r[(t+3)%4]&63]}else{r[t]=r[t]+e[r[(t+3)%4]&63]}}function perform(e,t){t=t||1;for(var r=0;r<t;r++){if(i){for(var n=3;n>=0;--n){e(n)}}else{for(var n=0;n<4;n++){e(n)}}}}return function(n,a,o,s){i=s;r=new Uint16Array(a.buffer,o||a.byteOffset,4);e=n;t=s?63:0;perform(mix,5);perform(mash);perform(mix,6);perform(mash);perform(mix,5)}}();function encryptECB(e,t){var r=this.pad(byteArray(t)),n=this.blockSize,i=r.byteLength/n,a=this.keySchedule(e);for(var o=0;o<i;o++){this.process(a,r,n*o)}return r.buffer}function decryptECB(e,t){var r=cloneArray(t),n=this.blockSize,i=r.byteLength/n,a=this.keySchedule(e,1);for(var o=0;o<i;o++){this.process(a,r,n*o,1)}return this.unpad(r).buffer}function encryptCFB(e,t,r){var n=new Uint8Array(r||this.iv),i=cloneArray(t),a=n.length,o=new Uint8Array(a),s=this.shiftBits>>3,f=i.length,c=f%s,u=(f-c)/s,d=this.keySchedule(e);for(var h=0;h<u;h++){for(var l=0;l<a;l++){o[l]=n[l]}this.process(d,n);for(var l=0;l<s;l++){i[h*s+l]^=n[l]}for(var l=0;l<a-s;l++){n[l]=o[s+l]}for(var l=0;l<s;l++){n[a-s+l]=i[h*s+l]}e=this.keyMeshing(e,n,h,d)}if(c>0){this.process(d,n);for(var h=0;h<c;h++){i[u*s+h]^=n[h]}}return i.buffer}function decryptCFB(e,t,r){var n=new Uint8Array(r||this.iv),i=cloneArray(t),a=n.length,o=new Uint8Array(a),s=this.shiftBits>>3,f=i.length,c=f%s,u=(f-c)/s,d=this.keySchedule(e);for(var h=0;h<u;h++){for(var l=0;l<a;l++){o[l]=n[l]}this.process(d,n);for(var l=0;l<s;l++){o[l]=i[h*s+l];i[h*s+l]^=n[l]}for(var l=0;l<a-s;l++){n[l]=o[s+l]}for(var l=0;l<s;l++){n[a-s+l]=o[l]}e=this.keyMeshing(e,n,h,d)}if(c>0){this.process(d,n);for(var h=0;h<c;h++){i[u*s+h]^=n[h]}}return i.buffer}function processOFB(e,t,r){var n=new Uint8Array(r||this.iv),i=cloneArray(t),a=n.length,o=new Uint8Array(a),s=this.shiftBits>>3,f=new Uint8Array(s),c=i.length,u=c%s,d=(c-u)/s,h=this.keySchedule(e);for(var l=0;l<d;l++){for(var p=0;p<a;p++){o[p]=n[p]}this.process(h,n);for(var p=0;p<s;p++){f[p]=n[p]}for(var p=0;p<s;p++){i[l*s+p]^=n[p]}for(var p=0;p<a-s;p++){n[p]=o[s+p]}for(var p=0;p<s;p++){n[a-s+p]=f[p]}e=this.keyMeshing(e,n,l,h)}if(u>0){this.process(h,n);for(var l=0;l<u;l++){i[d*s+l]^=n[l]}}return i.buffer}function processCTR89(e,t,r){var n=new Uint8Array(r||this.iv),i=cloneArray(t),a=this.blockSize,o=new Int8Array(a),s=i.length,f=s%a,c=(s-f)/a,u=this.keySchedule(e),d=new Int32Array(n.buffer);this.process(u,n);for(var h=0;h<c;h++){d[0]=d[0]+16843009&4294967295;var l=unsigned(d[1])+16843012;d[1]=signed(l<4294967296?l:l-4294967295);for(var p=0;p<a;p++){o[p]=n[p]}this.process(u,d);for(var p=0;p<a;p++){i[h*a+p]^=n[p]}for(var p=0;p<a;p++){n[p]=o[p]}e=this.keyMeshing(e,n,h,u)}if(f>0){d[0]=d[0]+16843009&4294967295;var l=unsigned(d[1])+16843012;d[1]=signed(l<4294967296?l:l-4294967295);this.process(u,d);for(var h=0;h<f;h++){i[c*a+h]^=n[h]}}return i.buffer}function processCTR15(e,t,r){var n=cloneArray(t),i=this.blockSize,a=this.shiftBits>>3,o=n.length,s=o%a,f=(o-s)/a,c=new Uint8Array(i),u=new Int32Array(i),d=this.keySchedule(e);c.set(r||this.iv);for(var h=0;h<f;h++){for(var l=0;l<i;l++){u[l]=c[l]}this.process(d,c);for(var l=0;l<a;l++){n[a*h+l]^=c[l]}for(var l=0;l<i;l++){c[l]=u[l]}for(var l=i-1;h>=0;--h){if(c[l]>254){c[l]-=254}else{c[l]++;break}}}if(s>0){this.process(d,c);for(var l=0;l<s;l++){n[a*f+l]^=c[l]}}return n.buffer}function encryptCBC(e,t,r){var n=new Uint8Array(r||this.iv),i=this.blockSize,a=n.length,o=this.pad(byteArray(t)),s=this.keySchedule(e);for(var f=0,c=o.length/i;f<c;f++){for(var u=0;u<i;u++){n[u]^=o[f*i+u]}this.process(s,n);for(var u=0;u<i;u++){o[f*i+u]=n[u]}if(a!==i){for(var u=0;u<a-i;u++){n[u]=n[i+u]}for(var u=0;u<i;u++){n[u+a-i]=o[f*i+u]}}e=this.keyMeshing(e,n,f,s)}return o.buffer}function decryptCBC(e,t,r){var n=new Uint8Array(r||this.iv),i=this.blockSize,a=n.length,o=cloneArray(t),s=new Uint8Array(i),f=this.keySchedule(e,1);for(var c=0,u=o.length/i;c<u;c++){for(var d=0;d<i;d++){s[d]=o[c*i+d]}this.process(f,o,c*i,1);for(var d=0;d<i;d++){o[c*i+d]^=n[d]}if(a!==i){for(var d=0;d<a-i;d++){n[d]=n[i+d]}}for(var d=0;d<i;d++){n[d+a-i]=s[d]}e=this.keyMeshing(e,n,c,f,1)}return this.unpad(o).buffer}function generateKey(){var e=new Uint8Array(this.keySize);(0,i.randomSeed)(e);return e.buffer}function processMAC89(e,t,r){var n=zeroPad.call(this,byteArray(r)),i=this.blockSize,a=n.length/i,o=this.sBox,s=new Int32Array(t.buffer);for(var f=0;f<a;f++){for(var c=0;c<i;c++){t[c]^=n[f*i+c]}for(var c=0;c<16;c++){round(o,s,e[c])}}}function processKeyMAC15(e){var t=0,r=e.length;for(var n=r-1;n>=0;--n){var i=e[n]>>>7;e[n]=e[n]<<1&255|t;t=i}if(t!==0){if(r===16)e[15]^=135;else e[7]^=27}}function processMAC15(e,t,r){var n=this.blockSize,i=this.sBox,a=byteArray(r),o=new Uint8Array(n);this.process(e,o);processKeyMAC15(o);if(r.byteLength%n!==0){a=bitPad.call(this,byteArray(r));processKeyMAC15(o)}for(var s=0,f=a.length/n;s<f;s++){for(var c=0;c<n;c++){t[c]^=a[s*n+c]}if(s===f-1){for(var c=0;c<n;c++){t[c]^=o[c]}}this.process(e,t)}}function signMAC(e,t,r){var n=this.keySchedule(e),i=new Uint8Array(r||this.iv),a=Math.ceil(this.macLength>>3)||this.blockSize>>1;this.processMAC(n,i,t);var o=new Uint8Array(a);o.set(new Uint8Array(i.buffer,0,a));return o.buffer}function verifyMAC(e,t,r,n){var i=new Uint8Array(signMAC.call(this,e,r,n)),a=byteArray(t);if(i.length!==a.length)return false;for(var o=0,s=i.length;o<s;o++){if(i[o]!==a[o])return false}return true}function wrapKeyGOST(e,t){var r=this.blockSize,i=this.keySize,a=i+(r>>1);if(!this.ukm)throw new n.DataError("UKM must be defined");var o=new Uint8Array(this.ukm);var s=signMAC.call(this,e,t,o);var f=encryptECB.call(this,e,t);var c=new Uint8Array(a);c.set(new Uint8Array(f),0);c.set(new Uint8Array(s),i);return c.buffer}function unwrapKeyGOST(e,t){var r=this.blockSize,i=this.keySize,a=i+(r>>1);var o=buffer(t);if(o.byteLength!==a)throw new n.DataError("Wrapping key size must be "+a+" bytes");if(!this.ukm)throw new n.DataError("UKM must be defined");var s=new Uint8Array(this.ukm),f=new Uint8Array(o,0,i),c=new Uint8Array(o,i,r>>1);var u=decryptECB.call(this,e,f);var d=verifyMAC.call(this,e,c,u,s);if(!d)throw new n.DataError("Error verify MAC of wrapping key");return u}function diversifyKEK(e,t){var r=this.blockSize;var n=intArray(e);var i=[];for(var a=0;a<r;a++){i[a]=[];for(var o=0;o<8;o++){i[a][o]=t[a]>>>o&1}}for(var a=0;a<r;a++){var s=new Int32Array(2);for(var o=0;o<8;o++){if(i[a][o])s[0]=s[0]+n[o]&4294967295;else s[1]=s[1]+n[o]&4294967295}var f=new Uint8Array(s.buffer);n=new Int32Array(encryptCFB.call(this,n,n,f))}return n}function wrapKeyCP(e,t){var r=this.blockSize,i=this.keySize,a=i+(r>>1);if(!this.ukm)throw new n.DataError("UKM must be defined");var o=new Uint8Array(this.ukm);var s=diversifyKEK.call(this,e,o);var f=signMAC.call(this,s,t,o);var c=encryptECB.call(this,s,t);var u=new Uint8Array(a);u.set(new Uint8Array(c),0);u.set(new Uint8Array(f),i);return u.buffer}function unwrapKeyCP(e,t){var r=this.blockSize,i=this.keySize,a=i+(r>>1);var o=buffer(t);if(o.byteLength!==a)throw new n.DataError("Wrapping key size must be "+a+" bytes");if(!this.ukm)throw new n.DataError("UKM must be defined");var s=new Uint8Array(this.ukm),f=new Uint8Array(o,0,i),c=new Uint8Array(o,i,r>>1);var u=diversifyKEK.call(this,e,s);var d=decryptECB.call(this,u,f);var h=verifyMAC.call(this,u,c,d,s);if(!h)throw new n.DataError("Error verify MAC of wrapping key");return d}function packKeySC(e,t){var r=this.blockSize>>1,a=this.keySize;var o=8;var s=new Uint8Array(buffer(e));if(s.byteLength!==a)throw new n.DataError("Wrong cleartext size "+s.byteLength+" bytes");t=t||this.ukm;if(t){t=new Uint8Array(buffer(t));if(t.byteLength>0&&t.byteLength%a===0)o=t.byteLength/a+1;else throw new n.DataError("Wrong rand size "+t.byteLength+" bytes")}else(0,i.randomSeed)(t=new Uint8Array((o-1)*a));var f=new Uint8Array(o*a+r+2),c=f.buffer;var u=new Uint8Array(a);var d=signMAC.call(this,s,u);f[0]=34;f[1]=o;f.set(new Uint8Array(d),2);f.set(t,a+r+2);for(var h=1;h<o;h++){var l=new Uint8Array(c,2+r+a*h);for(var p=0;p<a;p++){s[p]^=l[p]}}f.set(s,r+2);return f.buffer}function unpackKeySC(e){var t=this.blockSize>>1,r=this.keySize;var i=buffer(e);var a=new Uint8Array(i,0,1)[0];if(a!==34)throw new n.DataError("Invalid magic number");var o=new Uint8Array(i,1,1)[0];var s=new Uint8Array(i,2,t);var c=new Uint8Array(r);for(var u=0;u<o;u++){var d=new Uint8Array(i,2+t+r*u,r);for(var h=0;h<r;h++){c[h]^=d[h]}}var l=new Uint8Array(r);var p=verifyMAC.call(this,c,s,l);if(!p){var v=["E-A","E-B","E-C","E-D","E-SC"];for(var u=0,y=v.length;u<y;u++){this.sBox=f[v[u]];p=verifyMAC.call(this,c,s,l);if(p)break}}if(!p)throw new n.DataError("Invalid main key MAC");return c.buffer}function wrapKeySC(e,t){var r=this.blockSize>>1,n=this.keySize;var i=buffer(e);var a=buffer(t);if(i.byteLength!==n)i=unpackKeySC.call(this,i);var o=encryptECB.call(this,i,a);var s=signMAC.call(this,i,a);var f=new Uint8Array(r+n);f.set(new Uint8Array(o),0);f.set(new Uint8Array(s),n);return f.buffer}function unwrapKeySC(e,t){var r=this.blockSize>>1,i=this.keySize;var a=buffer(e);var o=buffer(t);if(a.byteLength!==i)a=unpackKeySC.call(this,a);var s=new Uint8Array(o,0,i);var f=new Uint8Array(o,i,r);var c=decryptECB.call(this,a,s);if(!verifyMAC.call(this,a,f,c))throw new n.DataError("Invalid key MAC");return c}function generateWrappingKeySC(){return packKeySC.call(this,generateKey.call(this))}function maskKey(e,t,r,n){var i=n/4,a=new Int32Array(buffer(e)),o=new Int32Array(buffer(t)),s=new Int32Array(i);if(r)for(var f=0;f<i;f++){s[f]=o[f]+a[f]&4294967295}else for(var f=0;f<i;f++){s[f]=o[f]-a[f]&4294967295}return s.buffer}function wrapKeyMask(e,t){return maskKey(e,t,this.procreator==="VN",this.keySize)}function unwrapKeyMask(e,t){return maskKey(e,t,this.procreator!=="VN",this.keySize)}function keyMeshingCP(e,t,r,n,i){if((r+1)*this.blockSize%1024===0){e=decryptECB.call(this,e,c);t.set(new Uint8Array(encryptECB.call(this,e,t)));n.set(this.keySchedule(e,i))}return e}function noKeyMeshing(e){return e}function noPad(e){return new Uint8Array(e)}function pkcs5Pad(e){var t=e.byteLength,r=this.blockSize,n=r-t%r,i=Math.ceil((t+1)/r)*r,a=new Uint8Array(i);a.set(e);for(var o=t;o<i;o++){a[o]=n}return a}function pkcs5Unpad(e){var t=e.byteLength,r=this.blockSize,i=e[t-1],a=t-i;if(i>r)throw(0,n.DataError)("Invalid padding");var o=new Uint8Array(a);if(a>0)o.set(new Uint8Array(e.buffer,0,a));return o}function zeroPad(e){var t=e.byteLength,r=this.blockSize,n=Math.ceil(t/r)*r,i=new Uint8Array(n);i.set(e);for(var a=t;a<n;a++){i[a]=0}return i}function bitPad(e){var t=e.byteLength,r=this.blockSize,n=Math.ceil((t+1)/r)*r,i=new Uint8Array(n);i.set(e);i[t]=1;for(var a=t+1;a<n;a++){i[a]=0}return i}function bitUnpad(e){var t=e.byteLength,r=t;while(r>1&&e[r-1]===0){r--}if(e[r-1]!==1)throw(0,n.DataError)("Invalid padding");r--;var i=new Uint8Array(r);if(r>0)i.set(new Uint8Array(e.buffer,0,r));return i}function randomPad(e){var t=e.byteLength,r=this.blockSize,n=r-t%r,a=Math.ceil(t/r)*r,o=new Uint8Array(a),s=new Uint8Array(o.buffer,t,n);o.set(e);(0,i.randomSeed)(s);return o}function GostCipher(e){if(!o)throw new n.NotSupportedError("Big endian platform not supported");e=e||{};this.keySize=32;this.blockLength=e.length||64;this.blockSize=this.blockLength>>3;this.name=(e.name||(e.version===1?"RC2":e.version===1989?"GOST 28147":"GOST R 34.12"))+(e.version>4?"-"+(e.version||1989)%100:"")+"-"+(this.blockLength===64?"":this.blockLength+"-")+(e.mode==="MAC"?"MAC-"+(e.macLength||this.blockLength>>1):e.mode==="KW"||e.keyWrapping?((e.keyWrapping||"NO")!=="NO"?e.keyWrapping:"")+"KW":(e.block||"ECB")+((e.block==="CFB"||e.block==="OFB"||e.block==="CTR"&&e.version===2015)&&e.shiftBits&&e.shiftBits!==this.blockLength?"-"+e.shiftBits:"")+(e.padding?"-"+(e.padding||(e.block==="CTR"||e.block==="CFB"||e.block==="OFB"?"NO":"ZERO"))+"PADDING":"")+((e.keyMeshing||"NO")!=="NO"?"-CPKEYMESHING":""))+(e.procreator?"/"+e.procreator:"")+(typeof e.sBox==="string"?"/"+e.sBox:"");this.procreator=e.procreator;switch(e.version||1989){case 1:this.process=y;this.keySchedule=v;this.blockLength=64;this.effectiveLength=e.length||32;this.keySize=8*Math.ceil(this.effectiveLength/8);this.blockSize=this.blockLength>>3;break;case 2015:this.version=2015;if(this.blockLength===64){this.process=process15;this.keySchedule=keySchedule15}else if(this.blockLength===128){this.process=process128;this.keySchedule=keySchedule128}else throw new n.DataError("Invalid block length");this.processMAC=processMAC15;break;case 1989:this.version=1989;this.process=process89;this.processMAC=processMAC89;this.keySchedule=keySchedule89;if(this.blockLength!==64)throw new n.DataError("Invalid block length");break;default:throw new n.NotSupportedError("Algorithm version "+e.version+" not supported")}switch(e.mode||e.keyWrapping&&"KW"||"ES"){case"ES":switch(e.block||"ECB"){case"ECB":this.encrypt=encryptECB;this.decrypt=decryptECB;break;case"CTR":if(this.version===1989){this.encrypt=processCTR89;this.decrypt=processCTR89}else{this.encrypt=processCTR15;this.decrypt=processCTR15;this.shiftBits=e.shiftBits||this.blockLength}break;case"CBC":this.encrypt=encryptCBC;this.decrypt=decryptCBC;break;case"CFB":this.encrypt=encryptCFB;this.decrypt=decryptCFB;this.shiftBits=e.shiftBits||this.blockLength;break;case"OFB":this.encrypt=processOFB;this.decrypt=processOFB;this.shiftBits=e.shiftBits||this.blockLength;break;default:throw new n.NotSupportedError("Block mode "+e.block+" not supported")}switch(e.keyMeshing){case"CP":this.keyMeshing=keyMeshingCP;break;default:this.keyMeshing=noKeyMeshing}if(this.encrypt===encryptECB||this.encrypt===encryptCBC){switch(e.padding){case"PKCS5P":this.pad=pkcs5Pad;this.unpad=pkcs5Unpad;break;case"RANDOM":this.pad=randomPad;this.unpad=noPad;break;case"BIT":this.pad=bitPad;this.unpad=bitUnpad;break;default:this.pad=zeroPad;this.unpad=noPad}}else{this.pad=noPad;this.unpad=noPad}this.generateKey=generateKey;break;case"MAC":this.sign=signMAC;this.verify=verifyMAC;this.generateKey=generateKey;this.macLength=e.macLength||this.blockLength>>1;this.pad=noPad;this.unpad=noPad;this.keyMeshing=noKeyMeshing;break;case"KW":this.pad=noPad;this.unpad=noPad;this.keyMeshing=noKeyMeshing;switch(e.keyWrapping){case"CP":this.wrapKey=wrapKeyCP;this.unwrapKey=unwrapKeyCP;this.generateKey=generateKey;this.shiftBits=e.shiftBits||this.blockLength;break;case"SC":this.wrapKey=wrapKeySC;this.unwrapKey=unwrapKeySC;this.generateKey=generateWrappingKeySC;break;default:this.wrapKey=wrapKeyGOST;this.unwrapKey=unwrapKeyGOST;this.generateKey=generateKey}break;case"MASK":this.wrapKey=wrapKeyMask;this.unwrapKey=unwrapKeyMask;this.generateKey=generateKey;break;default:throw new n.NotSupportedError("Mode "+e.mode+" not supported")}var t=e.sBox,r;if(!t)t=this.version===2015?f["E-Z"]:this.procreator==="SC"?f["E-SC"]:f["E-A"];else if(typeof t==="string"){r=t.toUpperCase();t=f[r];if(!t)throw new SyntaxError("Unknown sBox name: "+e.sBox)}else if(!t.length||t.length!==f["E-Z"].length)throw new SyntaxError("Length of sBox must be "+f["E-Z"].length);this.sBox=t;if(e.iv){this.iv=new Uint8Array(e.iv);if(this.iv.byteLength!==this.blockSize&&this.version===1989)throw new SyntaxError("Length of iv must be "+this.blockLength+" bits");else if(this.iv.byteLength!==this.blockSize>>1&&this.encrypt===processCTR15)throw new SyntaxError("Length of iv must be "+this.blockLength>>1+" bits");else if(this.iv.byteLength%this.blockSize!==0&&this.encrypt!==processCTR15)throw new SyntaxError("Length of iv must be a multiple of "+this.blockLength+" bits")}else this.iv=this.blockLength===128?u:s;if(e.ukm){this.ukm=new Uint8Array(e.ukm);if(this.ukm.byteLength*8!==this.blockLength)throw new SyntaxError("Length of ukm must be "+this.blockLength+" bits")}}},function(e,t,r){(function(t){var n=r(3);function withPublic(e,r){return new t(e.toRed(n.mont(r.modulus)).redPow(new n(r.publicExponent)).fromRed().toArray())}e.exports=withPublic}).call(this,r(2).Buffer)},function(e,t){e.exports=function xor(e,t){var r=e.length;var n=-1;while(++n<r){e[n]^=t[n]}return e}},function(e,t,r){(function(t){var n=r(18);e.exports=function(e,r){var i=new t("");var a=0,o;while(i.length<r){o=i2ops(a++);i=t.concat([i,n("sha1").update(e).update(o).digest()])}return i.slice(0,r)};function i2ops(e){var r=new t(4);r.writeUInt32BE(e,0);return r}}).call(this,r(2).Buffer)},function(e){e.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},function(e,t,r){var n=r(0);var i=r(2).Buffer;var a=r(14);var o=a.base;var s=a.constants.der;function DEREncoder(e){this.enc="der";this.name=e.name;this.entity=e;this.tree=new DERNode;this.tree._init(e.body)}e.exports=DEREncoder;DEREncoder.prototype.encode=function encode(e,t){return this.tree._encode(e,t).join()};function DERNode(e){o.Node.call(this,"der",e)}n(DERNode,o.Node);DERNode.prototype._encodeComposite=function encodeComposite(e,t,r,n){var a=encodeTag(e,t,r,this.reporter);if(n.length<128){var o=new i(2);o[0]=a;o[1]=n.length;return this._createEncoderBuffer([o,n])}var s=1;for(var f=n.length;f>=256;f>>=8)s++;var o=new i(1+1+s);o[0]=a;o[1]=128|s;for(var f=1+s,c=n.length;c>0;f--,c>>=8)o[f]=c&255;return this._createEncoderBuffer([o,n])};DERNode.prototype._encodeStr=function encodeStr(e,t){if(t==="bitstr"){return this._createEncoderBuffer([e.unused|0,e.data])}else if(t==="bmpstr"){var r=new i(e.length*2);for(var n=0;n<e.length;n++){r.writeUInt16BE(e.charCodeAt(n),n*2)}return this._createEncoderBuffer(r)}else if(t==="numstr"){if(!this._isNumstr(e)){return this.reporter.error("Encoding of string type: numstr supports "+"only digits and space")}return this._createEncoderBuffer(e)}else if(t==="printstr"){if(!this._isPrintstr(e)){return this.reporter.error("Encoding of string type: printstr supports "+"only latin upper and lower case letters, "+"digits, space, apostrophe, left and rigth "+"parenthesis, plus sign, comma, hyphen, "+"dot, slash, colon, equal sign, "+"question mark")}return this._createEncoderBuffer(e)}else if(/str$/.test(t)){return this._createEncoderBuffer(e)}else if(t==="objDesc"){return this._createEncoderBuffer(e)}else{return this.reporter.error("Encoding of string type: "+t+" unsupported")}};DERNode.prototype._encodeObjid=function encodeObjid(e,t,r){if(typeof e==="string"){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s\.]+/g);for(var n=0;n<e.length;n++)e[n]|=0}else if(Array.isArray(e)){e=e.slice();for(var n=0;n<e.length;n++)e[n]|=0}if(!Array.isArray(e)){return this.reporter.error("objid() should be either array or string, "+"got: "+JSON.stringify(e))}if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}var a=0;for(var n=0;n<e.length;n++){var o=e[n];for(a++;o>=128;o>>=7)a++}var s=new i(a);var f=s.length-1;for(var n=e.length-1;n>=0;n--){var o=e[n];s[f--]=o&127;while((o>>=7)>0)s[f--]=128|o&127}return this._createEncoderBuffer(s)};function two(e){if(e<10)return"0"+e;else return e}DERNode.prototype._encodeTime=function encodeTime(e,t){var r;var n=new Date(e);if(t==="gentime"){r=[two(n.getFullYear()),two(n.getUTCMonth()+1),two(n.getUTCDate()),two(n.getUTCHours()),two(n.getUTCMinutes()),two(n.getUTCSeconds()),"Z"].join("")}else if(t==="utctime"){r=[two(n.getFullYear()%100),two(n.getUTCMonth()+1),two(n.getUTCDate()),two(n.getUTCHours()),two(n.getUTCMinutes()),two(n.getUTCSeconds()),"Z"].join("")}else{this.reporter.error("Encoding "+t+" time is not supported yet")}return this._encodeStr(r,"octstr")};DERNode.prototype._encodeNull=function encodeNull(){return this._createEncoderBuffer("")};DERNode.prototype._encodeInt=function encodeInt(e,t){if(typeof e==="string"){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e)){return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e))}e=t[e]}if(typeof e!=="number"&&!i.isBuffer(e)){var r=e.toArray();if(!e.sign&&r[0]&128){r.unshift(0)}e=new i(r)}if(i.isBuffer(e)){var n=e.length;if(e.length===0)n++;var a=new i(n);e.copy(a);if(e.length===0)a[0]=0;return this._createEncoderBuffer(a)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);var n=1;for(var o=e;o>=256;o>>=8)n++;var a=new Array(n);for(var o=a.length-1;o>=0;o--){a[o]=e&255;e>>=8}if(a[0]&128){a.unshift(0)}return this._createEncoderBuffer(new i(a))};DERNode.prototype._encodeBool=function encodeBool(e){return this._createEncoderBuffer(e?255:0)};DERNode.prototype._use=function use(e,t){if(typeof e==="function")e=e(t);return e._getEncoder("der").tree};DERNode.prototype._skipDefault=function skipDefault(e,t,r){var n=this._baseState;var i;if(n["default"]===null)return false;var a=e.join();if(n.defaultBuffer===undefined)n.defaultBuffer=this._encodeValue(n["default"],t,r).join();if(a.length!==n.defaultBuffer.length)return false;for(i=0;i<a.length;i++)if(a[i]!==n.defaultBuffer[i])return false;return true};function encodeTag(e,t,r,n){var i;if(e==="seqof")e="seq";else if(e==="setof")e="set";if(s.tagByName.hasOwnProperty(e))i=s.tagByName[e];else if(typeof e==="number"&&(e|0)===e)i=e;else return n.error("Unknown tag: "+e);if(i>=31)return n.error("Multi-octet tag encoding unsupported");if(!t)i|=32;i|=s.tagClassByName[r||"universal"]<<6;return i}},function(e,t,r){var n=r(0);var i=r(14);var a=i.base;var o=i.bignum;var s=i.constants.der;function DERDecoder(e){this.enc="der";this.name=e.name;this.entity=e;this.tree=new DERNode;this.tree._init(e.body)}e.exports=DERDecoder;DERDecoder.prototype.decode=function decode(e,t){if(!(e instanceof a.DecoderBuffer))e=new a.DecoderBuffer(e,t);return this.tree._decode(e,t)};function DERNode(e){a.Node.call(this,"der",e)}n(DERNode,a.Node);DERNode.prototype._peekTag=function peekTag(e,t,r){if(e.isEmpty())return false;var n=e.save();var i=derDecodeTag(e,'Failed to peek tag: "'+t+'"');if(e.isError(i))return i;e.restore(n);return i.tag===t||i.tagStr===t||i.tagStr+"of"===t||r};DERNode.prototype._decodeTag=function decodeTag(e,t,r){var n=derDecodeTag(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;var i=derDecodeLen(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(i))return i;if(!r&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t){return e.error('Failed to match tag: "'+t+'"')}if(n.primitive||i!==null)return e.skip(i,'Failed to match body of: "'+t+'"');var a=e.save();var o=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');if(e.isError(o))return o;i=e.offset-a.offset;e.restore(a);return e.skip(i,'Failed to match body of: "'+t+'"')};DERNode.prototype._skipUntilEnd=function skipUntilEnd(e,t){while(true){var r=derDecodeTag(e,t);if(e.isError(r))return r;var n=derDecodeLen(e,r.primitive,t);if(e.isError(n))return n;var i;if(r.primitive||n!==null)i=e.skip(n);else i=this._skipUntilEnd(e,t);if(e.isError(i))return i;if(r.tagStr==="end")break}};DERNode.prototype._decodeList=function decodeList(e,t,r,n){var i=[];while(!e.isEmpty()){var a=this._peekTag(e,"end");if(e.isError(a))return a;var o=r.decode(e,"der",n);if(e.isError(o)&&a)break;i.push(o)}return i};DERNode.prototype._decodeStr=function decodeStr(e,t){if(t==="bitstr"){var r=e.readUInt8();if(e.isError(r))return r;return{unused:r,data:e.raw()}}else if(t==="bmpstr"){var n=e.raw();if(n.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");var i="";for(var a=0;a<n.length/2;a++){i+=String.fromCharCode(n.readUInt16BE(a*2))}return i}else if(t==="numstr"){var o=e.raw().toString("ascii");if(!this._isNumstr(o)){return e.error("Decoding of string type: "+"numstr unsupported characters")}return o}else if(t==="octstr"){return e.raw()}else if(t==="objDesc"){return e.raw()}else if(t==="printstr"){var s=e.raw().toString("ascii");if(!this._isPrintstr(s)){return e.error("Decoding of string type: "+"printstr unsupported characters")}return s}else if(/str$/.test(t)){return e.raw().toString()}else{return e.error("Decoding of string type: "+t+" unsupported")}};DERNode.prototype._decodeObjid=function decodeObjid(e,t,r){var n;var i=[];var a=0;while(!e.isEmpty()){var o=e.readUInt8();a<<=7;a|=o&127;if((o&128)===0){i.push(a);a=0}}if(o&128)i.push(a);var s=i[0]/40|0;var f=i[0]%40;if(r)n=i;else n=[s,f].concat(i.slice(1));if(t){var c=t[n.join(" ")];if(c===undefined)c=t[n.join(".")];if(c!==undefined)n=c}return n};DERNode.prototype._decodeTime=function decodeTime(e,t){var r=e.raw().toString();if(t==="gentime"){var n=r.slice(0,4)|0;var i=r.slice(4,6)|0;var a=r.slice(6,8)|0;var o=r.slice(8,10)|0;var s=r.slice(10,12)|0;var f=r.slice(12,14)|0}else if(t==="utctime"){var n=r.slice(0,2)|0;var i=r.slice(2,4)|0;var a=r.slice(4,6)|0;var o=r.slice(6,8)|0;var s=r.slice(8,10)|0;var f=r.slice(10,12)|0;if(n<70)n=2e3+n;else n=1900+n}else{return e.error("Decoding "+t+" time is not supported yet")}return Date.UTC(n,i-1,a,o,s,f,0)};DERNode.prototype._decodeNull=function decodeNull(e){return null};DERNode.prototype._decodeBool=function decodeBool(e){var t=e.readUInt8();if(e.isError(t))return t;else return t!==0};DERNode.prototype._decodeInt=function decodeInt(e,t){var r=e.raw();var n=new o(r);if(t)n=t[n.toString(10)]||n;return n};DERNode.prototype._use=function use(e,t){if(typeof e==="function")e=e(t);return e._getDecoder("der").tree};function derDecodeTag(e,t){var r=e.readUInt8(t);if(e.isError(r))return r;var n=s.tagClass[r>>6];var i=(r&32)===0;if((r&31)===31){var a=r;r=0;while((a&128)===128){a=e.readUInt8(t);if(e.isError(a))return a;r<<=7;r|=a&127}}else{r&=31}var o=s.tag[r];return{cls:n,primitive:i,tag:r,tagStr:o}}function derDecodeLen(e,t,r){var n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&n===128)return null;if((n&128)===0){return n}var i=n&127;if(i>4)return e.error("length octect is too long");n=0;for(var a=0;a<i;a++){n<<=8;var o=e.readUInt8(r);if(e.isError(o))return o;n|=o}return n}},function(e,t,r){var n=t;n._reverse=function reverse(e){var t={};Object.keys(e).forEach(function(r){if((r|0)==r)r=r|0;var n=e[r];t[n]=r});return t};n.der=r(97)},function(e,t,r){var n=r(0);var i=r(13).Reporter;var a=r(2).Buffer;function DecoderBuffer(e,t){i.call(this,t);if(!a.isBuffer(e)){this.error("Input not Buffer");return}this.base=e;this.offset=0;this.length=e.length}n(DecoderBuffer,i);t.DecoderBuffer=DecoderBuffer;DecoderBuffer.prototype.save=function save(){return{offset:this.offset,reporter:i.prototype.save.call(this)}};DecoderBuffer.prototype.restore=function restore(e){var t=new DecoderBuffer(this.base);t.offset=e.offset;t.length=this.offset;this.offset=e.offset;i.prototype.restore.call(this,e.reporter);return t};DecoderBuffer.prototype.isEmpty=function isEmpty(){return this.offset===this.length};DecoderBuffer.prototype.readUInt8=function readUInt8(e){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,true);else return this.error(e||"DecoderBuffer overrun")};DecoderBuffer.prototype.skip=function skip(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new DecoderBuffer(this.base);r._reporterState=this._reporterState;r.offset=this.offset;r.length=this.offset+e;this.offset+=e;return r};DecoderBuffer.prototype.raw=function raw(e){return this.base.slice(e?e.offset:this.offset,this.length)};function EncoderBuffer(e,t){if(Array.isArray(e)){this.length=0;this.value=e.map(function(e){if(!(e instanceof EncoderBuffer))e=new EncoderBuffer(e,t);this.length+=e.length;return e},this)}else if(typeof e==="number"){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e;this.length=1}else if(typeof e==="string"){this.value=e;this.length=a.byteLength(e)}else if(a.isBuffer(e)){this.value=e;this.length=e.length}else{return t.error("Unsupported type: "+typeof e)}}t.EncoderBuffer=EncoderBuffer;EncoderBuffer.prototype.join=function join(e,t){if(!e)e=new a(this.length);if(!t)t=0;if(this.length===0)return e;if(Array.isArray(this.value)){this.value.forEach(function(r){r.join(e,t);t+=r.length})}else{if(typeof this.value==="number")e[t]=this.value;else if(typeof this.value==="string")e.write(this.value,t);else if(a.isBuffer(this.value))this.value.copy(e,t);t+=this.length}return e}},function(e,t,r){"use strict";var n=r(6);var i=r(15);var a=r(5);var o=n.rotr64_hi;var s=n.rotr64_lo;var f=n.shr64_hi;var c=n.shr64_lo;var u=n.sum64;var d=n.sum64_hi;var h=n.sum64_lo;var l=n.sum64_4_hi;var p=n.sum64_4_lo;var v=n.sum64_5_hi;var y=n.sum64_5_lo;var b=i.BlockHash;var m=[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];function SHA512(){if(!(this instanceof SHA512))return new SHA512;b.call(this);this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209];this.k=m;this.W=new Array(160)}n.inherits(SHA512,b);e.exports=SHA512;SHA512.blockSize=1024;SHA512.outSize=512;SHA512.hmacStrength=192;SHA512.padLength=128;SHA512.prototype._prepareBlock=function _prepareBlock(e,t){var r=this.W;for(var n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=g1_512_hi(r[n-4],r[n-3]);var a=g1_512_lo(r[n-4],r[n-3]);var o=r[n-14];var s=r[n-13];var f=g0_512_hi(r[n-30],r[n-29]);var c=g0_512_lo(r[n-30],r[n-29]);var u=r[n-32];var d=r[n-31];r[n]=l(i,a,o,s,f,c,u,d);r[n+1]=p(i,a,o,s,f,c,u,d)}};SHA512.prototype._update=function _update(e,t){this._prepareBlock(e,t);var r=this.W;var n=this.h[0];var i=this.h[1];var o=this.h[2];var s=this.h[3];var f=this.h[4];var c=this.h[5];var l=this.h[6];var p=this.h[7];var b=this.h[8];var m=this.h[9];var g=this.h[10];var w=this.h[11];var C=this.h[12];var S=this.h[13];var A=this.h[14];var E=this.h[15];a(this.k.length===r.length);for(var B=0;B<r.length;B+=2){var _=A;var P=E;var F=s1_512_hi(b,m);var k=s1_512_lo(b,m);var D=ch64_hi(b,m,g,w,C,S);var I=ch64_lo(b,m,g,w,C,S);var x=this.k[B];var M=this.k[B+1];var K=r[B];var R=r[B+1];var T=v(_,P,F,k,D,I,x,M,K,R);var N=y(_,P,F,k,D,I,x,M,K,R);_=s0_512_hi(n,i);P=s0_512_lo(n,i);F=maj64_hi(n,i,o,s,f,c);k=maj64_lo(n,i,o,s,f,c);var U=d(_,P,F,k);var O=h(_,P,F,k);A=C;E=S;C=g;S=w;g=b;w=m;b=d(l,p,T,N);m=h(p,p,T,N);l=f;p=c;f=o;c=s;o=n;s=i;n=d(T,N,U,O);i=h(T,N,U,O)}u(this.h,0,n,i);u(this.h,2,o,s);u(this.h,4,f,c);u(this.h,6,l,p);u(this.h,8,b,m);u(this.h,10,g,w);u(this.h,12,C,S);u(this.h,14,A,E)};SHA512.prototype._digest=function digest(e){if(e==="hex")return n.toHex32(this.h,"big");else return n.split32(this.h,"big")};function ch64_hi(e,t,r,n,i){var a=e&r^~e&i;if(a<0)a+=4294967296;return a}function ch64_lo(e,t,r,n,i,a){var o=t&n^~t&a;if(o<0)o+=4294967296;return o}function maj64_hi(e,t,r,n,i){var a=e&r^e&i^r&i;if(a<0)a+=4294967296;return a}function maj64_lo(e,t,r,n,i,a){var o=t&n^t&a^n&a;if(o<0)o+=4294967296;return o}function s0_512_hi(e,t){var r=o(e,t,28);var n=o(t,e,2);var i=o(t,e,7);var a=r^n^i;if(a<0)a+=4294967296;return a}function s0_512_lo(e,t){var r=s(e,t,28);var n=s(t,e,2);var i=s(t,e,7);var a=r^n^i;if(a<0)a+=4294967296;return a}function s1_512_hi(e,t){var r=o(e,t,14);var n=o(e,t,18);var i=o(t,e,9);var a=r^n^i;if(a<0)a+=4294967296;return a}function s1_512_lo(e,t){var r=s(e,t,14);var n=s(e,t,18);var i=s(t,e,9);var a=r^n^i;if(a<0)a+=4294967296;return a}function g0_512_hi(e,t){var r=o(e,t,1);var n=o(e,t,8);var i=f(e,t,7);var a=r^n^i;if(a<0)a+=4294967296;return a}function g0_512_lo(e,t){var r=s(e,t,1);var n=s(e,t,8);var i=c(e,t,7);var a=r^n^i;if(a<0)a+=4294967296;return a}function g1_512_hi(e,t){var r=o(e,t,19);var n=o(t,e,29);var i=f(e,t,6);var a=r^n^i;if(a<0)a+=4294967296;return a}function g1_512_lo(e,t){var r=s(e,t,19);var n=s(t,e,29);var i=c(e,t,6);var a=r^n^i;if(a<0)a+=4294967296;return a}},function(e,t,r){"use strict";var n=r(6);var i=r(15);var a=r(52);var o=r(5);var s=n.sum32;var f=n.sum32_4;var c=n.sum32_5;var u=a.ch32;var d=a.maj32;var h=a.s0_256;var l=a.s1_256;var p=a.g0_256;var v=a.g1_256;var y=i.BlockHash;var b=[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];function SHA256(){if(!(this instanceof SHA256))return new SHA256;y.call(this);this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];this.k=b;this.W=new Array(64)}n.inherits(SHA256,y);e.exports=SHA256;SHA256.blockSize=512;SHA256.outSize=256;SHA256.hmacStrength=192;SHA256.padLength=64;SHA256.prototype._update=function _update(e,t){var r=this.W;for(var n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=f(v(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0];var a=this.h[1];var y=this.h[2];var b=this.h[3];var m=this.h[4];var g=this.h[5];var w=this.h[6];var C=this.h[7];o(this.k.length===r.length);for(n=0;n<r.length;n++){var S=c(C,l(m),u(m,g,w),this.k[n],r[n]);var A=s(h(i),d(i,a,y));C=w;w=g;g=m;m=s(b,S);b=y;y=a;a=i;i=s(S,A)}this.h[0]=s(this.h[0],i);this.h[1]=s(this.h[1],a);this.h[2]=s(this.h[2],y);this.h[3]=s(this.h[3],b);this.h[4]=s(this.h[4],m);this.h[5]=s(this.h[5],g);this.h[6]=s(this.h[6],w);this.h[7]=s(this.h[7],C)};SHA256.prototype._digest=function digest(e){if(e==="hex")return n.toHex32(this.h,"big");else return n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(6);var i=n.rotr32;function ft_1(e,t,r,n){if(e===0)return ch32(t,r,n);if(e===1||e===3)return p32(t,r,n);if(e===2)return maj32(t,r,n)}t.ft_1=ft_1;function ch32(e,t,r){return e&t^~e&r}t.ch32=ch32;function maj32(e,t,r){return e&t^e&r^t&r}t.maj32=maj32;function p32(e,t,r){return e^t^r}t.p32=p32;function s0_256(e){return i(e,2)^i(e,13)^i(e,22)}t.s0_256=s0_256;function s1_256(e){return i(e,6)^i(e,11)^i(e,25)}t.s1_256=s1_256;function g0_256(e){return i(e,7)^i(e,18)^e>>>3}t.g0_256=g0_256;function g1_256(e){return i(e,17)^i(e,19)^e>>>10}t.g1_256=g1_256},function(e,t,r){"use strict";var n=t;function toArray(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if(typeof e!=="string"){for(var n=0;n<e.length;n++)r[n]=e[n]|0;return r}if(t==="hex"){e=e.replace(/[^a-z0-9]+/gi,"");if(e.length%2!==0)e="0"+e;for(var n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else{for(var n=0;n<e.length;n++){var i=e.charCodeAt(n);var a=i>>8;var o=i&255;if(a)r.push(a,o);else r.push(o)}}return r}n.toArray=toArray;function zero2(e){if(e.length===1)return"0"+e;else return e}n.zero2=zero2;function toHex(e){var t="";for(var r=0;r<e.length;r++)t+=zero2(e[r].toString(16));return t}n.toHex=toHex;n.encode=function encode(e,t){if(t==="hex")return toHex(e);else return e}},function(e,t,r){var n;e.exports=function rand(e){if(!n)n=new Rand(null);return n.generate(e)};function Rand(e){this.rand=e}e.exports.Rand=Rand;Rand.prototype.generate=function generate(e){return this._rand(e)};Rand.prototype._rand=function _rand(e){if(this.rand.getBytes)return this.rand.getBytes(e);var t=new Uint8Array(e);for(var r=0;r<t.length;r++)t[r]=this.rand.getByte();return t};if(typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues){Rand.prototype._rand=function _rand(e){var t=new Uint8Array(e);self.crypto.getRandomValues(t);return t}}else if(self.msCrypto&&self.msCrypto.getRandomValues){Rand.prototype._rand=function _rand(e){var t=new Uint8Array(e);self.msCrypto.getRandomValues(t);return t}}else if(typeof window==="object"){Rand.prototype._rand=function(){throw new Error("Not implemented yet")}}}else{try{var i=r(129);if(typeof i.randomBytes!=="function")throw new Error("Not supported");Rand.prototype._rand=function _rand(e){return i.randomBytes(e)}}catch(e){}}},function(e,t,r){var n=r(3);var i=r(54);function MillerRabin(e){this.rand=e||new i.Rand}e.exports=MillerRabin;MillerRabin.create=function create(e){return new MillerRabin(e)};MillerRabin.prototype._randbelow=function _randbelow(e){var t=e.bitLength();var r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i};MillerRabin.prototype._randrange=function _randrange(e,t){var r=t.sub(e);return e.add(this._randbelow(r))};MillerRabin.prototype.test=function test(e,t,r){var i=e.bitLength();var a=n.mont(e);var o=new n(1).toRed(a);if(!t)t=Math.max(1,i/48|0);var s=e.subn(1);for(var f=0;!s.testn(f);f++){}var c=e.shrn(f);var u=s.toRed(a);var d=true;for(;t>0;t--){var h=this._randrange(new n(2),s);if(r)r(h);var l=h.toRed(a).redPow(c);if(l.cmp(o)===0||l.cmp(u)===0)continue;for(var p=1;p<f;p++){l=l.redSqr();if(l.cmp(o)===0)return false;if(l.cmp(u)===0)break}if(p===f)return false}return d};MillerRabin.prototype.getDivisor=function getDivisor(e,t){var r=e.bitLength();var i=n.mont(e);var a=new n(1).toRed(i);if(!t)t=Math.max(1,r/48|0);var o=e.subn(1);for(var s=0;!o.testn(s);s++){}var f=e.shrn(s);var c=o.toRed(i);for(;t>0;t--){var u=this._randrange(new n(2),o);var d=e.gcd(u);if(d.cmpn(1)!==0)return d;var h=u.toRed(i).redPow(f);if(h.cmp(a)===0||h.cmp(c)===0)continue;for(var l=1;l<s;l++){h=h.redSqr();if(h.cmp(a)===0)return h.fromRed().subn(1).gcd(e);if(h.cmp(c)===0)break}if(l===s){h=h.redSqr();return h.fromRed().subn(1).gcd(e)}}return false}},function(e,t,r){var n=r(12);e.exports=findPrime;findPrime.simpleSieve=simpleSieve;findPrime.fermatTest=fermatTest;var i=r(3);var a=new i(24);var o=r(55);var s=new o;var f=new i(1);var c=new i(2);var u=new i(5);var d=new i(16);var h=new i(8);var l=new i(10);var p=new i(3);var v=new i(7);var y=new i(11);var b=new i(4);var m=new i(12);var g=null;function _getPrimes(){if(g!==null)return g;var e=1048576;var t=[];t[0]=2;for(var r=1,n=3;n<e;n+=2){var i=Math.ceil(Math.sqrt(n));for(var a=0;a<r&&t[a]<=i;a++)if(n%t[a]===0)break;if(r!==a&&t[a]<=i)continue;t[r++]=n}g=t;return t}function simpleSieve(e){var t=_getPrimes();for(var r=0;r<t.length;r++)if(e.modn(t[r])===0){if(e.cmpn(t[r])===0){return true}else{return false}}return true}function fermatTest(e){var t=i.mont(e);return c.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)===0}function findPrime(e,t){if(e<16){if(t===2||t===5){return new i([140,123])}else{return new i([140,39])}}t=new i(t);var r,o;while(true){r=new i(n(Math.ceil(e/8)));while(r.bitLength()>e){r.ishrn(1)}if(r.isEven()){r.iadd(f)}if(!r.testn(1)){r.iadd(c)}if(!t.cmp(c)){while(r.mod(a).cmp(y)){r.iadd(b)}}else if(!t.cmp(u)){while(r.mod(l).cmp(p)){r.iadd(b)}}o=r.shrn(1);if(simpleSieve(o)&&simpleSieve(r)&&fermatTest(o)&&fermatTest(r)&&s.test(o)&&s.test(r)){return r}}}},function(e,t,r){var n=r(23);var i=r(1).Buffer;var a=r(8);var o=r(0);function StreamCipher(e,t,r,o){a.call(this);this._cipher=new n.AES(t);this._prev=i.from(r);this._cache=i.allocUnsafe(0);this._secCache=i.allocUnsafe(0);this._decrypt=o;this._mode=e}o(StreamCipher,a);StreamCipher.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)};StreamCipher.prototype._final=function(){this._cipher.scrub()};e.exports=StreamCipher},function(e,t,r){var n=r(23);var i=r(1).Buffer;var a=r(8);var o=r(0);var s=r(135);var f=r(16);var c=r(60);function xorTest(e,t){var r=0;if(e.length!==t.length)r++;var n=Math.min(e.length,t.length);for(var i=0;i<n;++i){r+=e[i]^t[i]}return r}function calcIv(e,t,r){if(t.length===12){e._finID=i.concat([t,i.from([0,0,0,1])]);return i.concat([t,i.from([0,0,0,2])])}var n=new s(r);var a=t.length;var o=a%16;n.update(t);if(o){o=16-o;n.update(i.alloc(o,0))}n.update(i.alloc(8,0));var f=a*8;var u=i.alloc(8);u.writeUIntBE(f,0,8);n.update(u);e._finID=n.state;var d=i.from(e._finID);c(d);return d}function StreamCipher(e,t,r,o){a.call(this);var f=i.alloc(4,0);this._cipher=new n.AES(t);var c=this._cipher.encryptBlock(f);this._ghash=new s(c);r=calcIv(this,r,c);this._prev=i.from(r);this._cache=i.allocUnsafe(0);this._secCache=i.allocUnsafe(0);this._decrypt=o;this._alen=0;this._len=0;this._mode=e;this._authTag=null;this._called=false}o(StreamCipher,a);StreamCipher.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;if(t<16){t=i.alloc(t,0);this._ghash.update(t)}}this._called=true;var r=this._mode.encrypt(this,e);if(this._decrypt){this._ghash.update(e)}else{this._ghash.update(r)}this._len+=e.length;return r};StreamCipher.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=f(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&xorTest(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e;this._cipher.scrub()};StreamCipher.prototype.getAuthTag=function getAuthTag(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag};StreamCipher.prototype.setAuthTag=function setAuthTag(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e};StreamCipher.prototype.setAAD=function setAAD(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e);this._alen+=e.length};e.exports=StreamCipher},function(e){e.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}},function(e,t){function incr32(e){var t=e.length;var r;while(t--){r=e.readUInt8(t);if(r===255){e.writeUInt8(0,t)}else{r++;e.writeUInt8(r,t);break}}}e.exports=incr32},function(e,t,r){var n=r(16);var i=r(1).Buffer;var a=r(60);function getBlock(e){var t=e._cipher.encryptBlockRaw(e._prev);a(e._prev);return t}var o=16;t.encrypt=function(e,t){var r=Math.ceil(t.length/o);var a=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(r*o)]);for(var s=0;s<r;s++){var f=getBlock(e);var c=a+s*o;e._cache.writeUInt32BE(f[0],c+0);e._cache.writeUInt32BE(f[1],c+4);e._cache.writeUInt32BE(f[2],c+8);e._cache.writeUInt32BE(f[3],c+12)}var u=e._cache.slice(0,t.length);e._cache=e._cache.slice(t.length);return n(t,u)}},function(e,t,r){var n=r(67);var i=r(32);var a=r(31);var o=r(64);var s=r(63);var f=r(1).Buffer;var c=f.alloc(128);var u={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function Hmac(e,t,r){var n=getDigest(e);var i=e==="sha512"||e==="sha384"?128:64;if(t.length>i){t=n(t)}else if(t.length<i){t=f.concat([t,c],i)}var a=f.allocUnsafe(i+u[e]);var o=f.allocUnsafe(i+u[e]);for(var s=0;s<i;s++){a[s]=t[s]^54;o[s]=t[s]^92}var d=f.allocUnsafe(i+r+4);a.copy(d,0,0,i);this.ipad1=d;this.ipad2=a;this.opad=o;this.alg=e;this.blocksize=i;this.hash=n;this.size=u[e]}Hmac.prototype.run=function(e,t){e.copy(t,this.blocksize);var r=this.hash(t);r.copy(this.opad,this.blocksize);return this.hash(this.opad)};function getDigest(e){function shaFunc(t){return a(e).update(t).digest()}if(e==="rmd160"||e==="ripemd160")return i;if(e==="md5")return n;return shaFunc}function pbkdf2(e,t,r,n,i){o(e,t,r,n);if(!f.isBuffer(e))e=f.from(e,s);if(!f.isBuffer(t))t=f.from(t,s);i=i||"sha1";var a=new Hmac(i,e,t.length);var c=f.allocUnsafe(n);var d=f.allocUnsafe(t.length+4);t.copy(d,0,0,t.length);var h=0;var l=u[i];var p=Math.ceil(n/l);for(var v=1;v<=p;v++){d.writeUInt32BE(v,t.length);var y=a.run(d,a.ipad1);var b=y;for(var m=1;m<r;m++){b=a.run(b,a.ipad2);for(var g=0;g<l;g++)y[g]^=b[g]}y.copy(c,h);h+=l}return c}e.exports=pbkdf2},function(e,t,r){(function(t){var r;if(t.browser){r="utf-8"}else{var n=parseInt(t.version.split(".")[0].slice(1),10);r=n>=6?"utf-8":"binary"}e.exports=r}).call(this,r(9))},function(e,t,r){(function(t){var r=Math.pow(2,30)-1;function checkBuffer(e,r){if(typeof e!=="string"&&!t.isBuffer(e)){throw new TypeError(r+" must be a buffer or string")}}e.exports=function(e,t,n,i){checkBuffer(e,"Password");checkBuffer(t,"Salt");if(typeof n!=="number"){throw new TypeError("Iterations not a number")}if(n<0){throw new TypeError("Bad iterations")}if(typeof i!=="number"){throw new TypeError("Key length not a number")}if(i<0||i>r||i!==i){throw new TypeError("Bad key length")}}}).call(this,r(2).Buffer)},function(e,t,r){t.pbkdf2=r(150);t.pbkdf2Sync=r(62)},function(e){e.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},function(e,t,r){var n=r(38);e.exports=function(e){return(new n).update(e).digest()}},function(e,t,r){"use strict";var n=r(0);var i=r(152);var a=r(8);var o=r(1).Buffer;var s=r(67);var f=r(32);var c=r(31);var u=o.alloc(128);function Hmac(e,t){a.call(this,"digest");if(typeof t==="string"){t=o.from(t)}var r=e==="sha512"||e==="sha384"?128:64;this._alg=e;this._key=t;if(t.length>r){var n=e==="rmd160"?new f:c(e);t=n.update(t).digest()}else if(t.length<r){t=o.concat([t,u],r)}var i=this._ipad=o.allocUnsafe(r);var s=this._opad=o.allocUnsafe(r);for(var d=0;d<r;d++){i[d]=t[d]^54;s[d]=t[d]^92}this._hash=e==="rmd160"?new f:c(e);this._hash.update(i)}n(Hmac,a);Hmac.prototype._update=function(e){this._hash.update(e)};Hmac.prototype._final=function(){var e=this._hash.digest();var t=this._alg==="rmd160"?new f:c(this._alg);return t.update(this._opad).update(e).digest()};e.exports=function createHmac(e,t){e=e.toLowerCase();if(e==="rmd160"||e==="ripemd160"){return new Hmac("rmd160",t)}if(e==="md5"){return new i(s,t)}return new Hmac(e,t)}},function(e,t,r){var n=r(0);var i=r(11);var a=r(1).Buffer;var o=[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];var s=new Array(160);function Sha512(){this.init();this._w=s;i.call(this,128,112)}n(Sha512,i);Sha512.prototype.init=function(){this._ah=1779033703;this._bh=3144134277;this._ch=1013904242;this._dh=2773480762;this._eh=1359893119;this._fh=2600822924;this._gh=528734635;this._hh=1541459225;this._al=4089235720;this._bl=2227873595;this._cl=4271175723;this._dl=1595750129;this._el=2917565137;this._fl=725511199;this._gl=4215389547;this._hl=327033209;return this};function Ch(e,t,r){return r^e&(t^r)}function maj(e,t,r){return e&t|r&(e|t)}function sigma0(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function sigma1(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function Gamma0(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function Gamma0l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function Gamma1(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Gamma1l(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function getCarry(e,t){return e>>>0<t>>>0?1:0}Sha512.prototype._update=function(e){var t=this._w;var r=this._ah|0;var n=this._bh|0;var i=this._ch|0;var a=this._dh|0;var s=this._eh|0;var f=this._fh|0;var c=this._gh|0;var u=this._hh|0;var d=this._al|0;var h=this._bl|0;var l=this._cl|0;var p=this._dl|0;var v=this._el|0;var y=this._fl|0;var b=this._gl|0;var m=this._hl|0;for(var g=0;g<32;g+=2){t[g]=e.readInt32BE(g*4);t[g+1]=e.readInt32BE(g*4+4)}for(;g<160;g+=2){var w=t[g-15*2];var C=t[g-15*2+1];var S=Gamma0(w,C);var A=Gamma0l(C,w);w=t[g-2*2];C=t[g-2*2+1];var E=Gamma1(w,C);var B=Gamma1l(C,w);var _=t[g-7*2];var P=t[g-7*2+1];var F=t[g-16*2];var k=t[g-16*2+1];var D=A+P|0;var I=S+_+getCarry(D,A)|0;D=D+B|0;I=I+E+getCarry(D,B)|0;D=D+k|0;I=I+F+getCarry(D,k)|0;t[g]=I;t[g+1]=D}for(var x=0;x<160;x+=2){I=t[x];D=t[x+1];var M=maj(r,n,i);var K=maj(d,h,l);var R=sigma0(r,d);var T=sigma0(d,r);var N=sigma1(s,v);var U=sigma1(v,s);var O=o[x];var G=o[x+1];var j=Ch(s,f,c);var L=Ch(v,y,b);var H=m+U|0;var q=u+N+getCarry(H,m)|0;H=H+L|0;q=q+j+getCarry(H,L)|0;H=H+G|0;q=q+O+getCarry(H,G)|0;H=H+D|0;q=q+I+getCarry(H,D)|0;var z=T+K|0;var W=R+M+getCarry(z,T)|0;u=c;m=b;c=f;b=y;f=s;y=v;v=p+H|0;s=a+q+getCarry(v,p)|0;a=i;p=l;i=n;l=h;n=r;h=d;d=H+z|0;r=q+W+getCarry(d,H)|0}this._al=this._al+d|0;this._bl=this._bl+h|0;this._cl=this._cl+l|0;this._dl=this._dl+p|0;this._el=this._el+v|0;this._fl=this._fl+y|0;this._gl=this._gl+b|0;this._hl=this._hl+m|0;this._ah=this._ah+r+getCarry(this._al,d)|0;this._bh=this._bh+n+getCarry(this._bl,h)|0;this._ch=this._ch+i+getCarry(this._cl,l)|0;this._dh=this._dh+a+getCarry(this._dl,p)|0;this._eh=this._eh+s+getCarry(this._el,v)|0;this._fh=this._fh+f+getCarry(this._fl,y)|0;this._gh=this._gh+c+getCarry(this._gl,b)|0;this._hh=this._hh+u+getCarry(this._hl,m)|0};Sha512.prototype._hash=function(){var e=a.allocUnsafe(64);function writeInt64BE(t,r,n){e.writeInt32BE(t,n);e.writeInt32BE(r,n+4)}writeInt64BE(this._ah,this._al,0);writeInt64BE(this._bh,this._bl,8);writeInt64BE(this._ch,this._cl,16);writeInt64BE(this._dh,this._dl,24);writeInt64BE(this._eh,this._el,32);writeInt64BE(this._fh,this._fl,40);writeInt64BE(this._gh,this._gl,48);writeInt64BE(this._hh,this._hl,56);return e};e.exports=Sha512},function(e,t,r){var n=r(0);var i=r(11);var a=r(1).Buffer;var o=[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];var s=new Array(64);function Sha256(){this.init();this._w=s;i.call(this,64,56)}n(Sha256,i);Sha256.prototype.init=function(){this._a=1779033703;this._b=3144134277;this._c=1013904242;this._d=2773480762;this._e=1359893119;this._f=2600822924;this._g=528734635;this._h=1541459225;return this};function ch(e,t,r){return r^e&(t^r)}function maj(e,t,r){return e&t|r&(e|t)}function sigma0(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function sigma1(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function gamma0(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function gamma1(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Sha256.prototype._update=function(e){var t=this._w;var r=this._a|0;var n=this._b|0;var i=this._c|0;var a=this._d|0;var s=this._e|0;var f=this._f|0;var c=this._g|0;var u=this._h|0;for(var d=0;d<16;++d)t[d]=e.readInt32BE(d*4);for(;d<64;++d)t[d]=gamma1(t[d-2])+t[d-7]+gamma0(t[d-15])+t[d-16]|0;for(var h=0;h<64;++h){var l=u+sigma1(s)+ch(s,f,c)+o[h]+t[h]|0;var p=sigma0(r)+maj(r,n,i)|0;u=c;c=f;f=s;s=a+l|0;a=i;i=n;n=r;r=l+p|0}this._a=r+this._a|0;this._b=n+this._b|0;this._c=i+this._c|0;this._d=a+this._d|0;this._e=s+this._e|0;this._f=f+this._f|0;this._g=c+this._g|0;this._h=u+this._h|0};Sha256.prototype._hash=function(){var e=a.allocUnsafe(32);e.writeInt32BE(this._a,0);e.writeInt32BE(this._b,4);e.writeInt32BE(this._c,8);e.writeInt32BE(this._d,12);e.writeInt32BE(this._e,16);e.writeInt32BE(this._f,20);e.writeInt32BE(this._g,24);e.writeInt32BE(this._h,28);return e};e.exports=Sha256},function(e,t,r){"use strict";e.exports=Transform;var n=r(10);var i=r(17);i.inherits=r(0);i.inherits(Transform,n);function afterTransform(e,t){var r=this._transformState;r.transforming=false;var n=r.writecb;if(!n){return this.emit("error",new Error("write callback called multiple times"))}r.writechunk=null;r.writecb=null;if(t!=null)this.push(t);n(e);var i=this._readableState;i.reading=false;if(i.needReadable||i.length<i.highWaterMark){this._read(i.highWaterMark)}}function Transform(e){if(!(this instanceof Transform))return new Transform(e);n.call(this,e);this._transformState={afterTransform:afterTransform.bind(this),needTransform:false,transforming:false,writecb:null,writechunk:null,writeencoding:null};this._readableState.needReadable=true;this._readableState.sync=false;if(e){if(typeof e.transform==="function")this._transform=e.transform;if(typeof e.flush==="function")this._flush=e.flush}this.on("prefinish",prefinish)}function prefinish(){var e=this;if(typeof this._flush==="function"){this._flush(function(t,r){done(e,t,r)})}else{done(this,null,null)}}Transform.prototype.push=function(e,t){this._transformState.needTransform=false;return n.prototype.push.call(this,e,t)};Transform.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")};Transform.prototype._write=function(e,t,r){var n=this._transformState;n.writecb=r;n.writechunk=e;n.writeencoding=t;if(!n.transforming){var i=this._readableState;if(n.needTransform||i.needReadable||i.length<i.highWaterMark)this._read(i.highWaterMark)}};Transform.prototype._read=function(e){var t=this._transformState;if(t.writechunk!==null&&t.writecb&&!t.transforming){t.transforming=true;this._transform(t.writechunk,t.writeencoding,t.afterTransform)}else{t.needTransform=true}};Transform.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,function(e){t(e);r.emit("close")})};function done(e,t,r){if(t)return e.emit("error",t);if(r!=null)e.push(r);if(e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}},function(e,t,r){"use strict";var n=r(24);function destroy(e,t){var r=this;var i=this._readableState&&this._readableState.destroyed;var a=this._writableState&&this._writableState.destroyed;if(i||a){if(t){t(e)}else if(e&&(!this._writableState||!this._writableState.errorEmitted)){n.nextTick(emitErrorNT,this,e)}return this}if(this._readableState){this._readableState.destroyed=true}if(this._writableState){this._writableState.destroyed=true}this._destroy(e||null,function(e){if(!t&&e){n.nextTick(emitErrorNT,r,e);if(r._writableState){r._writableState.errorEmitted=true}}else if(t){t(e)}});return this}function undestroy(){if(this._readableState){this._readableState.destroyed=false;this._readableState.reading=false;this._readableState.ended=false;this._readableState.endEmitted=false}if(this._writableState){this._writableState.destroyed=false;this._writableState.ended=false;this._writableState.ending=false;this._writableState.finished=false;this._writableState.errorEmitted=false}}function emitErrorNT(e,t){e.emit("error",t)}e.exports={destroy,undestroy}},function(e,t,r){e.exports=r(36).EventEmitter},function(e,t,r){"use strict";(function(t,n){var i=r(24);e.exports=Readable;var a=r(76);var o;Readable.ReadableState=ReadableState;var s=r(36).EventEmitter;var f=function(e,t){return e.listeners(t).length};var c=r(73);var u=r(1).Buffer;var d=t.Uint8Array||function(){};function _uint8ArrayToBuffer(e){return u.from(e)}function _isUint8Array(e){return u.isBuffer(e)||e instanceof d}var h=r(17);h.inherits=r(0);var l=r(167);var p=void 0;if(l&&l.debuglog){p=l.debuglog("stream")}else{p=function(){}}var v=r(166);var y=r(72);var b;h.inherits(Readable,c);var m=["error","close","destroy","pause","resume"];function prependListener(e,t,r){if(typeof e.prependListener==="function")return e.prependListener(t,r);if(!e._events||!e._events[t])e.on(t,r);else if(a(e._events[t]))e._events[t].unshift(r);else e._events[t]=[r,e._events[t]]}function ReadableState(e,t){o=o||r(10);e=e||{};var n=t instanceof o;this.objectMode=!!e.objectMode;if(n)this.objectMode=this.objectMode||!!e.readableObjectMode;var i=e.highWaterMark;var a=e.readableHighWaterMark;var s=this.objectMode?16:16*1024;if(i||i===0)this.highWaterMark=i;else if(n&&(a||a===0))this.highWaterMark=a;else this.highWaterMark=s;this.highWaterMark=Math.floor(this.highWaterMark);this.buffer=new v;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.destroyed=false;this.defaultEncoding=e.defaultEncoding||"utf8";this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(e.encoding){if(!b)b=r(33).StringDecoder;this.decoder=new b(e.encoding);this.encoding=e.encoding}}function Readable(e){o=o||r(10);if(!(this instanceof Readable))return new Readable(e);this._readableState=new ReadableState(e,this);this.readable=true;if(e){if(typeof e.read==="function")this._read=e.read;if(typeof e.destroy==="function")this._destroy=e.destroy}c.call(this)}Object.defineProperty(Readable.prototype,"destroyed",{get:function(){if(this._readableState===undefined){return false}return this._readableState.destroyed},set:function(e){if(!this._readableState){return}this._readableState.destroyed=e}});Readable.prototype.destroy=y.destroy;Readable.prototype._undestroy=y.undestroy;Readable.prototype._destroy=function(e,t){this.push(null);t(e)};Readable.prototype.push=function(e,t){var r=this._readableState;var n;if(!r.objectMode){if(typeof e==="string"){t=t||r.defaultEncoding;if(t!==r.encoding){e=u.from(e,t);t=""}n=true}}else{n=true}return readableAddChunk(this,e,t,false,n)};Readable.prototype.unshift=function(e){return readableAddChunk(this,e,null,true,false)};function readableAddChunk(e,t,r,n,i){var a=e._readableState;if(t===null){a.reading=false;onEofChunk(e,a)}else{var o;if(!i)o=chunkInvalid(a,t);if(o){e.emit("error",o)}else if(a.objectMode||t&&t.length>0){if(typeof t!=="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==u.prototype){t=_uint8ArrayToBuffer(t)}if(n){if(a.endEmitted)e.emit("error",new Error("stream.unshift() after end event"));else addChunk(e,a,t,true)}else if(a.ended){e.emit("error",new Error("stream.push() after EOF"))}else{a.reading=false;if(a.decoder&&!r){t=a.decoder.write(t);if(a.objectMode||t.length!==0)addChunk(e,a,t,false);else maybeReadMore(e,a)}else{addChunk(e,a,t,false)}}}else if(!n){a.reading=false}}return needMoreData(a)}function addChunk(e,t,r,n){if(t.flowing&&t.length===0&&!t.sync){e.emit("data",r);e.read(0)}else{t.length+=t.objectMode?1:r.length;if(n)t.buffer.unshift(r);else t.buffer.push(r);if(t.needReadable)emitReadable(e)}maybeReadMore(e,t)}function chunkInvalid(e,t){var r;if(!_isUint8Array(t)&&typeof t!=="string"&&t!==undefined&&!e.objectMode){r=new TypeError("Invalid non-string/buffer chunk")}return r}function needMoreData(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||e.length===0)}Readable.prototype.isPaused=function(){return this._readableState.flowing===false};Readable.prototype.setEncoding=function(e){if(!b)b=r(33).StringDecoder;this._readableState.decoder=new b(e);this._readableState.encoding=e;return this};var g=8388608;function computeNewHighWaterMark(e){if(e>=g){e=g}else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function howMuchToRead(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e){if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length}if(e>t.highWaterMark)t.highWaterMark=computeNewHighWaterMark(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}Readable.prototype.read=function(e){p("read",e);e=parseInt(e,10);var t=this._readableState;var r=e;if(e!==0)t.emittedReadable=false;if(e===0&&t.needReadable&&(t.length>=t.highWaterMark||t.ended)){p("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)endReadable(this);else emitReadable(this);return null}e=howMuchToRead(e,t);if(e===0&&t.ended){if(t.length===0)endReadable(this);return null}var n=t.needReadable;p("need readable",n);if(t.length===0||t.length-e<t.highWaterMark){n=true;p("length less than watermark",n)}if(t.ended||t.reading){n=false;p("reading or ended",n)}else if(n){p("do read");t.reading=true;t.sync=true;if(t.length===0)t.needReadable=true;this._read(t.highWaterMark);t.sync=false;if(!t.reading)e=howMuchToRead(r,t)}var i;if(e>0)i=fromList(e,t);else i=null;if(i===null){t.needReadable=true;e=0}else{t.length-=e}if(t.length===0){if(!t.ended)t.needReadable=true;if(r!==e&&t.ended)endReadable(this)}if(i!==null)this.emit("data",i);return i};function onEofChunk(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();if(r&&r.length){t.buffer.push(r);t.length+=t.objectMode?1:r.length}}t.ended=true;emitReadable(e)}function emitReadable(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){p("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)i.nextTick(emitReadable_,e);else emitReadable_(e)}}function emitReadable_(e){p("emit readable");e.emit("readable");flow(e)}function maybeReadMore(e,t){if(!t.readingMore){t.readingMore=true;i.nextTick(maybeReadMore_,e,t)}}function maybeReadMore_(e,t){var r=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark){p("maybeReadMore read 0");e.read(0);if(r===t.length)break;else r=t.length}t.readingMore=false}Readable.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))};Readable.prototype.pipe=function(e,t){var r=this;var a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e);break}a.pipesCount+=1;p("pipe count=%d opts=%j",a.pipesCount,t);var o=(!t||t.end!==false)&&e!==n.stdout&&e!==n.stderr;var s=o?onend:unpipe;if(a.endEmitted)i.nextTick(s);else r.once("end",s);e.on("unpipe",onunpipe);function onunpipe(e,t){p("onunpipe");if(e===r){if(t&&t.hasUnpiped===false){t.hasUnpiped=true;cleanup()}}}function onend(){p("onend");e.end()}var c=pipeOnDrain(r);e.on("drain",c);var u=false;function cleanup(){p("cleanup");e.removeListener("close",onclose);e.removeListener("finish",onfinish);e.removeListener("drain",c);e.removeListener("error",onerror);e.removeListener("unpipe",onunpipe);r.removeListener("end",onend);r.removeListener("end",unpipe);r.removeListener("data",ondata);u=true;if(a.awaitDrain&&(!e._writableState||e._writableState.needDrain))c()}var d=false;r.on("data",ondata);function ondata(t){p("ondata");d=false;var n=e.write(t);if(false===n&&!d){if((a.pipesCount===1&&a.pipes===e||a.pipesCount>1&&indexOf(a.pipes,e)!==-1)&&!u){p("false write response, pause",r._readableState.awaitDrain);r._readableState.awaitDrain++;d=true}r.pause()}}function onerror(t){p("onerror",t);unpipe();e.removeListener("error",onerror);if(f(e,"error")===0)e.emit("error",t)}prependListener(e,"error",onerror);function onclose(){e.removeListener("finish",onfinish);unpipe()}e.once("close",onclose);function onfinish(){p("onfinish");e.removeListener("close",onclose);unpipe()}e.once("finish",onfinish);function unpipe(){p("unpipe");r.unpipe(e)}e.emit("pipe",r);if(!a.flowing){p("pipe resume");r.resume()}return e};function pipeOnDrain(e){return function(){var t=e._readableState;p("pipeOnDrain",t.awaitDrain);if(t.awaitDrain)t.awaitDrain--;if(t.awaitDrain===0&&f(e,"data")){t.flowing=true;flow(e)}}}Readable.prototype.unpipe=function(e){var t=this._readableState;var r={hasUnpiped:false};if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this,r);return this}if(!e){var n=t.pipes;var i=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var a=0;a<i;a++){n[a].emit("unpipe",this,r)}return this}var o=indexOf(t.pipes,e);if(o===-1)return this;t.pipes.splice(o,1);t.pipesCount-=1;if(t.pipesCount===1)t.pipes=t.pipes[0];e.emit("unpipe",this,r);return this};Readable.prototype.on=function(e,t){var r=c.prototype.on.call(this,e,t);if(e==="data"){if(this._readableState.flowing!==false)this.resume()}else if(e==="readable"){var n=this._readableState;if(!n.endEmitted&&!n.readableListening){n.readableListening=n.needReadable=true;n.emittedReadable=false;if(!n.reading){i.nextTick(nReadingNextTick,this)}else if(n.length){emitReadable(this)}}}return r};Readable.prototype.addListener=Readable.prototype.on;function nReadingNextTick(e){p("readable nexttick read 0");e.read(0)}Readable.prototype.resume=function(){var e=this._readableState;if(!e.flowing){p("resume");e.flowing=true;resume(this,e)}return this};function resume(e,t){if(!t.resumeScheduled){t.resumeScheduled=true;i.nextTick(resume_,e,t)}}function resume_(e,t){if(!t.reading){p("resume read 0");e.read(0)}t.resumeScheduled=false;t.awaitDrain=0;e.emit("resume");flow(e);if(t.flowing&&!t.reading)e.read(0)}Readable.prototype.pause=function(){p("call pause flowing=%j",this._readableState.flowing);if(false!==this._readableState.flowing){p("pause");this._readableState.flowing=false;this.emit("pause")}return this};function flow(e){var t=e._readableState;p("flow",t.flowing);while(t.flowing&&e.read()!==null){}}Readable.prototype.wrap=function(e){var t=this;var r=this._readableState;var n=false;e.on("end",function(){p("wrapped end");if(r.decoder&&!r.ended){var e=r.decoder.end();if(e&&e.length)t.push(e)}t.push(null)});e.on("data",function(i){p("wrapped data");if(r.decoder)i=r.decoder.write(i);if(r.objectMode&&(i===null||i===undefined))return;else if(!r.objectMode&&(!i||!i.length))return;var a=t.push(i);if(!a){n=true;e.pause()}});for(var i in e){if(this[i]===undefined&&typeof e[i]==="function"){this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i)}}for(var a=0;a<m.length;a++){e.on(m[a],this.emit.bind(this,m[a]))}this._read=function(t){p("wrapped _read",t);if(n){n=false;e.resume()}};return this};Object.defineProperty(Readable.prototype,"readableHighWaterMark",{enumerable:false,get:function(){return this._readableState.highWaterMark}});Readable._fromList=fromList;function fromList(e,t){if(t.length===0)return null;var r;if(t.objectMode)r=t.buffer.shift();else if(!e||e>=t.length){if(t.decoder)r=t.buffer.join("");else if(t.buffer.length===1)r=t.buffer.head.data;else r=t.buffer.concat(t.length);t.buffer.clear()}else{r=fromListPartial(e,t.buffer,t.decoder)}return r}function fromListPartial(e,t,r){var n;if(e<t.head.data.length){n=t.head.data.slice(0,e);t.head.data=t.head.data.slice(e)}else if(e===t.head.data.length){n=t.shift()}else{n=r?copyFromBufferString(e,t):copyFromBuffer(e,t)}return n}function copyFromBufferString(e,t){var r=t.head;var n=1;var i=r.data;e-=i.length;while(r=r.next){var a=r.data;var o=e>a.length?a.length:e;if(o===a.length)i+=a;else i+=a.slice(0,e);e-=o;if(e===0){if(o===a.length){++n;if(r.next)t.head=r.next;else t.head=t.tail=null}else{t.head=r;r.data=a.slice(o)}break}++n}t.length-=n;return i}function copyFromBuffer(e,t){var r=u.allocUnsafe(e);var n=t.head;var i=1;n.data.copy(r);e-=n.data.length;while(n=n.next){var a=n.data;var o=e>a.length?a.length:e;a.copy(r,r.length-e,0,o);e-=o;if(e===0){if(o===a.length){++i;if(n.next)t.head=n.next;else t.head=t.tail=null}else{t.head=n;n.data=a.slice(o)}break}++i}t.length-=i;return r}function endReadable(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!t.endEmitted){t.ended=true;i.nextTick(endReadableNT,t,e)}}function endReadableNT(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function indexOf(e,t){for(var r=0,n=e.length;r<n;r++){if(e[r]===t)return r}return-1}}).call(this,r(7),r(9))},function(e,t,r){"use strict";var n=r(1).Buffer;var i=r(37).Transform;var a=r(0);function throwIfNotStringOrBuffer(e,t){if(!n.isBuffer(e)&&typeof e!=="string"){throw new TypeError(t+" must be a string or a buffer")}}function HashBase(e){i.call(this);this._block=n.allocUnsafe(e);this._blockSize=e;this._blockOffset=0;this._length=[0,0,0,0];this._finalized=false}a(HashBase,i);HashBase.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)};HashBase.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)};HashBase.prototype.update=function(e,t){throwIfNotStringOrBuffer(e,"Data");if(this._finalized)throw new Error("Digest already called");if(!n.isBuffer(e))e=n.from(e,t);var r=this._block;var i=0;while(this._blockOffset+e.length-i>=this._blockSize){for(var a=this._blockOffset;a<this._blockSize;)r[a++]=e[i++];this._update();this._blockOffset=0}while(i<e.length)r[this._blockOffset++]=e[i++];for(var o=0,s=e.length*8;s>0;++o){this._length[o]+=s;s=this._length[o]/4294967296|0;if(s>0)this._length[o]-=4294967296*s}return this};HashBase.prototype._update=function(){throw new Error("_update is not implemented")};HashBase.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=true;var t=this._digest();if(e!==undefined)t=t.toString(e);this._block.fill(0);this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t};HashBase.prototype._digest=function(){throw new Error("_digest is not implemented")};e.exports=HashBase},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return r.call(e)=="[object Array]"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gostASN1Instance=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.GostASN1=GostASN1;var i=r(176);var a=r(78);var o=r(39);var s=ArrayBuffer;var f=a.gostSecurityInstance.algorithms,c=a.gostSecurityInstance.names,u=a.gostSecurityInstance.identifiers,d=a.gostSecurityInstance.attributes,h=a.gostSecurityInstance.parameters;var l=o.gostCodingInstance.BER,p=o.gostCodingInstance.PEM,v=o.gostCodingInstance.Chars,y=o.gostCodingInstance.Hex,b=o.gostCodingInstance.Int16;function swapBytes(e){if(e instanceof s)e=new Uint8Array(e);var t=new Uint8Array(e.length);for(var r=0,n=e.length;r<n;r++){t[n-r-1]=e[r]}return t.buffer}function isBinary(e){return e instanceof s||e.buffer instanceof s}function lpad(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e}function npw2(e){return e<=2?e:e<=4?4:e<=8?8:e<=16?16:e<=32?32:e<=64?64:e<=128?128:e<=256?256:e<512?512:e<1024?1024:undefined}var m={encode:function encode(e,t){return"0x"+y.encode(e,t)},decode:function decode(e,t,r){if(typeof e==="number")e=e.toString(16);var n=e.replace("0x","");r=r||npw2(n.length);return y.decode(lpad(n,r),t)}};function assert(e){if(e)throw Error("Invalid format")}function defineProperty(e,t,r,i){if((typeof r==="undefined"?"undefined":n(r))!=="object")r={value:r};if(i!==undefined)r.enumerable=i;Object.defineProperty(e,t,r)}function defineProperties(e,t,r){for(var n in t){defineProperty(e,n,t[n],r)}}function getOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)}function _encode(e,t,r,n,i,a){assert(t===undefined);var o={tagNumber:r,tagClass:n||0,tagConstructed:i||false,object:t};e=e||"DER";if(e==="DER"||e==="CER")o=l.encode(o,e);if(e==="PEM")o=p.encode(o,a);return o}function _decode(e,t,r,n,i){assert(e===undefined);if(typeof e==="string")e=p.decode(e,i,false);if(e instanceof s){try{e=p.decode(v.encode(e),i,true)}catch(t){e=l.decode(e)}}r=r||0;n=n||false;if(e.tagNumber===undefined){e=_encode(true,e.object,t,r,e.object instanceof Array);e=l.decode(e)}assert(e.tagClass!==r||e.tagNumber!==t||e.tagConstructed!==n);if(r===0&&t===5)return null;else return e.object}function extend(e,t,r,n){if(typeof t!=="function"){n=r;r=t;t=function Class(){e.apply(this,arguments)}}t.prototype=Object.create(e.prototype,{constructor:{value:t},superclass:{value:e.prototype}});if(r)defineProperties(t.prototype,r);if(e!==Object)for(var i in e){t[i]=e[i]}t.super=e;if(n)defineProperties(t,n,true);return t}var g=extend(Object,function(e){this.object=e},{_set:function _set(e,t,r){e.property(t).set.call(this,r)},_get:function _get(e,t){return e.property(t).get.call(this)},_call:function _call(e,t,r){return e.method(t).apply(this,r)},hasProperty:function hasProperty(e){return this.hasOwnProperty(e)||!!this.constructor.property(e)},encode:function encode(){return this.object}},{decode:function decode(e){return new this(e)},property:function property(e){var t=this.prototype;while(t){var r=getOwnPropertyDescriptor(t,e);if(r)return r;else t=t.superclass}},method:function method(e){var t=this.prototype;while(t){if(t[e])return t[e];else t=t.superclass}}});var w=function PRIMITIVE(e){return extend(g,{encode:function encode(t){return _encode(t,this.object,e)}},{decode:function decode(t){return new this(_decode(t,e))}})};var C=g;var S=w(1);var A=w(22);var E=w(18);var B=w(19);var _=w(20);var P=w(12);var F=w(23);var k=w(24);var D=w(28);var I=w(30);var x=extend(w(5),{object:{get:function get(){return null},set:function set(e){assert(e!==null)}}});var M=function PRIMITIVE_CODE(e){var t=extend(w(e),function(e){if(this instanceof t)t.super.apply(this,arguments);else return CODE(e)});function CODE(r){return extend(w(e),function(e){t.super.call(this,e)},{encode:function encode(t){return _encode(t,r[this.object],e)}},{decode:function decode(t){var n=_decode(t,e);for(var i in r){if(n===r[i])return new this(i)}assert(true)}})}return t};var K=M(2);var R=M(10);var T=function(){var e=extend(w(4),function(t){if(this instanceof e)e.super.apply(this,arguments);else return WRAPPING(t)});function WRAPPING(t){if(t){return extend(t,{encode:function encode(e){return _encode(e,t.method("encode").call(this,true),4)}},{decode:function decode(e){return t.decode.call(this,_decode(e,4))}})}else return e}return e}();var N=function(){var e=extend(w(3),function(t){if(this instanceof e)e.super.apply(this,arguments);else if((typeof t==="undefined"?"undefined":n(t))==="object")return MASK(t);else return WRAPPING(t)});function WRAPPING(t){if(t){return extend(t,{encode:function encode(e){return _encode(e,t.method("encode").call(this,true),3)}},{decode:function decode(e){return t.decode.call(this,_decode(e,3))}})}else return e}function MASK(e){return extend(g,function(e,t){g.call(this,e);this.numbits=t||0},{encode:function encode(t){var r=this.object,n=[];if(r instanceof Array){for(var i=0,a=r.length;i<a;i++){var o=e[r[i]];if(o!==undefined)n[o]="1"}for(var i=0,a=Math.max(n.length,this.numbits);i<a;i++){if(!n[i])n[i]="0"}n=n.join("")}else n="0";return _encode(t,n,3)}},{decode:function decode(t){var r=_decode(t,3),n=[];for(var i in e){var a=e[i];if(r.charAt(a)==="1")n.push(i)}return new this(n,r.length)}})}return e}();var U=function COMBINE(e){e.combine=function(t,r){for(var n in e.prototype){if(e.prototype.hasOwnProperty(n)&&!t.hasProperty(n)){defineProperty(t,n,function(e){return{get:function get(){return this[r]&&this[r][e]},set:function set(t){if(!this[r])this[r]={};this[r][e]=t},configurable:false,enumerable:true}}(n))}}};return e};var O=function SEQUENCE(e,t){var r=extend(g,function(e,t){defineProperty(this,"items",{writable:true,value:{}});if(typeof e==="string"||e instanceof s)this.decode(e);else if(e!==undefined){this.object=e;if(t)this.check()}},{object:{get:function get(){return this},set:function set(t){if(t instanceof r){this.items=t.items;for(var n in e){var i=this.getItemClass(n,this.items);if(i.combine)i.combine(this,n)}}else{var a={};for(var n in e){var o=t[n];var i=this.getItemClass(n,a);if(o!==undefined){a[n]=new i(o)}else if(i.combine){a[n]=new i(t)}if(i.combine)i.combine(this,n)}this.items=a}}},getItemClass:function getItemClass(t,r){return e[t]},encode:function encode(r){var n=[],i=this.items;for(var a in e){if(i[a]){var o=i[a].encode(true);if(o!==undefined)n.push(o)}}return _encode(r,n,16,0,true,t)},decode:function decode(e){this.object=this.constructor.decode(e)},check:function check(){this.constructor.decode(this.encode(true))}},{encode:function encode(e,t){return new this(e).encode(t)},decode:function decode(r){r=_decode(r,16,0,true,t);var n=0,i=new this,a=i.items={};for(var o in e){var s=i.getItemClass(o,a);var f=s.decode(r[n]);if(f!==undefined){a[o]=f;if(s.combine)s.combine(i,o);n++}}return i}});for(var n in e){defineProperty(r.prototype,n,function(t){return{get:function get(){return this.items[t]&&this.items[t].object},set:function set(e){if(e!==undefined){var r=this.getItemClass(t,this.items);this.items[t]=new r(e)}else delete this.items[t]},configurable:false,enumerable:!e[t].combine}}(n));if(e[n].combine)e[n].combine(r.prototype,n)}return r};var G=function ATTRIBUTE(e,t,r,n,i){var a=O(e,i);var o=function DEFINE(i,o){t=t||"type";r=r||"value";o=o||n||C;var s=extend(a,function(e){if(this instanceof s){a.apply(this,arguments)}else return DEFINE.apply(this,arguments)},{getItemClass:function getItemClass(n,a){var s=e[n];if(r===n){var f,c=a&&a[t];if(c){var u=c.object;if(i){if(typeof i==="function")f=i(u);else f=i[u]}}f=f||o||C;s=s===C?f:s(f)}return s}});defineProperty(s.prototype,t,{get:function get(){return this.items[t]&&this.items[t].object},set:function set(){assert(true)},configurable:false,enumerable:true});return s};return o()};var j=extend(g,{encode:function encode(e){var t=this.object;t=/^(\d+\.)+\d+$/.test(t)?t:u[t];assert(!t);return _encode(e,t,6)}},{decode:function decode(e){var t=_decode(e,6);return new this(c[t]||t)}});var L=function IMPLICIT(e){e=e||C;return extend(e,{encode:function encode(t){var r=e.method("encode").call(this,t);if(typeof r==="string"||r instanceof s)return r;if(r.tagNumber!==4&&r.tagClass===0&&!(r.object instanceof Array))return{object:l.encode(r,"DER",true)};else return{object:r.object}}},{decode:function decode(t){if(typeof t==="string"||t instanceof s){return e.decode.call(this,t)}else{t={object:t.object,header:t.header,content:t.content};return e.decode.call(this,t)}}})};var H=function EXPLICIT(e){e=e||C;return extend(e,{encode:function encode(t){var r=e.method("encode").call(this,t);if(typeof r==="string"||r instanceof s)return r;return{object:[r]}}},{decode:function decode(t){if(typeof t==="string"||t instanceof s){return e.decode.call(this,t)}else return e.decode.call(this,t.object[0])}})};var q=function CTX(e,t){function CTX(){t.apply(this,arguments)}return extend(t,CTX,{encode:function encode(r){var n=t.method("encode").call(this,r);if(typeof n==="string"||n instanceof s)return n;n.tagNumber=e;n.tagClass=2;n.tagConstructed=n.object instanceof Array;return n}},{decode:function decode(r){assert(r.tagNumber!==undefined&&(r.tagClass!==2||r.tagNumber!==e));return t.decode.call(this,r)}})};var z=function ARRAY_OF(e){return function(t,r){t=t||C;var n=function DEFINE(n,i){var a=typeof t==="function"&&n!==undefined?t(n,i):t;if(r){var o=extend(g,function(e){if(this instanceof o){defineProperty(this,"items",{writable:true,value:{}});g.call(this,e||{})}else return DEFINE.apply(this,arguments)},{object:{get:function get(){this.read();return this},set:function set(e){if(e instanceof o){e.read();this.items=e.items}else{var t={};for(var r in e){var n=e[r];t[r]=this.createItem(n,r)}this.items=t}this.reset()}},createItem:function createItem(e,t){if(r){var n={};n[r.typeName]=t;n[r.valueName]=e}else n=e;return new a(n)},getItemValue:function getItemValue(e){var t=this.items[e];return r?t.object[r.valueName]:t.object},setItemValue:function setItemValue(e,t){var n=this.items[e];if(r)n.object[r.valueName]=t;else n.object=t},isItemType:function isItemType(e){return r?u[e]:!isNaN(parseInt(e))},reset:function reset(){var e=this.items;for(var t in this){if(this.hasOwnProperty(t)&&!this.items[t]&&this.isItemType(t))delete this[t]}for(var t in e){this[t]=this.getItemValue(t)}},read:function read(){var e=this.items;for(var t in this){if(this.isItemType(t)){if(!this.items[t]){e[t]=this.createItem(this[t],t);this[t]=this.getItemValue(t)}else if(this.getItemValue(t)!==this[t]){this.setItemValue(t,this[t])}}}},encode:function encode(t){this.read();var r=this.items,n=[];for(var i in r){var a=r[i].encode(true);if(a!==undefined)n.push(a)}return _encode(t,n,e,0,true)},decode:function decode(e){this.object=this.constructor.decode(e)},check:function check(){this.constructor.decode(this.encode(true))}},{encode:function encode(e,t){return new this(e).encode(t)},decode:function decode(t){t=_decode(t,e,0,true);var n=new this,i=n.items={};for(var o=0,s=t.length;o<s;o++){var f=a.decode(t[o]);var c=r?f.object[r.typeName]:o;i[c]=f}n.reset();return n}});return o}else{var s=extend(g,function(e){if(this instanceof s){defineProperties(this,{items:{writable:true,value:[]},values:{writable:true,value:[]}});g.call(this,e||[])}else return DEFINE.apply(this,arguments)},{object:{get:function get(){this.read();return this.values},set:function set(e){if(e instanceof s){e.read();this.items=e.items}else{var t=[];for(var r=0,n=e.length;r<n;r++){t[r]=new a(e[r])}this.items=t}this.reset()}},encode:function encode(t){this.read();var r=this.items,n=[];for(var i=0,a=r.length;i<a;i++){var o=r[i].encode(true);if(o!==undefined)n.push(o)}return _encode(t,n,e,0,true)},decode:function decode(e){this.object=this.constructor.decode(e)},check:function check(){this.constructor.decode(this.encode(true))},reset:function reset(){for(var e=0,t=this.items.length;e<t;e++){this.values.push(this.items[e].object)}},read:function read(){var e=this.items,t=this.values;for(var r=0,n=t.length;r<n;r++){if(!this.items[r]){e[r]=new a(t[r]);t[r]=e[r].object}else if(e[r].object!==t[r])e[r].object=t[r]}}},{encode:function encode(e,t){return new this(e).encode(t)},decode:function decode(t){t=_decode(t,e,0,true);var r=new this;r.items=[];for(var n=0,i=t.length;n<i;n++){r.items.push(a.decode(t[n]))}r.reset();return r}});return s}};return n()}};var W=z(16);var V=z(17);var X=function ENCLOSURE(e,t){if(t){var r=extend(g,{object:{get:function get(){if(this.item)return t.decode(this.item.object);else return undefined},set:function set(r){if(r!==undefined)this.item=new e(t.encode(r));else delete this.item}},encode:function encode(e){return this.item.encode(e)}},{decode:function decode(t){var r=new this;r.item=e.decode(t);return r}});for(var n in e){if(!r[n])r[n]=e[n]}return r}else return e};var Y=function SET_OF_SINGLE(e){var t=X(V(e),{encode:function encode(e){return[e]},decode:function decode(e){return e[0]}});return t};var J=function CHOICE(e,t){return extend(g,{object:{get:function get(){return this.item&&this.item.object},set:function set(r){if(r instanceof g){for(var n in e){if(r instanceof e[n]){this.item=r;return}}}var n=typeof t==="function"?t(r):t;assert(!n||!e[n]);r=new e[n](r);this.item=r}},encode:function encode(e){return this.item.encode(e)}},{decode:function decode(t){for(var r in e){try{var n=e[r].decode(t);if(n!==undefined)return new this(n)}catch(e){}}assert(true)}})};var Z=function ENCAPSULATES(e){e=e||C;return extend(e,{encode:function encode(){return l.encode(e.method("encode").call(this,true))}},{encode:function encode(e,t){return new this(e).encode(t)},decode:function decode(t){return e.decode.call(this,l.decode(t))}})};var Q=function DEFAULT(e,t){e=e||C;return extend(e,{encode:function encode(r){if(this.object===t)return undefined;return e.method("encode").call(this,r)}},{decode:function decode(r){if(r===undefined)return new this(t);else try{return e.decode.call(this,r)}catch(e){return undefined}}})};var $=function OPTIONAL(e){e=e||C;return extend(e,{},{decode:function decode(t){if(t===undefined)return undefined;else try{return e.decode.call(this,t)}catch(e){return undefined}}})};var ee=function DEFAULT_NULL(e,t){e=e||C;return extend(e,{encode:function encode(r){if(this.object===t)return new x(null).encode(r);return e.method("encode").call(this,r)}},{decode:function decode(r){if(r===undefined)return undefined;else if(r===null||r.tagNumber===5&&r.tagClass===0)return new this(t);else try{return e.decode.call(this,r)}catch(e){return undefined}}})};var te=J({teletexString:_,printableString:B,universalString:D,utf8String:P,bmpString:I,numericString:E},function(e){return/^[A-Za-z0-9\.@\+\-\:\=\\\/\?\!\#\$\%\^\&\*\(\)\[\]\{\}\>\<\|\~]*$/.test(e)?"printableString":"utf8String"});var re=J({utcTime:F,generalTime:k},function(e){return e.getYear()>=2050?"generalTime":"utcTime"});var ne=j;var ie=C;var ae=G({type:ne,value:ie});var oe={typeName:"type",valueName:"value"};var se=Y(ae({serialName:B,countryName:B,dnQualifier:B,emailAddress:A,domainComponent:A,SNILS:E,OGRN:E,INN:E},te));var fe=W(se,oe)();var ce=J({rdnSequence:fe},"rdnSequence");var ue=U(O({notBefore:re,notAfter:re}));var de=K;var he=G({type:j,value:C});var le=V(he,oe);var pe=W(he,oe);var ve=K;var ye=O({a:ve,b:ve,seed:$(N)});var be=T(extend(g,{encode:function encode(){var e=this.object;var t=Math.max(npw2(e.x.length-2),npw2(e.y.length-2))/2,r=new Uint8Array(2*t+1);r[0]=4;r.set(new Uint8Array(m.decode(e.x,false,t)),1);r.set(new Uint8Array(m.decode(e.y,false,t)),t+1);return r.buffer}},{decode:function decode(e){var t=(e.byteLength-1)/2;return new this({x:m.encode(new Uint8Array(e,1,t)),y:m.encode(new Uint8Array(e,t+1,t))})}}));var me=O({fieldType:j,parameters:K});var ge=O({version:de,fieldID:me,curve:ye,base:be,order:K,cofactor:$(K)});var we=O({publicKeyParamSet:j,digestParamSet:j,encryptionParamSet:$(j)});var Ce=ee(j,"id-GostR3411-94-CryptoProParamSet");var Se=J({namedParameters:j,ecParameters:ge,implicitly:$(x)},function(e){return typeof e==="string"||e instanceof String?"namedParameters":"ecParameters"});var Ae=function Algorithm(e,t){return X(O({algorithm:j,parameters:$(e)}),t)};var Ee=function(){var e=Ae(C),t=extend(g,function(e){if(this instanceof t)t.super.apply(this,arguments);else return r(e)},{encode:function encode(t){return new e(this.object).encode(t)}},{decode:function decode(t){return new this(e.decode(t).object)}});var r=function DEFINE(e){return extend(g,{object:{get:function get(){if(this.item)return this.item.object;else return undefined},set:function set(t){if(t){var r=e[t.id];if(!r)throw new Error("Algorithm not supported");this.item=new r(t)}else delete this.item}},encode:function encode(e){return this.item.encode(e)}},{decode:function decode(t){if(typeof t==="string")t=p.decode(t,undefined,false);if(t instanceof s)t=l.decode(t);var r=e[c[t.object[0].object]];if(r){var n=new this;n.item=r.decode(t);return n}else throw new Error("Algorithm not supported")}})};return t}();var Be=Ae(Se,{encode:function encode(e){var t;if(typeof e.namedCurve==="string")t=d["namedCurve"][e.namedCurve];else t={version:1,fieldID:{fieldType:"id-prime-Field",parameters:e.curve.p},curve:{a:e.curve.a,b:e.curve.b},base:{x:e.curve.x,y:e.curve.y},order:e.curve.q,cofactor:1};return{algorithm:e.id,parameters:t}},decode:function decode(e){var t=e.parameters,r=f[e.algorithm];if(typeof t==="string"||t instanceof String){r=(0,i.expand)(r,h[t])}else if((typeof t==="undefined"?"undefined":n(t))==="object"){r=(0,i.expand)(r,{curve:{p:t.fieldID.parameters,a:t.curve.a,b:t.curve.b,x:t.base.x,y:t.base.y,q:t.order}})}else throw new DataError("Invalid key paramters");return r}});var _e=Ae(we,{encode:function encode(e){var t=e.namedCurve?"namedCurve":"namedParam",r=e.name.indexOf("-94")>=0||e.name.indexOf("-2001")>=0||e.version===1994||e.version===2001?e.sBox||"D-A":e.name.indexOf("-512")>=0||e.length===512?"D-512":"D-256";return{algorithm:e.id,parameters:{publicKeyParamSet:d[t][e[t]],digestParamSet:d["sBox"][r],encryptionParamSet:e.encParams&&e.encParams.sBox?d["sBox"][e.encParams.sBox]:undefined}}},decode:function decode(e){var t=e.parameters,r=(0,i.expand)(f[e.algorithm],h[t.publicKeyParamSet],h[t.digestParamSet]);if(t.encryptionParamSet)r.encParams=h[t.encryptionParamSet];return r}});var Pe=Ae(C,{encode:function encode(e){return{algorithm:e.id}},decode:function decode(e){return f[e.algorithm]}});var Fe=Ae(x,{encode:function encode(e){return{algorithm:e.id,parameters:null}},decode:function decode(e){return f[e.algorithm]}});var ke=Ae(Ce,{encode:function encode(e){return{algorithm:e.id,parameters:d["sBox"][e.sBox||e.hash&&e.hash.sBox||"D-A"]}},decode:function decode(e){var t=(0,i.expand)(f[e.algorithm]),r=h[e.parameters];if(t.hash)t.hash=(0,i.expand)(t.hash,r);else t=(0,i.expand)(t,r);return t}});var De=Ee({ecdsa:Be,noSignature:Fe,rsaEncryption:Fe,"id-sc-gostR3410-2001":Be,"id-GostR3410-2001":_e,"id-GostR3410-94":_e,"id-GostR3410-2001DH":_e,"id-GostR3410-94DH":_e,"id-tc26-gost3410-12-256":_e,"id-tc26-gost3410-12-512":_e,"id-tc26-agreement-gost-3410-12-256":_e,"id-tc26-agreement-gost-3410-12-512":_e,"id-sc-gost28147-gfb":Pe,"id-Gost28147-89":Pe});var Ie=Ee({noSignature:Fe,rsaEncryption:Fe,sha1withRSAEncryption:Fe,sha256withRSAEncryption:Fe,sha384withRSAEncryption:Fe,sha512withRSAEncryption:Fe,ecdsa:Pe,"ecdsa-with-SHA1":Pe,"ecdsa-with-SHA256":Pe,"ecdsa-with-SHA384":Pe,"ecdsa-with-SHA512":Pe,"id-GostR3410-94":Fe,"id-GostR3410-2001":Fe,"id-GostR3411-94-with-GostR3410-2001":Pe,"id-GostR3411-94-with-GostR3410-94":Pe,"id-tc26-gost3410-12-256":Fe,"id-tc26-gost3410-12-512":Fe,"id-tc26-signwithdigest-gost3410-12-94":Pe,"id-tc26-signwithdigest-gost3410-12-256":Pe,"id-tc26-signwithdigest-gost3410-12-512":Pe,"id-sc-gostR3410-94":Fe,"id-sc-gostR3410-2001":Fe,"id-sc-gostR3411-94-with-gostR3410-94":Fe,"id-sc-gostR3411-94-with-gostR3410-2001":Fe});var xe=Ee({sha1:Pe,sha256:Fe,sha384:Fe,sha512:Fe,"id-GostR3411-94":ke,"id-tc26-gost3411-94":ke,"id-tc26-gost3411-12-256":Fe,"id-tc26-gost3411-12-512":Fe,"id-sc-gostR3411-94":Pe});var Me=T;var Ke=T;var Re=j;var Te=T;var Ne=O({iv:Te,encryptionParamSet:Re});var Ue=O({encryptionParamSet:Re,ukm:$(T)});var Oe=Ae(Ne,{encode:function encode(e){return{algorithm:e.id,parameters:{iv:e.iv,encryptionParamSet:d["sBox"][e.sBox||"E-A"]}}},decode:function decode(e){var t=(0,i.expand)(f[e.algorithm],h[e.parameters.encryptionParamSet]);t.iv=e.parameters.iv;return t}});var Ge=Ae(Te,{encode:function encode(e){return{algorithm:e.id,parameters:e.iv}},decode:function decode(e){var t=(0,i.expand)(f[e.algorithm]);t.iv=e.parameters||new Uint8Array([0,0,0,0,0,0,0,0]);return t}});var je=Ae(Ue,{encode:function encode(e){return{algorithm:e.id,parameters:{encryptionParamSet:d["sBox"][e.sBox||"E-A"],ukm:e.ukm}}},decode:function decode(e){var t=(0,i.expand)(f[e.algorithm],h[e.parameters.encryptionParamSet]);if(e.parameters.ukm)t.ukm=e.parameters.ukm;return t}});var Le=Ee({"id-Gost28147-89-None-KeyWrap":je,"id-Gost28147-89-CryptoPro-KeyWrap":je});var He=Ae(Le,{encode:function encode(e){return{algorithm:e.id,parameters:e.wrapping}},decode:function decode(e){var t=(0,i.expand)(f[e.algorithm]);t.wrapping=e.parameters;return t}});var qe=Ee({"id-sc-gost28147-gfb":Ge,"id-Gost28147-89":Oe});var ze=Ee({"id-Gost28147-89-MAC":Ne,"id-HMACGostR3411-94":ke,"id-tc26-hmac-gost-3411-12-256":ke,"id-tc26-hmac-gost-3411-12-512":ke,hmacWithSHA1:Pe,hmacWithSHA224:Pe,hmacWithSHA256:Pe,hmacWithSHA384:Pe,hmacWithSHA512:Pe,"id-sc-gost28147-mac":Pe,"id-sc-hmacWithGostR3411":Pe});var We=O({salt:J({specified:T,otherSource:Ee},function(e){return isBinary(e)?"specified":"otherSource"}),iterationCount:K,keyLength:$(K),prf:ze});var Ve=Ae(We,{encode:function encode(e){return{algorithm:e.id,parameters:{salt:e.salt,iterationCount:e.iterations,prf:e.hmac}}},decode:function decode(e){var t=(0,i.expand)(f[e.algorithm]);t.salt=e.parameters.salt;t.iterations=e.parameters.iterationCount;t.hmac=e.parameters.prf;t.hash=t.hmac.hash;return t}});var Xe=Ee({PBKDF2:Ve});var Ye=O({salt:T,iterationCount:K});var Je=Ae(Ye,{paramType:Ye,encode:function encode(e){return{algorithm:e.id,parameters:{salt:e.derivation.salt,iterationCount:e.derivation.iterations}}},decode:function decode(e){var t=(0,i.expand)(f[e.algorithm]);t.derivation=(0,i.expand)(t.derivation,{salt:e.parameters.salt,iterations:e.parameters.iterationCount});return t}});var Ze=O({keyDerivationFunc:Xe,encryptionScheme:qe});var Qe=Ae(Ze,{encode:function encode(e){return{algorithm:e.id,parameters:{keyDerivationFunc:e.derivation,encryptionScheme:e.encryption}}},decode:function decode(e){var t=(0,i.expand)(f[e.algorithm]);t.derivation=e.parameters.keyDerivationFunc;t.encryption=e.parameters.encryptionScheme;return t}});var $e=Ee({"pbeWithSHAAndAES128-CBC":Je,"pbeWithSHAAndAES192-CBC":Je,"pbeWithSHAAndAES256-CBC":Je,"pbeWithSHA256AndAES128-CBC":Je,"pbeWithSHA256AndAES192-CBC":Je,"pbeWithSHA256AndAES256-CBC":Je,"id-sc-pbeWithGost3411AndGost28147":Je,"id-sc-pbeWithGost3411AndGost28147CFB":Je,"pbeWithSHAAnd3-KeyTripleDES-CBC":Je,"pbeWithSHAAnd2-KeyTripleDES-CBC":Je,"pbeWithSHAAnd128BitRC2-CBC":Je,"pbeWithSHAAnd40BitRC2-CBC":Je,pbeUnknownGost:Je,PBES2:Qe});var et=Ee({ecdsa:Be,rsaEncryption:Fe,"id-sc-gost28147-gfb":Ge,"id-Gost28147-89":Oe,"id-sc-gostR3410-2001":Be,"id-GostR3410-2001":_e,"id-GostR3410-94":_e,"id-tc26-gost3410-12-256":_e,"id-tc26-gost3410-12-512":_e,"id-GostR3410-94-CryptoPro-ESDH":He,"id-GostR3410-2001-CryptoPro-ESDH":He,"id-tc26-agreement-gost-3410-12-256":He,"id-tc26-agreement-gost-3410-12-512":He,"id-sc-r3410-ESDH-r3411kdf":Fe,"id-Gost28147-89-None-KeyWrap":je,"id-Gost28147-89-CryptoPro-KeyWrap":je,"id-sc-cmsGostWrap":Pe,"id-sc-cmsGost28147Wrap":Pe,"pbeWithSHAAndAES128-CBC":Je,"pbeWithSHAAndAES192-CBC":Je,"pbeWithSHAAndAES256-CBC":Je,"pbeWithSHA256AndAES128-CBC":Je,"pbeWithSHA256AndAES192-CBC":Je,"pbeWithSHA256AndAES256-CBC":Je,"id-sc-pbeWithGost3411AndGost28147":Je,"id-sc-pbeWithGost3411AndGost28147CFB":Je,"pbeWithSHAAnd3-KeyTripleDES-CBC":Je,"pbeWithSHAAnd2-KeyTripleDES-CBC":Je,"pbeWithSHAAnd128BitRC2-CBC":Je,"pbeWithSHAAnd40BitRC2-CBC":Je,pbeUnknownGost:Je,PBES2:Qe});var tt=O({keyDerivationFunc:Xe,messageAuthScheme:ze});var rt=Ae(tt,{encode:function encode(e){return{algorithm:e.id,parameters:{keyDerivationFunc:e.derivation,messageAuthScheme:e.hmac}}},decode:function decode(e){var t=(0,i.expand)(f[e.algorithm]);t.derivation=e.parameters.keyDerivationFunc;t.hmac=e.parameters.messageAuthScheme;return t}});var nt=Ee({PBMAC1:rt});var it=Ee({"id-sc-gost28147-gfb":Ge,"id-Gost28147-89":Oe,"pbeWithSHAAndAES128-CBC":Je,"pbeWithSHAAndAES192-CBC":Je,"pbeWithSHAAndAES256-CBC":Je,"pbeWithSHA256AndAES128-CBC":Je,"pbeWithSHA256AndAES192-CBC":Je,"pbeWithSHA256AndAES256-CBC":Je,"id-sc-pbeWithGost3411AndGost28147":Je,"id-sc-pbeWithGost3411AndGost28147CFB":Je,"pbeWithSHAAnd3-KeyTripleDES-CBC":Je,"pbeWithSHAAnd2-KeyTripleDES-CBC":Je,"pbeWithSHAAnd128BitRC2-CBC":Je,"pbeWithSHAAnd40BitRC2-CBC":Je,pbeUnknownGost:Je,PBES2:Qe});var at=X;var ot=at(N(Z(K)),{encode:function encode(e){return b.encode(swapBytes(e))},decode:function decode(e){return swapBytes(b.decode(e))}});var st=at(N(Z(T)),{encode:function encode(e){var t=new Uint8Array(e.byteLength+1),r=swapBytes(e),n=e.byteLength/2;t[0]=4;t.set(new Uint8Array(r,n,n),1);t.set(new Uint8Array(r,0,n),n+1);return t.buffer},decode:function decode(e){assert((e.byteLength&1)===0);var t=new Uint8Array(e.byteLength-1),r=t.byteLength/2;t.set(new Uint8Array(e,r+1,r),0);t.set(new Uint8Array(e,1,r),r);return swapBytes(t)}});var ft=N(Z(T));var ct=O({algorithm:De,subjectPublicKey:N},"PUBLIC KEY");var ut=function(e){return X(G({algorithm:De,subjectPublicKey:C},"algorithm","subjectPublicKey")(function(t){return e[t.id]}),{encode:function encode(e){return{algorithm:e.algorithm,subjectPublicKey:e.buffer}},decode:function decode(e){return{algorithm:e.algorithm,type:"public",extractable:true,usages:["verify","deriveKey","deriveBits"],buffer:e.subjectPublicKey}}})}({"id-sc-gostR3410-2001":st,"id-sc-gostR3410-94":ot,"id-GostR3410-2001":ft,"id-GostR3410-94":ft,"id-tc26-gost3410-12-256":ft,"id-tc26-gost3410-12-512":ft});var dt=T;var ht=at(dt(Z(K)),{encode:function encode(e){return m.encode(e,true)},decode:function decode(e){return m.decode(e,true)}});var lt=T;var pt=O({keyValueMask:lt,keyValyePublicKey:T});var vt=J({privateKey:dt(Z(J({keyValueMask:lt,keyValueInfo:pt},function(e){if(isBinary(e))return"keyValueMask";else return"keyValueInfo"}))),keyValueMask:lt},function(e){return e.enclosed?"keyValueMask":"privateKey"});var yt=function(e){return G({version:de,privateKeyAlgorithm:De,privateKeyWrapped:at(dt(Z(O({keyData:K,keyMac:K}))),{encode:function encode(e){var t=e.byteLength-4;return{keyData:m.encode(new Uint8Array(e,0,t)),keyMac:m.encode(new Uint8Array(e,t,4))}},decode:function decode(e){var t=m.decode(e.keyData),r=m.decode(e.keyMac),n=new Uint8Array(t.byteLength+r.byteLength);n.set(new Uint8Array(t));n.set(new Uint8Array(r),t.byteLength);return n}}),attributes:C},"privateKeyAlgorithm","attributes")(function(t){return $(q(0,L(le({"id-sc-gostR3410-2001-publicKey":Y(e[t.id])}))))})}({"id-sc-gostR3410-2001":st,"id-sc-gostR3410-94":ot,"id-GostR3410-2001":ft,"id-GostR3410-94":ft,"id-GostR3410-2001DH":ft,"id-GostR3410-94DH":ft,"id-tc26-gost3410-12-256":ft,"id-tc26-gost3410-12-512":ft,"id-tc26-agreement-gost-3410-12-256":ft,"id-tc26-agreement-gost-3410-12-512":ft});var bt=O({version:de,privateKeyAlgorithm:De,privateKey:dt,attributes:$(q(0,L(le)))},"PRIVATE KEY");var mt=De;var gt=N;var wt=O({version:de,privateKeyAlgorithm:mt,privateKey:dt,attributes:$(q(0,L(le))),publicKey:$(q(1,L(gt)))});var Ct=W(wt);var St=function(e){return X(G({version:de,privateKeyAlgorithm:De,privateKey:C,attributes:$(q(0,L(le)))},"privateKeyAlgorithm","privateKey")(function(t){return e[t.id]}),{encode:function encode(e){return{version:0,privateKeyAlgorithm:e.algorithm,privateKey:e.buffer}},decode:function decode(e){return{algorithm:e.privateKeyAlgorithm,type:"private",extractable:true,usages:["sign","deriveKey","deriveBits"],buffer:isBinary(e.privateKey)?e.privateKey:e.privateKey.keyValueMask}}})}({"id-sc-gostR3410-2001":ht,"id-sc-gostR3410-94":ht,"id-GostR3410-2001":vt,"id-GostR3410-94":vt,"id-GostR3410-2001DH":vt,"id-GostR3410-94DH":vt,"id-tc26-gost3410-12-256":vt,"id-tc26-gost3410-12-512":vt,"id-tc26-agreement-gost-3410-12-256":vt,"id-tc26-agreement-gost-3410-12-512":vt});var At=T;var Et=O({encryptionAlgorithm:et,encryptedData:At},"ENCRYPTED PRIVATE KEY");var Bt=N;var _t=K;var Pt=O({cA:Q(S,false),pathLenConstraint:$(K)});var Ft=N({digitalSignature:0,nonRepudiation:1,keyEncipherment:2,dataEncipherment:3,keyAgreement:4,keyCertSign:5,cRLSign:6,encipherOnly:7,decipherOnly:8});var kt=j,Dt=W(kt);var It=T;var xt=O({type:j,value:q(0,H(C))});var Mt=O({nameAssigner:$(q(0,L(te))),partyName:$(q(1,L(te)))});var Kt=O({});var Rt=J({otherName:q(0,L(xt)),rfc822Name:q(1,L(te)),dNSName:q(2,L(te)),x400Address:q(3,L(Kt)),directoryName:q(4,H(ce)),ediPartyName:q(5,L(Mt)),uniformResourceIdentifier:q(6,L(te)),iPAddress:q(7,L(T)),registeredID:q(8,L(j))},function(e){return typeof e==="string"||e instanceof String?e.indexOf("@")>=0?"rfc822Name":"dNSName":isBinary(e)?"iPAddress":"directoryName"});var Tt=W(Rt);var Nt=O({keyIdentifier:$(q(0,L(It))),authorityCertIssuer:$(q(1,L(Tt))),authorityCertSerialNumber:$(q(2,L(_t)))});var Ut=O({notBefore:$(q(0,L(k))),notAfter:$(q(1,L(k)))});var Ot=j,Gt=j;var jt=O({policyQualifierId:Gt,qualifier:C});var Lt=O({policyIdentifier:Ot,policyQualifiers:$(W(jt))});var Ht=O({issuerDomainPolicy:Ot,subjectDomainPolicy:Ot});var qt=K;var zt=O({base:Rt,minimum:Q(q(0,L(qt)),0),maximum:$(q(1,L(qt)))});var Wt=W(zt);var Vt=O({permittedSubtrees:$(q(0,L(Wt))),excludedSubtrees:$(q(1,L(Wt)))});var Xt=K;var Yt=O({requireExplicitPolicy:$(q(0,L(Xt))),inhibitPolicyMapping:$(q(1,L(Xt)))});var Jt=N({unused:0,keyCompromise:1,cACompromise:2,affiliationChanged:3,superseded:4,cessationOfOperation:5,certificateHold:6,privilegeWithdrawn:7,aACompromise:8});var Zt=J({fullName:q(0,L(Tt)),nameRelativeToCRLIssuer:q(1,L(se))},function(e){return e instanceof Array?"fullName":"nameRelativeToCRLIssuer"});var Qt=O({distributionPoint:$(q(0,H(Zt))),reasons:$(q(1,L(Jt))),cRLIssuer:$(q(2,L(Tt)))});var $t=W(Qt);var er=$t;var tr=O({accessMethod:j,accessLocation:Rt});var rr=function Extension(e,t){var r=G({extnID:j,critical:Q(S,false),extnValue:function extnValue(e){return T(Z(e))}},"extnID","extnValue");var i=extend(r(e),{object:{get:function get(){var e=this._get(i.super,"object");if(e&&n(e.extnValue)==="object")this.defineValue(e.extnValue);return e},set:function set(e){this._set(i.super,"object",e);if(e&&e.extnValue)if(e.extnValue.critical!==undefined)this.critical=e.extnValue.critical;else if(this.critical===undefined&&t)this.critical=t(this.extnID,e.extnValue)}},extnValue:{get:function get(){var e=this._get(i.super,"extnValue");if((typeof e==="undefined"?"undefined":n(e))==="object")this.defineValue(e);return e},set:function set(e){this._set(i.super,"extnValue",e);if(e){if(e.critical!==undefined)this.critical=e.critical;else if(this.critical===undefined&&t)this.critical=t(this.extnID,e)}}},defineValue:function defineValue(e){if((typeof e==="undefined"?"undefined":n(e))==="object")if(!getOwnPropertyDescriptor(e,"critical")){var t=this;defineProperty(e,"critical",{get:function get(){return t.critical},set:function set(e){t.critical=e},enumerable:true,configurable:false})}}});return i};var nr=O({signTool:P,cATool:P,signToolCert:P,cAToolCert:P});var ir=W(rr,{typeName:"extnID",valueName:"extnValue"});var ar=ir({authorityKeyIdentifier:Nt,subjectKeyIdentifier:It,keyUsage:Ft,privateKeyUsagePeriod:Ut,certificatePolicies:W(Lt),policyMappings:W(Ht),subjectAltName:Tt,issuerAltName:Tt,subjectDirectoryAttributes:pe,basicConstraints:Pt,nameConstraints:Vt,policyConstraints:Yt,extKeyUsage:Dt,cRLDistributionPoints:$t,inhibitAnyPolicy:Xt,freshestCRL:er,authorityInfoAccess:W(tr),subjectInfoAccess:W(tr),subjectSignTool:P,issuerSignTool:nr},function(e,t){return e==="keyUsage"||e==="basicConstraints"&&t.pathLenConstraint===undefined});var or=O({r:K,s:K});var sr=C;var fr=or;var cr=U(O({version:q(0,H(de)),serialNumber:_t,signature:Ie,issuer:ce,validity:ue,subject:ce,subjectPublicKeyInfo:ct,issuerUniqueID:$(q(1,L(Bt))),subjectUniqueID:$(q(2,L(Bt))),extensions:$(q(3,H(ar)))}));var ur=O({tbsCertificate:cr,signatureAlgorithm:Ie,signatureValue:N},"CERTIFICATE");var dr=ar;var hr=le({challengePassword:Y(te),extensionRequest:Y(dr),msCertExtensions:Y(ar),extendedCertificateAttributes:Y(le)});var lr=U(O({version:K,subject:ce,subjectPublicKeyInfo:ct,attributes:q(0,L(hr))}));var pr=O({requestInfo:lr,signatureAlgorithm:Ie,signatureValue:N},"CERTIFICATE REQUEST");var vr=K;var yr=R({unspecified:0,keyCompromise:1,cACompromise:2,affiliationChanged:3,superseded:4,cessationOfOperation:5,certificateHold:6,removeFromCRL:8,privilegeWithdrawn:9,aACompromise:10});var br=O({distributionPoint:$(q(0,H(Zt))),onlyContainsUserCerts:Q(q(1,L(S)),false),onlyContainsCACerts:Q(q(2,L(S)),false),onlySomeReasons:$(q(3,L(Jt))),indirectCRL:Q(q(4,L(S)),false),onlyContainsAttributeCerts:Q(q(5,L(S)),false)});var mr=ir({authorityKeyIdentifier:Nt,issuerAltName:Tt,cRLNumber:vr,deltaCRLIndicator:vr,issuingDistributionPoint:br,freshestCRL:er},function(e){return e==="cRLNumber"});var gr=ir({cRLReason:yr,instructionCode:j,invalidityDate:k,certificateIssuer:Tt});var wr=U(O({version:$(de),signature:Ie,issuer:ce,thisUpdate:re,nextUpdate:$(re),revokedCertificates:$(W(O({userCertificate:_t,revocationDate:re,crlEntryExtensions:$(gr)}))),crlExtensions:$(q(0,H(mr)))}));var Cr=O({tbsCertList:wr,signatureAlgorithm:Ie,signatureValue:N},"CRL");var Sr=K;var Ar=O({digestedObjectType:R({publicKey:0,publicKeyCert:1,otherObjectTypes:2}),otherObjectTypeID:$(j),digestAlgorithm:xe,objectDigest:N});var Er=O({issuer:Tt,serial:_t,issuerUID:$(Bt)});var Br=O({issuerName:$(Tt),baseCertificateID:$(q(0,L(Er))),objectDigestInfo:$(q(1,L(Ar)))});var _r=O({targetCertificate:Er,targetName:$(Rt),certDigestInfo:$(Ar)});var Pr=J({targetName:q(0,H(Rt)),targetGroup:q(1,H(Rt)),targetCert:q(2,L(_r))});var Fr=W(Pr);var kr=ir({auditIdentity:T,targetInformation:Fr,authorityKeyIdentifier:Nt,authorityInfoAccess:W(tr),cRLDistributionPoints:$t,noRevAvail:x},function(e){return e==="auditIdentity"||e==="targetInformation"});var Dr=O({baseCertificateID:$(q(0,L(Er))),entityName:$(q(1,L(Tt))),objectDigestInfo:$(q(2,L(Ar)))});var Ir=J({v1Form:Tt,v2Form:q(0,L(Br))},"v2Form");var xr=O({notBeforeTime:k,notAfterTime:k});var Mr=O({service:Rt,ident:Rt,authInfo:$(T)});var Kr=O({roleAuthority:$(q(0,L(Tt))),roleName:q(1,H(Rt))});var Rr=N({unmarked:0,unclassified:1,restricted:2,confidential:3,secret:4,topSecret:5});var Tr=O({type:q(0,L(j)),value:q(1,L(C))});var Nr=O({policyId:q(0,L(j)),classList:Q(q(1,L(Rr)),["unclassified"]),securityCategories:$(q(2,L(V(Tr))))});var Ur=O({policyAuthority:$(q(0,L(Tt))),values:W(J({octets:T,oid:j,string:P},function(e){return isBinary?"octets":getIdentifier(e)?"oid":"string"}))});var Or=U(O({version:Sr,holder:Dr,issuer:Ir,signature:Ie,serialNumber:_t,attrCertValidityPeriod:xr,attributes:pe({authenticationInfo:V(Mr),accessIdentity:V(Mr),chargingIdentity:Y(Ur),group:Y(Ur),role:V(Kr),clearance:V(Nr)}),issuerUniqueID:$(Bt),extensions:$(kr)}));var Gr=O({acinfo:Or,signatureAlgorithm:Ie,signatureValue:N},"ATTRIBUTE CERTIFICATE");var jr=T;var Lr=T;var Hr=T;var qr=T;var zr=O({keyInfo:Le,entityUInfo:$(q(0,H(T))),suppPubInfo:q(2,H(T))});var Wr=X(O({encryptedKey:Me,maskKey:$(q(0,L(Me))),macKey:Ke}),{encode:function encode(e){var t=new Uint8Array(new Uint8Array(e,0,32)).buffer,r=new Uint8Array(new Uint8Array(e,32,4)).buffer;return{encryptedKey:t,macKey:r}},decode:function decode(e){var t=e.encryptedKey,r=e.maskKey,n=e.macKey;if(r){var i=new Int32Array(r),a=new Int32Array(t);for(var o=0,s=i.length/a.length;o<s;o++){for(var f=0,c=a.length;f<c;f++){a[f]=a[f]+i[c*o+f]&4294967295}}}var u=new Uint8Array(t.byteLength+n.byteLength);u.set(new Uint8Array(t),0);u.set(new Uint8Array(n),32);return u.buffer}});var Vr=O({encryptionParamSet:Re,ephemeralPublicKey:$(q(0,L(ut))),ukm:T});var Xr=X(O({sessionEncryptedKey:Wr,transportParameters:$(q(0,L(Vr)))}),{encode:function encode(e){var t=e.algorithm;return{sessionEncryptedKey:e.sessionEncryptedKey,transportParameters:{encryptionParamSet:d["sBox"][t.wrapping.sBox||"E-A"],ephemeralPublicKey:t["public"],ukm:t.ukm}}},decode:function decode(e){return{algorithm:{wrapping:h[e.transportParameters.encryptionParamSet],ukm:e.transportParameters.ukm,public:e.transportParameters.ephemeralPublicKey},sessionEncryptedKey:e.sessionEncryptedKey}}});var Yr=X(O({sessionEncryptedKey:Wr,ukm:O({ephemeralPublicKey:ut,addedukm:$(q(0,H(qr)))})}),{encode:function encode(e){var t=e.algorithm;return{sessionEncryptedKey:e.sessionEncryptedKey,ukm:{ephemeralPublicKey:t["public"],addedukm:t.ukm}}},decode:function decode(e){return{algorithm:{ukm:e.ukm.addedukm,public:e.ukm.ephemeralPublicKey},sessionEncryptedKey:e.sessionEncryptedKey}}});var Jr=function(e){return function(t){var r=e[t.id];return r?Z(r):C}}({"id-sc-gostR3410-2001":Yr,"id-sc-gostR3410-94":Yr,"id-GostR3410-2001":Xr,"id-GostR3410-94":Xr,"id-tc26-gost3410-12-256":Xr,"id-tc26-gost3410-12-512":Xr,"id-GostR3410-94-CryptoPro-ESDH":Wr,"id-GostR3410-2001-CryptoPro-ESDH":Wr,"id-tc26-agreement-gost-3410-12-256":Wr,"id-tc26-agreement-gost-3410-12-512":Wr,"id-sc-r3410-ESDH-r3411kdf":Wr,"id-Gost28147-89-None-KeyWrap":Wr,"id-Gost28147-89-CryptoPro-KeyWrap":Wr,"id-sc-cmsGostWrap":Wr,"id-sc-cmsGost28147Wrap":Wr});var Zr=N({kccaSoftPassword:0,kccaReservePrimary:1,kccaPrimaryKeyAbsent:2,kccaFKCShared:3});var Qr=N({pkaExportable:0,pkaUserProtect:1,pkaExchange:2,pkaEphemeral:3,pkaNonCachable:4,pkaDhAllowed:5});var $r=O({attributes:$(Qr),privateKeyAlgorithm:$(q(0,L(De)))});var en=O({path:A,hmac:Ke});var tn=Ee;var rn=O({containerAlgoritmIdentifier:$(q(0,L(Ee))),containerName:$(A),attributes:Zr,primaryPrivateKeyParameters:$r,hmacPassword:$(q(2,L(Ke))),secondaryEncryptedPrivateKey:$(q(3,L(Wr))),secondaryPrivateKeyParameters:$(q(4,L($r))),primaryCertificate:$(q(5,L(T(Z(ur))))),secondaryCertificate:$(q(6,L(T(Z(ur))))),encryptionContainerName:$(q(7,L(A))),primaryCertificateLink:$(q(8,L(en))),secondaryCertificateLink:$(q(9,L(en))),primaryFP:$(q(10,L(T))),secondaryFP:$(q(11,L(T))),passwordPolicy:$(tn),containerSecurityLevel:$(K),extensions:$(q(12,L(ir({keyValidity:O({notBefore:$(q(0,L(k))),notAfter:$(q(1,L(k)))})})))),secondaryEncryptionContainerName:$(q(13,L(A)))});var nn=O({keyContainerContent:rn,hmacKeyContainerContent:Ke});var an=O({containerName:A,extElem1:$(C)});var on=O({primaryKey:Me,secondaryKey:$(Me),hmacKey:$(Ke)});var sn=O({mask:Me,randomStatus:T,hmacRandom:Ke});var fn=O({keyClass:K,keyType:K,algorithm:$(q(0,H(De))),serialNumber:$(q(1,H(T))),addSerialNumber:$(q(2,H(T))),certSerialNumber:$(q(3,H(T))),subjectUID:$(q(4,H(T))),recipientUID:$(q(5,H(T))),validity:$(q(6,H(J({validity:ue,keyValidity:O({notBefore:$(q(0,L(k))),notAfter:$(q(1,L(k)))})},function(){return"keyValidity"})))),keyUID:$(q(7,H(N))),flags:$(q(10,H(K)))});var cn=O({version:K,keyInfo:fn,defenceKeyInfo:fn,certificate:$(q(0,H(ur))),publicKey:$(q(1,H(T)))});var un=K;var dn=j;var hn=re;var Hr=T;var ln=T;var pn=T;var vn=K;var yn=W(vn);var bn=O({bodyPartPath:yn,identifier:j,content:C});var mn=le({contentType:Y(dn),signingTime:Y(hn),messageDigest:Y(T)});var gn=le(function(e){return{countersignature:V(_n),unsignedData:V(bn)}[e]});var wn=mn,Cn=le,Sn=le;var An=O({issuer:ce,serialNumber:_t});var En=J({issuerAndSerialNumber:An,subjectKeyIdentifier:q(0,L(Hr))},function(e){return isBinary(e)?"subjectKeyIdentifier":"issuerAndSerialNumber"});var Bn=O({version:un,sid:En,digestAlgorithm:xe,signedAttrs:$(q(0,L(mn))),signatureAlgorithm:Ie,signatureValue:T,unsignedAttrs:$(q(1,L(gn)))});var _n=Bn,Pn=V(Bn),Fn=V(xe),kn=Gr;var Dn=U(O({version:un,certificate:ur,attributes:Cn}));var In=O({extendedCertificateInfo:Dn,signatureAlgorithm:Ie,signatureValue:N});var xn=O({otherCertFormat:j,otherCert:C});var Mn=U(O({version:K,subject:J({baseCertificateID:q(0,L(Er)),subjectName:q(1,L(Tt))},function(e){return e.issuer?"baseCertificateID":"subjectName"}),issuer:Tt,signature:Ie,serialNumber:_t,attCertValidityPeriod:xr,attributes:pe,issuerUniqueID:$(Bt),extensions:$(ar)}));var Kn=O({acInfo:Mn,signatureAlgorithm:Ie,signatureValue:N});var Rn=O({eContentType:dn,eContent:$(q(0,H(T)))});var Tn=J({certificate:ur,extendedCertificate:q(0,L(In)),v1AttrCert:q(1,L(Kn)),v2AttrCert:q(2,L(kn)),other:q(3,L(xn))},function(e){return e.holder?"AttributeCertificateV2":e.certificate?"ExtendedCertificate":e.otherCertFormat?"other":"certificate"});var Nn=O({otherRevInfoFormat:j,otherRevInfo:C});var Un=J({crl:Cr,other:q(1,L(Nn))},function(e){return e.otherRevInfoFormat?"other":"crl"});var On=V(Tn),Gn=V(Un);var jn=O({version:un,digestAlgorithms:Fn,encapContentInfo:Rn,certificates:$(q(0,L(On))),crls:$(q(1,L(Gn))),signerInfos:Pn});var Ln=J({issuerAndSerialNumber:An,subjectKeyIdentifier:q(0,L(Hr))},function(e){return isBinary(e)?"subjectKeyIdentifier":"issuerAndSerialNumber"});var Hn=O({version:un,rid:Ln,keyEncryptionAlgorithm:et,encryptedKey:jr});var qn=O({keyAttrId:j,keyAttr:$(C)});var zn=O({subjectKeyIdentifier:Hr,date:$(k),other:$(qn)});var Wn=J({issuerAndSerialNumber:An,rKeyId:q(0,L(zn))},function(e){return isBinary(e)?"rKeyId":"issuerAndSerialNumber"});var Vn=O({rid:Wn,encryptedKey:jr});var Xn=W(Vn);var Yn=O({algorithm:De,publicKey:N});var Jn=O({ephemeralPublicKey:Yn,addedukm:$(q(0,H(qr)))});var Zn=J({issuerAndSerialNumber:An,subjectKeyIdentifier:q(0,L(Hr)),originatorKey:q(1,L(Yn))},function(e){return isBinary(e)?"subjectKeyIdentifier":e.algorithm?"originatorKey":"issuerAndSerialNumber"});var Qn=O({version:un,originator:q(0,H(Zn)),ukm:$(q(1,H(qr))),keyEncryptionAlgorithm:et,recipientEncryptedKeys:Xn});var $n=O({keyIdentifier:T,date:$(k),other:$(qn)});var ei=O({version:un,kekid:$n,keyEncryptionAlgorithm:et,encryptedKey:jr});var ti=O({version:un,friendlyName:$(q(0,L(Xe))),keyEncryptionAlgorithm:et,encryptedKey:jr});var ri=O({oriType:j,oriValue:C});var ni=J({ktri:Hn,kari:q(1,L(Qn)),kekri:q(2,L(ei)),pwri:q(3,L(ti)),ori:q(4,L(ri))},function(e){return e.rid?"ktri":e.originator?"kari":e.kekid?"kekri":e.oriType?"ori":"pwri"});var ii=O({certs:$(q(0,L(On))),crls:$(q(1,L(Gn)))});var ai=V(ni);var oi=O({contentType:dn,contentEncryptionAlgorithm:it,encryptedContent:$(q(0,L(Lr)))});var si=O({version:un,originatorInfo:$(q(0,L(ii))),recipientInfos:ai,encryptedContentInfo:oi,unprotectedAttrs:$(q(1,L(Sn)))});var fi=O({version:un,digestAlgorithm:xe,encapContentInfo:Rn,digest:ln});var ci=O({version:un,encryptedContentInfo:oi,unprotectedAttrs:$(q(1,L(Sn)))});var ui=O({version:un,originatorInfo:$(q(0,L(ii))),recipientInfos:ai,macAlgorithm:ze,digestAlgorithm:$(q(1,xe)),encapContentInfo:Rn,authAttrs:$(q(2,L(wn))),mac:pn,unauthAttrs:$(q(3,L(Cn)))});var di=O({version:un,originatorInfo:$(q(0,L(ii))),recipientInfos:ai,authEncryptedContentInfo:oi,authAttrs:$(q(1,L(wn))),mac:pn,unauthAttrs:$(q(2,L(Cn)))});var hi=J({encrypted:ci,enveloped:q(0,L(si)),authEnveloped:q(1,L(di))},function(e){return e.encryptedContentInfo?e.recipientInfos?"enveloped":"encrypted":"authEnveloped"});var dn=j;var li=G({contentType:dn,content:function content(e){return q(0,H(e))}},"contentType","content",undefined,"CMS")({data:T,signedData:U(jn),envelopedData:U(si),digestedData:U(fi),encryptedData:U(ci),authData:U(ui),encryptedKeyPkg:U(hi),aKeyPackage:U(Ct)});var pi=O({digestAlgorithm:xe,digest:ln});var vi=le({friendlyName:Y(I),keyProviderNameAttr:Y(I),localKeyId:Y(T),certKeyIdentifierPropId:Y(T)});var yi=j;var bi=j;var mi=j;var gi=j;var wi=bt;var Ci=Et;var Si=G({certId:bi,certValue:function certValue(e){return q(0,H(e))}},"certId","certValue")({x509Certificate:T(Z(ur)),sdsiCertificate:A},T);var Ai=G({crlId:mi,crlValue:function crlValue(e){return q(0,H(e))}},"crlId","crlValue")({x509CRL:T(Z(Cr))},T);var Ei=G({secretTypeId:gi,secretValue:function secretValue(e){return q(0,H(e))}},"secretTypeId","secretValue")({secret:T},T);var Bi=G({bagId:yi,bagValue:function bagValue(e){return q(0,H(e))},bagAttributes:$(vi)},"bagId","bagValue")(function(e){return{keyBag:wi,pkcs8ShroudedKeyBag:Ci,certBag:Si,crlBag:Ai,secretBag:Ei,safeContentsBag:_i}[e]});var _i=W(Bi);var Pi=W(li);var Fi=O({mac:pi,macSalt:T,iterations:Q(K,1)});var ki=O({version:K,authSafe:li,macData:$(Fi)},"PFX");var Di=P;var Ii=P;var xi=O({issuer:Rt,serialNumber:K});var Mi=xi;var Ki=ct;var Ri=O({intendedAlg:$(q(0,L(Ee))),symmAlg:$(q(1,L(Ee))),encSymmKey:$(q(2,L(N))),keyAlg:$(q(3,L(Ee))),valueHint:$(q(4,L(T))),encValue:N});var Ti=T;var jr=J({encryptedValue:Ri,envelopedData:q(0,L(si))},function(e){return e.encryptedContentInfo?"envelopedData":"encryptedValue"});var Ni=J({encryptedPrivKey:q(0,jr),keyGenParameters:q(1,L(Ti)),archiveRemGenPrivKey:q(2,L(S))});var Ui=O({pubMethod:K({dontCare:0,x500:1,web:2,ldap:3}),pubLocation:$(Rt)});var Oi=O({action:K({dontPublish:0,pleasePublish:1}),pubInfos:$(W(Ui))});var Gi=K({encrCert:0,challengeResp:1});var ji=J({thisMessage:q(0,L(N)),subsequentMessage:q(1,L(Gi)),dhMAC:q(2,L(N)),agreeMAC:q(3,L(Hi)),encryptedKey:q(4,L(si))});var Li=O({salt:T,owf:Ee,iterationCount:K,mac:Ee});var Hi=O({algId:Ee,value:N});var qi=O({authInfo:J({sender:q(0,H(Rt)),publicKeyMAC:Hi}),publicKey:ct});var zi=O({poposkInput:$(q(0,qi)),algorithmIdentifier:Ee,signature:N});var Wi=J({raVerified:q(0,L(x)),signature:q(1,L(zi)),keyEncipherment:q(2,L(ji)),keyAgreement:q(3,L(ji))});var Vi=W(ae({regToken:Di,authenticator:Ii,pkiPublicationInfo:Oi,pkiArchiveOptions:Ni,oldCertID:Mi,protocolEncrKey:Ki}));var Xi=O({notBefore:$(q(0,L(re))),notAfter:$(q(1,L(re)))});var Yi=O({version:$(q(0,L(de))),serialNumber:$(q(1,L(K))),signingAlg:$(q(2,L(Ee))),issuer:$(q(3,L(ce))),validity:$(q(4,L(Xi))),subject:$(q(5,L(ce))),publicKey:$(q(6,L(ct))),issuerUID:$(q(7,L(Bt))),subjectUID:$(q(8,L(Bt))),extensions:$(q(9,L(ir)))});var Ji=O({certReqId:K,certTemplate:Yi,controls:$(Vi)});var Zi=P;var Qi=Ji;var $i=O({privateKey:bt,identifier:$(J({string:P,generalName:Rt},function(e){return typeof e==="string"||e instanceof String?"string":"generalName"}))});var ea=O({certReq:Ji,popo:$(Wi),regInfo:$(W(ae({utf8Pairs:Zi,certReq:Qi,encKeyWithID:$i})))});var ta=W(ea);var ra=O({pendToken:T,pendTime:k});var na=K({success:0,failed:2,pending:3,noSupport:4,confirmRequired:5,popRequired:6,partial:7});var ia=K({badAlg:0,badMessageCheck:1,badRequest:2,badTime:3,badCertId:4,unsupportedExt:5,mustArchiveKeys:6,badIdentity:7,popRequired:8,popFailed:9,noKeyReuse:10,internalCAError:11,tryLater:12,authDataFail:13});var aa=O({cMCStatus:na,bodyList:W(vn),statusString:$(P),otherInfo:$(J({failInfo:ia,pendInfo:ra}))});var oa=O({pkiDataReference:vn,certReferences:W(vn),extensions:W(rr)});var sa=O({pkiDataBodyid:vn,bodyIds:W(vn)});var fa=O({issuerName:Rt,serialNumber:K});var ca=O({issuerName:ce,cRLName:$(Rt),time:$(k),reasons:$(Jt)});var ua=O({issuerName:ce,serialNumber:K,reason:yr,invalidityDate:$(k),passphrase:$(T),comment:$(P)});var da=O({bodyPartID:vn,thePOPAlgID:Ee,thePOP:T});var ha=An;var la=J({bodyPartID:vn,bodyPartPath:yn});var pa=O({cMCStatus:na,bodyList:W(la),statusString:$(P),otherInfo:$(J({failInfo:ia,pendInfo:ra,extendedFailInfo:O({failInfoOID:j,failInfoValue:ie})}))});var va=O({seqNumber:K,hashAlgorithm:Ee,anchorHashes:W(T)});var ya=vn;var ba=W(vn);var ma=O({hashAlg:Ee,certHashes:W(T),pubInfo:Oi});var ga=O({pkiDataReference:yn,certReferences:ba,replace:Q(S,true),certTemplate:Yi});var wa=O({bodyList:W(la)});var Ca=O({proofAlgID:Ee,macAlgId:Ee,witness:T});var Sa=O({keyGenAlgorithm:Ee,macAlgorithm:Ee,witness:T});var Aa=O({bodyPartID:vn,certificationRequest:pr});var Ea=O({bodyPartID:vn,contentInfo:li});var Ba=O({bodyPartID:vn,otherMsgType:j,otherMsgValue:C});var _a=J({tcr:q(0,L(Aa)),crm:q(1,L(ea)),orm:q(2,L(O({bodyPartID:vn,requestMessageType:j,requestMessageValue:C})))});var Pa=O({request:_a,cms:li,thePOPAlgID:Ee,witnessAlgID:Ee,witness:T});var Fa=G({bodyPartID:vn,attrType:j,attrValues:function attrValues(e){return V(e)}},"attrType","attrValues",ie)({statusInfo:aa,identification:P,identityProof:T,dataReturn:T,transactionId:K,senderNonce:T,recipientNonce:T,addExtensions:oa,encryptedPOP:Pa,decryptedPOP:da,lraPOPWitness:sa,getCert:fa,getCRL:ca,revokeRequest:ua,regInfo:T,responseInfo:T,queryPending:T,popLinkRandom:T,popLinkWitness:T,confirmCertAcceptance:ha,statusInfoV2:pa,trustedAnchors:va,authPublish:ya,batchRequests:ba,batchResponses:ba,publishCert:ma,modCertTemplate:ga,controlProcessed:wa,popLinkWitnessV2:Sa,identityProofV2:Ca});var ka=O({controlSequence:W(Fa),reqSequence:W(_a),cmsSequence:W(Ea),otherMsgSequence:W(Ba)},"PKI REQUEST");var Da=O({controlSequence:W(Fa),cmsSequence:W(Ea),otherMsgSequence:W(Ba)},"PKI RESPONSE");function GostASN1(){}GostASN1.prototype={GostPrivateKeyInfo:St,GostSubjectPublicKeyInfo:ut,GostKeyContainer:nn,GostKeyContainerName:an,GostPrivateKeys:on,GostPrivateMasks:sn,ViPNetInfo:cn,GostSignature:fr,GostEncryptedKey:Jr,GostWrappedPrivateKey:yt,PrivateKeyInfo:bt,EncryptedPrivateKeyInfo:Et,SubjectPublicKeyInfo:ct,TBSCertificate:cr,Certificate:ur,CertificationRequestInfo:lr,CertificationRequest:pr,TBSCertList:wr,CertificateList:Cr,AttributeCertificateInfo:Or,AttributeCertificate:Gr,SignedAttributes:mn,UnsignedAttributes:gn,ContentInfo:li,SafeContents:_i,AuthenticatedSafe:Pi,PFX:ki,PKIData:ka,PKIResponse:Da};var Ia=t.gostASN1Instance=new GostASN1},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.GostSecurity=GostSecurity;function expand(){var e={};for(var t=0,r=arguments.length;t<r;t++){var i=arguments[t];if((typeof i==="undefined"?"undefined":n(i))==="object")for(var a in i){e[a]=i[a]}}return e}var i={"1.2.643.2.2":"CryptoPro","1.2.643.2.2.3":"id-GostR3411-94-with-GostR3410-2001","1.2.643.2.2.4":"id-GostR3411-94-with-GostR3410-94","1.2.643.2.2.9":"id-GostR3411-94","1.2.643.2.2.10":"id-HMACGostR3411-94","1.2.643.2.2.13.0":"id-Gost28147-89-None-KeyWrap","1.2.643.2.2.13.1":"id-Gost28147-89-CryptoPro-KeyWrap","1.2.643.2.2.14.0":"id-Gost28147-89-None-KeyMeshing","1.2.643.2.2.14.1":"id-Gost28147-89-CryptoPro-KeyMeshing","1.2.643.2.2.19":"id-GostR3410-2001","1.2.643.2.2.20":"id-GostR3410-94","1.2.643.2.2.20.1":"id-GostR3410-94-a","1.2.643.2.2.20.2":"id-GostR3410-94-aBis","1.2.643.2.2.20.3":"id-GostR3410-94-b","1.2.643.2.2.20.4":"id-GostR3410-94-bBis","1.2.643.2.2.21":"id-Gost28147-89","1.2.643.2.2.22":"id-Gost28147-89-MAC","1.2.643.2.2.30.0":"id-GostR3411-94-TestParamSet","1.2.643.2.2.30.1":"id-GostR3411-94-CryptoProParamSet","1.2.643.2.2.30.2":"id-GostR3411-94-CryptoPro-B-ParamSet","1.2.643.2.2.30.3":"id-GostR3411-94-CryptoPro-C-ParamSet","1.2.643.2.2.30.4":"id-GostR3411-94-CryptoPro-D-ParamSet","1.2.643.2.2.31.0":"id-Gost28147-89-TestParamSet","1.2.643.2.2.31.1":"id-Gost28147-89-CryptoPro-A-ParamSet","1.2.643.2.2.31.2":"id-Gost28147-89-CryptoPro-B-ParamSet","1.2.643.2.2.31.3":"id-Gost28147-89-CryptoPro-C-ParamSet","1.2.643.2.2.31.4":"id-Gost28147-89-CryptoPro-D-ParamSet","1.2.643.2.2.31.5":"id-Gost28147-89-CryptoPro-Oscar-1-1-ParamSet","1.2.643.2.2.31.6":"id-Gost28147-89-CryptoPro-Oscar-1-0-ParamSet","1.2.643.2.2.31.7":"id-Gost28147-89-CryptoPro-RIC-1-ParamSet ","1.2.643.2.2.31.12":"id-Gost28147-89-CryptoPro-tc26-1","1.2.643.2.2.31.13":"id-Gost28147-89-CryptoPro-tc26-2","1.2.643.2.2.31.14":"id-Gost28147-89-CryptoPro-tc26-3","1.2.643.2.2.31.15":"id-Gost28147-89-CryptoPro-tc26-4","1.2.643.2.2.31.16":"id-Gost28147-89-CryptoPro-tc26-5","1.2.643.2.2.31.17":"id-Gost28147-89-CryptoPro-tc26-6","1.2.643.2.2.32.0":"id-GostR3410-94-TestParamSet","1.2.643.2.2.32.2":"id-GostR3410-94-CryptoPro-A-ParamSet","1.2.643.2.2.32.3":"id-GostR3410-94-CryptoPro-B-ParamSet","1.2.643.2.2.32.4":"id-GostR3410-94-CryptoPro-C-ParamSet","1.2.643.2.2.32.5":"id-GostR3410-94-CryptoPro-D-ParamSet","1.2.643.2.2.33.1":"id-GostR3410-94-CryptoPro-XchA-ParamSet","1.2.643.2.2.33.2":"id-GostR3410-94-CryptoPro-XchB-ParamSet","1.2.643.2.2.33.3":"id-GostR3410-94-CryptoPro-XchC-ParamSet","1.2.643.2.2.34.2":"temporaryAccessToRC","1.2.643.2.2.34.3":"internetContentSignature","1.2.643.2.2.34.4":"adminRC","1.2.643.2.2.34.5":"operatorRC","1.2.643.2.2.34.6":"userRC","1.2.643.2.2.34.7":"clientRC","1.2.643.2.2.34.8":"serverRC","1.2.643.2.2.34.9":"sysAdminRC","1.2.643.2.2.34.10":"arcAdminRC","1.2.643.2.2.34.11":"authorityPersonRC","1.2.643.2.2.34.12":"clientCC","1.2.643.2.2.34.13":"sysAdminCC","1.2.643.2.2.34.14":"arcAdminCC","1.2.643.2.2.34.15":"accessIPSecCA","1.2.643.2.2.34.16":"auditAdminHSM","1.2.643.2.2.34.21":"adminHSM","1.2.643.2.2.34.22":"serverAdminHSH","1.2.643.2.2.34.24":"winlogonCA","1.2.643.2.2.34.25":"timestampServiceUser","1.2.643.2.2.34.26":"statusServiceUser","1.2.643.2.2.34.27":"arcAdminHSM","1.2.643.2.2.34.28":"auditorHSM","1.2.643.2.2.35.0":"id-GostR3410-2001-CryptoPro-TestParamSet","1.2.643.2.2.35.1":"id-GostR3410-2001-CryptoPro-A-ParamSet","1.2.643.2.2.35.2":"id-GostR3410-2001-CryptoPro-B-ParamSet","1.2.643.2.2.35.3":"id-GostR3410-2001-CryptoPro-C-ParamSet","1.2.643.2.2.36.0":"id-GostR3410-2001-CryptoPro-XchA-ParamSet","1.2.643.2.2.36.1":"id-GostR3410-2001-CryptoPro-XchB-ParamSet","1.2.643.2.2.37.1":"id-CryptoPro-GostPrivateKeys-V1","1.2.643.2.2.37.2":"id-CryptoPro-GostPrivateKeys-V2","1.2.643.2.2.37.2.1":"id-CryptoPro-GostPrivateKeys-V2-Full","1.2.643.2.2.37.2.2":"id-CryptoPro-GostPrivateKeys-V2-PartOf","1.2.643.2.2.37.3.1":"intermediateCertificates","1.2.643.2.2.37.3.2":"trustedCertificatesSignature","1.2.643.2.2.37.3.3":"trustedCertificatesExchange","1.2.643.2.2.37.3.10":"keyValidity","1.2.643.2.2.38.1":"personalBaseProlicy","1.2.643.2.2.38.2":"networkBasePolicy","1.2.643.2.2.47.1":"id-CryptoPro-ocsp-treats-exp-key-or-exp-cert-rev","1.2.643.2.2.47.2":"id-CryptoPro-ocsp-crl-locator","1.2.643.2.2.47.3":"id-CryptoPro-ocsp-instant-revocation-indicator","1.2.643.2.2.47.4":"id-CryptoPro-ocsp-revocation-announcement-reference","1.2.643.2.2.47.5":"id-CryptoPro-ocsp-historical-request","1.2.643.2.2.49.2":"limitedLicense","1.2.643.2.2.96":"id-GostR3410-2001-CryptoPro-ESDH","1.2.643.2.2.97":"id-GostR3410-94-CryptoPro-ESDH","1.2.643.2.2.98":"id-GostR3410-2001DH","1.2.643.2.2.99":"id-GostR3410-94DH","1.2.643.2.45.1.1.1":"signatureComment","1.2.643.2.45.1.1.2":"resourceName","1.2.643.2.45.1.1.3":"signatureUsage","1.2.643.3.131.1.1":"INN","1.2.643.3.141.1.1":"RNS FSS","1.2.643.3.141.1.2":"KP FSS","1.2.643.7.1":"tc26","1.2.643.7.1.1.1.1":"id-tc26-gost3410-12-256","1.2.643.7.1.1.1.2":"id-tc26-gost3410-12-512","1.2.643.7.1.1.2.1":"id-tc26-gost3411-94","1.2.643.7.1.1.2.2":"id-tc26-gost3411-12-256","1.2.643.7.1.1.2.3":"id-tc26-gost3411-12-512","1.2.643.7.1.1.3.1":"id-tc26-signwithdigest-gost3410-12-94","1.2.643.7.1.1.3.2":"id-tc26-signwithdigest-gost3410-12-256","1.2.643.7.1.1.3.3":"id-tc26-signwithdigest-gost3410-12-512","1.2.643.7.1.1.4.1":"id-tc26-hmac-gost-3411-12-256","1.2.643.7.1.1.4.2":"id-tc26-hmac-gost-3411-12-512","1.2.643.7.1.1.6.1":"id-tc26-agreement-gost-3410-12-256","1.2.643.7.1.1.6.2":"id-tc26-agreement-gost-3410-12-512","1.2.643.7.1.2.1.1.0":"id-tc26-gost-3410-12-256-paramSetTest","1.2.643.7.1.2.1.1.1":"id-tc26-gost-3410-12-256-paramSetA","1.2.643.7.1.2.1.1.2":"id-tc26-gost-3410-12-256-paramSetB","1.2.643.7.1.2.1.2.0":"id-tc26-gost-3410-12-512-paramSetTest","1.2.643.7.1.2.1.2.1":"id-tc26-gost-3410-12-512-paramSetA","1.2.643.7.1.2.1.2.2":"id-tc26-gost-3410-12-512-paramSetB","1.2.643.7.1.2.1.2.3":"id-tc26-gost-3410-12-512-paramSetC","1.2.643.7.1.2.1.2.4":"id-tc26-gost-3410-12-512-paramSetD","1.2.643.7.1.2.5.1.1":"id-tc26-gost-28147-param-Z","1.2.643.100.1":"OGRN","1.2.643.100.2.1":"SMEV-person","1.2.643.100.2.2":"SMEV-government","1.2.643.100.3":"SNILS","1.2.643.100.4":"KPP","1.2.643.100.5":"OGRNIP","1.2.643.100.6":"internal-government","1.2.643.100.111":"subjectSignTool","1.2.643.100.112":"issuerSignTool","1.2.643.100.113.1":"signToolClassKC1","1.2.643.100.113.2":"signToolClassKC2","1.2.643.100.113.3":"signToolClassKC3","1.2.643.100.113.4":"signToolClassKB1","1.2.643.100.113.5":"signToolClassKB2","1.2.643.100.113.6":"signToolClassKA1","1.2.643.100.114.1":"issuerToolClassKC1","1.2.643.100.114.2":"issuerToolClassKC2","1.2.643.100.114.3":"issuerToolClassKC3","1.2.643.100.114.4":"issuerToolClassKB2","1.2.643.100.114.5":"issuerToolClassKB1","1.2.643.100.114.6":"issuerToolClassKA1","1.2.840.10040.4":"x9cm","1.2.840.10040.4.1":"dsa","1.2.840.10040.4.3":"dsa-with-SHA1","1.2.840.10045":"ansi-x962","1.2.840.10045.1":"id-fieldType","1.2.840.10045.1.1":"id-prime-Field","1.2.840.10045.1.2":"id-characteristic-two-field","1.2.840.10045.2.1":"ecPublicKey","1.2.840.10045.3.0":"characteristicTwo","1.2.840.10045.3.1.1":"secp192r1","1.2.840.10045.3.1.2":"prime192v2","1.2.840.10045.3.1.3":"prime192v3","1.2.840.10045.3.1.4":"prime239v1","1.2.840.10045.3.1.5":"prime239v2","1.2.840.10045.3.1.6":"prime239v3","1.2.840.10045.3.1.7":"secp256r1","1.2.840.10045.4":"ecdsa","1.2.840.10045.4.1":"ecdsa-with-SHA1","1.2.840.10045.4.2":"ecdsa-with-Recommended","1.2.840.10045.4.4":"ecdsa-with-SHA2","1.2.840.10045.4.4.1":"ecdsa-with-SHA224","1.2.840.10045.4.4.2":"ecdsa-with-SHA256","1.2.840.10045.4.4.3":"ecdsa-with-SHA384","1.2.840.10045.4.4.4":"ecdsa-with-SHA512","1.2.840.113533.7.66.13":"PasswordBasedMac","1.3.6.1.4.1.22554.1.1.2.1.2":"pbeWithSHAAndAES128-CBC","1.3.6.1.4.1.22554.1.1.2.1.22":"pbeWithSHAAndAES192-CBC","1.3.6.1.4.1.22554.1.1.2.1.42":"pbeWithSHAAndAES256-CBC","1.3.6.1.4.1.22554.1.2.1.2.1.2":"pbeWithSHA256AndAES128-CBC","1.3.6.1.4.1.22554.1.2.1.2.1.22":"pbeWithSHA256AndAES192-CBC","1.3.6.1.4.1.22554.1.2.1.2.1.42":"pbeWithSHA256AndAES256-CBC","1.2.840.113549":"rsa","1.2.840.113549.1.1.1":"rsaEncryption","1.2.840.113549.1.1.2":"md2withRSAEncryption","1.2.840.113549.1.1.3":"md4withRSAEncryption","1.2.840.113549.1.1.4":"md5withRSAEncryption","1.2.840.113549.1.1.5":"sha1withRSAEncryption","1.2.840.113549.1.1.7":"rsaes-oaep","1.2.840.113549.1.1.8":"mgf1","1.2.840.113549.1.1.9":"pSpecified","1.2.840.113549.1.1.10":"rsassa-pss","1.2.840.113549.1.1.11":"sha256withRSAEncryption","1.2.840.113549.1.1.12":"sha384withRSAEncryption","1.2.840.113549.1.1.13":"sha512withRSAEncryption","1.2.840.113549.1.2.7":"hmacWithSHA1","1.2.840.113549.1.2.8":"hmacWithSHA224","1.2.840.113549.1.2.9":"hmacWithSHA256","1.2.840.113549.1.2.10":"hmacWithSHA384","1.2.840.113549.1.2.11":"hmacWithSHA512","1.2.840.113549.1.3.1":"dhKeyAgreement","1.2.840.113549.1.5.12":"PBKDF2","1.2.840.113549.1.5.13":"PBES2","1.2.840.113549.1.5.14":"PBMAC1","1.2.840.113549.1.7.1":"data","1.2.840.113549.1.7.2":"signedData","1.2.840.113549.1.7.3":"envelopedData","1.2.840.113549.1.7.4":"signedAndEnvelopedData","1.2.840.113549.1.7.5":"digestedData","1.2.840.113549.1.7.6":"encryptedData","1.2.840.113549.1.9.1":"emailAddress","1.2.840.113549.1.9.2":"unstructuredName","1.2.840.113549.1.9.3":"contentType","1.2.840.113549.1.9.4":"messageDigest","1.2.840.113549.1.9.5":"signingTime","1.2.840.113549.1.9.6":"countersignature","1.2.840.113549.1.9.7":"challengePassword","1.2.840.113549.1.9.8":"unstructuredAddress","1.2.840.113549.1.9.9":"extendedCertificateAttributes","1.2.840.113549.1.9.10":"issuerAndSerialNumber","1.2.840.113549.1.9.11":"passwordCheck","1.2.840.113549.1.9.12":"publicKey","1.2.840.113549.1.9.13":"signingDescription","1.2.840.113549.1.9.14":"extensionRequest","1.2.840.113549.1.9.15":"sMimeCapabilities","1.2.840.113549.1.9.16":"sMimeObjectIdentifierRegistry","1.2.840.113549.1.9.16.1.2":"authData","1.2.840.113549.1.9.16.1.4 ":"timestampToken","1.2.840.113549.1.9.16.1.17 ":"firmwareLoadReceipt","1.2.840.113549.1.9.16.1.21":"encKeyWithID","1.2.840.113549.1.9.16.1.23":"authEnvelopedData","1.2.840.113549.1.9.16.2":"sMimeAttributes","1.2.840.113549.1.9.16.2.1":"receiptRequest","1.2.840.113549.1.9.16.2.12":"signingCertificate","1.2.840.113549.1.9.16.2.14":"timeStampToken","1.2.840.113549.1.9.16.2.2":"securityLabel","1.2.840.113549.1.9.16.2.3":"mlExpansionHistory","1.2.840.113549.1.9.16.2.34":"unsignedData","1.2.840.113549.1.9.16.2.47":"signingCertificateV2","1.2.840.113549.1.9.16.3.5":"ESDH","1.2.840.113549.1.9.20":"friendlyName","1.2.840.113549.1.9.21":"localKeyId","1.2.840.113549.1.9.22":"certTypes","1.2.840.113549.1.9.22.1":"x509Certificate","1.2.840.113549.1.9.22.2":"sdsiCertificate","1.2.840.113549.1.9.23":"crlTypes","1.2.840.113549.1.9.23.1":"x509CRL","1.2.840.113549.1.9.24":"secretTypes","1.2.840.113549.1.9.24.1":"secret","1.2.840.113549.1.9.25.1":"pkcs15Token","1.2.840.113549.1.9.25.2":"encryptedPrivateKeyInfo","1.2.840.113549.1.9.25.3":"randomNonce","1.2.840.113549.1.9.25.4":"sequenceNumber","1.2.840.113549.1.9.25.5":"pkcs7PDU","1.2.840.113549.1.9.26.1":"pkcs9String","1.2.840.113549.1.9.26.2":"signingTimeString","1.2.840.113549.1.9.27.1":"caseIgnoreMatch","1.2.840.113549.1.9.27.2":"signingTimeMatch","1.2.840.113549.1.12.0.1":"pkcs-12","1.2.840.113549.1.12.1":"pbe","1.2.840.113549.1.12.1.1":"pbeWithSHAAnd128BitRC4","1.2.840.113549.1.12.1.2":"pbeWithSHAAnd40BitRC4","1.2.840.113549.1.12.1.3":"pbeWithSHAAnd3-KeyTripleDES-CBC","1.2.840.113549.1.12.1.4":"pbeWithSHAAnd2-KeyTripleDES-CBC","1.2.840.113549.1.12.1.5":"pbeWithSHAAnd128BitRC2-CBC","1.2.840.113549.1.12.1.6":"pbeWithSHAAnd40BitRC2-CBC","1.2.840.113549.1.12.1.80":"pbeUnknownGost","1.2.840.113549.1.12.2.1":"pkcs8-key-shrouding","1.2.840.113549.1.12.3.1":"keyBagId","1.2.840.113549.1.12.3.2":"certAndCRLBagId","1.2.840.113549.1.12.3.3":"secretBagId","1.2.840.113549.1.12.3.4":"safeContentsId","1.2.840.113549.1.12.3.5":"pkcs-8ShroudedKeyBagId","1.2.840.113549.1.12.4.1":"x509CertCRLBagId","1.2.840.113549.1.12.4.2":"pkcs-12-SDSICertBag","1.2.840.113549.1.12.10.1.1":"keyBag","1.2.840.113549.1.12.10.1.2":"pkcs8ShroudedKeyBag","1.2.840.113549.1.12.10.1.3":"certBag","1.2.840.113549.1.12.10.1.4":"crlBag","1.2.840.113549.1.12.10.1.5":"secretBag","1.2.840.113549.1.12.10.1.6":"safeContentsBag","1.2.840.113549.2.5":"md-5","1.2.840.113549.3.7":"des-EDE3-CBC","1.3.132.0.34":"secp384r1","1.3.132.0.35":"secp521r1","1.3.132.112":"ecDH","1.3.14.3.2.26":"sha1","1.3.6.1.4.1.311.2.1.14":"msCertExtensions","1.3.6.1.4.1.311.17.1":"keyProviderNameAttr","1.3.6.1.4.1.311.17.2":"localMachineKeyset","1.3.6.1.4.1.311.17.3.20":"certKeyIdentifierPropId","1.3.6.1.4.1.5849":"SignalCom","1.3.6.1.4.1.5849.1.1.1":"id-sc-gost28147-ecb","1.3.6.1.4.1.5849.1.1.2":"id-sc-gost28147-gamma","1.3.6.1.4.1.5849.1.1.3":"id-sc-gost28147-gfb","1.3.6.1.4.1.5849.1.1.4":"id-sc-gost28147-mac","1.3.6.1.4.1.5849.1.1.5":"id-sc-gostR3410-94","1.3.6.1.4.1.5849.1.1.6.1.1.1":"id-sc-gostR3410-94-default","1.3.6.1.4.1.5849.1.1.6.1.1.2":"id-sc-gostR3410-94-test","1.3.6.1.4.1.5849.1.2.1":"id-sc-gostR3411-94","1.3.6.1.4.1.5849.1.3.1":"id-sc-gostR3411-94-with-gostR3410-94","1.3.6.1.4.1.5849.1.3.2":"id-sc-gostR3411-94-with-gostR3410-2001","1.3.6.1.4.1.5849.1.4.1":"id-sc-cmsGostWrap","1.3.6.1.4.1.5849.1.4.2":"id-sc-cmsGost28147Wrap","1.3.6.1.4.1.5849.1.5.1":"id-sc-pbeWithGost3411AndGost28147","1.3.6.1.4.1.5849.1.5.2":"id-sc-pbeWithGost3411AndGost28147CFB","1.3.6.1.4.1.5849.1.6.2":"id-sc-gostR3410-2001","1.3.6.1.4.1.5849.1.7.2":"id-sc-hmacWithGostR3411","1.3.6.1.4.1.5849.1.8.1":"id-sc-r3410-ESDH-r3411kdf","1.3.6.1.4.1.5849.1.8.3":"id-sc-ecdh-singlePass-cofactor-r3411kdf","1.3.6.1.4.1.5849.2.2.1":"id-sc-gostR3410-2001-publicKey","1.3.6.1.5.5.7.0.12":"attribute-cert","1.3.6.1.5.5.7.1.1":"authorityInfoAccess","1.3.6.1.5.5.7.1.4":"auditIdentity","1.3.6.1.5.5.7.1.6":"aaControls","1.3.6.1.5.5.7.1.10":"ac-proxying","1.3.6.1.5.5.7.1.11":"subjectInfoAccess","1.3.6.1.5.5.7.3.1":"serverAuth","1.3.6.1.5.5.7.3.2":"clientAuth","1.3.6.1.5.5.7.3.3":"codeSigning","1.3.6.1.5.5.7.3.4":"emailProtection","1.3.6.1.5.5.7.3.5":"ipsecEndSystem","1.3.6.1.5.5.7.3.6":"ipsecTunnel","1.3.6.1.5.5.7.3.7":"ipsecUser","1.3.6.1.5.5.7.3.8":"timeStamping","1.3.6.1.5.5.7.3.9":"OCSPSigning","1.3.6.1.5.5.7.5.1":"regCtrl","1.3.6.1.5.5.7.5.1.1":"regToken","1.3.6.1.5.5.7.5.1.2":"authenticator","1.3.6.1.5.5.7.5.1.3":"pkiPublicationInfo","1.3.6.1.5.5.7.5.1.4":"pkiArchiveOptions","1.3.6.1.5.5.7.5.1.5":"oldCertID","1.3.6.1.5.5.7.5.1.6":"protocolEncrKey","1.3.6.1.5.5.7.5.2":"regInfoAttr","1.3.6.1.5.5.7.5.2.1":"UTF8Pairs","1.3.6.1.5.5.7.5.2.2":"certReq","1.3.6.1.5.5.7.6.2":"noSignature","1.3.6.1.5.5.7.7.1":"statusInfo","1.3.6.1.5.5.7.7.2":"identification","1.3.6.1.5.5.7.7.3":"identityProof","1.3.6.1.5.5.7.7.4":"dataReturn","1.3.6.1.5.5.7.7.5":"transactionId","1.3.6.1.5.5.7.7.6":"senderNonce","1.3.6.1.5.5.7.7.7":"recipientNonce","1.3.6.1.5.5.7.7.8":"addExtensions","1.3.6.1.5.5.7.7.9":"encryptedPOP","1.3.6.1.5.5.7.7.10":"decryptedPOP","1.3.6.1.5.5.7.7.11":"lraPOPWitness","1.3.6.1.5.5.7.7.15":"getCert","1.3.6.1.5.5.7.7.16":"getCRL","1.3.6.1.5.5.7.7.17":"revokeRequest","1.3.6.1.5.5.7.7.18":"regInfo","1.3.6.1.5.5.7.7.19":"responseInfo","1.3.6.1.5.5.7.7.21":"queryPending","1.3.6.1.5.5.7.7.22":"popLinkRandom","1.3.6.1.5.5.7.7.23":"popLinkWitness","1.3.6.1.5.5.7.7.24":"confirmCertAcceptance","1.3.6.1.5.5.7.7.25":"statusInfoV2","1.3.6.1.5.5.7.7.26":"trustedAnchors","1.3.6.1.5.5.7.7.27":"authPublish","1.3.6.1.5.5.7.7.28":"batchRequests","1.3.6.1.5.5.7.7.29":"batchResponses","1.3.6.1.5.5.7.7.30":"publishCert","1.3.6.1.5.5.7.7.31":"modCertTemplate","1.3.6.1.5.5.7.7.32":"controlProcessed","1.3.6.1.5.5.7.7.33":"popLinkWitnessV2","1.3.6.1.5.5.7.7.34":"identityProofV2","1.3.6.1.5.5.7.9.1":"dateOfBirth","1.3.6.1.5.5.7.9.2":"placeOfBirth","1.3.6.1.5.5.7.9.3":"gender","1.3.6.1.5.5.7.9.4":"countryOfCitizenship","1.3.6.1.5.5.7.9.5":"countryOfResidence","1.3.6.1.5.5.7.10.1":"authenticationInfo","1.3.6.1.5.5.7.10.2":"accessIdentity","1.3.6.1.5.5.7.10.3":"chargingIdentity","1.3.6.1.5.5.7.10.4":"group","1.3.6.1.5.5.7.10.6":"encAttrs","1.3.6.1.5.5.7.12.2":"PKIData","1.3.6.1.5.5.7.12.3":"PKIResponse","1.3.6.1.5.5.7.48.1.1":"ocsp-basic","1.3.6.1.5.5.7.48.1.2":"ocsp-nonce","1.3.6.1.5.5.7.48.1.3":"ocsp-crl","1.3.6.1.5.5.7.48.1.4":"ocsp-response","1.3.6.1.5.5.7.48.1.5":"ocsp-nocheck","1.3.6.1.5.5.7.48.1.6":"ocsp-archive-cutoff","1.3.6.1.5.5.7.48.1.7":"ocsp-service-locator","2.16.840.1.101.2.1.2.78.2":"encryptedKeyPkg","2.16.840.1.101.2.1.2.78.3":"keyPackageReceipt","2.16.840.1.101.2.1.2.78.5":"aKeyPackage","2.16.840.1.101.2.1.2.78.6":"keyPackageError","2.16.840.1.101.3.4":"nistAlgorithms","2.16.840.1.101.3.4.1":"aes","2.16.840.1.101.3.4.1.1":"aes128-ECB","2.16.840.1.101.3.4.1.2":"aes128-CBC","2.16.840.1.101.3.4.1.3":"aes128-OFB","2.16.840.1.101.3.4.1.4":"aes128-CFB","2.16.840.1.101.3.4.1.5":"aes128-wrap","2.16.840.1.101.3.4.1.6":"aes128-GCM","2.16.840.1.101.3.4.1.7":"aes128-CCM","2.16.840.1.101.3.4.1.8":"aes128-wrap-pad","2.16.840.1.101.3.4.1.21":"aes192-ECB","2.16.840.1.101.3.4.1.22":"aes192-CBC","2.16.840.1.101.3.4.1.23":"aes192-OFB","2.16.840.1.101.3.4.1.24":"aes192-CFB","2.16.840.1.101.3.4.1.25":"aes192-wrap","2.16.840.1.101.3.4.1.26":"aes192-GCM","2.16.840.1.101.3.4.1.27":"aes192-CCM","2.16.840.1.101.3.4.1.28":"aes192-wrap-pad","2.16.840.1.101.3.4.1.41":"aes256-ECB","2.16.840.1.101.3.4.1.42":"aes256-CBC","2.16.840.1.101.3.4.1.43":"aes256-OFB","2.16.840.1.101.3.4.1.44":"aes256-CFB","2.16.840.1.101.3.4.1.45":"aes256-wrap","2.16.840.1.101.3.4.1.46":"aes256-GCM","2.16.840.1.101.3.4.1.47":"aes256-CCM","2.16.840.1.101.3.4.1.48":"aes256-wrap-pad","2.16.840.1.101.3.4.2.1":"sha256","2.16.840.1.101.3.4.2.2":"sha384","2.16.840.1.101.3.4.2.3":"sha512","2.16.840.1.113730.3.1.216":"userPKCS12","2.5.1.5.55":"clearance","2.5.4.0":"objectClass","2.5.4.1":"aliasedEntryName","2.5.4.2":"knowldgeinformation","2.5.4.3":"commonName","2.5.4.5":"serialName","2.5.4.6":"countryName","2.5.4.7":"localityName","2.5.4.8":"stateOrProvinceName","2.5.4.9":"streetAddress","2.5.4.10":"organizationName","2.5.4.11":"organizationalUnitName","2.5.4.12":"title","2.5.4.13":"description","2.5.4.14":"searchGuide","2.5.4.15":"businessCategory","2.5.4.16":"postalAddress","2.5.4.17":"postalCode","2.5.4.18":"postOfficeBox","2.5.4.19":"physicalDeliveryOfficeName","2.5.4.20":"telephoneNumber","2.5.4.21":"telexNumber","2.5.4.22":"teletexTerminalIdentifier","2.5.4.23":"facsimileTelephoneNumber","2.5.4.24":"x121Address","2.5.4.25":"internationalISDNNumber","2.5.4.26":"registeredAddress","2.5.4.27":"destinationIndicator","2.5.4.28":"preferredDeliveryMethod","2.5.4.29":"presentationAddress","2.5.4.30":"supportedApplicationContext","2.5.4.31":"member","2.5.4.32":"owner","2.5.4.33":"roleOccupant","2.5.4.34":"seeAlso","2.5.4.35":"userPassword","2.5.4.36":"userCertificate","2.5.4.37":"cACertificate","2.5.4.38":"authorityRevocationList","2.5.4.39":"certificateRevocationList","2.5.4.40":"crossCertificatePair","2.5.4.41":"name","2.5.4.42":"givenName","2.5.4.43":"initials","2.5.4.44":"generationQualifier","2.5.4.45":"uniqueIdentifier","2.5.4.46":"dnQualifier","2.5.4.47":"enhancedSearchGuide","2.5.4.48":"protocolInformation","2.5.4.49":"distinguishedName","2.5.4.50":"uniqueMember","2.5.4.51":"houseIdentifier","2.5.4.52":"supportedAlgorithms","2.5.4.53":"deltaRevocationList","2.5.4.58":"attributeCertificate","2.5.4.65":"pseudonym","2.5.4.72":"role","2.5.29.1":"authorityKeyIdentifierX","2.5.29.2":"keyAttributesX","2.5.29.3":"certificatePoliciesX","2.5.29.4":"keyUsageRestriction","2.5.29.5":"policyMapping","2.5.29.6":"subtreesConstraint","2.5.29.7":"subjectAltNameX","2.5.29.8":"issuerAltNameX","2.5.29.9":"subjectDirectoryAttributes","2.5.29.10":"basicConstraintsX","2.5.29.11":"nameConstraintsX","2.5.29.12":"policyConstraintsX","2.5.29.13":"basicConstraintsY","2.5.29.14":"subjectKeyIdentifier","2.5.29.15":"keyUsage","2.5.29.16":"privateKeyUsagePeriod","2.5.29.17":"subjectAltName","2.5.29.18":"issuerAltName","2.5.29.19":"basicConstraints","2.5.29.20":"cRLNumber","2.5.29.21":"cRLReason","2.5.29.22":"expirationDate","2.5.29.23":"instructionCode","2.5.29.24":"invalidityDate","2.5.29.25":"cRLDistributionPointsX","2.5.29.26":"issuingDistributionPointX","2.5.29.27":"deltaCRLIndicator","2.5.29.28":"issuingDistributionPoint","2.5.29.29":"certificateIssuer","2.5.29.30":"nameConstraints","2.5.29.31":"cRLDistributionPoints","2.5.29.32":"certificatePolicies","2.5.29.33":"policyMappings","2.5.29.34":"policyConstraintsY","2.5.29.35":"authorityKeyIdentifier","2.5.29.36":"policyConstraints","2.5.29.37":"extKeyUsage","2.5.29.46":"freshestCRL","2.5.29.54":"inhibitAnyPolicy","2.5.29.55":"targetInformation","2.5.29.56":"noRevAvail"};var a={};for(var o in i){a[i[o]]=o}var s={"id-GostR3411-94-with-GostR3410-2001":"GOST R 34.10-2001/GOST R 34.11-94","id-GostR3411-94-with-GostR3410-94":"GOST R 34.10-94/GOST R 34.11-94","id-GostR3411-94":"GOST R 34.11-94","id-HMACGostR3411-94":{name:"HMAC",hash:{name:"GOST R 34.11-94"}},"id-Gost28147-89-None-KeyWrap":"GOST 28147-89-KW","id-Gost28147-89-CryptoPro-KeyWrap":"GOST 28147-89-CPKW","id-GostR3410-2001":"GOST R 34.10-2001","id-GostR3410-94":"GOST R 34.10-94","id-GostR3410-94-a":"GOST R 34.10-94","id-GostR3410-94-aBis":"GOST R 34.10-94","id-GostR3410-94-b":"GOST R 34.10-94","id-GostR3410-94-bBis":"GOST R 34.10-94","id-Gost28147-89":"GOST 28147-89","id-Gost28147-89-MAC":"GOST 28147-89-MAC","id-GostR3410-2001-CryptoPro-ESDH":"GOST R 34.10-2001-DH/GOST R 34.11-94","id-GostR3410-94-CryptoPro-ESDH":"GOST R 34.10-94-DH/GOST R 34.11-94","id-GostR3410-2001DH":"GOST R 34.10-2001-DH","id-GostR3410-94DH":"GOST R 34.10-94-DH","id-tc26-gost3410-12-256":"GOST R 34.10-256","id-tc26-gost3410-12-512":"GOST R 34.10-512","id-tc26-gost3411-94":"GOST R 34.11-94","id-tc26-gost3411-12-256":"GOST R 34.11-256","id-tc26-gost3411-12-512":"GOST R 34.11-512","id-tc26-signwithdigest-gost3410-12-94":"GOST R 34.10-256/GOST R 34.11-94","id-tc26-signwithdigest-gost3410-12-256":"GOST R 34.10-256/GOST R 34.11-256","id-tc26-signwithdigest-gost3410-12-512":"GOST R 34.10-512/GOST R 34.11-512","id-tc26-hmac-gost-3411-12-256":{name:"HMAC",hash:{name:"GOST R 34.11-256"}},"id-tc26-hmac-gost-3411-12-512":{name:"HMAC",hash:{name:"GOST R 34.11-512"}},"id-tc26-agreement-gost-3410-12-256":"GOST R 34.10-256-DH/GOST R 34.11-256","id-tc26-agreement-gost-3410-12-512":"GOST R 34.10-512-DH/GOST R 34.11-256","id-sc-gost28147-ecb":"GOST 28147-89-ECB/SC","id-sc-gost28147-gamma":"GOST 28147-89-CTR/SC","id-sc-gost28147-gfb":"GOST 28147-89-CFB/SC","id-sc-gost28147-mac":"GOST 28147-89-MAC/SC","id-sc-gostR3410-94":"GOST R 34.10-94/SC","id-sc-gostR3410-94-default":"GOST R 34.10-94/SC","id-sc-gostR3410-94-test":"GOST R 34.10-94/SC/S-TEST","id-sc-gostR3411-94":"GOST R 34.11-94/SC","id-sc-gostR3411-94-with-gostR3410-94":"GOST R 34.10-94/GOST R 34.11-94/SC","id-sc-gostR3411-94-with-gostR3410-2001":"GOST R 34.10-2001/GOST R 34.11-94/SC","id-sc-cmsGostWrap":"GOST 28147-89-SCKW/SC","id-sc-cmsGost28147Wrap":"GOST 28147-89-KW/SC","id-sc-pbeWithGost3411AndGost28147":{derivation:{name:"GOST R 34.11-94-PBKDF2/SC"},encryption:{name:"GOST 28147-ECB/SC"}},"id-sc-pbeWithGost3411AndGost28147CFB":{derivation:{name:"GOST R 34.11-94-PBKDF2/SC"},encryption:{name:"GOST 28147-CFB/SC"}},"id-sc-gostR3410-2001":"GOST R 34.10-2001/SC","id-sc-hmacWithGostR3411":{name:"HMAC",hash:{name:"GOST R 34.11-94/SC"}},"id-sc-r3410-ESDH-r3411kdf":"GOST R 34.10-2001-DH/GOST R 34.11-94/SC",noSignature:"NONE",rsaEncryption:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},sha1withRSAEncryption:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-1"}},sha256withRSAEncryption:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},sha384withRSAEncryption:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-384"}},sha512withRSAEncryption:{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-512"}},"rsaes-oaep":"RSA-OAEP","rsassa-pss":"RSA-PSS",ecdsa:"ECDSA","ecdsa-with-SHA1":{name:"ECDSA",hash:{name:"SHA-1"}},"ecdsa-with-SHA256":{name:"ECDSA",hash:{name:"SHA-256"}},"ecdsa-with-SHA384":{name:"ECDSA",hash:{name:"SHA-384"}},"ecdsa-with-SHA512":{name:"ECDSA",hash:{name:"SHA-512"}},"pbeWithSHAAndAES128-CBC":{derivation:{name:"PBKDF2",hash:{name:"SHA-1"}},encryption:{name:"AES-CBC",length:128}},"pbeWithSHAAndAES192-CBC":{derivation:{name:"PBKDF2",hash:{name:"SHA-1"}},encryption:{name:"AES-CBC",length:192}},"pbeWithSHAAndAES256-CBC":{derivation:{name:"PBKDF2",hash:{name:"SHA-1"}},encryption:{name:"AES-CBC",length:256}},"pbeWithSHA256AndAES128-CBC":{derivation:{name:"PBKDF2",hash:{name:"SHA-256"}},encryption:{name:"AES-CBC",length:128}},"pbeWithSHA256AndAES192-CBC":{derivation:{name:"PBKDF2",hash:{name:"SHA-256"}},encryption:{name:"AES-CBC",length:192}},"pbeWithSHA256AndAES256-CBC":{derivation:{name:"PBKDF2",hash:{name:"SHA-256"}},encryption:{name:"AES-CBC",length:256}},"pbeWithSHAAnd3-KeyTripleDES-CBC":{derivation:{name:"PFXKDF",iterations:2e3,hash:"SHA-1"},encryption:{name:"3DES",block:"CBC"}},"pbeWithSHAAnd2-KeyTripleDES-CBC":{derivation:{name:"PFXKDF",iterations:2e3,hash:"SHA-1"},encryption:{name:"2DES",block:"CBC"}},"pbeWithSHAAnd128BitRC2-CBC":{derivation:{name:"PFXKDF",iterations:2e3,hash:"SHA-1"},encryption:{name:"RC2",block:"CBC",length:128}},"pbeWithSHAAnd40BitRC2-CBC":{derivation:{name:"PFXKDF",iterations:2e3,hash:"SHA-1"},encryption:{name:"RC2",block:"CBC",length:40}},pbeUnknownGost:{derivation:{name:"PFXKDF",iterations:2e3,hash:"GOST R 34.11-94"},encryption:{name:"GOST 28147-89-CFB"}},ecDH:"ECDH",dhKeyAgreement:"DH","aes128-CBC":{name:"AES-CBC",length:128},"aes128-CFB":{name:"AES-CFB-8",length:128},"aes128-GCM":{name:"AES-GCM",length:128},"aes128-wrap":{name:"AES-KW",length:128},"aes192-CBC":{name:"AES-CBC",length:192},"aes192-CFB":{name:"AES-CFB-8",length:192},"aes192-GCM":{name:"AES-GCM",length:192},"aes192-wrap":{name:"AES-KW",length:192},"aes256-CBC":{name:"AES-CBC",length:256},"aes256-CFB":{name:"AES-CFB-8",length:256},"aes256-GCM":{name:"AES-GCM",length:256},"aes256-wrap":{name:"AES-KW",length:256},sha1:"SHA-1",sha256:"SHA-256",sha384:"SHA-384",sha512:"SHA-512",PBKDF2:"PBKDF2",PBES2:{derivation:{name:"PBKDF2"},encryption:{}},PBMAC1:{derivation:{name:"PBKDF2"},hmac:{}},hmacWithSHA1:"SHA-1-HMAC",hmacWithSHA256:{name:"HMAC",hash:{name:"SHA-256"}},hmacWithSHA384:{name:"HMAC",hash:{name:"SHA-384"}},hmacWithSHA512:{name:"HMAC",hash:{name:"SHA-512"}}};for(var f in s){var c=s[f];if(typeof c==="string"){c={name:c}}c.id=f;s[f]=c}var u={"id-GostR3410-94-TestParamSet":{namedParam:"S-TEST"},"id-GostR3410-94-CryptoPro-A-ParamSet":{namedParam:"S-A"},"id-GostR3410-94-CryptoPro-B-ParamSet":{namedParam:"S-B"},"id-GostR3410-94-CryptoPro-C-ParamSet":{namedParam:"S-C"},"id-GostR3410-94-CryptoPro-D-ParamSet":{namedParam:"S-D"},"id-GostR3410-94-CryptoPro-XchA-ParamSet":{namedParam:"X-A"},"id-GostR3410-94-CryptoPro-XchB-ParamSet":{namedParam:"X-B"},"id-GostR3410-94-CryptoPro-XchC-ParamSet":{namedParam:"X-C"},"id-GostR3410-2001-CryptoPro-TestParamSet":{namedCurve:"S-256-TEST"},"id-GostR3410-2001-CryptoPro-A-ParamSet":{namedCurve:"S-256-A"},"id-GostR3410-2001-CryptoPro-B-ParamSet":{namedCurve:"S-256-B"},"id-GostR3410-2001-CryptoPro-C-ParamSet":{namedCurve:"S-256-C"},"id-GostR3410-2001-CryptoPro-XchA-ParamSet":{namedCurve:"X-256-A"},"id-GostR3410-2001-CryptoPro-XchB-ParamSet":{namedCurve:"X-256-B"},"id-tc26-gost-3410-12-256-paramSetTest":{namedCurve:"T-256-TEST"},"id-tc26-gost-3410-12-256-paramSetA":{namedCurve:"T-256-A"},"id-tc26-gost-3410-12-256-paramSetB":{namedCurve:"T-256-B"},"id-tc26-gost-3410-12-512-paramSetTest":{namedCurve:"T-512-TEST"},"id-tc26-gost-3410-12-512-paramSetA":{namedCurve:"T-512-A"},"id-tc26-gost-3410-12-512-paramSetB":{namedCurve:"T-512-B"},"id-tc26-gost-3410-12-512-paramSetC":{namedCurve:"T-512-C"},"id-tc26-gost-3410-12-512-paramSetD":{namedCurve:"T-512-D"},secp256r1:{namedCurve:"P-256"},secp384r:{namedCurve:"P-384"},secp521r:{namedCurve:"P-521"},"id-GostR3411-94-TestParamSet":{sBox:"D-TEST"},"id-GostR3411-94-CryptoProParamSet":{sBox:"D-A"},"id-GostR3411-94-CryptoPro-A-ParamSet":{sBox:"D-B"},"id-GostR3411-94-CryptoPro-B-ParamSet":{sBox:"D-C"},"id-GostR3411-94-CryptoPro-C-ParamSet":{sBox:"D-D"},"id-Gost28147-89-TestParamSet":{block:"CTR",sBox:"E-TEST"},"id-Gost28147-89-CryptoPro-A-ParamSet":{block:"CFB",sBox:"E-A",keyMeshing:"CP"},"id-Gost28147-89-CryptoPro-B-ParamSet":{block:"CFB",sBox:"E-B",keyMeshing:"CP"},"id-Gost28147-89-CryptoPro-C-ParamSet":{block:"CFB",sBox:"E-C",keyMeshing:"CP"},"id-Gost28147-89-CryptoPro-D-ParamSet":{block:"CFB",sBox:"E-D",keyMeshing:"CP"},"id-Gost28147-89-None-KeyMeshing":{keyMeshing:"NO"},"id-Gost28147-89-CryptoPro-KeyMeshing":{keyMeshing:"CP"},"id-tc26-gost-28147-param-Z":{block:"CFB",sBox:"E-Z"}};var d={sBox:{"D-TEST":"id-GostR3411-94-TestParamSet","D-A":"id-GostR3411-94-CryptoProParamSet","D-B":"id-GostR3411-94-CryptoPro-A-ParamSet","D-C":"id-GostR3411-94-CryptoPro-B-ParamSet","D-D":"id-GostR3411-94-CryptoPro-C-ParamSet","E-TEST":"id-Gost28147-89-TestParamSet","E-A":"id-Gost28147-89-CryptoPro-A-ParamSet","E-B":"id-Gost28147-89-CryptoPro-B-ParamSet","E-C":"id-Gost28147-89-CryptoPro-C-ParamSet","E-D":"id-Gost28147-89-CryptoPro-D-ParamSet","E-Z":"id-tc26-gost-28147-param-Z","D-256":"id-tc26-gost3411-12-256","D-512":"id-tc26-gost3411-12-512"},namedParam:{"S-TEST":"id-GostR3410-94-TestParamSet","S-A":"id-GostR3410-94-CryptoPro-A-ParamSet","S-B":"id-GostR3410-94-CryptoPro-B-ParamSet","S-C":"id-GostR3410-94-CryptoPro-C-ParamSet","S-D":"id-GostR3410-94-CryptoPro-D-ParamSet","X-A":"id-GostR3410-94-CryptoPro-XchA-ParamSet","X-B":"id-GostR3410-94-CryptoPro-XchB-ParamSet","X-C":"id-GostR3410-94-CryptoPro-XchC-ParamSet"},namedCurve:{"S-256-TEST":"id-GostR3410-2001-CryptoPro-TestParamSet","S-256-A":"id-GostR3410-2001-CryptoPro-A-ParamSet","S-256-B":"id-GostR3410-2001-CryptoPro-B-ParamSet","S-256-C":"id-GostR3410-2001-CryptoPro-C-ParamSet","X-256-A":"id-GostR3410-2001-CryptoPro-XchA-ParamSet","X-256-B":"id-GostR3410-2001-CryptoPro-XchB-ParamSet","P-256":"secp256r1","T-256-TEST":"id-tc26-gost-3410-12-256-paramSetTest","T-256-A":"id-tc26-gost-3410-12-256-paramSetA","T-256-B":"id-tc26-gost-3410-12-256-paramSetB","T-512-TEST":"id-tc26-gost-3410-12-512-paramSetTest","T-512-A":"id-tc26-gost-3410-12-512-paramSetA","T-512-B":"id-tc26-gost-3410-12-512-paramSetB"}};var h={"CP-94":{title:"Crypto-Pro GOST R 34.10-94 Cryptographic Service Provider",signature:s["id-GostR3411-94-with-GostR3410-94"],publicKey:{id:"id-GostR3410-94",name:"GOST R 34.10-94",namedParam:"X-A"},privateKey:{id:"id-GostR3410-94DH",name:"GOST R 34.10-94-DH",namedParam:"X-A"},digest:s["id-GostR3411-94"],wrapping:{id:"id-Gost28147-89-CryptoPro-KeyWrap",name:"GOST 28147-89-CPKW",sBox:"E-A"},hmac:s["id-HMACGostR3411-94"],agreement:s["id-GostR3410-94-CryptoPro-ESDH"],encryption:{id:"id-Gost28147-89",name:"GOST 28147-89",block:"CFB",sBox:"E-A",keyMeshing:"CP"},derivation:{id:"PBKDF2",name:"GOST R 34.11-94-PBKDF2",iterations:2e3}},"CP-01":{title:"Crypto-Pro GOST R 34.10-2001 Cryptographic Service Provider",signature:s["id-GostR3411-94-with-GostR3410-2001"],publicKey:{id:"id-GostR3410-2001",name:"GOST R 34.10-2001",namedCurve:"X-256-A"},privateKey:{id:"id-GostR3410-2001DH",name:"GOST R 34.10-2001-DH",namedCurve:"X-256-A"},digest:{id:"id-GostR3411-94",name:"GOST R 34.11-94",sBox:"D-A"},wrapping:{id:"id-Gost28147-89-CryptoPro-KeyWrap",name:"GOST 28147-89-CPKW",sBox:"E-A"},hmac:s["id-HMACGostR3411-94"],agreement:s["id-GostR3410-2001-CryptoPro-ESDH"],encryption:{id:"id-Gost28147-89",name:"GOST 28147-89-CFB-CPKM",sBox:"E-A"},derivation:{id:"PBKDF2",name:"GOST R 34.11-94-PBKDF2",iterations:2e3}},"TC-256":{title:"Crypto-Pro GOST R 34.10-2012 Cryptographic Service Provider",signature:s["id-tc26-signwithdigest-gost3410-12-256"],publicKey:{id:"id-tc26-gost3410-12-256",name:"GOST R 34.10-256",namedCurve:"X-256-A"},privateKey:{id:"id-tc26-agreement-gost-3410-12-256",name:"GOST R 34.10-256-DH/GOST R 34.11-256",namedCurve:"X-256-A"},digest:s["id-tc26-gost3411-12-256"],wrapping:{id:"id-Gost28147-89-CryptoPro-KeyWrap",name:"GOST 28147-89-CPKW",sBox:"E-A"},hmac:s["id-tc26-hmac-gost-3411-12-256"],agreement:s["id-tc26-agreement-gost-3410-12-256"],encryption:{id:"id-Gost28147-89",name:"GOST 28147-89-CFB-CPKM",sBox:"E-A"},derivation:{id:"PBKDF2",name:"GOST R 34.11-256-12-PBKDF2",iterations:2e3}},"TC-512":{title:"Crypto-Pro GOST R 34.10-2012 Strong Cryptographic Service Provider",signature:s["id-tc26-signwithdigest-gost3410-12-512"],publicKey:{id:"id-tc26-gost3410-12-512",name:"GOST R 34.10-512",namedCurve:"T-512-A"},privateKey:{id:"id-tc26-agreement-gost-3410-12-512",name:"GOST R 34.10-512-DH/GOST R 34.11-256",namedCurve:"T-512-A"},digest:s["id-tc26-gost3411-12-512"],wrapping:{id:"id-Gost28147-89-CryptoPro-KeyWrap",name:"GOST 28147-89-CPKW",sBox:"E-A"},hmac:s["id-tc26-hmac-gost-3411-12-512"],agreement:s["id-tc26-agreement-gost-3410-12-512"],encryption:{id:"id-Gost28147-89",name:"GOST 28147-89-CFB-CPKM",sBox:"E-A"},derivation:{id:"PBKDF2",name:"GOST R 34.11-256-PBKDF2",iterations:2e3}},"SC-94":{title:"Signal-COM GOST Cryptographic Provider",signature:s["id-sc-gostR3411-94-with-gostR3410-94"],publicKey:{id:"id-sc-gostR3410-94",name:"GOST R 34.10-94/SC",namedParam:"S-A"},privateKey:{id:"id-sc-gostR3410-94",name:"GOST R 34.10-94/SC",modulusLength:1024,param:{p:"0xB4E25EFB018E3C8B87505E2A67553C5EDC56C2914B7E4F89D23F03F03377E70A2903489DD60E78418D3D851EDB5317C4871E40B04228C3B7902963C4B7D85D52B9AA88F2AFDBEB28DA8869D6DF846A1D98924E925561BD69300B9DDD05D247B5922D967CBB02671881C57D10E5EF72D3E6DAD4223DC82AA1F7D0294651A480DF",q:"0x972432A437178B30BD96195B773789AB2FFF15594B176DD175B63256EE5AF2CF",a:"0x8FD36731237654BBE41F5F1F8453E71CA414FFC22C25D915309E5D2E62A2A26C7111F3FC79568DAFA028042FE1A52A0489805C0DE9A1A469C844C7CABBEE625C3078888C1D85EEA883F1AD5BC4E6776E8E1A0750912DF64F79956499F1E182475B0B60E2632ADCD8CF94E9C54FD1F3B109D81F00BF2AB8CB862ADF7D40B9369A"}},digest:s["id-sc-gostR3411-94"],encryption:{id:"id-sc-gost28147-gfb",name:"GOST 28147-89-CFB/SC"},hmac:s["id-sc-hmacWithGostR3411"],wrapping:["id-sc-cmsGostWrap"],agreement:s["id-sc-r3410-ESDH-r3411kdf"],derivation:{id:"PBKDF2",name:"GOST R 34.11-94-PBKDF2/SC",iterations:2048},pbes:{id:"id-sc-pbeWithGost3411AndGost28147CFB",derivation:{id:"PBKDF2",name:"GOST R 34.11-94-PBKDF2/SC",iterations:2048},encryption:{id:"id-sc-gost28147-gfb",name:"GOST 28147-CFB/SC",iv:new Uint8Array([0,0,0,0,0,0,0,0])}}},"SC-01":{title:"Signal-COM ECGOST Cryptographic Provider",signature:s["id-sc-gostR3411-94-with-gostR3410-2001"],publicKey:{id:"id-sc-gostR3410-2001",name:"GOST R 34.10-2001/SC",namedCurve:"P-256"},privateKey:{id:"id-sc-gostR3410-2001",name:"GOST R 34.10-2001/SC",curve:{p:"0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF",a:"0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC",b:"0x5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B",x:"0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296",y:"0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",q:"0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"}},digest:s["id-sc-gostR3411-94"],encryption:{id:"id-sc-gost28147-gfb",name:"GOST 28147-89-CFB/SC"},hmac:s["id-sc-hmacWithGostR3411"],wrapping:s["id-sc-cmsGostWrap"],agreement:s["id-sc-r3410-ESDH-r3411kdf"],derivation:{id:"PBKDF2",name:"GOST R 34.11-94-PBKDF2/SC",iterations:2048},pbes:{id:"id-sc-pbeWithGost3411AndGost28147CFB",derivation:{id:"PBKDF2",name:"GOST R 34.11-94-PBKDF2/SC",iterations:2048},encryption:{id:"id-sc-gost28147-gfb",name:"GOST 28147-CFB/SC",iv:new Uint8Array([0,0,0,0,0,0,0,0])}}},"RSA-2048":{title:"Microsoft Strong Cryptographic Provider",signature:s["sha256withRSAEncryption"],publicKey:{id:"rsaEncryption",name:"RSASSA-PKCS1-v1_5",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:s["sha256"]},privateKey:{id:"rsaEncryption",name:"RSASSA-PKCS1-v1_5",modulusLength:2048,publicExponent:new Uint8Array([1,0,1]),hash:s["sha256"]},digest:s["sha256"],encryption:s["aes256-CFB"],hmac:s["hmacWithSHA256"]},"ECDSA-256":{title:"Microsoft Base DSS and Diffie-Hellman Cryptographic Provider",signature:s["ecdsa-with-SHA256"],publicKey:{id:"ecdsa",name:"ECDSA",namedCurve:"P-256"},privateKey:{id:"ecdsa",name:"ECDSA",namedCurve:"P-256"},digest:s["sha256"],encryption:s["aes256-CFB"],hmac:s["hmacWithSHA256"],agreement:s["ecDH"]}};["CP-94","CP-01","TC-256","TC-512","SC-94","SC-01"].forEach(function(e){var t=h[e];t.hmac=expand(t.hmac,{hash:t.digest});t.derivation=expand(t.derivation,{hash:t.digest,hmac:t.hmac});t.pbes=t.pbes||{id:"PBES2",derivation:t.derivation,encryption:t.encryption};t.pbmac=t.pbmac||{id:"PBMAC1",derivation:t.derivation,hmac:t.hmac};t.agreement=expand(t.agreement,{wrapping:t.wrapping})});["RSA-2048","ECDSA-256"].forEach(function(e){var t=h[e];t.derivation=t.derivation||{id:"PBKDF2",name:"PBKDF2",iterations:2048,hash:t.digest};t.pbes=t.pbes||{id:"PBES2",derivation:t.derivation,encryption:t.encryption};t.pbmac=t.pbmac||{id:"PBMAC1",derivation:t.derivation,hmac:t.hmac}});function GostSecurity(){}GostSecurity.prototype={names:i,identifiers:a,algorithms:s,parameters:u,attributes:d,providers:h};var l=t.gostSecurityInstance=new GostSecurity},function(e,t,r){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:true});var i=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.getRoot=getRoot;t.getCryptoModule=getCryptoModule;t.isInNode=isInNode;t.isBrowser=isBrowser;t.isInWebWorker=isInWebWorker;function getRoot(){return isInNode()?n:self}function getCryptoModule(){var e=getRoot();if(getRoot().hasOwnProperty("crypto")){return e.crypto}else if(e.hasOwnProperty("msCrypto")){return e.msCrypto}else if(isInNode()){return r(170)}throw new Error("Your environment does not have сrypto module")}function isInNode(){return(false?undefined:i(t))==="object"&&typeof e!=="undefined"}function isBrowser(){return typeof window!=="undefined"}function isInWebWorker(){return typeof importScripts!=="undefined"}}).call(this,r(7))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GostRandom=GostRandom;var n=r(79);function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}var i={seed:new Uint8Array(1024),getIndex:0,setIndex:0,set:function set(e){if(this.setIndex>=1024)this.setIndex=0;this.seed[this.setIndex++]=e},get:function get(){if(this.getIndex>=1024)this.getIndex=0;return this.seed[this.getIndex++]}};if((0,n.isBrowser)()){try{document.addEventListener("mousemove",function(e){i.set((new Date).getTime()&255^(e.clientX||e.pageX)&255^(e.clientY||e.pageY)&255)},false)}catch(e){}try{document.addEventListener("keydown",function(e){i.set((new Date).getTime()&255^e.keyCode&255)},false)}catch(e){}}var a=function(e){_inherits(TypeMismatchError,e);function TypeMismatchError(){_classCallCheck(this,TypeMismatchError);return _possibleConstructorReturn(this,(TypeMismatchError.__proto__||Object.getPrototypeOf(TypeMismatchError)).apply(this,arguments))}return TypeMismatchError}(Error);var o=function(e){_inherits(QuotaExceededError,e);function QuotaExceededError(){_classCallCheck(this,QuotaExceededError);return _possibleConstructorReturn(this,(QuotaExceededError.__proto__||Object.getPrototypeOf(QuotaExceededError)).apply(this,arguments))}return QuotaExceededError}(Error);function GostRandom(){}var s=(0,n.getCryptoModule)();GostRandom.prototype.getRandomValues=function(e){if(!e.byteLength)throw new a("Array is not of an integer type (Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, or Uint32Array)");if(e.byteLength>65536)throw new o("Byte length of array can't be greate then 65536");var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(s&&s.getRandomValues){s.getRandomValues(t)}else{for(var r=0,n=t.length;r<n;r++){t[r]=Math.floor(256*Math.random())&255}}for(var r=0,n=t.length;r<n;r++){t[r]=t[r]^i.get()}return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GostSign=GostSign;var n=r(40);var i=r(19);var a=r(25);var o=ArrayBuffer;var s={"S-256-TEST":{a:7,b:"0x5FBFF498AA938CE739B8E022FBAFEF40563F6E6A3472FC2A514C0CE9DAE23B7E",p:"0x8000000000000000000000000000000000000000000000000000000000000431",q:"0x8000000000000000000000000000000150FE8A1892976154C59CFC193ACCF5B3",x:2,y:"0x8E2A8A0E65147D4BD6316030E16D19C85C97F0A9CA267122B96ABBCEA7E8FC8"},"S-256-A":{a:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD94",b:166,p:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD97",q:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6C611070995AD10045841B09B761B893",x:1,y:"0x8D91E471E0989CDA27DF505A453F2B7635294F2DDF23E3B122ACC99C9E9F1E14"},"S-256-B":{a:"0x8000000000000000000000000000000000000000000000000000000000000C96",b:"0x3E1AF419A269A5F866A7D3C25C3DF80AE979259373FF2B182F49D4CE7E1BBC8B",p:"0x8000000000000000000000000000000000000000000000000000000000000C99",q:"0x800000000000000000000000000000015F700CFFF1A624E5E497161BCC8A198F",x:1,y:"0x3FA8124359F96680B83D1C3EB2C070E5C545C9858D03ECFB744BF8D717717EFC"},"S-256-C":{a:"0x9B9F605F5A858107AB1EC85E6B41C8AACF846E86789051D37998F7B9022D7598",b:32858,p:"0x9B9F605F5A858107AB1EC85E6B41C8AACF846E86789051D37998F7B9022D759B",q:"0x9B9F605F5A858107AB1EC85E6B41C8AA582CA3511EDDFB74F02F3A6598980BB9",x:0,y:"0x41ECE55743711A8C3CBF3783CD08C0EE4D4DC440D4641A8F366E550DFDB3BB67"},"P-256":{p:"0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF",a:"0xFFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC",b:"0x5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B",x:"0x6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296",y:"0x4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",q:"0xFFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"},"T-512-TEST":{a:7,b:"0x1CFF0806A31116DA29D8CFA54E57EB748BC5F377E49400FDD788B649ECA1AC4361834013B2AD7322480A89CA58E0CF74BC9E540C2ADD6897FAD0A3084F302ADC",p:"0x4531ACD1FE0023C7550D267B6B2FEE80922B14B2FFB90F04D4EB7C09B5D2D15DF1D852741AF4704A0458047E80E4546D35B8336FAC224DD81664BBF528BE6373",q:"0x4531ACD1FE0023C7550D267B6B2FEE80922B14B2FFB90F04D4EB7C09B5D2D15DA82F2D7ECB1DBAC719905C5EECC423F1D86E25EDBE23C595D644AAF187E6E6DF",x:"0x24D19CC64572EE30F396BF6EBBFD7A6C5213B3B3D7057CC825F91093A68CD762FD60611262CD838DC6B60AA7EEE804E28BC849977FAC33B4B530F1B120248A9A",y:"0x2BB312A43BD2CE6E0D020613C857ACDDCFBF061E91E5F2C3F32447C259F39B2C83AB156D77F1496BF7EB3351E1EE4E43DC1A18B91B24640B6DBB92CB1ADD371E"},"T-512-A":{p:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC7",a:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC4",b:"0xE8C2505DEDFC86DDC1BD0B2B6667F1DA34B82574761CB0E879BD081CFD0B6265EE3CB090F30D27614CB4574010DA90DD862EF9D4EBEE4761503190785A71C760",q:"0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF27E69532F48D89116FF22B8D4E0560609B4B38ABFAD2B85DCACDB1411F10B275",x:3,y:"0x7503CFE87A836AE3A61B8816E25450E6CE5E1C93ACF1ABC1778064FDCBEFA921DF1626BE4FD036E93D75E6A50E3A41E98028FE5FC235F5B889A589CB5215F2A4"},"T-512-B":{p:"0x8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006F",a:"0x8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006C",b:"0x687D1B459DC841457E3E06CF6F5E2517B97C7D614AF138BCBF85DC806C4B289F3E965D2DB1416D217F8B276FAD1AB69C50F78BEE1FA3106EFB8CCBC7C5140116",q:"0x800000000000000000000000000000000000000000000000000000000000000149A1EC142565A545ACFDB77BD9D40CFA8B996712101BEA0EC6346C54374F25BD",x:2,y:"0x1A8F7EDA389B094C2C071E3647A8940F3C123B697578C213BE6DD9E6C8EC7335DCB228FD1EDF4A39152CBCAAF8C0398828041055F94CEEEC7E21340780FE41BD"}};s["X-256-A"]=s["S-256-A"];s["X-256-B"]=s["S-256-C"];s["T-256-TEST"]=s["S-256-TEST"];s["T-256-A"]=s["S-256-A"];s["T-256-B"]=s["S-256-B"];s["T-256-C"]=s["S-256-C"];var f={"S-TEST":{modulusLength:512,p:"0xEE8172AE8996608FB69359B89EB82A69854510E2977A4D63BC97322CE5DC3386EA0A12B343E9190F23177539845839786BB0C345D165976EF2195EC9B1C379E3",q:"0x98915E7EC8265EDFCDA31E88F24809DDB064BDC7285DD50D7289F0AC6F49DD2D",a:"0x9e96031500c8774a869582d4afde2127afad2538b4b6270a6f7c8837b50d50f206755984a49e509304d648be2ab5aab18ebe2cd46ac3d8495b142aa6ce23e21c"},"S-A":{modulusLength:1024,p:"0xB4E25EFB018E3C8B87505E2A67553C5EDC56C2914B7E4F89D23F03F03377E70A2903489DD60E78418D3D851EDB5317C4871E40B04228C3B7902963C4B7D85D52B9AA88F2AFDBEB28DA8869D6DF846A1D98924E925561BD69300B9DDD05D247B5922D967CBB02671881C57D10E5EF72D3E6DAD4223DC82AA1F7D0294651A480DF",q:"0x972432A437178B30BD96195B773789AB2FFF15594B176DD175B63256EE5AF2CF",a:"0x8FD36731237654BBE41F5F1F8453E71CA414FFC22C25D915309E5D2E62A2A26C7111F3FC79568DAFA028042FE1A52A0489805C0DE9A1A469C844C7CABBEE625C3078888C1D85EEA883F1AD5BC4E6776E8E1A0750912DF64F79956499F1E182475B0B60E2632ADCD8CF94E9C54FD1F3B109D81F00BF2AB8CB862ADF7D40B9369A"},"S-B":{modulusLength:1024,p:"0xC6971FC57524B30C9018C5E621DE15499736854F56A6F8AEE65A7A404632B1BCF0349FFCAFCB0A103177971FC1612ADCDB8C8CC938C70225C8FD12AFF01B1D064E0AD6FDE6AB9159166CB9F2FC171D92F0CC7B6A6B2CD7FA342ACBE2C9315A42D576B1ECCE77A963157F3D0BD96A8EB0B0F3502AD238101B05116334F1E5B7AB",q:"0xB09D634C10899CD7D4C3A7657403E05810B07C61A688BAB2C37F475E308B0607",a:"0x3D26B467D94A3FFC9D71BF8DB8934084137264F3C2E9EB16DCA214B8BC7C872485336744934FD2EF5943F9ED0B745B90AA3EC8D70CDC91682478B664A2E1F8FB56CEF2972FEE7EDB084AF746419B854FAD02CC3E3646FF2E1A18DD4BEB3C44F7F2745588029649674546CC9187C207FB8F2CECE8E2293F68395C4704AF04BAB5"},"S-C":{modulusLength:1024,p:"0x9D88E6D7FE3313BD2E745C7CDD2AB9EE4AF3C8899E847DE74A33783EA68BC30588BA1F738C6AAF8AB350531F1854C3837CC3C860FFD7E2E106C3F63B3D8A4C034CE73942A6C3D585B599CF695ED7A3C4A93B2B947B7157BB1A1C043AB41EC8566C6145E938A611906DE0D32E562494569D7E999A0DDA5C879BDD91FE124DF1E9",q:"0xFADD197ABD19A1B4653EECF7ECA4D6A22B1F7F893B641F901641FBB555354FAF",a:"0x7447ED7156310599070B12609947A5C8C8A8625CF1CF252B407B331F93D639DDD1BA392656DECA992DD035354329A1E95A6E32D6F47882D960B8F10ACAFF796D13CD9611F853DAB6D2623483E46788708493937A1A29442598AEC2E0742022563440FE9C18740ECE6765AC05FAF024A64B026E7E408840819E962E7E5F401AE3"},"S-D":{modulusLength:1024,p:"0x80F102D32B0FD167D069C27A307ADAD2C466091904DBAA55D5B8CC7026F2F7A1919B890CB652C40E054E1E9306735B43D7B279EDDF9102001CD9E1A831FE8A163EED89AB07CF2ABE8242AC9DEDDDBF98D62CDDD1EA4F5F15D3A42A6677BDD293B24260C0F27C0F1D15948614D567B66FA902BAA11A69AE3BCEADBB83E399C9B5",q:"0xF0F544C418AAC234F683F033511B65C21651A6078BDA2D69BB9F732867502149",a:"0x6BCC0B4FADB3889C1E06ADD23CC09B8AB6ECDEDF73F04632595EE4250005D6AF5F5ADE44CB1E26E6263C672347CFA26F9E9393681E6B759733784CDE5DBD9A14A39369DFD99FA85CC0D10241C4010343F34A91393A706CF12677CBFA1F578D6B6CFBE8A1242CFCC94B3B653A476E145E3862C18CC3FED8257CFEF74CDB205BF1"},"X-A":{modulusLength:1024,p:"0xCA3B3F2EEE9FD46317D49595A9E7518E6C63D8F4EB4D22D10D28AF0B8839F079F8289E603B03530784B9BB5A1E76859E4850C670C7B71C0DF84CA3E0D6C177FE9F78A9D8433230A883CD82A2B2B5C7A3306980278570CDB79BF01074A69C9623348824B0C53791D53C6A78CAB69E1CFB28368611A397F50F541E16DB348DBE5F",q:"0xCAE4D85F80C147704B0CA48E85FB00A9057AA4ACC44668E17F1996D7152690D9",a:"0xBE27D652F2F1E339DA734211B85B06AE4DE236AA8FBEEB3F1ADCC52CD43853777E834A6A518138678A8ADBD3A55C70A7EAB1BA7A0719548677AAF4E609FFB47F6B9D7E45B0D06D83D7ADC53310ABD85783E7317F7EC73268B6A9C08D260B85D8485696CA39C17B17F044D1E050489036ABD381C5E6BF82BA352A1AFF136601AF"},"X-B":{modulusLength:1024,p:"0x9286DBDA91ECCFC3060AA5598318E2A639F5BA90A4CA656157B2673FB191CD0589EE05F4CEF1BD13508408271458C30851CE7A4EF534742BFB11F4743C8F787B11193BA304C0E6BCA25701BF88AF1CB9B8FD4711D89F88E32B37D95316541BF1E5DBB4989B3DF13659B88C0F97A3C1087B9F2D5317D557DCD4AFC6D0A754E279",q:"0xC966E9B3B8B7CDD82FF0F83AF87036C38F42238EC50A876CD390E43D67B6013F",a:"0x7E9C3096676F51E3B2F9884CF0AC2156779496F410E049CED7E53D8B7B5B366B1A6008E5196605A55E89C3190DABF80B9F1163C979FCD18328DAE5E9048811B370107BB7715F82091BB9DE0E33EE2FED6255474F8769FCE5EAFAEEF1CB5A32E0D5C6C2F0FC0B3447072947F5B4C387666993A333FC06568E534AD56D2338D729"},"X-C":{modulusLength:1024,p:"0xB194036ACE14139D36D64295AE6C50FC4B7D65D8B340711366CA93F383653908EE637BE428051D86612670AD7B402C09B820FA77D9DA29C8111A8496DA6C261A53ED252E4D8A69A20376E6ADDB3BDCD331749A491A184B8FDA6D84C31CF05F9119B5ED35246EA4562D85928BA1136A8D0E5A7E5C764BA8902029A1336C631A1D",q:"0x96120477DF0F3896628E6F4A88D83C93204C210FF262BCCB7DAE450355125259",a:"0x3F1817052BAA7598FE3E4F4FC5C5F616E122CFF9EBD89EF81DC7CE8BF56CC64B43586C80F1C4F56DD5718FDD76300BE336784259CA25AADE5A483F64C02A20CF4A10F9C189C433DEFE31D263E6C9764660A731ECCAECB74C8279303731E8CF69205BC73E5A70BDF93E5BB681DAB4EEB9C733CAAB2F673C475E0ECA921D29782E"}};var c=28,u=(1<<c)-1,d=1<<c,h=Math.pow(2,52),l=52-c,p=2*c-52;function am(e,t,r,n,i,a,o){var s=r&16383,f=r>>14;while(--o>=0){var c=e[t]&16383;var u=e[t++]>>14;var d=f*c+u*s;c=s*c+((d&16383)<<14)+n[i]+a;a=(c>>28)+(d>>14)+f*u;n[i++]=c&268435455}return a}function nbi(e){var t=new Array(Math.ceil(e));t.s=0;t.t=0;return t}function copyTo(e,t){for(var r=e.t-1;r>=0;--r){t[r]=e[r]}t.t=e.t;t.s=e.s;return t}function copy(e){return copyTo(e,nbi(e.t))}function setInt(e,t){e.t=1;e.s=t<0?-1:0;if(t>0)e[0]=t;else if(t<-1)e[0]=t+d;else e.t=0;return e}function nbv(e){var t=nbi(1);setInt(t,e);return t}var v=nbv(0),y=nbv(1),b=nbv(3);function clamp(e){var t=e.s&u;while(e.t>0&&e[e.t-1]===t){--e.t}return e}function subTo(e,t,r){var n=0,i=0,a=Math.min(t.t,e.t);while(n<a){i+=e[n]-t[n];r[n++]=i&u;i>>=c}if(t.t<e.t){i-=t.s;while(n<e.t){i+=e[n];r[n++]=i&u;i>>=c}i+=e.s}else{i+=e.s;while(n<t.t){i-=t[n];r[n++]=i&u;i>>=c}i-=t.s}r.s=i<0?-1:0;if(i<-1)r[n++]=d+i;else if(i>0)r[n++]=i;r.t=n;return clamp(r)}function sub(e,t){return subTo(e,t,nbi(e.t))}function addTo(e,t,r){var n=0,i=0,a=Math.min(t.t,e.t);while(n<a){i+=e[n]+t[n];r[n++]=i&u;i>>=c}if(t.t<e.t){i+=t.s;while(n<e.t){i+=e[n];r[n++]=i&u;i>>=c}i+=e.s}else{i+=e.s;while(n<t.t){i+=t[n];r[n++]=i&u;i=i>>c}i+=t.s}r.s=i<0?-1:0;if(i>0)r[n++]=i;else if(i<-1)r[n++]=d+i;r.t=n;return clamp(r)}function add(e,t){return addTo(e,t,nbi(e.t))}function negTo(e,t){return subTo(v,e,t)}function neg(e){return negTo(e,nbi(e.t))}function absTo(e,t){return e.s<0?negTo(t):copyTo(t)}function abs(e){return e.s<0?neg(e):e}function compare(e,t){var r=e.s-t.s;if(r!==0)return r;var n=e.t;r=n-t.t;if(r!==0)return e.s<0?-r:r;while(--n>=0){if((r=e[n]-t[n])!==0)return r}return 0}function equals(e,t){return compare(e,t)===0}function min(e,t){return compare(e,t)<0?e:t}function max(e,t){return compare(e,t)>0?e:t}function nbits(e){var t=1,r;if((r=e>>>16)!==0){e=r;t+=16}if((r=e>>8)!==0){e=r;t+=8}if((r=e>>4)!==0){e=r;t+=4}if((r=e>>2)!==0){e=r;t+=2}if((r=e>>1)!==0){e=r;t+=1}return t}function dshlTo(e,t,r){var n;for(n=e.t-1;n>=0;--n){r[n+t]=e[n]}for(n=t-1;n>=0;--n){r[n]=0}r.t=e.t+t;r.s=e.s;return r}function dshrTo(e,t,r){for(var n=t;n<e.t;++n){r[n-t]=e[n]}r.t=Math.max(e.t-t,0);r.s=e.s;return r}function shlTo(e,t,r){var n=t%c;var i=c-n;var a=(1<<i)-1;var o=Math.floor(t/c),s=e.s<<n&u,f;for(f=e.t-1;f>=0;--f){r[f+o+1]=e[f]>>i|s;s=(e[f]&a)<<n}for(f=o-1;f>=0;--f){r[f]=0}r[o]=s;r.t=e.t+o+1;r.s=e.s;return clamp(r)}function shrTo(e,t,r){r.s=e.s;var n=Math.floor(t/c);if(n>=e.t){r.t=0;return}var i=t%c;var a=c-i;var o=(1<<i)-1;r[0]=e[n]>>i;for(var s=n+1;s<e.t;++s){r[s-n-1]|=(e[s]&o)<<a;r[s-n]=e[s]>>i}if(i>0)r[e.t-n-1]|=(e.s&o)<<a;r.t=e.t-n;return clamp(r)}function shl(e,t){var r=nbi(e.t);if(t<0)shrTo(e,-t,r);else shlTo(e,t,r);return r}function shr(e,t){var r=nbi(e.t);if(t<0)shlTo(e,-t,r);else shrTo(e,t,r);return r}function bitLength(e){if(e.t<=0)return 0;return c*(e.t-1)+nbits(e[e.t-1]^e.s&u)}function _mulTo(e,t,r){var n=abs(e),i=abs(t);var a=n.t;r.t=a+i.t;while(--a>=0){r[a]=0}for(a=0;a<i.t;++a){r[a+n.t]=am(n,0,i[a],r,a,0,n.t)}r.s=0;if(e.s!==t.s)subTo(v,r,r);return clamp(r)}function mul(e,t){return _mulTo(e,t,nbi(e.t+t.t))}function _sqrTo(e,t){var r=abs(e);var n=t.t=2*r.t;while(--n>=0){t[n]=0}for(n=0;n<r.t-1;++n){var i=am(r,n,r[n],t,2*n,0,1);if((t[n+r.t]+=am(r,n+1,2*r[n],t,2*n+1,i,r.t-n-1))>=r.DV){t[n+r.t]-=r.DV;t[n+r.t+1]=1}}if(t.t>0)t[t.t-1]+=am(r,n,r[n],t,2*n,0,1);t.s=0;return clamp(t)}function sqr(e){return _sqrTo(e,nbi(e.t*2))}function divRemTo(e,t,r,n){var i=abs(t);if(i.t<=0)throw new OperationError("Division by zero");var a=abs(e);if(a.t<i.t){if(r)setInt(r,0);if(n)copyTo(e,n);return r}if(!n)n=nbi(t.t);var o=nbi(t.t),s=e.s,f=t.s;var d=c-nbits(i[i.t-1]);if(d>0){shlTo(i,d,o);shlTo(a,d,n)}else{copyTo(i,o);copyTo(a,n)}var b=o.t;var m=o[b-1];if(m===0)return r;var g=m*(1<<l)+(b>1?o[b-2]>>p:0);var w=h/g,C=(1<<l)/g,S=1<<p;var A=n.t,E=A-b,B=!r?nbi(Math.max(e.t-t.t,1)):r;dshlTo(o,E,B);if(compare(n,B)>=0){n[n.t++]=1;subTo(n,B,n)}dshlTo(y,b,B);subTo(B,o,o);while(o.t<b){o[o.t++]=0}while(--E>=0){var _=n[--A]===m?u:Math.floor(n[A]*w+(n[A-1]+S)*C);if((n[A]+=am(o,0,_,n,E,0,b))<_){dshlTo(o,E,B);subTo(n,B,n);while(n[A]<--_){subTo(n,B,n)}}}if(r){dshrTo(n,b,r);if(s!==f)subTo(v,r,r)}n.t=b;clamp(n);if(d>0)shrTo(n,d,n);if(s<0)subTo(v,n,n);return r}function modTo(e,t,r){divRemTo(abs(e),t,null,r);if(e.s<0&&compare(r,v)>0)subTo(t,r,r);return r}function mod(e,t){return modTo(e,t,nbi(t.t))}function div(e,t){return divRemTo(e,t,nbi(Math.max(e.t-t.t,1)),null)}function isEven(e){return(e.t>0?e[0]&1:e.s)===0}function isZero(e){return equals(e,v)}function sig(e){if(e.s<0)return-1;else if(e.t<=0||e.t===1&&e[0]<=0)return 0;else return 1}function invMod(e,t){var r=isEven(t);if(isEven(e)&&r||sig(t)===0)return v;var n=copy(t),i=copy(e);var a=nbv(1),o=nbv(0),s=nbv(0),f=nbv(1);while(sig(n)!==0){while(isEven(n)){shrTo(n,1,n);if(r){if(!isEven(a)||!isEven(o)){addTo(a,e,a);subTo(o,t,o)}shrTo(a,1,a)}else if(!isEven(o))subTo(o,t,o);shrTo(o,1,o)}while(isEven(i)){shrTo(i,1,i);if(r){if(!isEven(s)||!isEven(f)){addTo(s,e,s);subTo(f,t,f)}shrTo(s,1,s)}else if(!isEven(f))subTo(f,t,f);shrTo(f,1,f)}if(compare(n,i)>=0){subTo(n,i,n);if(r)subTo(a,s,a);subTo(o,f,o)}else{subTo(i,n,i);if(r)subTo(s,a,s);subTo(f,o,f)}}if(compare(i,y)!==0)return v;if(compare(f,t)>=0)return sub(f,t);if(sig(f)<0)addTo(f,t,f);else return f;if(sig(f)<0)return add(f,t);else return f}function testBit(e,t){var r=Math.floor(t/c);if(r>=e.t)return e.s!==0;return(e[r]&1<<t%c)!==0}function nothing(e){return e}function extend(e,t){for(var r in t){e.prototype[r]=t[r]}}var m=function Classic(e){this.m=e};extend(m,{convert:function convert(e){if(e.s<0||compare(e,this.m)>=0)return mod(e,this.m);else return e},revert:nothing,reduce:function reduce(e){modTo(e,this.m,e)},sqrTo:function sqrTo(e,t){_sqrTo(e,t);this.reduce(t)},mulTo:function mulTo(e,t,r){_mulTo(e,t,r);this.reduce(r)}});function invDig(e){if(e.t<1)return 0;var t=e[0];if((t&1)===0)return 0;var r=t&3;r=r*(2-(t&15)*r)&15;r=r*(2-(t&255)*r)&255;r=r*(2-((t&65535)*r&65535))&65535;r=r*(2-t*r%d)%d;return r>0?d-r:-r}var g=function Montgomery(e){this.m=e;this.mp=invDig(e);this.mpl=this.mp&32767;this.mph=this.mp>>15;this.um=(1<<c-15)-1;this.mt2=2*e.t};extend(g,{convert:function convert(e){var t=nbi(e.t);dshlTo(abs(e),this.m.t,t);divRemTo(t,this.m,null,t);if(e.s<0&&compare(t,v)>0)subTo(this.m,t,t);return t},revert:function revert(e){var t=nbi(e.t);copyTo(e,t);this.reduce(t);return t},reduce:function reduce(e){while(e.t<=this.mt2){e[e.t++]=0}for(var t=0;t<this.m.t;++t){var r=e[t]&32767;var n=r*this.mpl+((r*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&u;r=t+this.m.t;e[r]+=am(this.m,0,n,e,t,0,this.m.t);while(e[r]>=d){e[r]-=d;e[++r]++}}clamp(e);dshrTo(e,this.m.t,e);if(compare(e,this.m)>=0)subTo(e,this.m,e)},sqrTo:function sqrTo(e,t){_sqrTo(e,t);this.reduce(t)},mulTo:function mulTo(e,t,r){_mulTo(e,t,r);this.reduce(r)}});function dAddOffset(e,t,r){if(t===0)return;while(e.t<=r){e[e.t++]=0}e[r]+=t;while(e[r]>=d){e[r]-=d;if(++r>=e.t)e[e.t++]=0;++e[r]}}function mulLowerTo(e,t,r,n){var i=Math.min(e.t+t.t,r);n.s=0;n.t=i;while(i>0){n[--i]=0}var a;for(a=n.t-e.t;i<a;++i){n[i+e.t]=am(e,0,t[i],n,i,0,e.t)}for(a=Math.min(t.t,r);i<a;++i){am(e,0,t[i],n,i,0,r-i)}return clamp(n)}function mulUpperTo(e,t,r,n){--r;var i=n.t=e.t+t.t-r;n.s=0;while(--i>=0){n[i]=0}for(i=Math.max(r-e.t,0);i<t.t;++i){n[e.t+i-r]=am(e,r-i,t[i],n,0,0,e.t+i-r)}clamp(n);return dshrTo(n,1,n)}function Barrett(e){this.r2=nbi(2*e.t);this.q3=nbi(2*e.t);dshlTo(y,2*e.t,this.r2);this.mu=div(this.r2,e);this.m=e}extend(Barrett,{convert:function convert(e){if(e.s<0||e.t>2*this.m.t)return mod(e,this.m);else if(compare(e,this.m)<0)return e;else{var t=nbi(e.t);copyTo(e,t);this.reduce(t);return t}},revert:function revert(e){return e},reduce:function reduce(e){dshrTo(e,this.m.t-1,this.r2);if(e.t>this.m.t+1){e.t=this.m.t+1;clamp(e)}mulUpperTo(this.mu,this.r2,this.m.t+1,this.q3);mulLowerTo(this.m,this.q3,this.m.t+1,this.r2);while(compare(e,this.r2)<0){dAddOffset(e,1,this.m.t+1)}subTo(e,this.r2,e);while(compare(e,this.m)>=0){subTo(e,this.m,e)}},sqrTo:function sqrTo(e,t){_sqrTo(e,t);this.reduce(t)},mulTo:function mulTo(e,t,r){_mulTo(e,t,r);this.reduce(r)}});function expMod(e,t,r){var n=bitLength(t),i,a=nbv(1),o;if(n<=0)return a;else if(n<18)i=1;else if(n<48)i=3;else if(n<144)i=4;else if(n<768)i=5;else i=6;if(n<8)o=new m(r);else if(isEven(r))o=new Barrett(r);else o=new g(r);var s=new Array,f=3,u=i-1,d=(1<<i)-1;s[1]=o.convert(e);if(i>1){var h=nbi(r.t*2);o.sqrTo(s[1],h);while(f<=d){s[f]=nbi(r.t*2);o.mulTo(h,s[f-2],s[f]);f+=2}}var l=t.t-1,p,v=true,y=nbi(r.t*2),b;n=nbits(t[l])-1;while(l>=0){if(n>=u)p=t[l]>>n-u&d;else{p=(t[l]&(1<<n+1)-1)<<u-n;if(l>0)p|=t[l-1]>>c+n-u}f=i;while((p&1)==0){p>>=1;--f}if((n-=f)<0){n+=c;--l}if(v){copyTo(s[p],a);v=false}else{while(f>1){o.sqrTo(a,y);o.sqrTo(y,a);f-=2}if(f>0)o.sqrTo(a,y);else{b=a;a=y;y=b}o.mulTo(y,s[p],a)}while(l>=0&&(t[l]&1<<n)==0){o.sqrTo(a,y);b=a;a=y;y=b;if(--n<0){n=c-1;--l}}}return o.revert(a)}function newFE(e,t){e.r.reduce(t);t.q=e.q;t.r=e.r;return t}function copyFE(e,t){t.q=e.q;t.r=e.r;return t}function negFE(e){return copyFE(e,sub(e.q,e))}function addFE(e,t){var r=add(e,t);if(compare(r,e.q)>0)subTo(r,e.q,r);return copyFE(e,r)}function subFE(e,t){var r=sub(e,t);if(r.s<0)addTo(e.q,r,r);return copyFE(e,r)}function mulFE(e,t){return newFE(e,mul(e,t))}function sqrFE(e){return newFE(e,sqr(e))}function shlFE(e,t){return newFE(e,shl(e,t))}function invFE(e){return copyFE(e,invMod(e,e.q))}function newEC(e,t,r,n){return{curve:e,x:t,y:r,z:n||newFE(e,y)}}function getX(e){if(!e.zinv)e.zinv=invFE(e.z);return mulFE(e.x,e.zinv)}function getY(e){if(!e.zinv)e.zinv=invFE(e.z);return mulFE(e.y,e.zinv)}function isInfinity(e){if(!e.x&&!e.y)return true;return isZero(e.z)&&!isZero(e.y)}function getInfinity(e){return e.curve.infinity}function equalsEC(e,t){if(e===t)return true;if(isInfinity(e))return isInfinity(t);if(isInfinity(t))return isInfinity(e);var r,n;r=subFE(mulFE(t.y,e.z),mulFE(e.y,t.z));if(!isZero(r))return false;n=subFE(mulFE(t.x,e.z),mulFE(e.x,t.z));return isZero(n)}function negEC(e){return newEC(e.curve,e.x,negFE(e.y),e.z)}function addEC(e,t){if(isInfinity(e))return t;if(isInfinity(t))return e;var r=subFE(mulFE(t.y,e.z),mulFE(e.y,t.z));var n=subFE(mulFE(t.x,e.z),mulFE(e.x,t.z));if(isZero(n)){if(isZero(r)){return twiceEC(e)}return getInfinity(e)}var i=e.x;var a=e.y;var o=sqrFE(n);var s=mulFE(o,n);var f=mulFE(i,o);var c=mulFE(sqrFE(r),e.z);var u=mulFE(subFE(mulFE(subFE(c,shlFE(f,1)),t.z),s),n);var d=addFE(mulFE(subFE(subFE(mulFE(mulFE(f,b),r),mulFE(a,s)),mulFE(c,r)),t.z),mulFE(r,s));var h=mulFE(mulFE(s,e.z),t.z);return newEC(e.curve,u,d,h)}function twiceEC(e){if(isInfinity(e))return e;if(sig(e.y)===0)return getInfinity(e);var t=e.x;var r=e.y;var n=mulFE(r,e.z);var i=mulFE(n,r);var a=e.curve.a;var o=mulFE(sqrFE(t),b);if(!isZero(a)){o=addFE(o,mulFE(sqrFE(e.z),a))}var s=mulFE(shlFE(subFE(sqrFE(o),mulFE(shlFE(t,3),i)),1),n);var f=subFE(mulFE(shlFE(subFE(mulFE(mulFE(o,b),t),shlFE(i,1)),2),i),mulFE(sqrFE(o),o));var c=shlFE(mulFE(sqrFE(n),n),3);return newEC(e.curve,s,f,c)}function mulEC(e,t){if(isInfinity(e))return e;if(sig(t)===0)return getInfinity(e);var r=t;var n=mul(r,b);var i=negEC(e);var a=e;var o;for(o=bitLength(n)-2;o>0;--o){a=twiceEC(a);var s=testBit(n,o);var f=testBit(r,o);if(s!==f){a=addEC(a,s?e:i)}}return a}function mul2AndAddEC(e,t){var r=bitLength(t);var n=e,i=getInfinity(e);for(var a=0;a<r-1;a++){if(testBit(t,a)===1)i=addEC(i,n);n=twiceEC(n)}if(testBit(t,r-1)===1)i=addEC(i,n);return i}function mulTwoEC(e,t,r,n){var i;if(bitLength(t)>bitLength(n))i=bitLength(t)-1;else i=bitLength(n)-1;var a=getInfinity(e);var o=addEC(e,r);while(i>=0){a=twiceEC(a);if(testBit(t,i)){if(testBit(n,i)){a=addEC(a,o)}else{a=addEC(a,e)}}else{if(testBit(n,i)){a=addEC(a,r)}}--i}return a}function newCurve(e,t,r){var n={};n.q=e;n.r=new Barrett(e);n.a=newFE(n,t);n.b=newFE(n,r);n.infinity=newEC(n);return n}function atobi(e){var t=8;var r=new Uint8Array(e);var n=nbi(r.length*8/c);n.t=0;n.s=0;var i=0;for(var a=0,o=r.length;a<o;a++){var s=r[a];if(i===0)n[n.t++]=s;else if(i+t>c){n[n.t-1]|=(s&(1<<c-i)-1)<<i;n[n.t++]=s>>c-i}else n[n.t-1]|=s<<i;i+=t;if(i>=c)i-=c}return clamp(n)}function bitoa(e,t){var r=8;var n=(1<<r)-1,i,a=false,o=[],s=e.t;var f=c-s*c%r;if(s-- >0){if(f<c&&(i=e[s]>>f)>0){a=true;o.push(i)}while(s>=0){if(f<r){i=(e[s]&(1<<f)-1)<<r-f;i|=e[--s]>>(f+=c-r)}else{i=e[s]>>(f-=r)&n;if(f<=0){f+=c;--s}}if(i>0)a=true;if(a)o.push(i)}}var u=new Uint8Array(t?t/8:o.length);if(a)u.set(o.reverse());return u.buffer}function htobi(e){if(typeof e==="number"||e instanceof Number)return nbv(e);e=e.replace(/[^\-A-Fa-f0-9]/g,"");if(!e)e="0";var t=4;var r=nbi(e.length/7);var n=e.length,i=false,a=0;while(--n>=0){var o=e.charAt(n);if(o==="-"){i=true;continue}var s=parseInt(e.charAt(n),16);i=false;if(a===0)r[r.t++]=s;else if(a+t>c){r[r.t-1]|=(s&(1<<c-a)-1)<<a;r[r.t++]=s>>c-a}else r[r.t-1]|=s<<a;a+=t;if(a>=c)a-=c}if(i)subTo(v,r,r);return clamp(r)}function bitoh(e){if(e.s<0)return"-"+bitoh(negTo(e,nbi(e.t)));var t=4;var r=(1<<t)-1,n,i=false,a="",o=e.t;var s=c-o*c%t;if(o-- >0){if(s<c&&(n=e[o]>>s)>0){i=true;a=n.toString(16)}while(o>=0){if(s<t){n=(e[o]&(1<<s)-1)<<t-s;n|=e[--o]>>(s+=c-t)}else{n=e[o]>>(s-=t)&r;if(s<=0){s+=c;--o}}if(n>0)i=true;if(i)a+=n.toString(16)}}return"0x"+(i?a:"0")}function bitoi(e){var t=e.t,r=[];r[0]=e.s;var n=c-t*c%8,i,a=0;if(t-- >0){if(n<c&&(i=e[t]>>n)!==(e.s&u)>>n)r[a++]=i|e.s<<c-n;while(t>=0){if(n<8){i=(e[t]&(1<<n)-1)<<8-n;i|=e[--t]>>(n+=c-8)}else{i=e[t]>>(n-=8)&255;if(n<=0){n+=c;--t}}if((i&128)!==0)i|=-256;if(a===0&&(e.s&128)!==(i&128))++a;if(a>0||i!==e.s)r[a++]=i}}return new Uint8Array(r).buffer}function itobi(e){var t=8,r=new Uint8Array(e),n=nbi(r.length/7);n.t=0;n.s=0;var i=r.length,a=0;while(--i>=0){var o=r[i]&255;if(a===0)n[n.t++]=o;else if(a+t>c){n[n.t-1]|=(o&(1<<c-a)-1)<<a;n[n.t++]=o>>c-a}else n[n.t-1]|=o<<a;a+=t;if(a>=c)a-=c}if((r[0]&128)!==0){n.s=-1;if(a>0)n[n.t-1]|=(1<<c-a)-1<<a}return clamp(n)}function swap(e){var t=new Uint8Array(e),r=new Uint8Array(t.length);for(var n=0,i=t.length;n<i;n++){r[i-n-1]=t[n]}return r.buffer}function hash(e){if(this.hash)e=this.hash.digest(e);if(this.procreator==="SC"||this.procreator==="VN"&&this.hash.version===2012)e=swap(e);return e}function buffer(e){if(e instanceof o)return e;else if(e&&e.buffer&&e.buffer instanceof o)return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(new Uint8Array(e,e.byteOffset,e.byteLength)).buffer;else throw new i.DataError("CryptoOperationData or CryptoOperationDataView required")}function to2(e){var t=buffer(e);if(t.byteLength%2>0)throw new i.DataError("Buffer length must be even");var r=t.byteLength/2;return[atobi(new Uint8Array(t,0,r)),atobi(new Uint8Array(t,r,r))]}function from2(e,t,r){var n=bitoa(e,r),i=bitoa(t,r),a=new Uint8Array(n.byteLength+i.byteLength);a.set(new Uint8Array(n));a.set(new Uint8Array(i),n.byteLength);return a.buffer}function sign(e,t){var r=buffer(t);var n=atobi(hash.call(this,r));var i=this.q;var o=mod(atobi(buffer(e)),i);var s=mod(n,i);if(isZero(s))s=y;var f=v;while(isZero(f)){var c=v;while(isZero(c)){var u=mod(atobi(this.ukm||(0,a.getSeed)(this.bitLength)),i);if(this.curve){var d=this.P;var h=mulEC(d,u);c=mod(getX(h),i)}else{var l=this.p,p=this.a;c=mod(expMod(p,u,l),i)}}f=mod(add(mul(c,o),mul(u,s)),i)}var b;if(this.procreator==="SC"){b={r:bitoh(c),s:bitoh(f)}}else{b=from2(c,f,this.bitLength);if(this.procreator==="CP"||this.procreator==="VN")b=swap(b)}return b}function verify(e,t,r){var n=this.q;var i,a;if(this.procreator==="SC"){i=htobi(t.r);a=htobi(t.s)}else{if(this.procreator==="CP"||this.procreator==="VN")t=swap(t);var o=to2(t);a=o[1];i=o[0]}if(compare(i,n)>=0||compare(a,n)>=0)return false;var s=buffer(r);var f=atobi(hash.call(this,s));var c=mod(f,n);if(isZero(c)===0)c=y;var u=invMod(c,n);var d=mod(mul(a,u),n);var h=sub(n,mod(mul(i,u),n));if(this.curve){var l=to2(e),p=this.curve,v=this.P,b=newFE(p,l[0]),m=newFE(p,l[1]),g=new newEC(p,b,m);var w=mulTwoEC(v,d,g,h);var C=mod(getX(w),n)}else{var S=this.p,A=this.a;var m=atobi(e);var C=mod(mod(mul(expMod(A,d,S),expMod(m,h,S)),S),n)}return compare(C,i)===0}function generateKey(){var e=this.curve;if(e){var t=e.infinity;while(isInfinity(t)){var r=v;if(this.ukm){r=atobi(this.ukm)}else{while(isZero(r)){r=mod(atobi((0,a.getSeed)(this.bitLength)),this.q)}}t=mulEC(this.P,r);var n=getX(t),o=getY(t)}return{privateKey:bitoa(r,this.bitLength),publicKey:from2(n,o,this.bitLength)}}else throw new i.NotSupportedError("Key generation for GOST R 34.10-94 not supported")}function generateMaskKey(){var e=this.curve;if(e){var t=v;while(isZero(t)){t=mod(atobi((0,a.getSeed)(this.bitLength)),this.q)}return bitoa(t,this.bitLength)}else throw new i.NotSupportedError("Key generation for GOST R 34.10-94 not supported")}function unwrapKey(e,t){var r=this.curve;if(r){var n=this.q;var a=mod(atobi(buffer(t)),n);var o=mod(atobi(buffer(e)),n);var s=this.procreator==="VN"?mod(mul(a,o),n):mod(mul(a,invMod(o,n)),n);return bitoa(s)}else throw new i.NotSupportedError("Key wrapping GOST R 34.10-94 not supported")}function wrapKey(e,t){var r=this.curve;if(r){var n=this.q;var a=mod(atobi(buffer(t)),n);var o=mod(atobi(buffer(e)),n);var s=this.procreator==="VN"?mod(mul(a,invMod(o,n)),n):mod(mul(a,o),n);return bitoa(s)}else throw new i.NotSupportedError("Key wrapping GOST R 34.10-94 not supported")}function derive(e){var t,r=atobi(this.ukm);var n=this.q;var i=mod(atobi(buffer(e)),n);if(this.curve){var a=mulEC(this.peer_Q,mod(mul(r,i),n));t=from2(getX(a),getY(a),this.bitLength)}else{var o=this.p,s=this.a;t=bitoa(expMod(this.peer_y,i,o))}return hash.call(this,t)}function deriveBits(e,t){if(t<8||t>this.bitLength||t%8>0)throw new i.DataError("Length must be no more than "+this.bitLength+" bits and multiple of 8");var r=t/8,n=derive.call(this,e),a=new Uint8Array(r);a.set(new Uint8Array(n,0,r));return a.buffer}function deriveKey(e){var t=derive.call(this,e),r=new Uint8Array(32);r.set(new Uint8Array(t,0,32));return r.buffer}function GostSign(e){e=e||{};this.name=(e.name||"GOST R 34.10")+"-"+(e.version||2012)%100+"-"+(e.length||256)+((e.mode||"SIGN")!=="SIGN"?"-"+e.mode:"")+(typeof e.namedParam==="string"?"/"+e.namedParam:"")+(typeof e.namedCurve==="string"?"/"+e.namedCurve:"")+(typeof e.sBox==="string"?"/"+e.sBox:"");var t=e.version||2012;switch(e.mode||"SIGN"){case"SIGN":this.sign=sign;this.verify=verify;this.generateKey=generateKey;break;case"DH":this.deriveBits=deriveBits;this.deriveKey=deriveKey;this.generateKey=generateKey;break;case"MASK":this.wrapKey=wrapKey;this.unwrapKey=unwrapKey;this.generateKey=generateMaskKey;break}if(t===1994){var r=e.param;if(!r)r=f[this.namedParam=(e.namedParam||"S-A").toUpperCase()];this.modulusLength=e.modulusLength||r.modulusLength||1024;this.p=htobi(r.p);this.q=htobi(r.q);this.a=htobi(r.a);if(e["public"])this.peer_y=atobi(e["public"])}else{var r=e.curve;if(!r)r=s[this.namedCurve=(e.namedCurve||"S-256-A").toUpperCase()];var a=this.curve=newCurve(htobi(r.p),htobi(r.a),htobi(r.b));this.P=newEC(a,newFE(a,htobi(r.x)),newFE(a,htobi(r.y)));this.q=htobi(r.q);if(e["public"]){var o=to2(e["public"]);this.peer_Q=new newEC(this.curve,newFE(this.curve,o[0]),newFE(this.curve,o[1]))}}var c,u;if(this.curve){u=e.length||bitLength(this.q);if(u>508&&u<=512)u=512;else if(u>254&&u<=256)u=256;else throw new i.NotSupportedError("Support keys only 256 or 512 bits length");c=u}else{u=e.modulusLength||bitLength(this.p);if(u>1016&&u<=1024)u=1024;else if(u>508&&u<=512)u=512;else throw new i.NotSupportedError("Support keys only 512 or 1024 bits length");c=256}this.bitLength=c;this.keyLength=u;this.procreator=e.procreator;var d=e.hash;if(d){if(typeof d==="string"||d instanceof String)d={name:d};if(e.version===1994||e.version===2001){d.version=1994;d.length=256;d.sBox=e.sBox||d.sBox}else{d.version=2012;d.length=c}d.procreator=d.procreator||e.procreator;this.hash=new n.GostDigest(d)}if(e.ukm)this.ukm=e.ukm}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gostEngine=undefined;var n=r(41);var i=r(40);var a=r(81);var o=r(19);function defineEngine(e,t){if(!t)throw new(SyntaxError||Error)("Algorithm not defined");if(!t.name)throw new(SyntaxError||Error)("Algorithm name not defined");var r=t.name,n=t.mode;if((r==="GOST 28147"||r==="GOST R 34.12"||r==="RC2")&&(e==="generateKey"||n==="MAC"&&(e==="sign"||e==="verify")||(n==="KW"||n==="MASK")&&(e==="wrapKey"||e==="unwrapKey")||(!n||n==="ES")&&(e==="encrypt"||e==="decrypt"))){return"GostCipher"}else if((r==="GOST R 34.11"||r==="SHA")&&(e==="digest"||n==="HMAC"&&(e==="sign"||e==="verify"||e==="generateKey")||(n==="KDF"||n==="PBKDF2"||n==="PFXKDF"||n==="CPKDF")&&(e==="deriveKey"||e==="deriveBits"||e==="generateKey"))){return"GostDigest"}else if(r==="GOST R 34.10"&&(e==="generateKey"||(!n||n==="SIGN")&&(e==="sign"||e==="verify")||n==="MASK"&&(e==="wrapKey"||e==="unwrapKey")||n==="DH"&&(e==="deriveKey"||e==="deriveBits"))){return"GostSign"}else throw new o.NotSupportedError("Algorithm "+r+"-"+n+" is not valid for "+e)}var s={execute:function execute(e,t,r){var n=defineEngine(t,e);var i=this["get"+n](e);return i[t].apply(i,r)},getGostCipher:function getGostCipher(e){return new n.GostCipher(e)},getGostDigest:function getGostDigest(e){return new i.GostDigest(e)},getGostSign:function getGostSign(e){return new a.GostSign(e)}};t.gostEngine=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gostSubtleInstance=undefined;t.SubtleCrypto=SubtleCrypto;var n=r(82);var i=r(79);var a=r(19);var o=r(77);function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function _possibleConstructorReturn(e,t){if(!e){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return t&&(typeof t==="object"||typeof t==="function")?t:e}function _inherits(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function, not "+typeof t)}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}});if(t)Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t}var s=function(e){_inherits(InvalidStateError,e);function InvalidStateError(){_classCallCheck(this,InvalidStateError);return _possibleConstructorReturn(this,(InvalidStateError.__proto__||Object.getPrototypeOf(InvalidStateError)).apply(this,arguments))}return InvalidStateError}(Error);var f=function(e){_inherits(InvalidAccessError,e);function InvalidAccessError(){_classCallCheck(this,InvalidAccessError);return _possibleConstructorReturn(this,(InvalidAccessError.__proto__||Object.getPrototypeOf(InvalidAccessError)).apply(this,arguments))}return InvalidAccessError}(Error);var c=(0,i.getCryptoModule)();function normalize(e,t){if(typeof e==="string"||e instanceof String)e={name:e};var r=e.name;if(!r)throw new SyntaxError("Algorithm name not defined");var n=r.split("/"),n=n[0].split("-").concat(n.slice(1));var i={};r=n[0].replace(/[\.\s]/g,"");n=n.slice(1);if(r.indexOf("28147")>=0){i={name:"GOST 28147",version:1989,mode:(e.mode||(t==="sign"||t==="verify"?"MAC":t==="wrapKey"||t==="unwrapKey"?"KW":"ES")).toUpperCase(),length:e.length||64}}else if(r.indexOf("3412")>=0){i={name:"GOST R 34.12",version:2015,mode:(e.mode||(t==="sign"||t==="verify"?"MAC":t==="wrapKey"||t==="unwrapKey"?"KW":"ES")).toUpperCase(),length:e.length||64}}else if(r.indexOf("3411")>=0){i={name:"GOST R 34.11",version:2012,mode:(e.mode||(t==="deriveKey"||t==="deriveBits"?"KDF":t==="sign"||t==="verify"?"HMAC":"HASH")).toUpperCase(),length:e.length||256}}else if(r.indexOf("3410")>=0){i={name:"GOST R 34.10",version:2012,mode:(e.mode||(t==="deriveKey"||t==="deriveBits"?"DH":"SIGN")).toUpperCase(),length:e.length||256}}else if(r.indexOf("SHA")>=0){i={name:"SHA",version:(e.length||160)===160?1:2,mode:(e.mode||(t==="deriveKey"||t==="deriveBits"?"KDF":t==="sign"||t==="verify"?"HMAC":"HASH")).toUpperCase(),length:e.length||160}}else if(r.indexOf("RC2")>=0){i={name:"RC2",version:1,mode:(e.mode||(t==="sign"||t==="verify"?"MAC":t==="wrapKey"||t==="unwrapKey"?"KW":"ES")).toUpperCase(),length:e.length||32}}else if(r.indexOf("PBKDF2")>=0){i=normalize(e.hash,"digest");i.mode="PBKDF2"}else if(r.indexOf("PFXKDF")>=0){i=normalize(e.hash,"digest");i.mode="PFXKDF"}else if(r.indexOf("CPKDF")>=0){i=normalize(e.hash,"digest");i.mode="CPKDF"}else if(r.indexOf("HMAC")>=0){i=normalize(e.hash,"digest");i.mode="HMAC"}else throw new a.NotSupportedError("Algorithm not supported");n.forEach(function(e){e=e.toUpperCase();if(/^[0-9]+$/.test(e)){if(["8","16","32"].indexOf(e)>=0||i.length==="128"&&e==="64"){if(i.mode==="ES")i.shiftBits=parseInt(e);else if(i.mode==="MAC")i.macLength=parseInt(e);else throw new a.NotSupportedError("Algorithm "+i.name+" mode "+e+" not supported")}else if(["89","94","01","12","15","1989","1994","2001","2012","2015"].indexOf(e)>=0){var t=parseInt(e);t=t<1900?t<80?2e3+t:1900+t:t;i.version=t}else if(["1"].indexOf(e)>=0&&i.name==="SHA"){i.version=1;i.length=160}else if(["256","384","512"].indexOf(e)>=0&&i.name==="SHA"){i.version=2;i.length=parseInt(e)}else if(["40","128"].indexOf(e)>=0&&i.name==="RC2"){i.version=1;i.length=parseInt(e)}else if(["64","128","256","512"].indexOf(e)>=0)i.length=parseInt(e);else if(["1000","2000"].indexOf(e)>=0)i.iterations=parseInt(e)}else if(["E-TEST","E-A","E-B","E-C","E-D","E-SC","E-Z","D-TEST","D-A","D-SC"].indexOf(e)>=0){i.sBox=e}else if(["S-TEST","S-A","S-B","S-C","S-D","X-A","X-B","X-C"].indexOf(e)>=0){i.namedParam=e}else if(["S-256-TEST","S-256-A","S-256-B","S-256-C","P-256","T-512-TEST","T-512-A","T-512-B","X-256-A","X-256-B","T-256-TEST","T-256-A","T-256-B","S-256-B","T-256-C","S-256-C"].indexOf(e)>=0){i.namedCurve=e}else if(["SC","CP","VN"].indexOf(e)>=0){i.procreator=e}else if(i.name==="GOST 28147"||i.name==="GOST R 34.12"||i.name==="RC2"){if(["ES","MAC","KW","MASK"].indexOf(e)>=0){i.mode=e}else if(["ECB","CFB","OFB","CTR","CBC"].indexOf(e)>=0){i.mode="ES";i.block=e}else if(["CPKW","NOKW","SCKW"].indexOf(e)>=0){i.mode="KW";i.keyWrapping=e.replace("KW","")}else if(["ZEROPADDING","PKCS5PADDING","NOPADDING","RANDOMPADDING","BITPADDING"].indexOf(e)>=0){i.padding=e.replace("PADDING","")}else if(["NOKM","CPKM"].indexOf(e)>=0){i.keyMeshing=e.replace("KM","")}else throw new a.NotSupportedError("Algorithm "+i.name+" mode "+e+" not supported")}else if(i.name==="GOST R 34.11"||i.name==="SHA"){if(["HASH","KDF","HMAC","PBKDF2","PFXKDF","CPKDF"].indexOf(e)>=0)i.mode=e;else throw new a.NotSupportedError("Algorithm "+i.name+" mode "+e+" not supported")}else if(i.name==="GOST R 34.10"){var r=e.replace(/[\.\s]/g,"");if(r.indexOf("GOST")>=0&&r.indexOf("3411")>=0)i.hash=e;else if(["SIGN","DH","MASK"].indexOf(e))i.mode=e;else throw new a.NotSupportedError("Algorithm "+i.name+" mode "+e+" not supported")}});i.procreator=e.procreator||i.procreator||"CP";switch(i.name){case"GOST R 34.10":i.keySize=i.length/(i.version===1994?4:8);break;case"GOST R 34.11":i.keySize=32;break;case"GOST 28147":case"GOST R 34.12":i.keySize=32;break;case"RC2":i.keySize=Math.ceil(i.length/8);break;case"SHA":i.keySize=i.length/8;break}if(i.mode==="ES"){if(e.block)i.block=e.block;if(i.block)i.block=i.block.toUpperCase();if(e.padding)i.padding=e.padding;if(i.padding)i.padding=i.padding.toUpperCase();if(e.shiftBits)i.shiftBits=e.shiftBits;if(e.keyMeshing)i.keyMeshing=e.keyMeshing;if(i.keyMeshing)i.keyMeshing=i.keyMeshing.toUpperCase();if(t!=="importKey"&&t!=="generateKey"){i.block=i.block||"ECB";i.padding=i.padding||(i.block==="CBC"||i.block==="ECB"?"ZERO":"NO");if(i.block==="CFB"||i.block==="OFB")i.shiftBits=i.shiftBits||i.length;i.keyMeshing=i.keyMeshing||"NO"}}if(i.mode==="KW"){if(e.keyWrapping)i.keyWrapping=e.keyWrapping;if(i.keyWrapping)i.keyWrapping=i.keyWrapping.toUpperCase();if(t!=="importKey"&&t!=="generateKey")i.keyWrapping=i.keyWrapping||"NO"}["sBox","namedParam","namedCurve","curve","param","modulusLength"].forEach(function(t){e[t]&&(i[t]=e[t])});if(t!=="importKey"&&t!=="generateKey"){if(i.name==="GOST 28147"){i.sBox=i.sBox||(i.procreator==="SC"?"E-SC":"E-A")}else if(i.name==="GOST R 34.12"&&i.length===64){i.sBox="E-Z"}else if(i.name==="GOST R 34.11"&&i.version===1994){i.sBox=i.sBox||(i.procreator==="SC"?"D-SC":"D-A")}else if(i.name==="GOST R 34.10"&&i.version===1994){i.namedParam=i.namedParam||(i.mode==="DH"?"X-A":"S-A")}else if(i.name==="GOST R 34.10"&&i.version===2001){i.namedCurve=i.namedCurve||(i.length===256?i.procreator==="SC"?"P-256":i.mode==="DH"?"X-256-A":"S-256-A":i.mode==="T-512-A")}else if(i.name==="GOST R 34.10"&&i.version===2012){i.namedCurve=i.namedCurve||(i.length===256?i.procreator==="SC"?"P-256":i.mode==="DH"?"X-256-A":"S-256-A":i.mode==="T-512-A")}}switch(i.mode){case"DH":e.ukm&&(i.ukm=e.ukm);e["public"]&&(i["public"]=e["public"]);break;case"SIGN":case"KW":e.ukm&&(i.ukm=e.ukm);break;case"ES":case"MAC":e.iv&&(i.iv=e.iv);break;case"KDF":e.label&&(i.label=e.label);e.contex&&(i.context=e.contex);break;case"PBKDF2":e.salt&&(i.salt=e.salt);e.iterations&&(i.iterations=e.iterations);e.diversifier&&(i.diversifier=e.diversifier);break;case"PFXKDF":e.salt&&(i.salt=e.salt);e.iterations&&(i.iterations=e.iterations);e.diversifier&&(i.diversifier=e.diversifier);break;case"CPKDF":e.salt&&(i.salt=e.salt);e.iterations&&(i.iterations=e.iterations);break}if(t&&(i.mode!=="ES"&&i.mode!=="SIGN"&&i.mode!=="MAC"&&i.mode!=="HMAC"&&i.mode!=="KW"&&i.mode!=="DH"&&i.mode!=="MASK"&&t==="generateKey"||i.mode!=="ES"&&(t==="encrypt"||t==="decrypt")||i.mode!=="SIGN"&&i.mode!=="MAC"&&i.mode!=="HMAC"&&(t==="sign"||t==="verify")||i.mode!=="HASH"&&t==="digest"||i.mode!=="KW"&&i.mode!=="MASK"&&(t==="wrapKey"||t==="unwrapKey")||i.mode!=="DH"&&i.mode!=="PBKDF2"&&i.mode!=="PFXKDF"&&i.mode!=="CPKDF"&&i.mode!=="KDF"&&(t==="deriveKey"||t==="deriveBits")))throw new a.NotSupportedError("Algorithm mode "+i.mode+" not valid for method "+t);e.hash&&(i.hash=e.hash);if(i.hash){if((typeof i.hash==="string"||i.hash instanceof String)&&i.procreator)i.hash=i.hash+"/"+i.procreator;i.hash=normalize(i.hash,"digest")}e.id&&(i.id=e.id);return i}function checkNative(e){if(!c||!c.subtle||!e)return false;var t=typeof e==="string"||e instanceof String?t=e:e.name;if(!t)return false;t=t.toUpperCase();if((t.indexOf("KDF")>=0||t.indexOf("HMAC")>=0)&&e.hash)return checkNative(e.hash);return t.indexOf("GOST")===-1&&t.indexOf("SHA-1")===-1&&t.indexOf("RC2")===-1&&t.indexOf("?DES")===-1}function checkKey(e,t){if(!e.algorithm)throw new SyntaxError("Key algorithm not defined");if(!e.algorithm.name)throw new SyntaxError("Key algorithm name not defined");var r=e.algorithm.name,n=r==="GOST 28147"||r==="GOST R 34.12"||r==="RC2",i=r==="GOST R 34.11"||r==="SHA",o=r==="GOST R 34.10";if(!n&&!o&&!i)throw new a.NotSupportedError("Key algorithm "+r+" is unsupproted");if(!e.type)throw new SyntaxError("Key type not defined");if((n||i)&&e.type!=="secret"||o&&!(e.type==="public"||e.type==="private"))throw new a.DataError("Key type "+e.type+" is not valid for algorithm "+r);if(!e.usages||!e.usages.indexOf)throw new SyntaxError("Key usages not defined");for(var c=0,u=e.usages.length;c<u;c++){var d=e.usages[c];if((d==="encrypt"||d==="decrypt")&&e.type!=="secret"||d==="sign"&&e.type==="public"||d==="verify"&&e.type==="private")throw new s("Key type "+e.type+" is not valid for "+d)}if(t)if(e.usages.indexOf(t)===-1)throw new f("Key usages is not contain method "+t);if(!e.buffer)throw new SyntaxError("Key buffer is not defined");var h=e.buffer.byteLength*8,l=8*e.algorithm.keySize;if(e.type==="secret"&&h!==(l||256)&&(e.usages.indexOf("encrypt")>=0||e.usages.indexOf("decrypt")>=0)||e.type==="private"&&!(h===256||h===512)||e.type==="public"&&!(h===512||h===1024))throw new SyntaxError("Key buffer has wrong size "+h+" bit")}function extractKey(e,t,r){checkKey(r,e);if(t){var n;switch(t.mode){case"ES":n=["sBox","keyMeshing","padding","block"];break;case"SIGN":n=["namedCurve","namedParam","sBox","curve","param","modulusLength"];break;case"MAC":n=["sBox"];break;case"KW":n=["keyWrapping","ukm"];break;case"DH":n=["namedCurve","namedParam","sBox","ukm","curve","param","modulusLength"];break;case"KDF":n=["context","label"];break;case"PBKDF2":n=["sBox","iterations","salt"];break;case"PFXKDF":n=["sBox","iterations","salt","diversifier"];break;case"CPKDF":n=["sBox","salt"];break}if(n)n.forEach(function(e){r.algorithm[e]&&(t[e]=r.algorithm[e])})}return r.buffer}function convertKey(e,t,r,n,i){var a={type:i||(e.name==="GOST R 34.10"?"private":"secret"),extractable:t||"false",algorithm:e,usages:r||[],buffer:n};checkKey(a);return a}function convertKeyPair(e,t,r,n,i,a){if(!n||!n.indexOf)throw new SyntaxError("Key usages not defined");var o=n.filter(function(e){return e!=="sign"});var s=n.filter(function(e){return e!=="verify"});return{publicKey:convertKey(e,r,o,i,"public"),privateKey:convertKey(t,r,s,a,"private")}}function swapBytes(e){if(e instanceof u)e=new Uint8Array(e);var t=new Uint8Array(e.length);for(var r=0,n=e.length;r<n;r++){t[n-r-1]=e[r]}return t.buffer}function execute(e,t,r){return new Promise(function(i,a){try{i(n.gostEngine.execute(e,t,r))}catch(e){a(e)}})}function call(e){try{e()}catch(e){}}var u=ArrayBuffer;function SubtleCrypto(){}SubtleCrypto.prototype.encrypt=function(e,t,r){return new Promise(call).then(function(){if(checkNative(e))return c.subtle.encrypt(e,t,r);e=normalize(e,"encrypt");return execute(e,"encrypt",[extractKey("encrypt",e,t),r])})};SubtleCrypto.prototype.decrypt=function(e,t,r){return new Promise(call).then(function(){if(checkNative(e))return c.subtle.decrypt(e,t,r);e=normalize(e,"decrypt");return execute(e,"decrypt",[extractKey("decrypt",e,t),r])})};SubtleCrypto.prototype.sign=function(e,t,r){return new Promise(call).then(function(){if(checkNative(e))return c.subtle.sign(e,t,r);e=normalize(e,"sign");var n=execute(e,"sign",[extractKey("sign",e,t),r]).then(function(t){if(e.procreator==="SC"&&e.mode==="SIGN"){t=o.gostASN1Instance.GostSignature.encode(t)}return t});return n})};SubtleCrypto.prototype.verify=function(e,t,r,n){return new Promise(call).then(function(){if(checkNative(e))return c.subtle.verify(e,t,r,n);e=normalize(e,"verify");if(e.procreator==="SC"&&e.mode==="SIGN"){var i=o.gostASN1Instance.GostSignature.decode(r);r={r:i.r,s:i.s}}return execute(e,"verify",[extractKey("verify",e,t),r,n])})};SubtleCrypto.prototype.digest=function(e,t){return new Promise(call).then(function(){if(checkNative(e))return c.subtle.digest(e,t);e=normalize(e,"digest");return execute(e,"digest",[t])})};SubtleCrypto.prototype.generateKey=function(e,t,r){return new Promise(call).then(function(){if(checkNative(e))return c.subtle.generateKey(e,t,r);var n=e.privateKey,i=e.publicKey;e=normalize(e,"generateKey");if(n)n=normalize(n,"generateKey");else n=e;if(i)i=normalize(i,"generateKey");else i=e;return execute(e,"generateKey",[]).then(function(a){if(a.publicKey&&a.privateKey)return convertKeyPair(i,n,t,r,a.publicKey,a.privateKey);else return convertKey(e,t,r,a)})})};SubtleCrypto.prototype.deriveKey=function(e,t,r,n,i){return new Promise(call).then(function(){if(checkNative(e))return c.subtle.deriveKey(e,t,r,n,i);e=normalize(e,"deriveKey");r=normalize(r,"generateKey");e.keySize=r.keySize;if(e["public"]){e["public"].algorithm=normalize(e["public"].algorithm);e["public"]=extractKey("deriveKey",e,e["public"])}return execute(e,"deriveKey",[extractKey("deriveKey",e,t)]).then(function(e){return convertKey(r,n,i,e)})})};SubtleCrypto.prototype.deriveBits=function(e,t,r){return new Promise(call).then(function(){if(checkNative(e))return c.subtle.deriveBits(e,t,r);e=normalize(e,"deriveBits");if(e["public"])e["public"]=extractKey("deriveBits",e,e["public"]);return execute(e,"deriveBits",[extractKey("deriveBits",e,t),r])})};SubtleCrypto.prototype.importKey=function(e,t,r,n,i){var s;return new Promise(call).then(function(){if(checkNative(r))return c.subtle.importKey(e,t,r,n,i);if(e==="raw"){r=normalize(r,"importKey");if(i&&i.indexOf){var f=r.name.toUpperCase().replace(/[\.\s]/g,"");if(f.indexOf("3410")>=0&&i.indexOf("sign")>=0)s="private";else if(f.indexOf("3410")>=0&&i.indexOf("verify")>=0)s="public"}return t}else{var u;if(e==="pkcs8")u=o.gostASN1Instance.GostPrivateKeyInfo.decode(t).object;else if(e==="spki")u=o.gostASN1Instance.GostSubjectPublicKeyInfo.decode(t).object;else throw new a.NotSupportedError("Key format not supported");r=normalize(u.algorithm,"importKey");s=u.type;if(n!==false)n=n||u.extractable;if(i){for(var d=0;d<i.length;d++){if(u.usages.indexOf(i[d])<0)throw(0,a.DataError)("Key usage not valid for this key")}}else i=u.usages;var h=u.buffer,l=r.keySize,p=h.byteLength;if(s==="public"||l===p)return h;else{if(p%l>0)throw new a.DataError("Invalid key size");r.mode="MASK";r.procreator="VN";var v=[];for(var d=l;d<p;d+=l){v.push(function(e){return function(t){return execute(r,"unwrapKey",[e,t]).then(function(e){var t=v.pop();if(t)return t(e);else{delete r.mode;return e}})}}(new Uint8Array(h,d,l)))}return v.pop()(new Uint8Array(h,0,l))}}}).then(function(e){return convertKey(r,n,i,e,s)})};SubtleCrypto.prototype.exportKey=function(e,t){return new Promise(call).then(function(){if(t&&checkNative(t.algorithm))return c.subtle.exportKey(e,t);if(!t.extractable)throw new f("Key not extractable");var r=extractKey(null,null,t);if(e==="raw")return r;else if(e==="pkcs8"&&t.algorithm&&t.algorithm.id){if(t.algorithm.procreator==="VN"){var n=t.algorithm,i;n.mode="MASK";return execute(n,"generateKey").then(function(e){i=e;return execute(n,"wrapKey",[i,t.buffer])}).then(function(e){delete n.mode;var t=new Uint8Array(e.byteLength+i.byteLength);t.set(new Uint8Array(e,0,e.byteLength));t.set(new Uint8Array(i,0,i.byteLength),e.byteLength);var r=t.buffer;r.enclosed=true;return o.gostASN1Instance.GostPrivateKeyInfo.encode({algorithm:n,buffer:r})})}else return o.gostASN1Instance.GostPrivateKeyInfo.encode(t)}else if(e==="spki"&&t.algorithm&&t.algorithm.id)return o.gostASN1Instance.GostSubjectPublicKeyInfo.encode(t);else throw new a.NotSupportedError("Key format not supported")})};SubtleCrypto.prototype.wrapKey=function(e,t,r,n){return new Promise(call).then(function(){if(checkNative(n))return c.subtle.wrapKey(e,t,r,n);n=normalize(n,"wrapKey");var i=extractKey(null,null,t);if(n.procreator==="SC"&&t.type==="private")i=swapBytes(i);return execute(n,"wrapKey",[extractKey("wrapKey",n,r),i]).then(function(t){if(e==="raw")return t;else throw new a.NotSupportedError("Key format not supported")})})};SubtleCrypto.prototype.unwrapKey=function(e,t,r,n,i,o,s){return new Promise(call).then(function(){if(checkNative(n))return c.subtle.unwrapKey(e,t,r,n,i,o,s);n=normalize(n,"unwrapKey");i=normalize(i,"importKey");if(e!=="raw")throw new a.NotSupportedError("Key format not supported");return execute(n,"unwrapKey",[extractKey("unwrapKey",n,r),t]).then(function(e){var t;if(i&&i.name){var r=i.name.toUpperCase().replace(/[\.\s]/g,"");if(r.indexOf("3410")>=0&&s.indexOf("sign")>=0)t="private";else if(r.indexOf("3410")>=0&&s.indexOf("verify")>=0)t="public"}if(n.procreator==="SC"&&t==="private")e=swapBytes(e);return convertKey(i,o,s,e,t)})})};var d=t.gostSubtleInstance=new SubtleCrypto},function(e,t,r){"use strict";(function(e,n){function oldBrowser(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var i=r(1);var a=r(12);var o=i.Buffer;var s=i.kMaxLength;var f=e.crypto||e.msCrypto;var c=Math.pow(2,32)-1;function assertOffset(e,t){if(typeof e!=="number"||e!==e){throw new TypeError("offset must be a number")}if(e>c||e<0){throw new TypeError("offset must be a uint32")}if(e>s||e>t){throw new RangeError("offset out of range")}}function assertSize(e,t,r){if(typeof e!=="number"||e!==e){throw new TypeError("size must be a number")}if(e>c||e<0){throw new TypeError("size must be a uint32")}if(e+t>r||e>s){throw new RangeError("buffer too small")}}if(f&&f.getRandomValues||!n.browser){t.randomFill=randomFill;t.randomFillSync=randomFillSync}else{t.randomFill=oldBrowser;t.randomFillSync=oldBrowser}function randomFill(t,r,n,i){if(!o.isBuffer(t)&&!(t instanceof e.Uint8Array)){throw new TypeError('"buf" argument must be a Buffer or Uint8Array')}if(typeof r==="function"){i=r;r=0;n=t.length}else if(typeof n==="function"){i=n;n=t.length-r}else if(typeof i!=="function"){throw new TypeError('"cb" argument must be a function')}assertOffset(r,t.length);assertSize(n,r,t.length);return actualFill(t,r,n,i)}function actualFill(e,t,r,i){if(n.browser){var o=e.buffer;var s=new Uint8Array(o,t,r);f.getRandomValues(s);if(i){n.nextTick(function(){i(null,e)});return}return e}if(i){a(r,function(r,n){if(r){return i(r)}n.copy(e,t);i(null,e)});return}var c=a(r);c.copy(e,t);return e}function randomFillSync(t,r,n){if(typeof r==="undefined"){r=0}if(!o.isBuffer(t)&&!(t instanceof e.Uint8Array)){throw new TypeError('"buf" argument must be a Buffer or Uint8Array')}assertOffset(r,t.length);if(n===undefined)n=t.length-r;assertSize(n,r,t.length);return actualFill(t,r,n)}}).call(this,r(7),r(9))},function(e,t,r){(function(t){var n=r(20);var i=r(44);var a=r(43);var o=r(3);var s=r(27);var f=r(18);var c=r(42);e.exports=function privateDecrypt(e,r,i){var a;if(e.padding){a=e.padding}else if(i){a=1}else{a=4}var f=n(e);var u=f.modulus.byteLength();if(r.length>u||new o(r).cmp(f.modulus)>=0){throw new Error("decryption error")}var d;if(i){d=c(new o(r),f)}else{d=s(r,f)}var h=new t(u-d.length);h.fill(0);d=t.concat([h,d],u);if(a===4){return oaep(f,d)}else if(a===1){return pkcs1(f,d,i)}else if(a===3){return d}else{throw new Error("unknown padding")}};function oaep(e,r){var n=e.modulus;var o=e.modulus.byteLength();var s=r.length;var c=f("sha1").update(new t("")).digest();var u=c.length;var d=2*u;if(r[0]!==0){throw new Error("decryption error")}var h=r.slice(1,u+1);var l=r.slice(u+1);var p=a(h,i(l,u));var v=a(l,i(p,o-u-1));if(compare(c,v.slice(0,u))){throw new Error("decryption error")}var y=u;while(v[y]===0){y++}if(v[y++]!==1){throw new Error("decryption error")}return v.slice(y)}function pkcs1(e,t,r){var n=t.slice(0,2);var i=2;var a=0;while(t[i++]!==0){if(i>=t.length){a++;break}}var o=t.slice(2,i-1);var s=t.slice(i-1,i);if(n.toString("hex")!=="0002"&&!r||n.toString("hex")!=="0001"&&r){a++}if(o.length<8){a++}if(a){throw new Error("decryption error")}return t.slice(i)}function compare(e,r){e=new t(e);r=new t(r);var n=0;var i=e.length;if(e.length!==r.length){n++;i=Math.min(e.length,r.length)}var a=-1;while(++a<i){n+=e[a]^r[a]}return n}}).call(this,r(2).Buffer)},function(e,t,r){(function(t){var n=r(20);var i=r(12);var a=r(18);var o=r(44);var s=r(43);var f=r(3);var c=r(42);var u=r(27);var d={RSA_PKCS1_OAEP_PADDING:4,RSA_PKCS1_PADDIN:1,RSA_NO_PADDING:3};e.exports=function publicEncrypt(e,t,r){var i;if(e.padding){i=e.padding}else if(r){i=1}else{i=4}var a=n(e);var o;if(i===4){o=oaep(a,t)}else if(i===1){o=pkcs1(a,t,r)}else if(i===3){o=new f(t);if(o.cmp(a.modulus)>=0){throw new Error("data too long for modulus")}}else{throw new Error("unknown padding")}if(r){return u(o,a)}else{return c(o,a)}};function oaep(e,r){var n=e.modulus.byteLength();var c=r.length;var u=a("sha1").update(new t("")).digest();var d=u.length;var h=2*d;if(c>n-h-2){throw new Error("message too long")}var l=new t(n-c-h-2);l.fill(0);var p=n-d-1;var v=i(d);var y=s(t.concat([u,l,new t([1]),r],p),o(v,p));var b=s(v,o(y,d));return new f(t.concat([new t([0]),b,y],n))}function pkcs1(e,r,n){var i=r.length;var a=e.modulus.byteLength();if(i>a-11){throw new Error("message too long")}var o;if(n){o=new t(a-i-3);o.fill(255)}else{o=nonZero(a-i-3)}return new f(t.concat([new t([0,n?1:2]),o,new t([0]),r],a))}function nonZero(e,r){var n=new t(e);var a=0;var o=i(e*2);var s=0;var f;while(a<e){if(s===o.length){o=i(e*2);s=0}f=o[s++];if(f){n[a++]=f}}return n}}).call(this,r(2).Buffer)},function(e,t,r){t.publicEncrypt=r(86);t.privateDecrypt=r(85);t.privateEncrypt=function privateEncrypt(e,r){return t.publicEncrypt(e,r,true)};t.publicDecrypt=function publicDecrypt(e,r){return t.privateDecrypt(e,r,true)}},function(e,t,r){(function(t){var n=r(4);var i=r(3);e.exports=function createECDH(e){return new ECDH(e)};var a={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};a.p224=a.secp224r1;a.p256=a.secp256r1=a.prime256v1;a.p192=a.secp192r1=a.prime192v1;a.p384=a.secp384r1;a.p521=a.secp521r1;function ECDH(e){this.curveType=a[e];if(!this.curveType){this.curveType={name:e}}this.curve=new n.ec(this.curveType.name);this.keys=void 0}ECDH.prototype.generateKeys=function(e,t){this.keys=this.curve.genKeyPair();return this.getPublicKey(e,t)};ECDH.prototype.computeSecret=function(e,r,n){r=r||"utf8";if(!t.isBuffer(e)){e=new t(e,r)}var i=this.curve.keyFromPublic(e).getPublic();var a=i.mul(this.keys.getPrivate()).getX();return formatReturnValue(a,n,this.curveType.byteLength)};ECDH.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic(t==="compressed",true);if(t==="hybrid"){if(r[r.length-1]%2){r[0]=7}else{r[0]=6}}return formatReturnValue(r,e)};ECDH.prototype.getPrivateKey=function(e){return formatReturnValue(this.keys.getPrivate(),e)};ECDH.prototype.setPublicKey=function(e,r){r=r||"utf8";if(!t.isBuffer(e)){e=new t(e,r)}this.keys._importPublic(e);return this};ECDH.prototype.setPrivateKey=function(e,r){r=r||"utf8";if(!t.isBuffer(e)){e=new t(e,r)}var n=new i(e);n=n.toString(16);this.keys=this.curve.genKeyPair();this.keys._importPrivate(n);return this};function formatReturnValue(e,r,n){if(!Array.isArray(e)){e=e.toArray()}var i=new t(e);if(n&&i.length<n){var a=new t(n-i.length);a.fill(0);i=t.concat([a,i])}if(!r){return i}else{return i.toString(r)}}}).call(this,r(2).Buffer)},function(e,t,r){(function(t){var n=r(3);var i=r(4).ec;var a=r(20);var o=r(45);function verify(e,r,i,o,s){var f=a(i);if(f.type==="ec"){if(o!=="ecdsa"&&o!=="ecdsa/rsa")throw new Error("wrong public key type");return ecVerify(e,r,f)}else if(f.type==="dsa"){if(o!=="dsa")throw new Error("wrong public key type");return dsaVerify(e,r,f)}else{if(o!=="rsa"&&o!=="ecdsa/rsa")throw new Error("wrong public key type")}r=t.concat([s,r]);var c=f.modulus.byteLength();var u=[1];var d=0;while(r.length+u.length+2<c){u.push(255);d++}u.push(0);var h=-1;while(++h<r.length){u.push(r[h])}u=new t(u);var l=n.mont(f.modulus);e=new n(e).toRed(l);e=e.redPow(new n(f.publicExponent));e=new t(e.fromRed().toArray());var p=d<8?1:0;c=Math.min(e.length,u.length);if(e.length!==u.length)p=1;h=-1;while(++h<c)p|=e[h]^u[h];return p===0}function ecVerify(e,t,r){var n=o[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var a=new i(n);var s=r.data.subjectPrivateKey.data;return a.verify(t,e,s)}function dsaVerify(e,t,r){var i=r.data.p;var o=r.data.q;var s=r.data.g;var f=r.data.pub_key;var c=a.signature.decode(e,"der");var u=c.s;var d=c.r;checkValue(u,o);checkValue(d,o);var h=n.mont(i);var l=u.invm(o);var p=s.toRed(h).redPow(new n(t).mul(l).mod(o)).fromRed().mul(f.toRed(h).redPow(d.mul(l).mod(o)).fromRed()).mod(i).mod(o);return p.cmp(d)===0}function checkValue(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}e.exports=verify}).call(this,r(2).Buffer)},function(e,t,r){(function(t){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r\+\/\=]+)[\n\r]+/m;var i=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----/m;var a=/^-----BEGIN ((?:.* KEY)|CERTIFICATE)-----([0-9A-z\n\r\+\/\=]+)-----END \1-----$/m;var o=r(22);var s=r(29);e.exports=function(e,r){var f=e.toString();var c=f.match(n);var u;if(!c){var d=f.match(a);u=new t(d[2].replace(/[\r\n]/g,""),"base64")}else{var h="aes"+c[1];var l=new t(c[2],"hex");var p=new t(c[3].replace(/[\r\n]/g,""),"base64");var v=o(r,l.slice(0,8),parseInt(c[1],10)).key;var y=[];var b=s.createDecipheriv(h,v,l);y.push(b.update(p));y.push(b.final());u=t.concat(y)}var m=f.match(i)[1];return{tag:m,data:u}}}).call(this,r(2).Buffer)},function(e){e.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},function(e,t,r){"use strict";var n=r(14);var i=n.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})});var a=n.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())});var o=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional())});var s=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())});var f=n.define("RelativeDistinguishedName",function(){this.setof(a)});var c=n.define("RDNSequence",function(){this.seqof(f)});var u=n.define("Name",function(){this.choice({rdnSequence:this.use(c)})});var d=n.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))});var h=n.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(false),this.key("extnValue").octstr())});var l=n.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(u),this.key("validity").use(d),this.key("subject").use(u),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())});var p=n.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});e.exports=p},function(e,t,r){var n=r(0);var i=r(46);function PEMEncoder(e){i.call(this,e);this.enc="pem"}n(PEMEncoder,i);e.exports=PEMEncoder;PEMEncoder.prototype.encode=function encode(e,t){var r=i.prototype.encode.call(this,e);var n=r.toString("base64");var a=["-----BEGIN "+t.label+"-----"];for(var o=0;o<n.length;o+=64)a.push(n.slice(o,o+64));a.push("-----END "+t.label+"-----");return a.join("\n")}},function(e,t,r){var n=t;n.der=r(46);n.pem=r(93)},function(e,t,r){var n=r(0);var i=r(2).Buffer;var a=r(47);function PEMDecoder(e){a.call(this,e);this.enc="pem"}n(PEMDecoder,a);e.exports=PEMDecoder;PEMDecoder.prototype.decode=function decode(e,t){var r=e.toString().split(/[\r\n]+/g);var n=t.label.toUpperCase();var o=/^-----(BEGIN|END) ([^-]+)-----$/;var s=-1;var f=-1;for(var c=0;c<r.length;c++){var u=r[c].match(o);if(u===null)continue;if(u[2]!==n)continue;if(s===-1){if(u[1]!=="BEGIN")break;s=c}else{if(u[1]!=="END")break;f=c;break}}if(s===-1||f===-1)throw new Error("PEM section not found for: "+n);var d=r.slice(s+1,f).join("");d.replace(/[^a-z0-9\+\/=]+/gi,"");var h=new i(d,"base64");return a.prototype.decode.call(this,h,t)}},function(e,t,r){var n=t;n.der=r(47);n.pem=r(95)},function(e,t,r){var n=r(48);t.tagClass={0:"universal",1:"application",2:"context",3:"private"};t.tagClassByName=n._reverse(t.tagClass);t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"};t.tagByName=n._reverse(t.tag)},function(e,t,r){var n=r(13).Reporter;var i=r(13).EncoderBuffer;var a=r(13).DecoderBuffer;var o=r(5);var s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"];var f=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);var c=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function Node(e,t){var r={};this._baseState=r;r.enc=e;r.parent=t||null;r.children=null;r.tag=null;r.args=null;r.reverseArgs=null;r.choice=null;r.optional=false;r.any=false;r.obj=false;r.use=null;r.useDecoder=null;r.key=null;r["default"]=null;r.explicit=null;r.implicit=null;r.contains=null;if(!r.parent){r.children=[];this._wrap()}}e.exports=Node;var u=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];Node.prototype.clone=function clone(){var e=this._baseState;var t={};u.forEach(function(r){t[r]=e[r]});var r=new this.constructor(t.parent);r._baseState=t;return r};Node.prototype._wrap=function wrap(){var e=this._baseState;f.forEach(function(t){this[t]=function _wrappedMethod(){var r=new this.constructor(this);e.children.push(r);return r[t].apply(r,arguments)}},this)};Node.prototype._init=function init(e){var t=this._baseState;o(t.parent===null);e.call(this);t.children=t.children.filter(function(e){return e._baseState.parent===this},this);o.equal(t.children.length,1,"Root node can have only one child")};Node.prototype._useArgs=function useArgs(e){var t=this._baseState;var r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this);if(r.length!==0){o(t.children===null);t.children=r;r.forEach(function(e){e._baseState.parent=this},this)}if(e.length!==0){o(t.args===null);t.args=e;t.reverseArgs=e.map(function(e){if(typeof e!=="object"||e.constructor!==Object)return e;var t={};Object.keys(e).forEach(function(r){if(r==(r|0))r|=0;var n=e[r];t[n]=r});return t})}};c.forEach(function(e){Node.prototype[e]=function _overrided(){var t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}});s.forEach(function(e){Node.prototype[e]=function _tagMethod(){var t=this._baseState;var r=Array.prototype.slice.call(arguments);o(t.tag===null);t.tag=e;this._useArgs(r);return this}});Node.prototype.use=function use(e){o(e);var t=this._baseState;o(t.use===null);t.use=e;return this};Node.prototype.optional=function optional(){var e=this._baseState;e.optional=true;return this};Node.prototype.def=function def(e){var t=this._baseState;o(t["default"]===null);t["default"]=e;t.optional=true;return this};Node.prototype.explicit=function explicit(e){var t=this._baseState;o(t.explicit===null&&t.implicit===null);t.explicit=e;return this};Node.prototype.implicit=function implicit(e){var t=this._baseState;o(t.explicit===null&&t.implicit===null);t.implicit=e;return this};Node.prototype.obj=function obj(){var e=this._baseState;var t=Array.prototype.slice.call(arguments);e.obj=true;if(t.length!==0)this._useArgs(t);return this};Node.prototype.key=function key(e){var t=this._baseState;o(t.key===null);t.key=e;return this};Node.prototype.any=function any(){var e=this._baseState;e.any=true;return this};Node.prototype.choice=function choice(e){var t=this._baseState;o(t.choice===null);t.choice=e;this._useArgs(Object.keys(e).map(function(t){return e[t]}));return this};Node.prototype.contains=function contains(e){var t=this._baseState;o(t.use===null);t.contains=e;return this};Node.prototype._decode=function decode(e,t){var r=this._baseState;if(r.parent===null)return e.wrapResult(r.children[0]._decode(e,t));var n=r["default"];var i=true;var o=null;if(r.key!==null)o=e.enterKey(r.key);if(r.optional){var s=null;if(r.explicit!==null)s=r.explicit;else if(r.implicit!==null)s=r.implicit;else if(r.tag!==null)s=r.tag;if(s===null&&!r.any){var f=e.save();try{if(r.choice===null)this._decodeGeneric(r.tag,e,t);else this._decodeChoice(e,t);i=true}catch(e){i=false}e.restore(f)}else{i=this._peekTag(e,s,r.any);if(e.isError(i))return i}}var c;if(r.obj&&i)c=e.enterObject();if(i){if(r.explicit!==null){var u=this._decodeTag(e,r.explicit);if(e.isError(u))return u;e=u}var d=e.offset;if(r.use===null&&r.choice===null){if(r.any)var f=e.save();var h=this._decodeTag(e,r.implicit!==null?r.implicit:r.tag,r.any);if(e.isError(h))return h;if(r.any)n=e.raw(f);else e=h}if(t&&t.track&&r.tag!==null)t.track(e.path(),d,e.length,"tagged");if(t&&t.track&&r.tag!==null)t.track(e.path(),e.offset,e.length,"content");if(r.any)n=n;else if(r.choice===null)n=this._decodeGeneric(r.tag,e,t);else n=this._decodeChoice(e,t);if(e.isError(n))return n;if(!r.any&&r.choice===null&&r.children!==null){r.children.forEach(function decodeChildren(r){r._decode(e,t)})}if(r.contains&&(r.tag==="octstr"||r.tag==="bitstr")){var l=new a(n);n=this._getUse(r.contains,e._reporterState.obj)._decode(l,t)}}if(r.obj&&i)n=e.leaveObject(c);if(r.key!==null&&(n!==null||i===true))e.leaveKey(o,r.key,n);else if(o!==null)e.exitKey(o);return n};Node.prototype._decodeGeneric=function decodeGeneric(e,t,r){var n=this._baseState;if(e==="seq"||e==="set")return null;if(e==="seqof"||e==="setof")return this._decodeList(t,e,n.args[0],r);else if(/str$/.test(e))return this._decodeStr(t,e,r);else if(e==="objid"&&n.args)return this._decodeObjid(t,n.args[0],n.args[1],r);else if(e==="objid")return this._decodeObjid(t,null,null,r);else if(e==="gentime"||e==="utctime")return this._decodeTime(t,e,r);else if(e==="null_")return this._decodeNull(t,r);else if(e==="bool")return this._decodeBool(t,r);else if(e==="objDesc")return this._decodeStr(t,e,r);else if(e==="int"||e==="enum")return this._decodeInt(t,n.args&&n.args[0],r);if(n.use!==null){return this._getUse(n.use,t._reporterState.obj)._decode(t,r)}else{return t.error("unknown tag: "+e)}};Node.prototype._getUse=function _getUse(e,t){var r=this._baseState;r.useDecoder=this._use(e,t);o(r.useDecoder._baseState.parent===null);r.useDecoder=r.useDecoder._baseState.children[0];if(r.implicit!==r.useDecoder._baseState.implicit){r.useDecoder=r.useDecoder.clone();r.useDecoder._baseState.implicit=r.implicit}return r.useDecoder};Node.prototype._decodeChoice=function decodeChoice(e,t){var r=this._baseState;var n=null;var i=false;Object.keys(r.choice).some(function(a){var o=e.save();var s=r.choice[a];try{var f=s._decode(e,t);if(e.isError(f))return false;n={type:a,value:f};i=true}catch(t){e.restore(o);return false}return true},this);if(!i)return e.error("Choice not matched");return n};Node.prototype._createEncoderBuffer=function createEncoderBuffer(e){return new i(e,this.reporter)};Node.prototype._encode=function encode(e,t,r){var n=this._baseState;if(n["default"]!==null&&n["default"]===e)return;var i=this._encodeValue(e,t,r);if(i===undefined)return;if(this._skipDefault(i,t,r))return;return i};Node.prototype._encodeValue=function encode(e,t,r){var i=this._baseState;if(i.parent===null)return i.children[0]._encode(e,t||new n);var a=null;this.reporter=t;if(i.optional&&e===undefined){if(i["default"]!==null)e=i["default"];else return}var o=null;var s=false;if(i.any){a=this._createEncoderBuffer(e)}else if(i.choice){a=this._encodeChoice(e,t)}else if(i.contains){o=this._getUse(i.contains,r)._encode(e,t);s=true}else if(i.children){o=i.children.map(function(r){if(r._baseState.tag==="null_")return r._encode(null,t,e);if(r._baseState.key===null)return t.error("Child should have a key");var n=t.enterKey(r._baseState.key);if(typeof e!=="object")return t.error("Child expected, but input is not object");var i=r._encode(e[r._baseState.key],t,e);t.leaveKey(n);return i},this).filter(function(e){return e});o=this._createEncoderBuffer(o)}else{if(i.tag==="seqof"||i.tag==="setof"){if(!(i.args&&i.args.length===1))return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var f=this.clone();f._baseState.implicit=null;o=this._createEncoderBuffer(e.map(function(r){var n=this._baseState;return this._getUse(n.args[0],e)._encode(r,t)},f))}else if(i.use!==null){a=this._getUse(i.use,r)._encode(e,t)}else{o=this._encodePrimitive(i.tag,e);s=true}}var a;if(!i.any&&i.choice===null){var c=i.implicit!==null?i.implicit:i.tag;var u=i.implicit===null?"universal":"context";if(c===null){if(i.use===null)t.error("Tag could be omitted only for .use()")}else{if(i.use===null)a=this._encodeComposite(c,s,u,o)}}if(i.explicit!==null)a=this._encodeComposite(i.explicit,false,"context",a);return a};Node.prototype._encodeChoice=function encodeChoice(e,t){var r=this._baseState;var n=r.choice[e.type];if(!n){o(false,e.type+" not found in "+JSON.stringify(Object.keys(r.choice)))}return n._encode(e.value,t)};Node.prototype._encodePrimitive=function encodePrimitive(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);else if(e==="objid"&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);else if(e==="objid")return this._encodeObjid(t,null,null);else if(e==="gentime"||e==="utctime")return this._encodeTime(t,e);else if(e==="null_")return this._encodeNull();else if(e==="int"||e==="enum")return this._encodeInt(t,r.args&&r.reverseArgs[0]);else if(e==="bool")return this._encodeBool(t);else if(e==="objDesc")return this._encodeStr(t,e);else throw new Error("Unsupported tag: "+e)};Node.prototype._isNumstr=function isNumstr(e){return/^[0-9 ]*$/.test(e)};Node.prototype._isPrintstr=function isPrintstr(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}},function(e,t,r){var n=r(0);function Reporter(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}t.Reporter=Reporter;Reporter.prototype.isError=function isError(e){return e instanceof ReporterError};Reporter.prototype.save=function save(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};Reporter.prototype.restore=function restore(e){var t=this._reporterState;t.obj=e.obj;t.path=t.path.slice(0,e.pathLen)};Reporter.prototype.enterKey=function enterKey(e){return this._reporterState.path.push(e)};Reporter.prototype.exitKey=function exitKey(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)};Reporter.prototype.leaveKey=function leaveKey(e,t,r){var n=this._reporterState;this.exitKey(e);if(n.obj!==null)n.obj[t]=r};Reporter.prototype.path=function path(){return this._reporterState.path.join("/")};Reporter.prototype.enterObject=function enterObject(){var e=this._reporterState;var t=e.obj;e.obj={};return t};Reporter.prototype.leaveObject=function leaveObject(e){var t=this._reporterState;var r=t.obj;t.obj=e;return r};Reporter.prototype.error=function error(e){var t;var r=this._reporterState;var n=e instanceof ReporterError;if(n){t=e}else{t=new ReporterError(r.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack)}if(!r.options.partial)throw t;if(!n)r.errors.push(t);return t};Reporter.prototype.wrapResult=function wrapResult(e){var t=this._reporterState;if(!t.options.partial)return e;return{result:this.isError(e)?null:e,errors:t.errors}};function ReporterError(e,t){this.path=e;this.rethrow(t)}n(ReporterError,Error);ReporterError.prototype.rethrow=function rethrow(e){this.message=e+" at: "+(this.path||"(shallow)");if(Error.captureStackTrace)Error.captureStackTrace(this,ReporterError);if(!this.stack){try{throw new Error(this.message)}catch(e){this.stack=e.stack}}return this}},function(e,t){var r=[].indexOf;e.exports=function(e,t){if(r)return e.indexOf(t);for(var n=0;n<e.length;++n){if(e[n]===t)return n}return-1}},function(module,exports,__webpack_require__){var indexOf=__webpack_require__(100);var Object_keys=function(e){if(Object.keys)return Object.keys(e);else{var t=[];for(var r in e)t.push(r);return t}};var forEach=function(e,t){if(e.forEach)return e.forEach(t);else for(var r=0;r<e.length;r++){t(e[r],r,e)}};var defineProp=function(){try{Object.defineProperty({},"_",{});return function(e,t,r){Object.defineProperty(e,t,{writable:true,enumerable:false,configurable:true,value:r})}}catch(e){return function(e,t,r){e[t]=r}}}();var globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function NodeScript(e){if(!(this instanceof Script))return new Script(e);this.code=e};Script.prototype.runInContext=function(e){if(!(e instanceof Context)){throw new TypeError("needs a 'context' argument.")}var t=document.createElement("iframe");if(!t.style)t.style={};t.style.display="none";document.body.appendChild(t);var r=t.contentWindow;var n=r.eval,i=r.execScript;if(!n&&i){i.call(r,"null");n=r.eval}forEach(Object_keys(e),function(t){r[t]=e[t]});forEach(globals,function(t){if(e[t]){r[t]=e[t]}});var a=Object_keys(r);var o=n.call(r,this.code);forEach(Object_keys(r),function(t){if(t in e||indexOf(a,t)===-1){e[t]=r[t]}});forEach(globals,function(t){if(!(t in e)){defineProp(e,t,r[t])}});document.body.removeChild(t);return o};Script.prototype.runInThisContext=function(){return eval(this.code)};Script.prototype.runInNewContext=function(e){var t=Script.createContext(e);var r=this.runInContext(t);forEach(Object_keys(t),function(r){e[r]=t[r]});return r};forEach(Object_keys(Script.prototype),function(e){exports[e]=Script[e]=function(t){var r=Script(t);return r[e].apply(r,[].slice.call(arguments,1))}});exports.createScript=function(e){return exports.Script(e)};exports.createContext=Script.createContext=function(e){var t=new Context;if(typeof e==="object"){forEach(Object_keys(e),function(r){t[r]=e[r]})}return t}},function(e,t,r){var n=r(14);var i=r(0);var a=t;a.define=function define(e,t){return new Entity(e,t)};function Entity(e,t){this.name=e;this.body=t;this.decoders={};this.encoders={}}Entity.prototype._createNamed=function createNamed(e){var t;try{t=r(101).runInThisContext("(function "+this.name+"(entity) {\n"+"  this._initNamed(entity);\n"+"})")}catch(e){t=function(e){this._initNamed(e)}}i(t,e);t.prototype._initNamed=function initnamed(t){e.call(this,t)};return new t(this)};Entity.prototype._getDecoder=function _getDecoder(e){e=e||"der";if(!this.decoders.hasOwnProperty(e))this.decoders[e]=this._createNamed(n.decoders[e]);return this.decoders[e]};Entity.prototype.decode=function decode(e,t,r){return this._getDecoder(t).decode(e,r)};Entity.prototype._getEncoder=function _getEncoder(e){e=e||"der";if(!this.encoders.hasOwnProperty(e))this.encoders[e]=this._createNamed(n.encoders[e]);return this.encoders[e]};Entity.prototype.encode=function encode(e,t,r){return this._getEncoder(t).encode(e,r)}},function(e,t,r){"use strict";var n=r(14);t.certificate=r(92);var i=n.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});t.RSAPrivateKey=i;var a=n.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});t.RSAPublicKey=a;var o=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});t.PublicKey=o;var s=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())});var f=n.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});t.PrivateKey=f;var c=n.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});t.EncryptedPrivateKey=c;var u=n.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});t.DSAPrivateKey=u;t.DSAparam=n.define("DSAparam",function(){this.int()});var d=n.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});t.ECPrivateKey=d;var h=n.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});t.signature=n.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},function(e,t,r){"use strict";var n=r(3);var i=r(4);var a=i.utils;var o=a.assert;var s=a.cachedProperty;var f=a.parseBytes;function Signature(e,t){this.eddsa=e;if(typeof t!=="object")t=f(t);if(Array.isArray(t)){t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}}o(t.R&&t.S,"Signature without R or S");if(e.isPoint(t.R))this._R=t.R;if(t.S instanceof n)this._S=t.S;this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded;this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(Signature,"S",function S(){return this.eddsa.decodeInt(this.Sencoded())});s(Signature,"R",function R(){return this.eddsa.decodePoint(this.Rencoded())});s(Signature,"Rencoded",function Rencoded(){return this.eddsa.encodePoint(this.R())});s(Signature,"Sencoded",function Sencoded(){return this.eddsa.encodeInt(this.S())});Signature.prototype.toBytes=function toBytes(){return this.Rencoded().concat(this.Sencoded())};Signature.prototype.toHex=function toHex(){return a.encode(this.toBytes(),"hex").toUpperCase()};e.exports=Signature},function(e,t,r){"use strict";var n=r(4);var i=n.utils;var a=i.assert;var o=i.parseBytes;var s=i.cachedProperty;function KeyPair(e,t){this.eddsa=e;this._secret=o(t.secret);if(e.isPoint(t.pub))this._pub=t.pub;else this._pubBytes=o(t.pub)}KeyPair.fromPublic=function fromPublic(e,t){if(t instanceof KeyPair)return t;return new KeyPair(e,{pub:t})};KeyPair.fromSecret=function fromSecret(e,t){if(t instanceof KeyPair)return t;return new KeyPair(e,{secret:t})};KeyPair.prototype.secret=function secret(){return this._secret};s(KeyPair,"pubBytes",function pubBytes(){return this.eddsa.encodePoint(this.pub())});s(KeyPair,"pub",function pub(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())});s(KeyPair,"privBytes",function privBytes(){var e=this.eddsa;var t=this.hash();var r=e.encodingLength-1;var n=t.slice(0,e.encodingLength);n[0]&=248;n[r]&=127;n[r]|=64;return n});s(KeyPair,"priv",function priv(){return this.eddsa.decodeInt(this.privBytes())});s(KeyPair,"hash",function hash(){return this.eddsa.hash().update(this.secret()).digest()});s(KeyPair,"messagePrefix",function messagePrefix(){return this.hash().slice(this.eddsa.encodingLength)});KeyPair.prototype.sign=function sign(e){a(this._secret,"KeyPair can only verify");return this.eddsa.sign(e,this)};KeyPair.prototype.verify=function verify(e,t){return this.eddsa.verify(e,t,this)};KeyPair.prototype.getSecret=function getSecret(e){a(this._secret,"KeyPair is public only");return i.encode(this.secret(),e)};KeyPair.prototype.getPublic=function getPublic(e){return i.encode(this.pubBytes(),e)};e.exports=KeyPair},function(e,t,r){"use strict";var n=r(26);var i=r(4);var a=i.utils;var o=a.assert;var s=a.parseBytes;var f=r(105);var c=r(104);function EDDSA(e){o(e==="ed25519","only tested with ed25519 so far");if(!(this instanceof EDDSA))return new EDDSA(e);var e=i.curves[e].curve;this.curve=e;this.g=e.g;this.g.precompute(e.n.bitLength()+1);this.pointClass=e.point().constructor;this.encodingLength=Math.ceil(e.n.bitLength()/8);this.hash=n.sha512}e.exports=EDDSA;EDDSA.prototype.sign=function sign(e,t){e=s(e);var r=this.keyFromSecret(t);var n=this.hashInt(r.messagePrefix(),e);var i=this.g.mul(n);var a=this.encodePoint(i);var o=this.hashInt(a,r.pubBytes(),e).mul(r.priv());var f=n.add(o).umod(this.curve.n);return this.makeSignature({R:i,S:f,Rencoded:a})};EDDSA.prototype.verify=function verify(e,t,r){e=s(e);t=this.makeSignature(t);var n=this.keyFromPublic(r);var i=this.hashInt(t.Rencoded(),n.pubBytes(),e);var a=this.g.mul(t.S());var o=t.R().add(n.pub().mul(i));return o.eq(a)};EDDSA.prototype.hashInt=function hashInt(){var e=this.hash();for(var t=0;t<arguments.length;t++)e.update(arguments[t]);return a.intFromLE(e.digest()).umod(this.curve.n)};EDDSA.prototype.keyFromPublic=function keyFromPublic(e){return f.fromPublic(this,e)};EDDSA.prototype.keyFromSecret=function keyFromSecret(e){return f.fromSecret(this,e)};EDDSA.prototype.makeSignature=function makeSignature(e){if(e instanceof c)return e;return new c(this,e)};EDDSA.prototype.encodePoint=function encodePoint(e){var t=e.getY().toArray("le",this.encodingLength);t[this.encodingLength-1]|=e.getX().isOdd()?128:0;return t};EDDSA.prototype.decodePoint=function decodePoint(e){e=a.parseBytes(e);var t=e.length-1;var r=e.slice(0,t).concat(e[t]&~128);var n=(e[t]&128)!==0;var i=a.intFromLE(r);return this.curve.pointFromY(i,n)};EDDSA.prototype.encodeInt=function encodeInt(e){return e.toArray("le",this.encodingLength)};EDDSA.prototype.decodeInt=function decodeInt(e){return a.intFromLE(e)};EDDSA.prototype.isPoint=function isPoint(e){return e instanceof this.pointClass}},function(e,t,r){"use strict";var n=r(3);var i=r(4);var a=i.utils;var o=a.assert;function Signature(e,t){if(e instanceof Signature)return e;if(this._importDER(e,t))return;o(e.r&&e.s,"Signature without r or s");this.r=new n(e.r,16);this.s=new n(e.s,16);if(e.recoveryParam===undefined)this.recoveryParam=null;else this.recoveryParam=e.recoveryParam}e.exports=Signature;function Position(){this.place=0}function getLength(e,t){var r=e[t.place++];if(!(r&128)){return r}var n=r&15;var i=0;for(var a=0,o=t.place;a<n;a++,o++){i<<=8;i|=e[o]}t.place=o;return i}function rmPadding(e){var t=0;var r=e.length-1;while(!e[t]&&!(e[t+1]&128)&&t<r){t++}if(t===0){return e}return e.slice(t)}Signature.prototype._importDER=function _importDER(e,t){e=a.toArray(e,t);var r=new Position;if(e[r.place++]!==48){return false}var i=getLength(e,r);if(i+r.place!==e.length){return false}if(e[r.place++]!==2){return false}var o=getLength(e,r);var s=e.slice(r.place,o+r.place);r.place+=o;if(e[r.place++]!==2){return false}var f=getLength(e,r);if(e.length!==f+r.place){return false}var c=e.slice(r.place,f+r.place);if(s[0]===0&&s[1]&128){s=s.slice(1)}if(c[0]===0&&c[1]&128){c=c.slice(1)}this.r=new n(s);this.s=new n(c);this.recoveryParam=null;return true};function constructLength(e,t){if(t<128){e.push(t);return}var r=1+(Math.log(t)/Math.LN2>>>3);e.push(r|128);while(--r){e.push(t>>>(r<<3)&255)}e.push(t)}Signature.prototype.toDER=function toDER(e){var t=this.r.toArray();var r=this.s.toArray();if(t[0]&128)t=[0].concat(t);if(r[0]&128)r=[0].concat(r);t=rmPadding(t);r=rmPadding(r);while(!r[0]&&!(r[1]&128)){r=r.slice(1)}var n=[2];constructLength(n,t.length);n=n.concat(t);n.push(2);constructLength(n,r.length);var i=n.concat(r);var o=[48];constructLength(o,i.length);o=o.concat(i);return a.encode(o,e)}},function(e,t,r){"use strict";var n=r(3);var i=r(4);var a=i.utils;var o=a.assert;function KeyPair(e,t){this.ec=e;this.priv=null;this.pub=null;if(t.priv)this._importPrivate(t.priv,t.privEnc);if(t.pub)this._importPublic(t.pub,t.pubEnc)}e.exports=KeyPair;KeyPair.fromPublic=function fromPublic(e,t,r){if(t instanceof KeyPair)return t;return new KeyPair(e,{pub:t,pubEnc:r})};KeyPair.fromPrivate=function fromPrivate(e,t,r){if(t instanceof KeyPair)return t;return new KeyPair(e,{priv:t,privEnc:r})};KeyPair.prototype.validate=function validate(){var e=this.getPublic();if(e.isInfinity())return{result:false,reason:"Invalid public key"};if(!e.validate())return{result:false,reason:"Public key is not a point"};if(!e.mul(this.ec.curve.n).isInfinity())return{result:false,reason:"Public key * N != O"};return{result:true,reason:null}};KeyPair.prototype.getPublic=function getPublic(e,t){if(typeof e==="string"){t=e;e=null}if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!t)return this.pub;return this.pub.encode(t,e)};KeyPair.prototype.getPrivate=function getPrivate(e){if(e==="hex")return this.priv.toString(16,2);else return this.priv};KeyPair.prototype._importPrivate=function _importPrivate(e,t){this.priv=new n(e,t||16);this.priv=this.priv.umod(this.ec.curve.n)};KeyPair.prototype._importPublic=function _importPublic(e,t){if(e.x||e.y){if(this.ec.curve.type==="mont"){o(e.x,"Need x coordinate")}else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards"){o(e.x&&e.y,"Need both x and y coordinate")}this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)};KeyPair.prototype.derive=function derive(e){return e.mul(this.priv).getX()};KeyPair.prototype.sign=function sign(e,t,r){return this.ec.sign(e,this,t,r)};KeyPair.prototype.verify=function verify(e,t){return this.ec.verify(e,t,this)};KeyPair.prototype.inspect=function inspect(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(e,t,r){"use strict";var n=r(26);var i=r(53);var a=r(5);function HmacDRBG(e){if(!(this instanceof HmacDRBG))return new HmacDRBG(e);this.hash=e.hash;this.predResist=!!e.predResist;this.outLen=this.hash.outSize;this.minEntropy=e.minEntropy||this.hash.hmacStrength;this._reseed=null;this.reseedInterval=null;this.K=null;this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex");var r=i.toArray(e.nonce,e.nonceEnc||"hex");var n=i.toArray(e.pers,e.persEnc||"hex");a(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits");this._init(t,r,n)}e.exports=HmacDRBG;HmacDRBG.prototype._init=function init(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8);this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++){this.K[i]=0;this.V[i]=1}this._update(n);this._reseed=1;this.reseedInterval=281474976710656};HmacDRBG.prototype._hmac=function hmac(){return new n.hmac(this.hash,this.K)};HmacDRBG.prototype._update=function update(e){var t=this._hmac().update(this.V).update([0]);if(e)t=t.update(e);this.K=t.digest();this.V=this._hmac().update(this.V).digest();if(!e)return;this.K=this._hmac().update(this.V).update([1]).update(e).digest();this.V=this._hmac().update(this.V).digest()};HmacDRBG.prototype.reseed=function reseed(e,t,r,n){if(typeof t!=="string"){n=r;r=t;t=null}e=i.toArray(e,t);r=i.toArray(r,n);a(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits");this._update(e.concat(r||[]));this._reseed=1};HmacDRBG.prototype.generate=function generate(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");if(typeof t!=="string"){n=r;r=t;t=null}if(r){r=i.toArray(r,n||"hex");this._update(r)}var a=[];while(a.length<e){this.V=this._hmac().update(this.V).digest();a=a.concat(this.V)}var o=a.slice(0,e);this._update(r);this._reseed++;return i.encode(o,t)}},function(e,t,r){"use strict";var n=r(3);var i=r(109);var a=r(4);var o=a.utils;var s=o.assert;var f=r(108);var c=r(107);function EC(e){if(!(this instanceof EC))return new EC(e);if(typeof e==="string"){s(a.curves.hasOwnProperty(e),"Unknown curve "+e);e=a.curves[e]}if(e instanceof a.curves.PresetCurve)e={curve:e};this.curve=e.curve.curve;this.n=this.curve.n;this.nh=this.n.ushrn(1);this.g=this.curve.g;this.g=e.curve.g;this.g.precompute(e.curve.n.bitLength()+1);this.hash=e.hash||e.curve.hash}e.exports=EC;EC.prototype.keyPair=function keyPair(e){return new f(this,e)};EC.prototype.keyFromPrivate=function keyFromPrivate(e,t){return f.fromPrivate(this,e,t)};EC.prototype.keyFromPublic=function keyFromPublic(e,t){return f.fromPublic(this,e,t)};EC.prototype.genKeyPair=function genKeyPair(e){if(!e)e={};var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a.rand(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()});var r=this.n.byteLength();var o=this.n.sub(new n(2));do{var s=new n(t.generate(r));if(s.cmp(o)>0)continue;s.iaddn(1);return this.keyFromPrivate(s)}while(true)};EC.prototype._truncateToN=function truncateToN(e,t){var r=e.byteLength()*8-this.n.bitLength();if(r>0)e=e.ushrn(r);if(!t&&e.cmp(this.n)>=0)return e.sub(this.n);else return e};EC.prototype.sign=function sign(e,t,r,a){if(typeof r==="object"){a=r;r=null}if(!a)a={};t=this.keyFromPrivate(t,r);e=this._truncateToN(new n(e,16));var o=this.n.byteLength();var s=t.getPrivate().toArray("be",o);var f=e.toArray("be",o);var u=new i({hash:this.hash,entropy:s,nonce:f,pers:a.pers,persEnc:a.persEnc||"utf8"});var d=this.n.sub(new n(1));for(var h=0;true;h++){var l=a.k?a.k(h):new n(u.generate(this.n.byteLength()));l=this._truncateToN(l,true);if(l.cmpn(1)<=0||l.cmp(d)>=0)continue;var p=this.g.mul(l);if(p.isInfinity())continue;var v=p.getX();var y=v.umod(this.n);if(y.cmpn(0)===0)continue;var b=l.invm(this.n).mul(y.mul(t.getPrivate()).iadd(e));b=b.umod(this.n);if(b.cmpn(0)===0)continue;var m=(p.getY().isOdd()?1:0)|(v.cmp(y)!==0?2:0);if(a.canonical&&b.cmp(this.nh)>0){b=this.n.sub(b);m^=1}return new c({r:y,s:b,recoveryParam:m})}};EC.prototype.verify=function verify(e,t,r,i){e=this._truncateToN(new n(e,16));r=this.keyFromPublic(r,i);t=new c(t,"hex");var a=t.r;var o=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return false;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return false;var s=o.invm(this.n);var f=s.mul(e).umod(this.n);var u=s.mul(a).umod(this.n);if(!this.curve._maxwellTrick){var d=this.g.mulAdd(f,r.getPublic(),u);if(d.isInfinity())return false;return d.getX().umod(this.n).cmp(a)===0}var d=this.g.jmulAdd(f,r.getPublic(),u);if(d.isInfinity())return false;return d.eqXToP(a)};EC.prototype.recoverPubKey=function(e,t,r,i){s((3&r)===r,"The recovery param is more than two bits");t=new c(t,i);var a=this.n;var o=new n(e);var f=t.r;var u=t.s;var d=r&1;var h=r>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");if(h)f=this.curve.pointFromX(f.add(this.curve.n),d);else f=this.curve.pointFromX(f,d);var l=t.r.invm(a);var p=a.sub(o).mul(l).umod(a);var v=u.mul(l).umod(a);return this.g.mulAdd(p,f,v)};EC.prototype.getKeyRecoveryParam=function(e,t,r,n){t=new c(t,n);if(t.recoveryParam!==null)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(e,t,r){"use strict";var n=r(6);var i=r(5);function Hmac(e,t,r){if(!(this instanceof Hmac))return new Hmac(e,t,r);this.Hash=e;this.blockSize=e.blockSize/8;this.outSize=e.outSize/8;this.inner=null;this.outer=null;this._init(n.toArray(t,r))}e.exports=Hmac;Hmac.prototype._init=function init(e){if(e.length>this.blockSize)e=(new this.Hash).update(e).digest();i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;this.inner=(new this.Hash).update(e);for(t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)};Hmac.prototype.update=function update(e,t){this.inner.update(e,t);return this};Hmac.prototype.digest=function digest(e){this.outer.update(this.inner.digest());return this.outer.digest(e)}},function(e,t,r){"use strict";var n=r(6);var i=r(15);var a=n.rotl32;var o=n.sum32;var s=n.sum32_3;var c=n.sum32_4;var u=i.BlockHash;function RIPEMD160(){if(!(this instanceof RIPEMD160))return new RIPEMD160;u.call(this);this.h=[1732584193,4023233417,2562383102,271733878,3285377520];this.endian="little"}n.inherits(RIPEMD160,u);t.ripemd160=RIPEMD160;RIPEMD160.blockSize=512;RIPEMD160.outSize=160;RIPEMD160.hmacStrength=192;RIPEMD160.padLength=64;RIPEMD160.prototype._update=function update(e,t){var r=this.h[0];var n=this.h[1];var i=this.h[2];var u=this.h[3];var v=this.h[4];var y=r;var b=n;var m=i;var g=u;var w=v;for(var C=0;C<80;C++){var S=o(a(c(r,f(C,n,i,u),e[d[C]+t],K(C)),l[C]),v);r=v;v=u;u=a(i,10);i=n;n=S;S=o(a(c(y,f(79-C,b,m,g),e[h[C]+t],Kh(C)),p[C]),w);y=w;w=g;g=a(m,10);m=b;b=S}S=s(this.h[1],i,g);this.h[1]=s(this.h[2],u,w);this.h[2]=s(this.h[3],v,y);this.h[3]=s(this.h[4],r,b);this.h[4]=s(this.h[0],n,m);this.h[0]=S};RIPEMD160.prototype._digest=function digest(e){if(e==="hex")return n.toHex32(this.h,"little");else return n.split32(this.h,"little")};function f(e,t,r,n){if(e<=15)return t^r^n;else if(e<=31)return t&r|~t&n;else if(e<=47)return(t|~r)^n;else if(e<=63)return t&n|r&~n;else return t^(r|~n)}function K(e){if(e<=15)return 0;else if(e<=31)return 1518500249;else if(e<=47)return 1859775393;else if(e<=63)return 2400959708;else return 2840853838}function Kh(e){if(e<=15)return 1352829926;else if(e<=31)return 1548603684;else if(e<=47)return 1836072691;else if(e<=63)return 2053994217;else return 0}var d=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13];var h=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11];var l=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6];var p=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(e,t,r){"use strict";var n=r(6);var i=r(50);function SHA384(){if(!(this instanceof SHA384))return new SHA384;i.call(this);this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(SHA384,i);e.exports=SHA384;SHA384.blockSize=1024;SHA384.outSize=384;SHA384.hmacStrength=192;SHA384.padLength=128;SHA384.prototype._digest=function digest(e){if(e==="hex")return n.toHex32(this.h.slice(0,12),"big");else return n.split32(this.h.slice(0,12),"big")}},function(e,t,r){"use strict";var n=r(6);var i=r(51);function SHA224(){if(!(this instanceof SHA224))return new SHA224;i.call(this);this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(SHA224,i);e.exports=SHA224;SHA224.blockSize=512;SHA224.outSize=224;SHA224.hmacStrength=192;SHA224.padLength=64;SHA224.prototype._digest=function digest(e){if(e==="hex")return n.toHex32(this.h.slice(0,7),"big");else return n.split32(this.h.slice(0,7),"big")}},function(e,t,r){"use strict";var n=r(6);var i=r(15);var a=r(52);var o=n.rotl32;var s=n.sum32;var f=n.sum32_5;var c=a.ft_1;var u=i.BlockHash;var d=[1518500249,1859775393,2400959708,3395469782];function SHA1(){if(!(this instanceof SHA1))return new SHA1;u.call(this);this.h=[1732584193,4023233417,2562383102,271733878,3285377520];this.W=new Array(80)}n.inherits(SHA1,u);e.exports=SHA1;SHA1.blockSize=512;SHA1.outSize=160;SHA1.hmacStrength=80;SHA1.padLength=64;SHA1.prototype._update=function _update(e,t){var r=this.W;for(var n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=o(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0];var a=this.h[1];var u=this.h[2];var h=this.h[3];var l=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20);var v=f(o(i,5),c(p,a,u,h),l,r[n],d[p]);l=h;h=u;u=o(a,30);a=i;i=v}this.h[0]=s(this.h[0],i);this.h[1]=s(this.h[1],a);this.h[2]=s(this.h[2],u);this.h[3]=s(this.h[3],h);this.h[4]=s(this.h[4],l)};SHA1.prototype._digest=function digest(e){if(e==="hex")return n.toHex32(this.h,"big");else return n.split32(this.h,"big")}},function(e,t,r){"use strict";t.sha1=r(116);t.sha224=r(115);t.sha256=r(51);t.sha384=r(114);t.sha512=r(50)},function(e,t,r){"use strict";var n=t;var i=r(26);var a=r(4);var o=a.utils.assert;function PresetCurve(e){if(e.type==="short")this.curve=new a.curve.short(e);else if(e.type==="edwards")this.curve=new a.curve.edwards(e);else this.curve=new a.curve.mont(e);this.g=this.curve.g;this.n=this.curve.n;this.hash=e.hash;o(this.g.validate(),"Invalid curve");o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}n.PresetCurve=PresetCurve;function defineCurve(e,t){Object.defineProperty(n,e,{configurable:true,enumerable:true,get:function(){var r=new PresetCurve(t);Object.defineProperty(n,e,{configurable:true,enumerable:true,value:r});return r}})}defineCurve("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:i.sha256,gRed:false,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]});defineCurve("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:i.sha256,gRed:false,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]});defineCurve("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:i.sha256,gRed:false,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]});defineCurve("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f "+"5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 "+"f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:i.sha384,gRed:false,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 "+"5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 "+"0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]});defineCurve("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b "+"99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd "+"3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff "+"ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 "+"f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:i.sha512,gRed:false,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 "+"053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 "+"a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 "+"579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 "+"3fad0761 353c7086 a272c240 88be9476 9fd16650"]});defineCurve("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:false,g:["9"]});defineCurve("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:i.sha256,gRed:false,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var s;try{s=r(111)}catch(e){s=undefined}defineCurve("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:i.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:false,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",s]})},function(e,t,r){"use strict";var n=r(21);var i=r(4);var a=r(3);var o=r(0);var s=n.base;var f=i.utils.assert;function EdwardsCurve(e){this.twisted=(e.a|0)!==1;this.mOneA=this.twisted&&(e.a|0)===-1;this.extended=this.mOneA;s.call(this,"edwards",e);this.a=new a(e.a,16).umod(this.red.m);this.a=this.a.toRed(this.red);this.c=new a(e.c,16).toRed(this.red);this.c2=this.c.redSqr();this.d=new a(e.d,16).toRed(this.red);this.dd=this.d.redAdd(this.d);f(!this.twisted||this.c.fromRed().cmpn(1)===0);this.oneC=(e.c|0)===1}o(EdwardsCurve,s);e.exports=EdwardsCurve;EdwardsCurve.prototype._mulA=function _mulA(e){if(this.mOneA)return e.redNeg();else return this.a.redMul(e)};EdwardsCurve.prototype._mulC=function _mulC(e){if(this.oneC)return e;else return this.c.redMul(e)};EdwardsCurve.prototype.jpoint=function jpoint(e,t,r,n){return this.point(e,t,r,n)};EdwardsCurve.prototype.pointFromX=function pointFromX(e,t){e=new a(e,16);if(!e.red)e=e.toRed(this.red);var r=e.redSqr();var n=this.c2.redSub(this.a.redMul(r));var i=this.one.redSub(this.c2.redMul(this.d).redMul(r));var o=n.redMul(i.redInvm());var s=o.redSqrt();if(s.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");var f=s.fromRed().isOdd();if(t&&!f||!t&&f)s=s.redNeg();return this.point(e,s)};EdwardsCurve.prototype.pointFromY=function pointFromY(e,t){e=new a(e,16);if(!e.red)e=e.toRed(this.red);var r=e.redSqr();var n=r.redSub(this.one);var i=r.redMul(this.d).redAdd(this.one);var o=n.redMul(i.redInvm());if(o.cmp(this.zero)===0){if(t)throw new Error("invalid point");else return this.point(this.zero,e)}var s=o.redSqrt();if(s.redSqr().redSub(o).cmp(this.zero)!==0)throw new Error("invalid point");if(s.isOdd()!==t)s=s.redNeg();return this.point(s,e)};EdwardsCurve.prototype.validate=function validate(e){if(e.isInfinity())return true;e.normalize();var t=e.x.redSqr();var r=e.y.redSqr();var n=t.redMul(this.a).redAdd(r);var i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return n.cmp(i)===0};function Point(e,t,r,n,i){s.BasePoint.call(this,e,"projective");if(t===null&&r===null&&n===null){this.x=this.curve.zero;this.y=this.curve.one;this.z=this.curve.one;this.t=this.curve.zero;this.zOne=true}else{this.x=new a(t,16);this.y=new a(r,16);this.z=n?new a(n,16):this.curve.one;this.t=i&&new a(i,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);if(this.t&&!this.t.red)this.t=this.t.toRed(this.curve.red);this.zOne=this.z===this.curve.one;if(this.curve.extended&&!this.t){this.t=this.x.redMul(this.y);if(!this.zOne)this.t=this.t.redMul(this.z.redInvm())}}}o(Point,s.BasePoint);EdwardsCurve.prototype.pointFromJSON=function pointFromJSON(e){return Point.fromJSON(this,e)};EdwardsCurve.prototype.point=function point(e,t,r,n){return new Point(this,e,t,r,n)};Point.fromJSON=function fromJSON(e,t){return new Point(e,t[0],t[1],t[2])};Point.prototype.inspect=function inspect(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Point.prototype.isInfinity=function isInfinity(){return this.x.cmpn(0)===0&&this.y.cmp(this.z)===0};Point.prototype._extDbl=function _extDbl(){var e=this.x.redSqr();var t=this.y.redSqr();var r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e);var i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t);var a=n.redAdd(t);var o=a.redSub(r);var s=n.redSub(t);var f=i.redMul(o);var c=a.redMul(s);var u=i.redMul(s);var d=o.redMul(a);return this.curve.point(f,c,d,u)};Point.prototype._projDbl=function _projDbl(){var e=this.x.redAdd(this.y).redSqr();var t=this.x.redSqr();var r=this.y.redSqr();var n;var i;var a;if(this.curve.twisted){var o=this.curve._mulA(t);var s=o.redAdd(r);if(this.zOne){n=e.redSub(t).redSub(r).redMul(s.redSub(this.curve.two));i=s.redMul(o.redSub(r));a=s.redSqr().redSub(s).redSub(s)}else{var f=this.z.redSqr();var c=s.redSub(f).redISub(f);n=e.redSub(t).redISub(r).redMul(c);i=s.redMul(o.redSub(r));a=s.redMul(c)}}else{var o=t.redAdd(r);var f=this.curve._mulC(this.c.redMul(this.z)).redSqr();var c=o.redSub(f).redSub(f);n=this.curve._mulC(e.redISub(o)).redMul(c);i=this.curve._mulC(o).redMul(t.redISub(r));a=o.redMul(c)}return this.curve.point(n,i,a)};Point.prototype.dbl=function dbl(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()};Point.prototype._extAdd=function _extAdd(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x));var r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x));var n=this.t.redMul(this.curve.dd).redMul(e.t);var i=this.z.redMul(e.z.redAdd(e.z));var a=r.redSub(t);var o=i.redSub(n);var s=i.redAdd(n);var f=r.redAdd(t);var c=a.redMul(o);var u=s.redMul(f);var d=a.redMul(f);var h=o.redMul(s);return this.curve.point(c,u,h,d)};Point.prototype._projAdd=function _projAdd(e){var t=this.z.redMul(e.z);var r=t.redSqr();var n=this.x.redMul(e.x);var i=this.y.redMul(e.y);var a=this.curve.d.redMul(n).redMul(i);var o=r.redSub(a);var s=r.redAdd(a);var f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(i);var c=t.redMul(o).redMul(f);var u;var d;if(this.curve.twisted){u=t.redMul(s).redMul(i.redSub(this.curve._mulA(n)));d=o.redMul(s)}else{u=t.redMul(s).redMul(i.redSub(n));d=this.curve._mulC(o).redMul(s)}return this.curve.point(c,u,d)};Point.prototype.add=function add(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.curve.extended)return this._extAdd(e);else return this._projAdd(e)};Point.prototype.mul=function mul(e){if(this._hasDoubles(e))return this.curve._fixedNafMul(this,e);else return this.curve._wnafMul(this,e)};Point.prototype.mulAdd=function mulAdd(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,false)};Point.prototype.jmulAdd=function jmulAdd(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,true)};Point.prototype.normalize=function normalize(){if(this.zOne)return this;var e=this.z.redInvm();this.x=this.x.redMul(e);this.y=this.y.redMul(e);if(this.t)this.t=this.t.redMul(e);this.z=this.curve.one;this.zOne=true;return this};Point.prototype.neg=function neg(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Point.prototype.getX=function getX(){this.normalize();return this.x.fromRed()};Point.prototype.getY=function getY(){this.normalize();return this.y.fromRed()};Point.prototype.eq=function eq(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};Point.prototype.eqXToP=function eqXToP(e){var t=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(t)===0)return true;var r=e.clone();var n=this.curve.redN.redMul(this.z);for(;;){r.iadd(this.curve.n);if(r.cmp(this.curve.p)>=0)return false;t.redIAdd(n);if(this.x.cmp(t)===0)return true}return false};Point.prototype.toP=Point.prototype.normalize;Point.prototype.mixedAdd=Point.prototype.add},function(e,t,r){"use strict";var n=r(21);var i=r(3);var a=r(0);var o=n.base;var s=r(4);var f=s.utils;function MontCurve(e){o.call(this,"mont",e);this.a=new i(e.a,16).toRed(this.red);this.b=new i(e.b,16).toRed(this.red);this.i4=new i(4).toRed(this.red).redInvm();this.two=new i(2).toRed(this.red);this.a24=this.i4.redMul(this.a.redAdd(this.two))}a(MontCurve,o);e.exports=MontCurve;MontCurve.prototype.validate=function validate(e){var t=e.normalize().x;var r=t.redSqr();var n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);var i=n.redSqrt();return i.redSqr().cmp(n)===0};function Point(e,t,r){o.BasePoint.call(this,e,"projective");if(t===null&&r===null){this.x=this.curve.one;this.z=this.curve.zero}else{this.x=new i(t,16);this.z=new i(r,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}a(Point,o.BasePoint);MontCurve.prototype.decodePoint=function decodePoint(e,t){return this.point(f.toArray(e,t),1)};MontCurve.prototype.point=function point(e,t){return new Point(this,e,t)};MontCurve.prototype.pointFromJSON=function pointFromJSON(e){return Point.fromJSON(this,e)};Point.prototype.precompute=function precompute(){};Point.prototype._encode=function _encode(){return this.getX().toArray("be",this.curve.p.byteLength())};Point.fromJSON=function fromJSON(e,t){return new Point(e,t[0],t[1]||e.one)};Point.prototype.inspect=function inspect(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"};Point.prototype.isInfinity=function isInfinity(){return this.z.cmpn(0)===0};Point.prototype.dbl=function dbl(){var e=this.x.redAdd(this.z);var t=e.redSqr();var r=this.x.redSub(this.z);var n=r.redSqr();var i=t.redSub(n);var a=t.redMul(n);var o=i.redMul(n.redAdd(this.curve.a24.redMul(i)));return this.curve.point(a,o)};Point.prototype.add=function add(){throw new Error("Not supported on Montgomery curve")};Point.prototype.diffAdd=function diffAdd(e,t){var r=this.x.redAdd(this.z);var n=this.x.redSub(this.z);var i=e.x.redAdd(e.z);var a=e.x.redSub(e.z);var o=a.redMul(r);var s=i.redMul(n);var f=t.z.redMul(o.redAdd(s).redSqr());var c=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(f,c)};Point.prototype.mul=function mul(e){var t=e.clone();var r=this;var n=this.curve.point(null,null);var i=this;for(var a=[];t.cmpn(0)!==0;t.iushrn(1))a.push(t.andln(1));for(var o=a.length-1;o>=0;o--){if(a[o]===0){r=r.diffAdd(n,i);n=n.dbl()}else{n=r.diffAdd(n,i);r=r.dbl()}}return n};Point.prototype.mulAdd=function mulAdd(){throw new Error("Not supported on Montgomery curve")};Point.prototype.jumlAdd=function jumlAdd(){throw new Error("Not supported on Montgomery curve")};Point.prototype.eq=function eq(e){return this.getX().cmp(e.getX())===0};Point.prototype.normalize=function normalize(){this.x=this.x.redMul(this.z.redInvm());this.z=this.curve.one;return this};Point.prototype.getX=function getX(){this.normalize();return this.x.fromRed()}},function(e,t,r){"use strict";var n=r(21);var i=r(4);var a=r(3);var o=r(0);var s=n.base;var f=i.utils.assert;function ShortCurve(e){s.call(this,"short",e);this.a=new a(e.a,16).toRed(this.red);this.b=new a(e.b,16).toRed(this.red);this.tinv=this.two.redInvm();this.zeroA=this.a.fromRed().cmpn(0)===0;this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0;this.endo=this._getEndomorphism(e);this._endoWnafT1=new Array(4);this._endoWnafT2=new Array(4)}o(ShortCurve,s);e.exports=ShortCurve;ShortCurve.prototype._getEndomorphism=function _getEndomorphism(e){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var t;var r;if(e.beta){t=new a(e.beta,16).toRed(this.red)}else{var n=this._getEndoRoots(this.p);t=n[0].cmp(n[1])<0?n[0]:n[1];t=t.toRed(this.red)}if(e.lambda){r=new a(e.lambda,16)}else{var i=this._getEndoRoots(this.n);if(this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))===0){r=i[0]}else{r=i[1];f(this.g.mul(r).x.cmp(this.g.x.redMul(t))===0)}}var o;if(e.basis){o=e.basis.map(function(e){return{a:new a(e.a,16),b:new a(e.b,16)}})}else{o=this._getEndoBasis(r)}return{beta:t,lambda:r,basis:o}};ShortCurve.prototype._getEndoRoots=function _getEndoRoots(e){var t=e===this.p?this.red:a.mont(e);var r=new a(2).toRed(t).redInvm();var n=r.redNeg();var i=new a(3).toRed(t).redNeg().redSqrt().redMul(r);var o=n.redAdd(i).fromRed();var s=n.redSub(i).fromRed();return[o,s]};ShortCurve.prototype._getEndoBasis=function _getEndoBasis(e){var t=this.n.ushrn(Math.floor(this.n.bitLength()/2));var r=e;var n=this.n.clone();var i=new a(1);var o=new a(0);var s=new a(0);var f=new a(1);var c;var u;var d;var h;var l;var p;var v;var y=0;var b;var m;while(r.cmpn(0)!==0){var g=n.div(r);b=n.sub(g.mul(r));m=s.sub(g.mul(i));var w=f.sub(g.mul(o));if(!d&&b.cmp(t)<0){c=v.neg();u=i;d=b.neg();h=m}else if(d&&++y===2){break}v=b;n=r;r=b;s=i;i=m;f=o;o=w}l=b.neg();p=m;var C=d.sqr().add(h.sqr());var S=l.sqr().add(p.sqr());if(S.cmp(C)>=0){l=c;p=u}if(d.negative){d=d.neg();h=h.neg()}if(l.negative){l=l.neg();p=p.neg()}return[{a:d,b:h},{a:l,b:p}]};ShortCurve.prototype._endoSplit=function _endoSplit(e){var t=this.endo.basis;var r=t[0];var n=t[1];var i=n.b.mul(e).divRound(this.n);var a=r.b.neg().mul(e).divRound(this.n);var o=i.mul(r.a);var s=a.mul(n.a);var f=i.mul(r.b);var c=a.mul(n.b);var u=e.sub(o).sub(s);var d=f.add(c).neg();return{k1:u,k2:d}};ShortCurve.prototype.pointFromX=function pointFromX(e,t){e=new a(e,16);if(!e.red)e=e.toRed(this.red);var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b);var n=r.redSqrt();if(n.redSqr().redSub(r).cmp(this.zero)!==0)throw new Error("invalid point");var i=n.fromRed().isOdd();if(t&&!i||!t&&i)n=n.redNeg();return this.point(e,n)};ShortCurve.prototype.validate=function validate(e){if(e.inf)return true;var t=e.x;var r=e.y;var n=this.a.redMul(t);var i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return r.redSqr().redISub(i).cmpn(0)===0};ShortCurve.prototype._endoWnafMulAdd=function _endoWnafMulAdd(e,t,r){var n=this._endoWnafT1;var i=this._endoWnafT2;for(var a=0;a<e.length;a++){var o=this._endoSplit(t[a]);var s=e[a];var f=s._getBeta();if(o.k1.negative){o.k1.ineg();s=s.neg(true)}if(o.k2.negative){o.k2.ineg();f=f.neg(true)}n[a*2]=s;n[a*2+1]=f;i[a*2]=o.k1;i[a*2+1]=o.k2}var c=this._wnafMulAdd(1,n,i,a*2,r);for(var u=0;u<a*2;u++){n[u]=null;i[u]=null}return c};function Point(e,t,r,n){s.BasePoint.call(this,e,"affine");if(t===null&&r===null){this.x=null;this.y=null;this.inf=true}else{this.x=new a(t,16);this.y=new a(r,16);if(n){this.x.forceRed(this.curve.red);this.y.forceRed(this.curve.red)}if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);this.inf=false}}o(Point,s.BasePoint);ShortCurve.prototype.point=function point(e,t,r){return new Point(this,e,t,r)};ShortCurve.prototype.pointFromJSON=function pointFromJSON(e,t){return Point.fromJSON(this,e,t)};Point.prototype._getBeta=function _getBeta(){if(!this.curve.endo)return;var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve;var n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t;t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t};Point.prototype.toJSON=function toJSON(){if(!this.precomputed)return[this.x,this.y];return[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]};Point.fromJSON=function fromJSON(e,t,r){if(typeof t==="string")t=JSON.parse(t);var n=e.point(t[0],t[1],r);if(!t[2])return n;function obj2point(t){return e.point(t[0],t[1],r)}var i=t[2];n.precomputed={beta:null,doubles:i.doubles&&{step:i.doubles.step,points:[n].concat(i.doubles.points.map(obj2point))},naf:i.naf&&{wnd:i.naf.wnd,points:[n].concat(i.naf.points.map(obj2point))}};return n};Point.prototype.inspect=function inspect(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Point.prototype.isInfinity=function isInfinity(){return this.inf};Point.prototype.add=function add(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var t=this.y.redSub(e.y);if(t.cmpn(0)!==0)t=t.redMul(this.x.redSub(e.x).redInvm());var r=t.redSqr().redISub(this.x).redISub(e.x);var n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)};Point.prototype.dbl=function dbl(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var t=this.curve.a;var r=this.x.redSqr();var n=e.redInvm();var i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n);var a=i.redSqr().redISub(this.x.redAdd(this.x));var o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)};Point.prototype.getX=function getX(){return this.x.fromRed()};Point.prototype.getY=function getY(){return this.y.fromRed()};Point.prototype.mul=function mul(e){e=new a(e,16);if(this._hasDoubles(e))return this.curve._fixedNafMul(this,e);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[e]);else return this.curve._wnafMul(this,e)};Point.prototype.mulAdd=function mulAdd(e,t,r){var n=[this,t];var i=[e,r];if(this.curve.endo)return this.curve._endoWnafMulAdd(n,i);else return this.curve._wnafMulAdd(1,n,i,2)};Point.prototype.jmulAdd=function jmulAdd(e,t,r){var n=[this,t];var i=[e,r];if(this.curve.endo)return this.curve._endoWnafMulAdd(n,i,true);else return this.curve._wnafMulAdd(1,n,i,2,true)};Point.prototype.eq=function eq(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Point.prototype.neg=function neg(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed;var n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t};Point.prototype.toJ=function toJ(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function JPoint(e,t,r,n){s.BasePoint.call(this,e,"jacobian");if(t===null&&r===null&&n===null){this.x=this.curve.one;this.y=this.curve.one;this.z=new a(0)}else{this.x=new a(t,16);this.y=new a(r,16);this.z=new a(n,16)}if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}o(JPoint,s.BasePoint);ShortCurve.prototype.jpoint=function jpoint(e,t,r){return new JPoint(this,e,t,r)};JPoint.prototype.toP=function toP(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm();var t=e.redSqr();var r=this.x.redMul(t);var n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)};JPoint.prototype.neg=function neg(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint.prototype.add=function add(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr();var r=this.z.redSqr();var n=this.x.redMul(t);var i=e.x.redMul(r);var a=this.y.redMul(t.redMul(e.z));var o=e.y.redMul(r.redMul(this.z));var s=n.redSub(i);var f=a.redSub(o);if(s.cmpn(0)===0){if(f.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl()}var c=s.redSqr();var u=c.redMul(s);var d=n.redMul(c);var h=f.redSqr().redIAdd(u).redISub(d).redISub(d);var l=f.redMul(d.redISub(h)).redISub(a.redMul(u));var p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,p)};JPoint.prototype.mixedAdd=function mixedAdd(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr();var r=this.x;var n=e.x.redMul(t);var i=this.y;var a=e.y.redMul(t).redMul(this.z);var o=r.redSub(n);var s=i.redSub(a);if(o.cmpn(0)===0){if(s.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl()}var f=o.redSqr();var c=f.redMul(o);var u=r.redMul(f);var d=s.redSqr().redIAdd(c).redISub(u).redISub(u);var h=s.redMul(u.redISub(d)).redISub(i.redMul(c));var l=this.z.redMul(o);return this.curve.jpoint(d,h,l)};JPoint.prototype.dblp=function dblp(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t=this;for(var r=0;r<e;r++)t=t.dbl();return t}var n=this.curve.a;var i=this.curve.tinv;var a=this.x;var o=this.y;var s=this.z;var f=s.redSqr().redSqr();var c=o.redAdd(o);for(var r=0;r<e;r++){var u=a.redSqr();var d=c.redSqr();var h=d.redSqr();var l=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(f));var p=a.redMul(d);var v=l.redSqr().redISub(p.redAdd(p));var y=p.redISub(v);var b=l.redMul(y);b=b.redIAdd(b).redISub(h);var m=c.redMul(s);if(r+1<e)f=f.redMul(h);a=v;s=m;c=b}return this.curve.jpoint(a,c.redMul(i),s)};JPoint.prototype.dbl=function dbl(){if(this.isInfinity())return this;if(this.curve.zeroA)return this._zeroDbl();else if(this.curve.threeA)return this._threeDbl();else return this._dbl()};JPoint.prototype._zeroDbl=function _zeroDbl(){var e;var t;var r;if(this.zOne){var n=this.x.redSqr();var i=this.y.redSqr();var a=i.redSqr();var o=this.x.redAdd(i).redSqr().redISub(n).redISub(a);o=o.redIAdd(o);var s=n.redAdd(n).redIAdd(n);var f=s.redSqr().redISub(o).redISub(o);var c=a.redIAdd(a);c=c.redIAdd(c);c=c.redIAdd(c);e=f;t=s.redMul(o.redISub(f)).redISub(c);r=this.y.redAdd(this.y)}else{var u=this.x.redSqr();var d=this.y.redSqr();var h=d.redSqr();var l=this.x.redAdd(d).redSqr().redISub(u).redISub(h);l=l.redIAdd(l);var p=u.redAdd(u).redIAdd(u);var v=p.redSqr();var y=h.redIAdd(h);y=y.redIAdd(y);y=y.redIAdd(y);e=v.redISub(l).redISub(l);t=p.redMul(l.redISub(e)).redISub(y);r=this.y.redMul(this.z);r=r.redIAdd(r)}return this.curve.jpoint(e,t,r)};JPoint.prototype._threeDbl=function _threeDbl(){var e;var t;var r;if(this.zOne){var n=this.x.redSqr();var i=this.y.redSqr();var a=i.redSqr();var o=this.x.redAdd(i).redSqr().redISub(n).redISub(a);o=o.redIAdd(o);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a);var f=s.redSqr().redISub(o).redISub(o);e=f;var c=a.redIAdd(a);c=c.redIAdd(c);c=c.redIAdd(c);t=s.redMul(o.redISub(f)).redISub(c);r=this.y.redAdd(this.y)}else{var u=this.z.redSqr();var d=this.y.redSqr();var h=this.x.redMul(d);var l=this.x.redSub(u).redMul(this.x.redAdd(u));l=l.redAdd(l).redIAdd(l);var p=h.redIAdd(h);p=p.redIAdd(p);var v=p.redAdd(p);e=l.redSqr().redISub(v);r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(u);var y=d.redSqr();y=y.redIAdd(y);y=y.redIAdd(y);y=y.redIAdd(y);t=l.redMul(p.redISub(e)).redISub(y)}return this.curve.jpoint(e,t,r)};JPoint.prototype._dbl=function _dbl(){var e=this.curve.a;var t=this.x;var r=this.y;var n=this.z;var i=n.redSqr().redSqr();var a=t.redSqr();var o=r.redSqr();var s=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(i));var f=t.redAdd(t);f=f.redIAdd(f);var c=f.redMul(o);var u=s.redSqr().redISub(c.redAdd(c));var d=c.redISub(u);var h=o.redSqr();h=h.redIAdd(h);h=h.redIAdd(h);h=h.redIAdd(h);var l=s.redMul(d).redISub(h);var p=r.redAdd(r).redMul(n);return this.curve.jpoint(u,l,p)};JPoint.prototype.trpl=function trpl(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr();var t=this.y.redSqr();var r=this.z.redSqr();var n=t.redSqr();var i=e.redAdd(e).redIAdd(e);var a=i.redSqr();var o=this.x.redAdd(t).redSqr().redISub(e).redISub(n);o=o.redIAdd(o);o=o.redAdd(o).redIAdd(o);o=o.redISub(a);var s=o.redSqr();var f=n.redIAdd(n);f=f.redIAdd(f);f=f.redIAdd(f);f=f.redIAdd(f);var c=i.redIAdd(o).redSqr().redISub(a).redISub(s).redISub(f);var u=t.redMul(c);u=u.redIAdd(u);u=u.redIAdd(u);var d=this.x.redMul(s).redISub(u);d=d.redIAdd(d);d=d.redIAdd(d);var h=this.y.redMul(c.redMul(f.redISub(c)).redISub(o.redMul(s)));h=h.redIAdd(h);h=h.redIAdd(h);h=h.redIAdd(h);var l=this.z.redAdd(o).redSqr().redISub(r).redISub(s);return this.curve.jpoint(d,h,l)};JPoint.prototype.mul=function mul(e,t){e=new a(e,t);return this.curve._wnafMul(this,e)};JPoint.prototype.eq=function eq(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return true;var t=this.z.redSqr();var r=e.z.redSqr();if(this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0)!==0)return false;var n=t.redMul(this.z);var i=r.redMul(e.z);return this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)===0};JPoint.prototype.eqXToP=function eqXToP(e){var t=this.z.redSqr();var r=e.toRed(this.curve.red).redMul(t);if(this.x.cmp(r)===0)return true;var n=e.clone();var i=this.curve.redN.redMul(t);for(;;){n.iadd(this.curve.n);if(n.cmp(this.curve.p)>=0)return false;r.redIAdd(i);if(this.x.cmp(r)===0)return true}return false};JPoint.prototype.inspect=function inspect(){if(this.isInfinity())return"<EC JPoint Infinity>";return"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};JPoint.prototype.isInfinity=function isInfinity(){return this.z.cmpn(0)===0}},function(e,t,r){"use strict";var n=r(3);var i=r(4);var a=i.utils;var o=a.getNAF;var s=a.getJSF;var f=a.assert;function BaseCurve(e,t){this.type=e;this.p=new n(t.p,16);this.red=t.prime?n.red(t.prime):n.mont(this.p);this.zero=new n(0).toRed(this.red);this.one=new n(1).toRed(this.red);this.two=new n(2).toRed(this.red);this.n=t.n&&new n(t.n,16);this.g=t.g&&this.pointFromJSON(t.g,t.gRed);this._wnafT1=new Array(4);this._wnafT2=new Array(4);this._wnafT3=new Array(4);this._wnafT4=new Array(4);var r=this.n&&this.p.div(this.n);if(!r||r.cmpn(100)>0){this.redN=null}else{this._maxwellTrick=true;this.redN=this.n.toRed(this.red)}}e.exports=BaseCurve;BaseCurve.prototype.point=function point(){throw new Error("Not implemented")};BaseCurve.prototype.validate=function validate(){throw new Error("Not implemented")};BaseCurve.prototype._fixedNafMul=function _fixedNafMul(e,t){f(e.precomputed);var r=e._getDoubles();var n=o(t,1);var i=(1<<r.step+1)-(r.step%2===0?2:1);i/=3;var a=[];for(var s=0;s<n.length;s+=r.step){var c=0;for(var t=s+r.step-1;t>=s;t--)c=(c<<1)+n[t];a.push(c)}var u=this.jpoint(null,null,null);var d=this.jpoint(null,null,null);for(var h=i;h>0;h--){for(var s=0;s<a.length;s++){var c=a[s];if(c===h)d=d.mixedAdd(r.points[s]);else if(c===-h)d=d.mixedAdd(r.points[s].neg())}u=u.add(d)}return u.toP()};BaseCurve.prototype._wnafMul=function _wnafMul(e,t){var r=4;var n=e._getNAFPoints(r);r=n.wnd;var i=n.points;var a=o(t,r);var s=this.jpoint(null,null,null);for(var c=a.length-1;c>=0;c--){for(var t=0;c>=0&&a[c]===0;c--)t++;if(c>=0)t++;s=s.dblp(t);if(c<0)break;var u=a[c];f(u!==0);if(e.type==="affine"){if(u>0)s=s.mixedAdd(i[u-1>>1]);else s=s.mixedAdd(i[-u-1>>1].neg())}else{if(u>0)s=s.add(i[u-1>>1]);else s=s.add(i[-u-1>>1].neg())}}return e.type==="affine"?s.toP():s};BaseCurve.prototype._wnafMulAdd=function _wnafMulAdd(e,t,r,n,i){var a=this._wnafT1;var f=this._wnafT2;var c=this._wnafT3;var u=0;for(var d=0;d<n;d++){var h=t[d];var l=h._getNAFPoints(e);a[d]=l.wnd;f[d]=l.points}for(var d=n-1;d>=1;d-=2){var p=d-1;var v=d;if(a[p]!==1||a[v]!==1){c[p]=o(r[p],a[p]);c[v]=o(r[v],a[v]);u=Math.max(c[p].length,u);u=Math.max(c[v].length,u);continue}var y=[t[p],null,null,t[v]];if(t[p].y.cmp(t[v].y)===0){y[1]=t[p].add(t[v]);y[2]=t[p].toJ().mixedAdd(t[v].neg())}else if(t[p].y.cmp(t[v].y.redNeg())===0){y[1]=t[p].toJ().mixedAdd(t[v]);y[2]=t[p].add(t[v].neg())}else{y[1]=t[p].toJ().mixedAdd(t[v]);y[2]=t[p].toJ().mixedAdd(t[v].neg())}var b=[-3,-1,-5,-7,0,7,5,1,3];var m=s(r[p],r[v]);u=Math.max(m[0].length,u);c[p]=new Array(u);c[v]=new Array(u);for(var g=0;g<u;g++){var w=m[0][g]|0;var C=m[1][g]|0;c[p][g]=b[(w+1)*3+(C+1)];c[v][g]=0;f[p]=y}}var S=this.jpoint(null,null,null);var A=this._wnafT4;for(var d=u;d>=0;d--){var E=0;while(d>=0){var B=true;for(var g=0;g<n;g++){A[g]=c[g][d]|0;if(A[g]!==0)B=false}if(!B)break;E++;d--}if(d>=0)E++;S=S.dblp(E);if(d<0)break;for(var g=0;g<n;g++){var _=A[g];var h;if(_===0)continue;else if(_>0)h=f[g][_-1>>1];else if(_<0)h=f[g][-_-1>>1].neg();if(h.type==="affine")S=S.mixedAdd(h);else S=S.add(h)}}for(var d=0;d<n;d++)f[d]=null;if(i)return S;else return S.toP()};function BasePoint(e,t){this.curve=e;this.type=t;this.precomputed=null}BaseCurve.BasePoint=BasePoint;BasePoint.prototype.eq=function eq(){throw new Error("Not implemented")};BasePoint.prototype.validate=function validate(){return this.curve.validate(this)};BaseCurve.prototype.decodePoint=function decodePoint(e,t){e=a.toArray(e,t);var r=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*r){if(e[0]===6)f(e[e.length-1]%2===0);else if(e[0]===7)f(e[e.length-1]%2===1);var n=this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));return n}else if((e[0]===2||e[0]===3)&&e.length-1===r){return this.pointFromX(e.slice(1,1+r),e[0]===3)}throw new Error("Unknown point format")};BasePoint.prototype.encodeCompressed=function encodeCompressed(e){return this.encode(e,true)};BasePoint.prototype._encode=function _encode(e){var t=this.curve.p.byteLength();var r=this.getX().toArray("be",t);if(e)return[this.getY().isEven()?2:3].concat(r);return[4].concat(r,this.getY().toArray("be",t))};BasePoint.prototype.encode=function encode(e,t){return a.encode(this._encode(t),e)};BasePoint.prototype.precompute=function precompute(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};t.naf=this._getNAFPoints(8);t.doubles=this._getDoubles(4,e);t.beta=this._getBeta();this.precomputed=t;return this};BasePoint.prototype._hasDoubles=function _hasDoubles(e){if(!this.precomputed)return false;var t=this.precomputed.doubles;if(!t)return false;return t.points.length>=Math.ceil((e.bitLength()+1)/t.step)};BasePoint.prototype._getDoubles=function _getDoubles(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var r=[this];var n=this;for(var i=0;i<t;i+=e){for(var a=0;a<e;a++)n=n.dbl();r.push(n)}return{step:e,points:r}};BasePoint.prototype._getNAFPoints=function _getNAFPoints(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var t=[this];var r=(1<<e)-1;var n=r===1?null:this.dbl();for(var i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}};BasePoint.prototype._getBeta=function _getBeta(){return null};BasePoint.prototype.dblp=function dblp(e){var t=this;for(var r=0;r<e;r++)t=t.dbl();return t}},function(e,t,r){"use strict";var n=t;var i=r(3);var a=r(5);var o=r(53);n.assert=a;n.toArray=o.toArray;n.zero2=o.zero2;n.toHex=o.toHex;n.encode=o.encode;function getNAF(e,t){var r=[];var n=1<<t+1;var i=e.clone();while(i.cmpn(1)>=0){var a;if(i.isOdd()){var o=i.andln(n-1);if(o>(n>>1)-1)a=(n>>1)-o;else a=o;i.isubn(a)}else{a=0}r.push(a);var s=i.cmpn(0)!==0&&i.andln(n-1)===0?t+1:1;for(var f=1;f<s;f++)r.push(0);i.iushrn(s)}return r}n.getNAF=getNAF;function getJSF(e,t){var r=[[],[]];e=e.clone();t=t.clone();var n=0;var i=0;while(e.cmpn(-n)>0||t.cmpn(-i)>0){var a=e.andln(3)+n&3;var o=t.andln(3)+i&3;if(a===3)a=-1;if(o===3)o=-1;var s;if((a&1)===0){s=0}else{var f=e.andln(7)+n&7;if((f===3||f===5)&&o===2)s=-a;else s=a}r[0].push(s);var c;if((o&1)===0){c=0}else{var f=t.andln(7)+i&7;if((f===3||f===5)&&a===2)c=-o;else c=o}r[1].push(c);if(2*n===s+1)n=1-n;if(2*i===c+1)i=1-i;e.iushrn(1);t.iushrn(1)}return r}n.getJSF=getJSF;function cachedProperty(e,t,r){var n="_"+t;e.prototype[t]=function cachedProperty(){return this[n]!==undefined?this[n]:this[n]=r.call(this)}}n.cachedProperty=cachedProperty;function parseBytes(e){return typeof e==="string"?n.toArray(e,"hex"):e}n.parseBytes=parseBytes;function intFromLE(e){return new i(e,"hex","le")}n.intFromLE=intFromLE},function(e){e.exports={_args:[["elliptic@6.4.0","/Users/mtokarev/projects/js/crypto"]],_development:true,_from:"elliptic@6.4.0",_id:"elliptic@6.4.0",_inBundle:false,_integrity:"sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=",_location:"/elliptic",_phantomChildren:{},_requested:{type:"version",registry:true,raw:"elliptic@6.4.0",name:"elliptic",escapedName:"elliptic",rawSpec:"6.4.0",saveSpec:null,fetchSpec:"6.4.0"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz",_spec:"6.4.0",_where:"/Users/mtokarev/projects/js/crypto",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^2.11.3",grunt:"^0.4.5","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^8.6.2",istanbul:"^0.4.2",jscs:"^2.9.0",jshint:"^2.6.0",mocha:"^2.1.0"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.4.0"}},function(e,t,r){(function(t){var n=r(68);var i=r(27);var a=r(4).ec;var o=r(3);var s=r(20);var f=r(45);function sign(e,r,n,a,o){var f=s(r);if(f.curve){if(a!=="ecdsa"&&a!=="ecdsa/rsa")throw new Error("wrong private key type");return ecSign(e,f)}else if(f.type==="dsa"){if(a!=="dsa")throw new Error("wrong private key type");return dsaSign(e,f,n)}else{if(a!=="rsa"&&a!=="ecdsa/rsa")throw new Error("wrong private key type")}e=t.concat([o,e]);var c=f.modulus.byteLength();var u=[0,1];while(e.length+u.length+1<c)u.push(255);u.push(0);var d=-1;while(++d<e.length)u.push(e[d]);var h=i(u,f);return h}function ecSign(e,r){var n=f[r.curve.join(".")];if(!n)throw new Error("unknown curve "+r.curve.join("."));var i=new a(n);var o=i.keyFromPrivate(r.privateKey);var s=o.sign(e);return new t(s.toDER())}function dsaSign(e,t,r){var n=t.params.priv_key;var i=t.params.p;var a=t.params.q;var s=t.params.g;var f=new o(0);var c;var u=bits2int(e,a).mod(a);var d=false;var h=getKey(n,a,e,r);while(d===false){c=makeKey(a,h,r);f=makeR(s,c,i,a);d=c.invm(a).imul(u.add(n.mul(f))).mod(a);if(d.cmpn(0)===0){d=false;f=new o(0)}}return toDER(f,d)}function toDER(e,r){e=e.toArray();r=r.toArray();if(e[0]&128)e=[0].concat(e);if(r[0]&128)r=[0].concat(r);var n=e.length+r.length+4;var i=[48,n,2,e.length];i=i.concat(e,[2,r.length],r);return new t(i)}function getKey(e,r,i,a){e=new t(e.toArray());if(e.length<r.byteLength()){var o=new t(r.byteLength()-e.length);o.fill(0);e=t.concat([o,e])}var s=i.length;var f=bits2octets(i,r);var c=new t(s);c.fill(1);var u=new t(s);u.fill(0);u=n(a,u).update(c).update(new t([0])).update(e).update(f).digest();c=n(a,u).update(c).digest();u=n(a,u).update(c).update(new t([1])).update(e).update(f).digest();c=n(a,u).update(c).digest();return{k:u,v:c}}function bits2int(e,t){var r=new o(e);var n=(e.length<<3)-t.bitLength();if(n>0)r.ishrn(n);return r}function bits2octets(e,r){e=bits2int(e,r);e=e.mod(r);var n=new t(e.toArray());if(n.length<r.byteLength()){var i=new t(r.byteLength()-n.length);i.fill(0);n=t.concat([i,n])}return n}function makeKey(e,r,i){var a;var o;do{a=new t(0);while(a.length*8<e.bitLength()){r.v=n(i,r.k).update(r.v).digest();a=t.concat([a,r.v])}o=bits2int(a,e);r.k=n(i,r.k).update(r.v).update(new t([0])).digest();r.v=n(i,r.k).update(r.v).digest()}while(o.cmp(e)!==-1);return o}function makeR(e,t,r,n){return e.toRed(o.mont(r)).redPow(t).fromRed().mod(n)}e.exports=sign;e.exports.getKey=getKey;e.exports.makeKey=makeKey}).call(this,r(2).Buffer)},function(e,t,r){(function(t){var n=r(18);var i=r(37);var a=r(0);var o=r(125);var s=r(89);var f=r(66);Object.keys(f).forEach(function(e){f[e].id=new t(f[e].id,"hex");f[e.toLowerCase()]=f[e]});function Sign(e){i.Writable.call(this);var t=f[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash;this._hash=n(t.hash);this._tag=t.id;this._signType=t.sign}a(Sign,i.Writable);Sign.prototype._write=function _write(e,t,r){this._hash.update(e);r()};Sign.prototype.update=function update(e,r){if(typeof e==="string")e=new t(e,r);this._hash.update(e);return this};Sign.prototype.sign=function signMethod(e,t){this.end();var r=this._hash.digest();var n=o(r,e,this._hashType,this._signType,this._tag);return t?n.toString(t):n};function Verify(e){i.Writable.call(this);var t=f[e];if(!t)throw new Error("Unknown message digest");this._hash=n(t.hash);this._tag=t.id;this._signType=t.sign}a(Verify,i.Writable);Verify.prototype._write=function _write(e,t,r){this._hash.update(e);r()};Verify.prototype.update=function update(e,r){if(typeof e==="string")e=new t(e,r);this._hash.update(e);return this};Verify.prototype.verify=function verifyMethod(e,r,n){if(typeof r==="string")r=new t(r,n);this.end();var i=this._hash.digest();return s(r,i,e,this._signType,this._tag)};function createSign(e){return new Sign(e)}function createVerify(e){return new Verify(e)}e.exports={Sign:createSign,Verify:createVerify,createSign,createVerify}}).call(this,r(2).Buffer)},function(e,t,r){(function(t){var n=r(3);var i=r(55);var a=new i;var o=new n(24);var s=new n(11);var f=new n(10);var c=new n(3);var u=new n(7);var d=r(56);var h=r(12);e.exports=DH;function setPublicKey(e,r){r=r||"utf8";if(!t.isBuffer(e)){e=new t(e,r)}this._pub=new n(e);return this}function setPrivateKey(e,r){r=r||"utf8";if(!t.isBuffer(e)){e=new t(e,r)}this._priv=new n(e);return this}var l={};function checkPrime(e,t){var r=t.toString("hex");var n=[r,e.toString(16)].join("_");if(n in l){return l[n]}var i=0;if(e.isEven()||!d.simpleSieve||!d.fermatTest(e)||!a.test(e)){i+=1;if(r==="02"||r==="05"){i+=8}else{i+=4}l[n]=i;return i}if(!a.test(e.shrn(1))){i+=2}var h;switch(r){case"02":if(e.mod(o).cmp(s)){i+=8}break;case"05":h=e.mod(f);if(h.cmp(c)&&h.cmp(u)){i+=8}break;default:i+=4}l[n]=i;return i}function DH(e,t,r){this.setGenerator(t);this.__prime=new n(e);this._prime=n.mont(this.__prime);this._primeLen=e.length;this._pub=undefined;this._priv=undefined;this._primeCode=undefined;if(r){this.setPublicKey=setPublicKey;this.setPrivateKey=setPrivateKey}else{this._primeCode=8}}Object.defineProperty(DH.prototype,"verifyError",{enumerable:true,get:function(){if(typeof this._primeCode!=="number"){this._primeCode=checkPrime(this.__prime,this.__gen)}return this._primeCode}});DH.prototype.generateKeys=function(){if(!this._priv){this._priv=new n(h(this._primeLen))}this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed();return this.getPublicKey()};DH.prototype.computeSecret=function(e){e=new n(e);e=e.toRed(this._prime);var r=e.redPow(this._priv).fromRed();var i=new t(r.toArray());var a=this.getPrime();if(i.length<a.length){var o=new t(a.length-i.length);o.fill(0);i=t.concat([o,i])}return i};DH.prototype.getPublicKey=function getPublicKey(e){return formatReturnValue(this._pub,e)};DH.prototype.getPrivateKey=function getPrivateKey(e){return formatReturnValue(this._priv,e)};DH.prototype.getPrime=function(e){return formatReturnValue(this.__prime,e)};DH.prototype.getGenerator=function(e){return formatReturnValue(this._gen,e)};DH.prototype.setGenerator=function(e,r){r=r||"utf8";if(!t.isBuffer(e)){e=new t(e,r)}this.__gen=e;this._gen=new n(e);return this};function formatReturnValue(e,r){var n=new t(e.toArray());if(!r){return n}else{return n.toString(r)}}}).call(this,r(2).Buffer)},function(e){e.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},function(e,t){},function(e,t){},function(e,t){e.exports=function(e){if(!e.webpackPolyfill){e.deprecate=function(){};e.paths=[];if(!e.children)e.children=[];Object.defineProperty(e,"loaded",{enumerable:true,get:function(){return e.l}});Object.defineProperty(e,"id",{enumerable:true,get:function(){return e.i}});e.webpackPolyfill=1}return e}},function(e,t,r){(function(e){var n=r(56);var i=r(128);var a=r(127);function getDiffieHellman(t){var r=new e(i[t].prime,"hex");var n=new e(i[t].gen,"hex");return new a(r,n)}var o={binary:true,hex:true,base64:true};function createDiffieHellman(t,r,i,s){if(e.isBuffer(r)||o[r]===undefined){return createDiffieHellman(t,"binary",r,i)}r=r||"binary";s=s||"binary";i=i||new e([2]);if(!e.isBuffer(i)){i=new e(i,s)}if(typeof t==="number"){return new a(n(t,i),i,true)}if(!e.isBuffer(t)){t=new e(t,r)}return new a(t,i,true)}t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=getDiffieHellman;t.createDiffieHellman=t.DiffieHellman=createDiffieHellman}).call(this,r(2).Buffer)},function(e,t){t["des-ecb"]={key:8,iv:0};t["des-cbc"]=t.des={key:8,iv:8};t["des-ede3-cbc"]=t.des3={key:24,iv:8};t["des-ede3"]={key:24,iv:0};t["des-ede-cbc"]={key:16,iv:8};t["des-ede"]={key:16,iv:0}},function(e,t,r){var n=r(58);var i=r(1).Buffer;var a=r(28);var o=r(57);var s=r(8);var f=r(23);var c=r(22);var u=r(0);function Decipher(e,t,r){s.call(this);this._cache=new Splitter;this._last=void 0;this._cipher=new f.AES(t);this._prev=i.from(r);this._mode=e;this._autopadding=true}u(Decipher,s);Decipher.prototype._update=function(e){this._cache.add(e);var t;var r;var n=[];while(t=this._cache.get(this._autopadding)){r=this._mode.decrypt(this,t);n.push(r)}return i.concat(n)};Decipher.prototype._final=function(){var e=this._cache.flush();if(this._autopadding){return unpad(this._mode.decrypt(this,e))}else if(e){throw new Error("data not multiple of block length")}};Decipher.prototype.setAutoPadding=function(e){this._autopadding=!!e;return this};function Splitter(){this.cache=i.allocUnsafe(0)}Splitter.prototype.add=function(e){this.cache=i.concat([this.cache,e])};Splitter.prototype.get=function(e){var t;if(e){if(this.cache.length>16){t=this.cache.slice(0,16);this.cache=this.cache.slice(16);return t}}else{if(this.cache.length>=16){t=this.cache.slice(0,16);this.cache=this.cache.slice(16);return t}}return null};Splitter.prototype.flush=function(){if(this.cache.length)return this.cache};function unpad(e){var t=e[15];if(t<1||t>16){throw new Error("unable to decrypt data")}var r=-1;while(++r<t){if(e[r+(16-t)]!==t){throw new Error("unable to decrypt data")}}if(t===16)return;return e.slice(0,16-t)}function createDecipheriv(e,t,r){var s=a[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if(typeof r==="string")r=i.from(r);if(s.mode!=="GCM"&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if(typeof t==="string")t=i.from(t);if(t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if(s.type==="stream"){return new o(s.module,t,r,true)}else if(s.type==="auth"){return new n(s.module,t,r,true)}return new Decipher(s.module,t,r)}function createDecipher(e,t){var r=a[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(t,false,r.key,r.iv);return createDecipheriv(e,n.key,n.iv)}t.createDecipher=createDecipher;t.createDecipheriv=createDecipheriv},function(e,t,r){var n=r(1).Buffer;var i=n.alloc(16,0);function toArray(e){return[e.readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)]}function fromArray(e){var t=n.allocUnsafe(16);t.writeUInt32BE(e[0]>>>0,0);t.writeUInt32BE(e[1]>>>0,4);t.writeUInt32BE(e[2]>>>0,8);t.writeUInt32BE(e[3]>>>0,12);return t}function GHASH(e){this.h=e;this.state=n.alloc(16,0);this.cache=n.allocUnsafe(0)}GHASH.prototype.ghash=function(e){var t=-1;while(++t<e.length){this.state[t]^=e[t]}this._multiply()};GHASH.prototype._multiply=function(){var e=toArray(this.h);var t=[0,0,0,0];var r,n,i;var a=-1;while(++a<128){n=(this.state[~~(a/8)]&1<<7-a%8)!==0;if(n){t[0]^=e[0];t[1]^=e[1];t[2]^=e[2];t[3]^=e[3]}i=(e[3]&1)!==0;for(r=3;r>0;r--){e[r]=e[r]>>>1|(e[r-1]&1)<<31}e[0]=e[0]>>>1;if(i){e[0]=e[0]^225<<24}}this.state=fromArray(t)};GHASH.prototype.update=function(e){this.cache=n.concat([this.cache,e]);var t;while(this.cache.length>=16){t=this.cache.slice(0,16);this.cache=this.cache.slice(16);this.ghash(t)}};GHASH.prototype.final=function(e,t){if(this.cache.length){this.ghash(n.concat([this.cache,i],16))}this.ghash(fromArray([0,e,0,t]));return this.state};e.exports=GHASH},function(e,t,r){(function(e){var n=r(16);function getBlock(e){e._prev=e._cipher.encryptBlock(e._prev);return e._prev}t.encrypt=function(t,r){while(t._cache.length<r.length){t._cache=e.concat([t._cache,getBlock(t)])}var i=t._cache.slice(0,r.length);t._cache=t._cache.slice(r.length);return n(r,i)}}).call(this,r(2).Buffer)},function(e,t,r){var n=r(1).Buffer;function encryptByte(e,t,r){var n;var i=-1;var a=8;var o=0;var s,f;while(++i<a){n=e._cipher.encryptBlock(e._prev);s=t&1<<7-i?128:0;f=n[0]^s;o+=(f&128)>>i%8;e._prev=shiftIn(e._prev,r?s:f)}return o}function shiftIn(e,t){var r=e.length;var i=-1;var a=n.allocUnsafe(e.length);e=n.concat([e,n.from([t])]);while(++i<r){a[i]=e[i]<<1|e[i+1]>>7}return a}t.encrypt=function(e,t,r){var i=t.length;var a=n.allocUnsafe(i);var o=-1;while(++o<i){a[o]=encryptByte(e,t[o],r)}return a}},function(e,t,r){var n=r(1).Buffer;function encryptByte(e,t,r){var i=e._cipher.encryptBlock(e._prev);var a=i[0]^t;e._prev=n.concat([e._prev.slice(1),n.from([r?t:a])]);return a}t.encrypt=function(e,t,r){var i=t.length;var a=n.allocUnsafe(i);var o=-1;while(++o<i){a[o]=encryptByte(e,t[o],r)}return a}},function(e,t,r){var n=r(1).Buffer;var i=r(16);function encryptStart(e,t,r){var a=t.length;var o=i(t,e._cache);e._cache=e._cache.slice(a);e._prev=n.concat([e._prev,r?t:o]);return o}t.encrypt=function(e,t,r){var i=n.allocUnsafe(0);var a;while(t.length){if(e._cache.length===0){e._cache=e._cipher.encryptBlock(e._prev);e._prev=n.allocUnsafe(0)}if(e._cache.length<=t.length){a=e._cache.length;i=n.concat([i,encryptStart(e,t.slice(0,a),r)]);t=t.slice(a)}else{i=n.concat([i,encryptStart(e,t,r)]);break}}return i}},function(e,t,r){var n=r(16);t.encrypt=function(e,t){var r=n(t,e._prev);e._prev=e._cipher.encryptBlock(r);return e._prev};t.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},function(e,t){t.encrypt=function(e,t){return e._cipher.encryptBlock(t)};t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},function(e,t,r){var n=r(28);var i=r(58);var a=r(1).Buffer;var o=r(57);var s=r(8);var f=r(23);var c=r(22);var u=r(0);function Cipher(e,t,r){s.call(this);this._cache=new Splitter;this._cipher=new f.AES(t);this._prev=a.from(r);this._mode=e;this._autopadding=true}u(Cipher,s);Cipher.prototype._update=function(e){this._cache.add(e);var t;var r;var n=[];while(t=this._cache.get()){r=this._mode.encrypt(this,t);n.push(r)}return a.concat(n)};var d=a.alloc(16,16);Cipher.prototype._final=function(){var e=this._cache.flush();if(this._autopadding){e=this._mode.encrypt(this,e);this._cipher.scrub();return e}if(!e.equals(d)){this._cipher.scrub();throw new Error("data not multiple of block length")}};Cipher.prototype.setAutoPadding=function(e){this._autopadding=!!e;return this};function Splitter(){this.cache=a.allocUnsafe(0)}Splitter.prototype.add=function(e){this.cache=a.concat([this.cache,e])};Splitter.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);this.cache=this.cache.slice(16);return e}return null};Splitter.prototype.flush=function(){var e=16-this.cache.length;var t=a.allocUnsafe(e);var r=-1;while(++r<e){t.writeUInt8(e,r)}return a.concat([this.cache,t])};function createCipheriv(e,t,r){var s=n[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if(typeof t==="string")t=a.from(t);if(t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if(typeof r==="string")r=a.from(r);if(s.mode!=="GCM"&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if(s.type==="stream"){return new o(s.module,t,r)}else if(s.type==="auth"){return new i(s.module,t,r)}return new Cipher(s.module,t,r)}function createCipher(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=c(t,false,r.key,r.iv);return createCipheriv(e,i.key,i.iv)}t.createCipheriv=createCipheriv;t.createCipher=createCipher},function(e,t,r){"use strict";var n=r(5);var i=r(0);var a=r(30);var o=a.Cipher;var s=a.DES;function EDEState(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8);var i=t.slice(8,16);var a=t.slice(16,24);if(e==="encrypt"){this.ciphers=[s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i}),s.create({type:"encrypt",key:a})]}else{this.ciphers=[s.create({type:"decrypt",key:a}),s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r})]}}function EDE(e){o.call(this,e);var t=new EDEState(this.type,this.options.key);this._edeState=t}i(EDE,o);e.exports=EDE;EDE.create=function create(e){return new EDE(e)};EDE.prototype._update=function _update(e,t,r,n){var i=this._edeState;i.ciphers[0]._update(e,t,r,n);i.ciphers[1]._update(r,n,r,n);i.ciphers[2]._update(r,n,r,n)};EDE.prototype._pad=s.prototype._pad;EDE.prototype._unpad=s.prototype._unpad},function(e,t,r){"use strict";var n=r(5);var i=r(0);var a={};function CBCState(e){n.equal(e.length,8,"Invalid IV length");this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}function instantiate(e){function CBC(t){e.call(this,t);this._cbcInit()}i(CBC,e);var t=Object.keys(a);for(var r=0;r<t.length;r++){var n=t[r];CBC.prototype[n]=a[n]}CBC.create=function create(e){return new CBC(e)};return CBC}t.instantiate=instantiate;a._cbcInit=function _cbcInit(){var e=new CBCState(this.options.iv);this._cbcState=e};a._update=function _update(e,t,r,n){var i=this._cbcState;var a=this.constructor.super_.prototype;var o=i.iv;if(this.type==="encrypt"){for(var s=0;s<this.blockSize;s++)o[s]^=e[t+s];a._update.call(this,o,0,r,n);for(var s=0;s<this.blockSize;s++)o[s]=r[n+s]}else{a._update.call(this,e,t,r,n);for(var s=0;s<this.blockSize;s++)r[n+s]^=o[s];for(var s=0;s<this.blockSize;s++)o[s]=e[t+s]}}},function(e,t,r){"use strict";var n=r(5);var i=r(0);var a=r(30);var o=a.utils;var s=a.Cipher;function DESState(){this.tmp=new Array(2);this.keys=null}function DES(e){s.call(this,e);var t=new DESState;this._desState=t;this.deriveKeys(t,e.key)}i(DES,s);e.exports=DES;DES.create=function create(e){return new DES(e)};var f=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];DES.prototype.deriveKeys=function deriveKeys(e,t){e.keys=new Array(16*2);n.equal(t.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(t,0);var i=o.readUInt32BE(t,4);o.pc1(r,i,e.tmp,0);r=e.tmp[0];i=e.tmp[1];for(var a=0;a<e.keys.length;a+=2){var s=f[a>>>1];r=o.r28shl(r,s);i=o.r28shl(i,s);o.pc2(r,i,e.keys,a)}};DES.prototype._update=function _update(e,t,r,n){var i=this._desState;var a=o.readUInt32BE(e,t);var s=o.readUInt32BE(e,t+4);o.ip(a,s,i.tmp,0);a=i.tmp[0];s=i.tmp[1];if(this.type==="encrypt")this._encrypt(i,a,s,i.tmp,0);else this._decrypt(i,a,s,i.tmp,0);a=i.tmp[0];s=i.tmp[1];o.writeUInt32BE(r,a,n);o.writeUInt32BE(r,s,n+4)};DES.prototype._pad=function _pad(e,t){var r=e.length-t;for(var n=t;n<e.length;n++)e[n]=r;return true};DES.prototype._unpad=function _unpad(e){var t=e[e.length-1];for(var r=e.length-t;r<e.length;r++)n.equal(e[r],t);return e.slice(0,e.length-t)};DES.prototype._encrypt=function _encrypt(e,t,r,n,i){var a=t;var s=r;for(var f=0;f<e.keys.length;f+=2){var c=e.keys[f];var u=e.keys[f+1];o.expand(s,e.tmp,0);c^=e.tmp[0];u^=e.tmp[1];var d=o.substitute(c,u);var h=o.permute(d);var l=s;s=(a^h)>>>0;a=l}o.rip(s,a,n,i)};DES.prototype._decrypt=function _decrypt(e,t,r,n,i){var a=r;var s=t;for(var f=e.keys.length-2;f>=0;f-=2){var c=e.keys[f];var u=e.keys[f+1];o.expand(a,e.tmp,0);c^=e.tmp[0];u^=e.tmp[1];var d=o.substitute(c,u);var h=o.permute(d);var l=a;a=(s^h)>>>0;s=l}o.rip(a,s,n,i)}},function(e,t,r){"use strict";var n=r(5);function Cipher(e){this.options=e;this.type=this.options.type;this.blockSize=8;this._init();this.buffer=new Array(this.blockSize);this.bufferOff=0}e.exports=Cipher;Cipher.prototype._init=function _init(){};Cipher.prototype.update=function update(e){if(e.length===0)return[];if(this.type==="decrypt")return this._updateDecrypt(e);else return this._updateEncrypt(e)};Cipher.prototype._buffer=function _buffer(e,t){var r=Math.min(this.buffer.length-this.bufferOff,e.length-t);for(var n=0;n<r;n++)this.buffer[this.bufferOff+n]=e[t+n];this.bufferOff+=r;return r};Cipher.prototype._flushBuffer=function _flushBuffer(e,t){this._update(this.buffer,0,e,t);this.bufferOff=0;return this.blockSize};Cipher.prototype._updateEncrypt=function _updateEncrypt(e){var t=0;var r=0;var n=(this.bufferOff+e.length)/this.blockSize|0;var i=new Array(n*this.blockSize);if(this.bufferOff!==0){t+=this._buffer(e,t);if(this.bufferOff===this.buffer.length)r+=this._flushBuffer(i,r)}var a=e.length-(e.length-t)%this.blockSize;for(;t<a;t+=this.blockSize){this._update(e,t,i,r);r+=this.blockSize}for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return i};Cipher.prototype._updateDecrypt=function _updateDecrypt(e){var t=0;var r=0;var n=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1;var i=new Array(n*this.blockSize);for(;n>0;n--){t+=this._buffer(e,t);r+=this._flushBuffer(i,r)}t+=this._buffer(e,t);return i};Cipher.prototype.final=function final(e){var t;if(e)t=this.update(e);var r;if(this.type==="encrypt")r=this._finalEncrypt();else r=this._finalDecrypt();if(t)return t.concat(r);else return r};Cipher.prototype._pad=function _pad(e,t){if(t===0)return false;while(t<e.length)e[t++]=0;return true};Cipher.prototype._finalEncrypt=function _finalEncrypt(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);this._update(this.buffer,0,e,0);return e};Cipher.prototype._unpad=function _unpad(e){return e};Cipher.prototype._finalDecrypt=function _finalDecrypt(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);this._flushBuffer(e,0);return this._unpad(e)}},function(e,t,r){"use strict";t.readUInt32BE=function readUInt32BE(e,t){var r=e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t];return r>>>0};t.writeUInt32BE=function writeUInt32BE(e,t,r){e[0+r]=t>>>24;e[1+r]=t>>>16&255;e[2+r]=t>>>8&255;e[3+r]=t&255};t.ip=function ip(e,t,r,n){var i=0;var a=0;for(var o=6;o>=0;o-=2){for(var s=0;s<=24;s+=8){i<<=1;i|=t>>>s+o&1}for(var s=0;s<=24;s+=8){i<<=1;i|=e>>>s+o&1}}for(var o=6;o>=0;o-=2){for(var s=1;s<=25;s+=8){a<<=1;a|=t>>>s+o&1}for(var s=1;s<=25;s+=8){a<<=1;a|=e>>>s+o&1}}r[n+0]=i>>>0;r[n+1]=a>>>0};t.rip=function rip(e,t,r,n){var i=0;var a=0;for(var o=0;o<4;o++){for(var s=24;s>=0;s-=8){i<<=1;i|=t>>>s+o&1;i<<=1;i|=e>>>s+o&1}}for(var o=4;o<8;o++){for(var s=24;s>=0;s-=8){a<<=1;a|=t>>>s+o&1;a<<=1;a|=e>>>s+o&1}}r[n+0]=i>>>0;r[n+1]=a>>>0};t.pc1=function pc1(e,t,r,n){var i=0;var a=0;for(var o=7;o>=5;o--){for(var s=0;s<=24;s+=8){i<<=1;i|=t>>s+o&1}for(var s=0;s<=24;s+=8){i<<=1;i|=e>>s+o&1}}for(var s=0;s<=24;s+=8){i<<=1;i|=t>>s+o&1}for(var o=1;o<=3;o++){for(var s=0;s<=24;s+=8){a<<=1;a|=t>>s+o&1}for(var s=0;s<=24;s+=8){a<<=1;a|=e>>s+o&1}}for(var s=0;s<=24;s+=8){a<<=1;a|=e>>s+o&1}r[n+0]=i>>>0;r[n+1]=a>>>0};t.r28shl=function r28shl(e,t){return e<<t&268435455|e>>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function pc2(e,t,r,i){var a=0;var o=0;var s=n.length>>>1;for(var f=0;f<s;f++){a<<=1;a|=e>>>n[f]&1}for(var f=s;f<n.length;f++){o<<=1;o|=t>>>n[f]&1}r[i+0]=a>>>0;r[i+1]=o>>>0};t.expand=function expand(e,t,r){var n=0;var i=0;n=(e&1)<<5|e>>>27;for(var a=23;a>=15;a-=4){n<<=6;n|=e>>>a&63}for(var a=11;a>=3;a-=4){i|=e>>>a&63;i<<=6}i|=(e&31)<<1|e>>>31;t[r+0]=n>>>0;t[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function substitute(e,t){var r=0;for(var n=0;n<4;n++){var a=e>>>18-n*6&63;var o=i[n*64+a];r<<=4;r|=o}for(var n=0;n<4;n++){var a=t>>>18-n*6&63;var o=i[4*64+n*64+a];r<<=4;r|=o}return r>>>0};var a=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function permute(e){var t=0;for(var r=0;r<a.length;r++){t<<=1;t|=e>>>a[r]&1}return t>>>0};t.padSplit=function padSplit(e,t,r){var n=e.toString(2);while(n.length<t)n="0"+n;var i=[];for(var a=0;a<t;a+=r)i.push(n.slice(a,a+r));return i.join(" ")}},function(e,t,r){(function(t){var n=r(8);var i=r(30);var a=r(0);var o={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};o.des=o["des-cbc"];o.des3=o["des-ede3-cbc"];e.exports=DES;a(DES,n);function DES(e){n.call(this);var r=e.mode.toLowerCase();var i=o[r];var a;if(e.decrypt){a="decrypt"}else{a="encrypt"}var s=e.key;if(r==="des-ede"||r==="des-ede-cbc"){s=t.concat([s,s.slice(0,8)])}var f=e.iv;this._des=i.create({key:s,iv:f,type:a})}DES.prototype._update=function(e){return new t(this._des.update(e))};DES.prototype._final=function(){return new t(this._des.final())}}).call(this,r(2).Buffer)},function(e,t,r){var n=r(148);var i=r(29);var a=r(28);var o=r(133);var s=r(22);function createCipher(e,t){e=e.toLowerCase();var r,n;if(a[e]){r=a[e].key;n=a[e].iv}else if(o[e]){r=o[e].key*8;n=o[e].iv}else{throw new TypeError("invalid suite type")}var i=s(t,false,r,n);return createCipheriv(e,i.key,i.iv)}function createDecipher(e,t){e=e.toLowerCase();var r,n;if(a[e]){r=a[e].key;n=a[e].iv}else if(o[e]){r=o[e].key*8;n=o[e].iv}else{throw new TypeError("invalid suite type")}var i=s(t,false,r,n);return createDecipheriv(e,i.key,i.iv)}function createCipheriv(e,t,r){e=e.toLowerCase();if(a[e])return i.createCipheriv(e,t,r);if(o[e])return new n({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function createDecipheriv(e,t,r){e=e.toLowerCase();if(a[e])return i.createDecipheriv(e,t,r);if(o[e])return new n({key:t,iv:r,mode:e,decrypt:true});throw new TypeError("invalid suite type")}function getCiphers(){return Object.keys(o).concat(i.getCiphers())}t.createCipher=t.Cipher=createCipher;t.createCipheriv=t.Cipheriv=createCipheriv;t.createDecipher=t.Decipher=createDecipher;t.createDecipheriv=t.Decipheriv=createDecipheriv;t.listCiphers=t.getCiphers=getCiphers},function(e,t,r){(function(t,n){var i=r(64);var a=r(63);var o=r(62);var s=r(1).Buffer;var f;var c=t.crypto&&t.crypto.subtle;var u={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"};var d=[];function checkNative(e){if(t.process&&!t.process.browser){return Promise.resolve(false)}if(!c||!c.importKey||!c.deriveBits){return Promise.resolve(false)}if(d[e]!==undefined){return d[e]}f=f||s.alloc(8);var r=browserPbkdf2(f,f,10,128,e).then(function(){return true}).catch(function(){return false});d[e]=r;return r}function browserPbkdf2(e,t,r,n,i){return c.importKey("raw",e,{name:"PBKDF2"},false,["deriveBits"]).then(function(e){return c.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:i}},e,n<<3)}).then(function(e){return s.from(e)})}function resolvePromise(e,t){e.then(function(e){n.nextTick(function(){t(null,e)})},function(e){n.nextTick(function(){t(e)})})}e.exports=function(e,r,f,c,d,h){if(typeof d==="function"){h=d;d=undefined}d=d||"sha1";var l=u[d.toLowerCase()];if(!l||typeof t.Promise!=="function"){return n.nextTick(function(){var t;try{t=o(e,r,f,c,d)}catch(e){return h(e)}h(null,t)})}i(e,r,f,c);if(typeof h!=="function")throw new Error("No callback provided to pbkdf2");if(!s.isBuffer(e))e=s.from(e,a);if(!s.isBuffer(r))r=s.from(r,a);resolvePromise(checkNative(l).then(function(t){if(t)return browserPbkdf2(e,r,f,c,l);return o(e,r,f,c,d)}),h)}}).call(this,r(7),r(9))},function(e,t,r){e.exports=r(66)},function(e,t,r){"use strict";var n=r(0);var i=r(1).Buffer;var a=r(8);var o=i.alloc(128);var s=64;function Hmac(e,t){a.call(this,"digest");if(typeof t==="string"){t=i.from(t)}this._alg=e;this._key=t;if(t.length>s){t=e(t)}else if(t.length<s){t=i.concat([t,o],s)}var r=this._ipad=i.allocUnsafe(s);var n=this._opad=i.allocUnsafe(s);for(var f=0;f<s;f++){r[f]=t[f]^54;n[f]=t[f]^92}this._hash=[r]}n(Hmac,a);Hmac.prototype._update=function(e){this._hash.push(e)};Hmac.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))};e.exports=Hmac},function(e,t,r){var n=r(0);var i=r(69);var a=r(11);var o=r(1).Buffer;var s=new Array(160);function Sha384(){this.init();this._w=s;a.call(this,128,112)}n(Sha384,i);Sha384.prototype.init=function(){this._ah=3418070365;this._bh=1654270250;this._ch=2438529370;this._dh=355462360;this._eh=1731405415;this._fh=2394180231;this._gh=3675008525;this._hh=1203062813;this._al=3238371032;this._bl=914150663;this._cl=812702999;this._dl=4144912697;this._el=4290775857;this._fl=1750603025;this._gl=1694076839;this._hl=3204075428;return this};Sha384.prototype._hash=function(){var e=o.allocUnsafe(48);function writeInt64BE(t,r,n){e.writeInt32BE(t,n);e.writeInt32BE(r,n+4)}writeInt64BE(this._ah,this._al,0);writeInt64BE(this._bh,this._bl,8);writeInt64BE(this._ch,this._cl,16);writeInt64BE(this._dh,this._dl,24);writeInt64BE(this._eh,this._el,32);writeInt64BE(this._fh,this._fl,40);return e};e.exports=Sha384},function(e,t,r){var n=r(0);var i=r(70);var a=r(11);var o=r(1).Buffer;var s=new Array(64);function Sha224(){this.init();this._w=s;a.call(this,64,56)}n(Sha224,i);Sha224.prototype.init=function(){this._a=3238371032;this._b=914150663;this._c=812702999;this._d=4144912697;this._e=4290775857;this._f=1750603025;this._g=1694076839;this._h=3204075428;return this};Sha224.prototype._hash=function(){var e=o.allocUnsafe(28);e.writeInt32BE(this._a,0);e.writeInt32BE(this._b,4);e.writeInt32BE(this._c,8);e.writeInt32BE(this._d,12);e.writeInt32BE(this._e,16);e.writeInt32BE(this._f,20);e.writeInt32BE(this._g,24);return e};e.exports=Sha224},function(e,t,r){var n=r(0);var i=r(11);var a=r(1).Buffer;var o=[1518500249,1859775393,2400959708|0,3395469782|0];var s=new Array(80);function Sha1(){this.init();this._w=s;i.call(this,64,56)}n(Sha1,i);Sha1.prototype.init=function(){this._a=1732584193;this._b=4023233417;this._c=2562383102;this._d=271733878;this._e=3285377520;return this};function rotl1(e){return e<<1|e>>>31}function rotl5(e){return e<<5|e>>>27}function rotl30(e){return e<<30|e>>>2}function ft(e,t,r,n){if(e===0)return t&r|~t&n;if(e===2)return t&r|t&n|r&n;return t^r^n}Sha1.prototype._update=function(e){var t=this._w;var r=this._a|0;var n=this._b|0;var i=this._c|0;var a=this._d|0;var s=this._e|0;for(var f=0;f<16;++f)t[f]=e.readInt32BE(f*4);for(;f<80;++f)t[f]=rotl1(t[f-3]^t[f-8]^t[f-14]^t[f-16]);for(var c=0;c<80;++c){var u=~~(c/20);var d=rotl5(r)+ft(u,n,i,a)+s+t[c]+o[u]|0;s=a;a=i;i=rotl30(n);n=r;r=d}this._a=r+this._a|0;this._b=n+this._b|0;this._c=i+this._c|0;this._d=a+this._d|0;this._e=s+this._e|0};Sha1.prototype._hash=function(){var e=a.allocUnsafe(20);e.writeInt32BE(this._a|0,0);e.writeInt32BE(this._b|0,4);e.writeInt32BE(this._c|0,8);e.writeInt32BE(this._d|0,12);e.writeInt32BE(this._e|0,16);return e};e.exports=Sha1},function(e,t,r){var n=r(0);var i=r(11);var a=r(1).Buffer;var o=[1518500249,1859775393,2400959708|0,3395469782|0];var s=new Array(80);function Sha(){this.init();this._w=s;i.call(this,64,56)}n(Sha,i);Sha.prototype.init=function(){this._a=1732584193;this._b=4023233417;this._c=2562383102;this._d=271733878;this._e=3285377520;return this};function rotl5(e){return e<<5|e>>>27}function rotl30(e){return e<<30|e>>>2}function ft(e,t,r,n){if(e===0)return t&r|~t&n;if(e===2)return t&r|t&n|r&n;return t^r^n}Sha.prototype._update=function(e){var t=this._w;var r=this._a|0;var n=this._b|0;var i=this._c|0;var a=this._d|0;var s=this._e|0;for(var f=0;f<16;++f)t[f]=e.readInt32BE(f*4);for(;f<80;++f)t[f]=t[f-3]^t[f-8]^t[f-14]^t[f-16];for(var c=0;c<80;++c){var u=~~(c/20);var d=rotl5(r)+ft(u,n,i,a)+s+t[c]+o[u]|0;s=a;a=i;i=rotl30(n);n=r;r=d}this._a=r+this._a|0;this._b=n+this._b|0;this._c=i+this._c|0;this._d=a+this._d|0;this._e=s+this._e|0};Sha.prototype._hash=function(){var e=a.allocUnsafe(20);e.writeInt32BE(this._a|0,0);e.writeInt32BE(this._b|0,4);e.writeInt32BE(this._c|0,8);e.writeInt32BE(this._d|0,12);e.writeInt32BE(this._e|0,16);return e};e.exports=Sha},function(e,t,r){e.exports=r(35).PassThrough},function(e,t,r){e.exports=r(35).Transform},function(e,t,r){e.exports=r(10)},function(e,t,r){e.exports=r(34)},function(e,t,r){"use strict";e.exports=PassThrough;var n=r(71);var i=r(17);i.inherits=r(0);i.inherits(PassThrough,n);function PassThrough(e){if(!(this instanceof PassThrough))return new PassThrough(e);n.call(this,e)}PassThrough.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){(function(t){e.exports=deprecate;function deprecate(e,t){if(config("noDeprecation")){return e}var r=false;function deprecated(){if(!r){if(config("throwDeprecation")){throw new Error(t)}else if(config("traceDeprecation")){console.trace(t)}else{console.warn(t)}r=true}return e.apply(this,arguments)}return deprecated}function config(e){try{if(!t.localStorage)return false}catch(e){return false}var r=t.localStorage[e];if(null==r)return false;return String(r).toLowerCase()==="true"}}).call(this,r(7))},function(e,t,r){(function(e,t){(function(e,r){"use strict";if(e.setImmediate){return}var n=1;var i={};var a=false;var o=e.document;var s;function setImmediate(e){if(typeof e!=="function"){e=new Function(""+e)}var t=new Array(arguments.length-1);for(var r=0;r<t.length;r++){t[r]=arguments[r+1]}var a={callback:e,args:t};i[n]=a;s(n);return n++}function clearImmediate(e){delete i[e]}function run(e){var t=e.callback;var n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(r,n);break}}function runIfPresent(e){if(a){setTimeout(runIfPresent,0,e)}else{var t=i[e];if(t){a=true;try{run(t)}finally{clearImmediate(e);a=false}}}}function installNextTickImplementation(){s=function(e){t.nextTick(function(){runIfPresent(e)})}}function canUsePostMessage(){if(e.postMessage&&!e.importScripts){var t=true;var r=e.onmessage;e.onmessage=function(){t=false};e.postMessage("","*");e.onmessage=r;return t}}function installPostMessageImplementation(){var t="setImmediate$"+Math.random()+"$";var r=function(r){if(r.source===e&&typeof r.data==="string"&&r.data.indexOf(t)===0){runIfPresent(+r.data.slice(t.length))}};if(e.addEventListener){e.addEventListener("message",r,false)}else{e.attachEvent("onmessage",r)}s=function(r){e.postMessage(t+r,"*")}}function installMessageChannelImplementation(){var e=new MessageChannel;e.port1.onmessage=function(e){var t=e.data;runIfPresent(t)};s=function(t){e.port2.postMessage(t)}}function installReadyStateChangeImplementation(){var e=o.documentElement;s=function(t){var r=o.createElement("script");r.onreadystatechange=function(){runIfPresent(t);r.onreadystatechange=null;e.removeChild(r);r=null};e.appendChild(r)}}function installSetTimeoutImplementation(){s=function(e){setTimeout(runIfPresent,0,e)}}var f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e;if({}.toString.call(e.process)==="[object process]"){installNextTickImplementation()}else if(canUsePostMessage()){installPostMessageImplementation()}else if(e.MessageChannel){installMessageChannelImplementation()}else if(o&&"onreadystatechange"in o.createElement("script")){installReadyStateChangeImplementation()}else{installSetTimeoutImplementation()}f.setImmediate=setImmediate;f.clearImmediate=clearImmediate})(typeof self==="undefined"?typeof e==="undefined"?this:e:self)}).call(this,r(7),r(9))},function(e,t,r){(function(e){var n=typeof e!=="undefined"&&e||typeof self!=="undefined"&&self||window;var i=Function.prototype.apply;t.setTimeout=function(){return new Timeout(i.call(setTimeout,n,arguments),clearTimeout)};t.setInterval=function(){return new Timeout(i.call(setInterval,n,arguments),clearInterval)};t.clearTimeout=t.clearInterval=function(e){if(e){e.close()}};function Timeout(e,t){this._id=e;this._clearFn=t}Timeout.prototype.unref=Timeout.prototype.ref=function(){};Timeout.prototype.close=function(){this._clearFn.call(n,this._id)};t.enroll=function(e,t){clearTimeout(e._idleTimeoutId);e._idleTimeout=t};t.unenroll=function(e){clearTimeout(e._idleTimeoutId);e._idleTimeout=-1};t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;if(t>=0){e._idleTimeoutId=setTimeout(function onTimeout(){if(e._onTimeout)e._onTimeout()},t)}};r(163);t.setImmediate=typeof self!=="undefined"&&self.setImmediate||typeof e!=="undefined"&&e.setImmediate||this&&this.setImmediate;t.clearImmediate=typeof self!=="undefined"&&self.clearImmediate||typeof e!=="undefined"&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(7))},function(e,t){},function(e,t,r){"use strict";function _classCallCheck(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}var n=r(1).Buffer;var i=r(165);function copyBuffer(e,t,r){e.copy(t,r)}e.exports=function(){function BufferList(){_classCallCheck(this,BufferList);this.head=null;this.tail=null;this.length=0}BufferList.prototype.push=function push(e){var t={data:e,next:null};if(this.length>0)this.tail.next=t;else this.head=t;this.tail=t;++this.length};BufferList.prototype.unshift=function unshift(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length};BufferList.prototype.shift=function shift(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e};BufferList.prototype.clear=function clear(){this.head=this.tail=null;this.length=0};BufferList.prototype.join=function join(e){if(this.length===0)return"";var t=this.head;var r=""+t.data;while(t=t.next){r+=e+t.data}return r};BufferList.prototype.concat=function concat(e){if(this.length===0)return n.alloc(0);if(this.length===1)return this.head.data;var t=n.allocUnsafe(e>>>0);var r=this.head;var i=0;while(r){copyBuffer(r.data,t,i);i+=r.data.length;r=r.next}return t};return BufferList}();if(i&&i.inspect&&i.inspect.custom){e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e}}},function(e,t){},function(e,t){t.read=function(e,t,r,n,i){var a,o;var s=i*8-n-1;var f=(1<<s)-1;var c=f>>1;var u=-7;var d=r?i-1:0;var h=r?-1:1;var l=e[t+d];d+=h;a=l&(1<<-u)-1;l>>=-u;u+=s;for(;u>0;a=a*256+e[t+d],d+=h,u-=8){}o=a&(1<<-u)-1;a>>=-u;u+=n;for(;u>0;o=o*256+e[t+d],d+=h,u-=8){}if(a===0){a=1-c}else if(a===f){return o?NaN:(l?-1:1)*Infinity}else{o=o+Math.pow(2,n);a=a-c}return(l?-1:1)*o*Math.pow(2,a-n)};t.write=function(e,t,r,n,i,a){var o,s,f;var c=a*8-i-1;var u=(1<<c)-1;var d=u>>1;var h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var l=n?0:a-1;var p=n?1:-1;var v=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){s=isNaN(t)?1:0;o=u}else{o=Math.floor(Math.log(t)/Math.LN2);if(t*(f=Math.pow(2,-o))<1){o--;f*=2}if(o+d>=1){t+=h/f}else{t+=h*Math.pow(2,1-d)}if(t*f>=2){o++;f/=2}if(o+d>=u){s=0;o=u}else if(o+d>=1){s=(t*f-1)*Math.pow(2,i);o=o+d}else{s=t*Math.pow(2,d-1)*Math.pow(2,i);o=0}}for(;i>=8;e[r+l]=s&255,l+=p,s/=256,i-=8){}o=o<<i|s;c+=i;for(;c>0;e[r+l]=o&255,l+=p,o/=256,c-=8){}e[r+l-p]|=v*128}},function(e,t,r){"use strict";t.byteLength=byteLength;t.toByteArray=toByteArray;t.fromByteArray=fromByteArray;var n=[];var i=[];var a=typeof Uint8Array!=="undefined"?Uint8Array:Array;var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var s=0,f=o.length;s<f;++s){n[s]=o[s];i[o.charCodeAt(s)]=s}i["-".charCodeAt(0)]=62;i["_".charCodeAt(0)]=63;function getLens(e){var t=e.length;if(t%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var r=e.indexOf("=");if(r===-1)r=t;var n=r===t?0:4-r%4;return[r,n]}function byteLength(e){var t=getLens(e);var r=t[0];var n=t[1];return(r+n)*3/4-n}function _byteLength(e,t,r){return(t+r)*3/4-r}function toByteArray(e){var t;var r=getLens(e);var n=r[0];var o=r[1];var s=new a(_byteLength(e,n,o));var f=0;var c=o>0?n-4:n;for(var u=0;u<c;u+=4){t=i[e.charCodeAt(u)]<<18|i[e.charCodeAt(u+1)]<<12|i[e.charCodeAt(u+2)]<<6|i[e.charCodeAt(u+3)];s[f++]=t>>16&255;s[f++]=t>>8&255;s[f++]=t&255}if(o===2){t=i[e.charCodeAt(u)]<<2|i[e.charCodeAt(u+1)]>>4;s[f++]=t&255}if(o===1){t=i[e.charCodeAt(u)]<<10|i[e.charCodeAt(u+1)]<<4|i[e.charCodeAt(u+2)]>>2;s[f++]=t>>8&255;s[f++]=t&255}return s}function tripletToBase64(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[e&63]}function encodeChunk(e,t,r){var n;var i=[];for(var a=t;a<r;a+=3){n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255);i.push(tripletToBase64(n))}return i.join("")}function fromByteArray(e){var t;var r=e.length;var i=r%3;var a=[];var o=16383;for(var s=0,f=r-i;s<f;s+=o){a.push(encodeChunk(e,s,s+o>f?f:s+o))}if(i===1){t=e[r-1];a.push(n[t>>2]+n[t<<4&63]+"==")}else if(i===2){t=(e[r-2]<<8)+e[r-1];a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")}return a.join("")}},function(e,t,r){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=r(12);t.createHash=t.Hash=r(18);t.createHmac=t.Hmac=r(68);var n=r(151);var i=Object.keys(n);var a=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return a};var o=r(65);t.pbkdf2=o.pbkdf2;t.pbkdf2Sync=o.pbkdf2Sync;var s=r(149);t.Cipher=s.Cipher;t.createCipher=s.createCipher;t.Cipheriv=s.Cipheriv;t.createCipheriv=s.createCipheriv;t.Decipher=s.Decipher;t.createDecipher=s.createDecipher;t.Decipheriv=s.Decipheriv;t.createDecipheriv=s.createDecipheriv;t.getCiphers=s.getCiphers;t.listCiphers=s.listCiphers;var f=r(132);t.DiffieHellmanGroup=f.DiffieHellmanGroup;t.createDiffieHellmanGroup=f.createDiffieHellmanGroup;t.getDiffieHellman=f.getDiffieHellman;t.createDiffieHellman=f.createDiffieHellman;t.DiffieHellman=f.DiffieHellman;var c=r(126);t.createSign=c.createSign;t.Sign=c.Sign;t.createVerify=c.createVerify;t.Verify=c.Verify;t.createECDH=r(88);var u=r(87);t.publicEncrypt=u.publicEncrypt;t.privateEncrypt=u.privateEncrypt;t.publicDecrypt=u.publicDecrypt;t.privateDecrypt=u.privateDecrypt;var d=r(84);t.randomFill=d.randomFill;t.randomFillSync=d.randomFillSync;t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))};t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gostCertInstance=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.GostCert=GostCert;var i=r(173);var a=r(78);var o=r(39);var s=r(77);var f=r(83);var c=ArrayBuffer;var u=o.gostCodingInstance;var d=a.gostSecurityInstance.providers;var h=s.gostASN1Instance;var l=f.gostSubtleInstance;function expand(e){for(var t=1,r=arguments.length;t<r;t++){var i=arguments[t];if((typeof i==="undefined"?"undefined":n(i))==="object")for(var a in i){if(i.hasOwnProperty(a))e[a]=i[a]}}return e}function extend(e){var t=function F(){};t.prototype=e.prototype;var r=new t,n=[r];for(var i=1;i<arguments.length;i++){n.push(arguments[i])}return expand.apply(this,n)}function today(e){var t=new Date;t.setHours(0,0,0,0);if(e)t.setDate(t.getDate()+e);return t}function call(e){try{e()}catch(e){}}function genSerialNumber(){var e=new Uint8Array(4);i.gostCrypto.getRandomValues(e);e[0]=e[0]&127;return u.Int16.encode(e)}var p=function(){var e=function hex(e){var t=typeof e==="undefined"?"undefined":n(e);return t==="undefined"||e===""?"0":t==="number"||e instanceof Number?e.toString(16).toLowerCase():e.replace("0x","").toLowerCase()};var t=function lpad(e,t){return(new Array(t+1).join("0")+e).slice(-t)};return function(r,n){r=e(r);n=e(n);var i=Math.max(r.length,n.length);return t(r,i)===t(n,i)}}();function equalNames(e,t){for(var r in e){if(e[r]!==t[r])return false}for(var r in t){if(e[r]!==t[r])return false}return true}function equalBuffers(e,t){var r=new Uint8Array(e),n=new Uint8Array(t);if(r.length!==n.length)return false;for(var i=0,a=r.length;i<a;i++){if(r[i]!==n[i])return false}return true}function matchCertificate(e,t){var r=e.extensions&&e.extensions.subjectKeyIdentifier;return e&&t&&(!t.issuer||equalNames(e.issuer,t.issuer))&&(!t.serialNumber||p(e.serialNumber,t.serialNumber))&&(!t.subjectKeyIdentifier||equalBuffers(r,t.subjectKeyIdentifier))&&(!t.subject||equalNames(e.subject,t.subject))&&(!t.date||e.notBefore.getTime()<=t.date.getTime()&&e.notAfter.getTime()>t.date.getTime())}function authoritySelector(e,t,r){var n={subject:e.issuer,date:r},i=t&&t.authorityKeyIdentifier;if(i){n.subjectKeyIdentifier=i.keyIdentifier;if(i.authorityCertIssuer&&i.authorityCertIssuer[0]&&i.authorityCertSerialNumber){n.issuer=i.authorityCertIssuer[0];n.serialNumber=i.authorityCertSerialNumber}}return n}function selectCertificates(e,t){var r=[];for(var n=0,i=e.length;n<i;n++){if(matchCertificate(e[n],t))r.push(e[n])}return r}function matchCRL(e,t){return(!t.issuer||equalNames(e.issuer,t.issuer))&&(!t.date||e.thisUpdate.getTime()<t.date.getTime())}function selectCRLs(e,t){var r=[];for(var n=0,i=e.length;n<i;n++){if(matchCRL(e[n],t))r.push(e[n])}return r}function keyProvider(e){var t=e.id;for(var r in d){var n=d[r];if(n.publicKey.id===t)return n}}function defineProperty(e,t,r,i){if((typeof r==="undefined"?"undefined":n(r))!=="object")r={value:r};if(i!==undefined)r.enumerable=i;Object.defineProperty(e,t,r)}function defineProperties(e,t,r){for(var n in t){defineProperty(e,n,t[n],r)}}function extend(e,t,r,n){if(typeof t!=="function"){n=r;r=t;t=function Class(){e.apply(this,arguments)}}t.prototype=Object.create(e.prototype,{constructor:{value:t},superclass:{value:e.prototype}});if(r)defineProperties(t.prototype,r,true);if(e!==Object)for(var i in e){t[i]=e[i]}t.super=e;if(n)defineProperties(t,n,true);return t}function GostCert(){}var v={providerName:"CP-01",subject:{countryName:"RU",commonName:"Anonymous"},caKeyUsage:["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign"],caExtKeyUsage:["serverAuth","clientAuth","codeSigning","emailProtection","ipsecEndSystem","ipsecTunnel","ipsecUser","timeStamping","OCSPSigning"],userKeyUsage:["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement"],userExtKeyUsage:["clientAuth","emailProtection"],days:7305};GostCert.prototype.options=v;var y=function X509(e){try{h.Certificate.call(this,e,true)}catch(t){try{e=new h.CertificationRequest(e,true)}catch(e){}e=e||{};h.Certificate.call(this,{version:2,serialNumber:e.serialNumber||genSerialNumber(),signature:e.signature||{id:"noSignature"},issuer:e.subject||v.subject,notBefore:e.notBefore||today(),notAfter:e.notAfter||today(e.days||v.days),subject:e.subject||v.subject,subjectPublicKeyInfo:e.subjectPublicKeyInfo||{algorithm:{id:"noSignature"},subjectPublicKey:new c(0)},extensions:e.attributes&&(e.attributes.extensionRequest||e.attributes.msCertExtensions)||e.extensions,signatureAlgorithm:{id:"noSignature"},signatureValue:new c(0)})}};extend(h.Certificate,y,{sign:function sign(e,t){var r=this,n=r.subjectPublicKeyInfo;return new Promise(call).then(function(){if(!n||!n.algorithm||n.algorithm==="noSignature")throw new Error("Key pair was not generated for the certificate");if(!e)throw new Error("The private key of the issuer is not defined");t=t||r;return l.digest("SHA-1",n.subjectPublicKey)}).then(function(n){var i=t.getProvider()||d[v.providerName];if(!r.signature||r.signature.id==="noSignature")r.signature=i.signature;r.signatureAlgorithm=r.signature;r.issuer=t.subject;if(!r.extensions)r.extensions={};var a=r.extensions,o=t.extensions;if(r===t){a.keyUsage=a.keyUsage||v.caKeyUsage;a.extKeyUsage=a.extKeyUsage||v.caExtKeyUsage;a.basicConstraints=a.basicConstraints||{cA:true}}else{if(!t.checkUsage("keyCertSign",r.notBefore))throw new Error("The issuer's certificate is not valid for signing a certificate");a.keyUsage=a.keyUsage||v.userKeyUsage;a.extKeyUsage=a.extKeyUsage||v.userExtKeyUsage;a.basicConstraints=a.basicConstraints||{cA:a.keyUsage.indexOf("keyCertSign")>=0};if(a.basicConstraints.cA){var s=o&&o.basicConstraints&&o.pathLenConstraint;if(s!==undefined){if(s>0)a.basicConstraints.pathLenConstraint=s-1;else throw new Error("Path length constraint exceeded")}}}a.subjectKeyIdentifier=n;if(o&&o.subjectKeyIdentifier)a.authorityKeyIdentifier={keyIdentifier:o.subjectKeyIdentifier,authorityCertIssuer:[t.issuer],authorityCertSerialNumber:t.serialNumber};return l.importKey("pkcs8",e.encode(),e.privateKeyAlgorithm,false,["sign"])}).then(function(e){return l.sign(r.signatureAlgorithm,e,r.tbsCertificate.encode())}).then(function(e){r.signatureValue=e;return r})},generate:function generate(e){var t=this,r,n;if(e)n=d[e];else n=this.getProvider()||d[v.providerName];if(n)e=expand(n.publicKey,{privateKey:n.privateKey});return new Promise(call).then(function(){return l.generateKey(e,"true",["sign","verify"])}).then(function(e){r=e.privateKey;return l.exportKey("spki",e.publicKey)}).then(function(e){t.subjectPublicKeyInfo=new h.SubjectPublicKeyInfo(e);return l.exportKey("pkcs8",r)}).then(function(e){return new h.PrivateKeyInfo(e)})},getPublicKey:function getPublicKey(){var e=this.subjectPublicKeyInfo,t=e.algorithm.id==="rsaEncryption"?["verify"]:["verify","deriveKey","deriveBits"];return l.importKey("spki",e.encode(),e.algorithm,"false",t)},getProvider:function getProvider(){return keyProvider(this.subjectPublicKeyInfo.algorithm)},verify:function verify(e,t,r){var n=this,i=n.extensions;return new Promise(call).then(function(){r=r||today();if(n.notBefore.getTime()>r.getTime()||n.notAfter.getTime()<=r.getTime())throw new Error("The certificate has not yet started or expired");for(var t in i){var a=i[t];if(a.critical&&["authorityKeyIdentifier","subjectKeyIdentifier","keyUsage","certificatePolicies","policyMappings","basicConstraints","nameConstraints","policyConstraints","extKeyUsage"].indexOf(t)<0)throw new Error("The critical extension '"+t+"' is unrecognized")}var o=authoritySelector(n,i,n.notBefore);if(!e&&matchCertificate(n,o))e=n;if(e){if(!matchCertificate(e,o)||!e.checkUsage("keyCertSign",n.notBefore))throw new Error("The issuer's certificate is not valid");return e.verifySignature(n.tbsCertificate.encode(),n.signatureValue,n.signatureAlgorithm)}return true}).then(function(e){if(!e)throw new Error("The certificate has invalid signature");if(t){if(!matchCRL(t,{issuer:n.issuer,date:r}))throw new Error("The issuer's CRL is not valid");if(t.isRevoked(n.serialNumber))throw new Error("The certificate is revoked")}return n})},verifySignature:function verifySignature(e,t,r){return this.getPublicKey().then(function(n){return l.verify(r,n,t,e)})},checkUsage:function checkUsage(e,t){var r=this,n=r.extensions;t=t||today();return r.notBefore.getTime()<=t.getTime()&&r.notAfter.getTime()>t.getTime()&&(!n||!(["keyCertSign","cRLSign"].indexOf(e)>0&&n.basicConstraints&&!n.basicConstraints.cA||n.keyUsage&&n.keyUsage.indexOf(e)<0&&n.extKeyUsage&&n.extKeyUsage.indexOf(e)<0))}});GostCert.prototype.X509=y;var b=function CRL(e){CRL.super.call(this,e);if(!this.version)this.version=1;if(!this.revokedCertificates)this.revokedCertificates=[];if(!this.thisUpdate)this.thisUpdate=today()};extend(h.CertificateList,b,{sign:function sign(e,t){var r=this;return new Promise(call).then(function(){if(!e)throw new Error("The issuer's private key is not defined");if(!t)throw new Error("The issuer's certificate is not defined");if(!r.issuer)r.issuer=t.issuer;else if(!equalNames(r.issuer,t.issuer))throw new Error("The CRL prototype and authority certificate have different issuers");if(!t.checkUsage("cRLSign",r.thisUpdate))throw new Error("The issuer's certificate is not valid for signing a CRL");var n=t.getProvider()||d[v.providerName];if(!r.signature)r.signature=n.signature;r.signatureAlgorithm=r.signature;r.issuer=t.subject;if(!r.crlExtensions)r.crlExtensions={};var i=r.crlExtensions,a=t.extensions;if(a&&a.subjectKeyIdentifier)i.authorityKeyIdentifier={keyIdentifier:a.subjectKeyIdentifier,authorityCertIssuer:[t.issuer],authorityCertSerialNumber:t.serialNumber};i.cRLNumber=i.cRLNumber||0;return l.importKey("pkcs8",e.encode(),e.privateKeyAlgorithm,false,["sign"])}).then(function(e){return l.sign(r.signatureAlgorithm,e,r.tbsCertList.encode())}).then(function(e){r.signatureValue=e;return r})},verify:function verify(e,t){var r=this,n=r.crlExtensions;return new Promise(call).then(function(){t=t||today();if(!r.thisUpdate.getTime()>t.getTime())throw new Error("The CRL has not yet started");if(e){if(!matchCertificate(e,authoritySelector(r,n,r.thisUpdate))||!e.checkUsage("cRLSign",r.thisUpdate))throw new Error("The issuer's certificate is not valid");if(!r.signatureValue||!r.signatureAlgorithm)throw new Error("The has no signature");return e.verifySignature(r.tbsCertList.encode(),r.signatureValue,r.signatureAlgorithm)}}).then(function(e){if(!e)throw new Error("The CRL has invalid signature");return r})},isRevoked:function isRevoked(e,t){var r=this.revokedCertificates;t=t||today();for(var n=0;n<r.length;n++){if(t.getTime()>=r[n].revocationDate.getTime()&&p(r[n].userCertificate,e))return true}return false}});GostCert.prototype.CRL=b;function Request(e){try{h.CertificationRequest.call(this,e,true)}catch(t){e=e||{};h.CertificationRequest.call(this,{version:0,subject:e.subject||v.subject,subjectPublicKeyInfo:e.subjectPublicKeyInfo||{algorithm:{id:"noSignature"},subjectPublicKey:new c(0)},attributes:e.attributes||{extensionRequest:{keyUsage:v.userKeyUsage,extKeyUsage:v.userExtKeyUsage}},signatureAlgorithm:{id:"noSignature"},signatureValue:new c(0)})}}extend(h.CertificationRequest,Request,{generate:function generate(e){var t=this,r,n;if(e)n=d[e];else n=this.getProvider()||d[v.providerName];if(n)e=expand(n.publicKey,{privateKey:n.privateKey});return new Promise(call).then(function(){return l.generateKey(e,"true",["sign","verify"])}).then(function(e){r=e.privateKey;return l.exportKey("spki",e.publicKey)}).then(function(e){t.subjectPublicKeyInfo=new h.SubjectPublicKeyInfo(e);return l.exportKey("pkcs8",r)}).then(function(e){r=new h.PrivateKeyInfo(e);return t.sign(r)}).then(function(){return r})},getProvider:function getProvider(){return keyProvider(this.subjectPublicKeyInfo.algorithm)},sign:function sign(e){var t=this,r=t.subjectPublicKeyInfo;return new Promise(call).then(function(){if(!r||!r.algorithm||r.algorithm==="noSignature")throw new Error("Key pair was not generated for the certificate");if(!e)throw new Error("The private key is not defined");var n=keyProvider(r.algorithm)||d[v.providerName];t.signatureAlgorithm=n.signature;return l.importKey("pkcs8",e.encode(),e.privateKeyAlgorithm,false,["sign"])}).then(function(e){return l.sign(t.signatureAlgorithm,e,t.requestInfo.encode())}).then(function(e){t.signatureValue=e;return t})},verify:function verify(){var e=this,t=e.subjectPublicKeyInfo;return new Promise(call).then(function(){return l.importKey("spki",t.encode(),t.algorithm,"false",["verify"])}).then(function(t){return l.verify(e.signatureAlgorithm,t,e.signatureValue,e.requestInfo.encode())}).then(function(t){if(!t)throw new Error("The certification request has invalid signature");return e})}});GostCert.prototype.Request=Request;function CertStore(e,t){this.certificates=e||[];this.crls=t||[]}extend(Object,CertStore,{getCertificates:function getCertificates(e){return selectCertificates(this.certificates,e)},getCRLs:function getCRLs(e){return selectCRLs(this.certificates,e)},load:function load(e){var t=new h.ContentInfo(e),r=t.certificates,n=t.crls;for(var i=0;i<r.length;i++){this.certificates.push(new y(r[i]))}for(var i=0;i<n.length;i++){this.crls.push(new b(n[i]))}return this},store:function store(){return new h.ContentInfo({contentType:"signedData",version:0,digestAlgorithms:[],encapContentInfo:{contentType:"data"},certificates:this.certs,crls:this.crls,signerInfos:[]})}});GostCert.prototype.CertStore=CertStore;function CertPath(e){this.certStore=e}extend(Object,CertPath,{build:function build(e,t){var r=this;return new Promise(call).then(function(){var n=new y(e),i=[],a=false,o=[];while(n){var s=[],f=[];i.push(n);if(!a){s=r.certStore.getCRLs({issuer:n.issuer,date:t});var c=authoritySelector(n,n.extensions,n.notBefore);if(!matchCertificate(n,c))f=r.certStore.getCertificates(c);else a=true}var u=f.length>0&&new y(f[0]),d=s.length>0&&new b(s[0]);if(d)o.push(d.verify(u,t));o.push(n.verify(u,d,t));n=u}if(!a)throw new Error("Root certificate is not found");return Promise.all(o).then(function(e){for(var t=0;t<e;t++){if(!e[t])throw new Error("Certification path is not validated")}return i})})}});GostCert.prototype.CertPath=CertPath;function CertificateTrustPolicy(){}extend(Object,CertificateTrustPolicy,{getValidCertificate:function getValidCertificate(e,t,r){}});GostCert.prototype.CertificateTrustPolicy=CertificateTrustPolicy;function TrustedCAPolicy(e,t,r){this.trustedCACerts=e||[];this.requireCRL=t||false;this.requireCA=r||true}extend(CertificateTrustPolicy,TrustedCAPolicy,{getValidCertificate:function getValidCertificate(e,t,r,n){var i=this,a;return new Promise(call).then(function(){t=t||[];r=r||[];var o=selectCertificates(i.trustedCACerts,e);if(o.length>0)return new y(o[0]);o=selectCertificates(t,e);if(o.length===0)return;var s=new y(o[0]),f=false,c=[];a=[];while(s){var u=[],d=[];a.push(s);if(!f){u=selectCRLs(r,{issuer:s.issuer,date:n});if(u.length===0&&i.requireCRL)return;e=authoritySelector(s,s.extensions,s.notBefore);d=selectCertificates(i.trustedCACerts,e);if(d.length===0){if(!matchCertificate(s,e)){d=selectCertificates(t,e);if(d.length>0){var h=d[0].extensions;if(i.requireCA){if(!h||!h.basicConstraints||!h.basicConstraints.cA)return;if(h.basicConstraints.pathLenConstraint!==undefined&&h.basicConstraints.pathLenConstraint<a.length-1)return}}else return}}else f=true}var l=d.length>0&&new y(d[0]),p=u.length>0&&new b(u[0]);if(p)c.push(p.verify(l,n));c.push(s.verify(l,p,n));s=l}if(!f)throw new Error("Trusted root certificate is not found");return Promise.all(c).then(function(e){for(var t=0;t<e;t++){if(!e[t])throw new Error("Certification path is not validated")}return a[0]})})}});GostCert.prototype.TrustedCAPolicy=TrustedCAPolicy;var m=t.gostCertInstance=new GostCert},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gostCMSInstance=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.GostCMS=GostCMS;var i=r(83);var a=r(77);var o=r(39);var s=r(171);var f=r(78);var c=ArrayBuffer;var u=f.gostSecurityInstance.providers;var d=o.gostCodingInstance;var h=a.gostASN1Instance;var l=i.gostSubtleInstance;var p=s.gostCertInstance;function expand(){var e={};for(var t=0,r=arguments.length;t<r;t++){var i=arguments[t];if((typeof i==="undefined"?"undefined":n(i))==="object")for(var a in i){if(i.hasOwnProperty(a))e[a]=i[a]}}return e}function defineProperty(e,t,r,i){if((typeof r==="undefined"?"undefined":n(r))!=="object")r={value:r};if(i!==undefined)r.enumerable=i;Object.defineProperty(e,t,r)}function defineProperties(e,t,r){for(var n in t){defineProperty(e,n,t[n],r)}}function extend(e,t,r,n){if(typeof t!=="function"){n=r;r=t;t=function Class(){e.apply(this,arguments)}}t.prototype=Object.create(e.prototype,{constructor:{value:t},superclass:{value:e.prototype}});if(r)defineProperties(t.prototype,r,true);if(e!==Object)for(var i in e){t[i]=e[i]}t.super=e;if(n)defineProperties(t,n,true);return t}function call(e){try{e()}catch(e){}}function equalBuffers(e,t){var r=new Uint8Array(e),n=new Uint8Array(t);if(r.length!==n.length)return false;for(var i=0,a=r.length;i<a;i++){if(r[i]!==n[i])return false}return true}var v=function(){var e=function hex(e){var t=typeof e==="undefined"?"undefined":n(e);return t==="undefined"||e===""?"0":t==="number"||e instanceof Number?e.toString(16).toLowerCase():e.replace("0x","").toLowerCase()};var t=function lpad(e,t){return(new Array(t+1).join("0")+e).slice(-t)};return function(r,n){r=e(r);n=e(n);var i=Math.max(r.length,n.length);return t(r,i)===t(n,i)}}();function equalNames(e,t){for(var r in e){if(e[r]!==t[r])return false}for(var r in t){if(e[r]!==t[r])return false}return true}function addUnique(e,t,r){var n=false;for(var i=0,a=e.length;i<a;i++){if(r(e[i],t)){n=true;break}}if(!n)e.push(t)}function setContentData(e,t){var r=e.content;switch(e.contentType){case"data":e.content=t.content;break;case"digestedData":case"signedData":case"authData":r.encapContentInfo={eContentType:t.contentType,eContent:t.content};break;case"envelopedData":case"encryptedData":r.encryptedContentInfo={contentType:t.contentType,encryptedContent:t.content};break}}function getContentData(e){var t=e.content;switch(e.contentType){case"data":return{contentType:e.contentType,content:e.content};case"digestedData":case"signedData":case"authData":var r=t.encapContentInfo;return{contentType:r.eContentType,content:r.eContent};case"envelopedData":case"encryptedData":var n=t.encryptedContentInfo;return{contentType:n.contentType,content:n.encryptedContent}}}function checkContentInfo(e){var t,r;if(e){if(typeof e==="string")try{e=d.PEM.decode(e)}catch(t){e=d.Chars.decode(e)}if(e instanceof c)try{e=h.ContentInfo.decode(e)}catch(t){e={contentType:"data",content:e}}r=e.contentType;if(!r)throw new Error("Invalid content object");t=e.content;if(!(t instanceof c))t=t.encode();return{contentType:r,content:t}}else e={contentType:"data"};return e}function createContentInfo(e){try{e=new h.ContentInfo(e.content,true)}catch(e){}switch(e.contentType){case"data":return new DataContentInfo(e);case"digestedData":return new DigestedDataContentInfo(e);case"signedData":return new SignedDataContentInfo(e);case"encryptedData":return new EncryptedDataContentInfo(e);case"envelopedData":return new EnvelopedDataContentInfo(e);default:return new h.ContentInfo(e)}}function matchCert(e,t){return e instanceof c?t.extensions&&equalBuffers(e,t.extensions.subjectKeyIdentifier):equalNames(t.issuer,e.issuer)&&v(t.serialNumber,e.serialNumber)}function getSeed(e){var t=new Uint8Array(e);gostCrypto.getRandomValues(t);return t.buffer}function saltSize(e){switch(e.id){case"pbeWithSHAAnd40BitRC2-CBC":case"pbeWithSHAAnd128BitRC2-CBC":return 8;case"pbeUnknownGost":return 16;case"sha1":return 20;default:return 32}}function passwordData(e,t){if(!t)return new c(0);if(t instanceof c)return t;if(typeof t!=="string")throw new Error("The password must be string or raw data type");if(e.name.indexOf("CPKDF")>=0){var r=[];for(var n=0;n<t.length;n++){var i=t.charCodeAt(n);r.push(i&255);r.push(i>>>8&255);r.push(0);r.push(0)}return new Uint8Array(r).buffer}else if(e.name.indexOf("PFXKDF")>=0)return d.Chars.decode(t+"\0","unicode");else return d.Chars.decode(t,"utf8")}function encryptionProvider(e){var t=e.id;for(var r in u){var n=u[r];if(n.encryption.id===t)return n}}function GostCMS(){}var y={providerName:"CP-01",autoAddCert:false,useKeyIdentifier:false};GostCMS.prototype.options=y;function DataContentInfo(e,t){h.ContentInfo.call(this,e||t||{contentType:"data"});if(t&&this.contentType!==(t.contentType||"data"))throw new Error("Invalid content type")}extend(h.ContentInfo,DataContentInfo,{isDetached:{value:false,enumerable:true,writable:true},writeDetached:function writeDetached(e){this.isDetached=e},encode:function encode(e){if(this.isDetached){var t=getContentData(this);setContentData(this,{contentType:t.contentType});var r=h.ContentInfo.method("encode").call(this,e);setContentData(this,t);return r}else return h.ContentInfo.method("encode").call(this,e)},encloseContent:function encloseContent(e){var t=this;return new Promise(call).then(function(){t.setEnclosed(e);return t})},setEnclosed:function setEnclosed(e){setContentData(this,checkContentInfo(e))},getEnclosed:function getEnclosed(){return createContentInfo(getContentData(this))}});GostCMS.prototype.DataContentInfo=DataContentInfo;function DigestedDataContentInfo(e){DataContentInfo.call(this,e,{contentType:"digestedData",version:0,digestAlgorithm:u[y.providerName].digest,encapContentInfo:{eContentType:"data"},digest:new c(0)})}extend(DataContentInfo,DigestedDataContentInfo,{encloseContent:function encloseContent(e,t){var r=this;return new Promise(call).then(function(){r.setEnclosed(e);if(t){var n=u[t];r.digestAlgorithm=n&&n.digest||t}return l.digest(r.digestAlgorithm,r.encapContentInfo.eContent)}).then(function(e){r.digest=e})},verify:function verify(e){var t=this;return new Promise(call).then(function(){if(e)t.setEnclosed(e);var r=t.encapContentInfo&&t.encapContentInfo.eContent;if(!r)throw new Error("Detached content is not found");return l.digest(t.digestAlgorithm,t.encapContentInfo.eContent)}).then(function(e){if(!equalBuffers(e,t.digest))throw Error("Message digest is not verified");return createContentInfo({contentType:t.encapContentInfo.eContentType,content:t.encapContentInfo.eContent})})}});GostCMS.prototype.DigestedDataContentInfo=DigestedDataContentInfo;function SignedDataContentInfo(e){DataContentInfo.call(this,e,{contentType:"signedData",version:1,digestAlgorithms:[],encapContentInfo:{eContentType:"data"},signerInfos:[]})}extend(DataContentInfo,SignedDataContentInfo,{addSignature:function addSignature(e,t,r,i){var a=this,o,s,f;return new Promise(call).then(function(){if(!e||!t)throw new Error("Signer key or certificate is not defined");if(t instanceof Array){f=t;t=f[0]}else f=[t];var c=t.getProvider()||u[y.providerName];var d=y.useKeyIdentifier&&t.extensions&&t.extensions.subjectKeyIdentifier;s=a.encapContentInfo.eContent;o={version:d?2:0,sid:d?t.extensions.subjectKeyIdentifier:{issuer:t.issuer,serialNumber:t.serialNumber},digestAlgorithm:c.digest,signatureAlgorithm:t.subjectPublicKeyInfo.algorithm};if(i)o.unsignedAttrs=i;if(r){if((typeof r==="undefined"?"undefined":n(r))!=="object")r={};return l.digest(o.digestAlgorithm,s)}}).then(function(t){if(t){r.contentType=a.encapContentInfo.eContentType,r.messageDigest=t,r.signingTime=new Date;o.signedAttrs=r,s=h.SignedAttributes.encode(o.signedAttrs)}return l.importKey("pkcs8",h.PrivateKeyInfo.encode(e),e.privateKeyAlgorithm,false,["sign"])}).then(function(e){var t=expand(o.signatureAlgorithm,{hash:o.digestAlgorithm});return l.sign(t,e,s)}).then(function(e){o.signatureValue=e;addUnique(a.digestAlgorithms,o.digestAlgorithm,function(e,t){return e.id===t.id});if(y.autoAddCert){if(!a.certificates)a.certificates=[];for(var t=0,r=f.length;t<r;t++){addUnique(a.certificates,f[t],function(e,t){return equalNames(e.issuer,t.issuer)&&v(e.serialNumber,t.serialNumber)})}}a.signerInfos.push(o)})},isDegenerate:{get:function get(){return!(this.signerInfos&&this.signerInfos.length>0)}},verify:function verify(e,t){var r=this,n;return new Promise(call).then(function(){if(t)r.setEnclosed(t);if(!r.signerInfos||r.signerInfos.length===0)throw new Error("No signatures found");return Promise.all(r.signerInfos.map(function(t,n){var i=t.sid,a=i instanceof c?{subjectKeyIdentifier:i}:{issuer:i.issuer,serialNumber:i.serialNumber};var o;if(t.signedAttrs&&t.signedAttrs.signingTime)o=t.signedAttrs.signingTime;return e.getValidCertificate(a,r.certificates,r.crls,o).catch(function(){return})}))}).then(function(e){var t=[];e.forEach(function(e){if(e)t.push(r.verifySignature(e).then(function(e){n=e},function(){return}))});if(t.length===0)throw new Error("Valid verification path not found");return Promise.all(t)}).then(function(){if(!n)throw Error("Verification path found but no valid signature");return n})},verifySignature:function verifySignature(e,t){var r=this,n,i,a;return new Promise(call).then(function(){if(t)r.setEnclosed(t);i=r.encapContentInfo&&r.encapContentInfo.eContent;if(!i)throw new Error("Detached content is not found");for(var o=0;o<r.signerInfos.length;o++){var s=r.signerInfos[o].sid;if(matchCert(s,e)){n=r.signerInfos[o];break}}if(!n)throw new Error("Signature not found for the certificate");if(n.signedAttrs){a=n.signedAttrs.messageDigest;if(!a)throw new Error("Message digest must present in signed attributes");i=n.signedAttrs.encode()}if(!i)throw new Error("Data for verification not found");var f=expand(n.signatureAlgorithm,{hash:n.digestAlgorithm});return e.verifySignature(i,n.signatureValue,f)}).then(function(e){if(!e)throw new Error("Signature not verified");if(n.signedAttrs)return l.digest(n.digestAlgorithm,r.encapContentInfo.eContent)}).then(function(e){if(e&&!equalBuffers(e,a))throw new Error("Message digest not verified");return createContentInfo({contentType:r.encapContentInfo.eContentType,content:r.encapContentInfo.eContent})})}});GostCMS.prototype.SignedDataContentInfo=SignedDataContentInfo;function EncryptedDataContentInfo(e){DataContentInfo.call(this,e,{contentType:"encryptedData",version:0,encryptedContentInfo:{contentType:"data",contentEncryptionAlgorithm:u[y.providerName].encryption}})}extend(DataContentInfo,EncryptedDataContentInfo,{encloseContent:function encloseContent(e,t,r){var n=this,i,a;return new Promise(call).then(function(){e=checkContentInfo(e);if(!e.content)throw new Error("Content for encryption must be specified");var n=typeof t==="string"?"pbes":"encryption";if(r){var o=u[r];r=o&&o[n]||r}else r=u[y.providerName][n];if(r.derivation){a=expand(r.derivation);i=expand(r.encryption);a.salt=getSeed(saltSize(r));var s;return l.importKey("raw",passwordData(a,t),a,false,["deriveKey","deriveBits"]).then(function(e){s=e;if(a.name.indexOf("PFXKDF")>=0){a.diversifier=2;return l.deriveBits(a,s,64)}}).then(function(e){if(e)i.iv=e;a.diversifier=1;return l.deriveKey(a,s,i,false,["encrypt"])}).then(function(e){return e})}else{i=expand(r);if(t instanceof c){return l.importKey("raw",t,i,false,["encrypt"])}else if(t.type==="secret"){return t}else throw new Error("Content encryption key must be raw data or secret key type")}}).then(function(t){if(!i.iv)i.iv=getSeed(8);return l.encrypt(i,t,e.content)}).then(function(t){if(r.derivation){delete a.diversifier;r=expand(r,{derivation:a,encryption:i})}else r=i;n.encryptedContentInfo={contentType:e.contentType,contentEncryptionAlgorithm:r,encryptedContent:t};return n})},getEnclosed:function getEnclosed(e,t){var r=this,n,i,a;return new Promise(call).then(function(){if(t)r.setEnclosed(t);a=r.encryptedContentInfo.encryptedContent;if(!a)throw new Error("Encrypted content must be specified");n=expand(r.encryptedContentInfo.contentEncryptionAlgorithm);if(n.derivation){i=expand(n.derivation);n=expand(n.encryption);var o;return l.importKey("raw",passwordData(i,e),i,false,["deriveKey","deriveBits"]).then(function(e){o=e;if(i.name.indexOf("PFXKDF")>=0){i.diversifier=2;return l.deriveBits(i,o,64)}}).then(function(e){if(e)n.iv=e;i.diversifier=1;return l.deriveKey(i,o,n,false,["decrypt"])})}else{if(e instanceof c){return l.importKey("raw",e,n,false,["decrypt"])}else if(e.type==="secret"){return e}else throw new Error("Decryption key must be raw data or secret key type")}}).then(function(e){return l.decrypt(n,e,a)}).then(function(e){return createContentInfo({contentType:r.encryptedContentInfo.contentType,content:e})})}});GostCMS.prototype.EncryptedDataContentInfo=EncryptedDataContentInfo;function EnvelopedDataContentInfo(e){DataContentInfo.call(this,e,{contentType:"envelopedData",version:0,recipientInfos:[],encryptedContentInfo:{contentType:"data",contentEncryptionAlgorithm:u[y.providerName].encryption}})}extend(DataContentInfo,EnvelopedDataContentInfo,{encloseContent:function encloseContent(e,t){var r=this;return new Promise(call).then(function(){e=checkContentInfo(e);if(!e.content)throw new Error("Content for encryption must be specified");if(t){var r=u[t];t=r&&r.encryption||t}else t=u[y.providerName].encryption;return l.generateKey(t,true,["encrypt"])}).then(function(n){r.contentEncryptionKey=n;if(!t.iv)t.iv=getSeed(8);return l.encrypt(t,n,e.content)}).then(function(n){r.encryptedContentInfo={contentType:e.contentType,contentEncryptionAlgorithm:t,encryptedContent:n};return r})},addRecipient:function addRecipient(e,t,r,n){var i=this,a,o,s,f;return new Promise(call).then(function(){e=new p.X509(e);if(t&&typeof t!=="string"&&!t.algorithm){n=r;r=t;t=undefined}if(t){o=u[t]}else o=e.getProvider();if(!i.contentEncryptionKey)throw new Error("The content encryption key is not assigned");if(n){var a;if(n instanceof Array){a=n;n=a[0]}else a=[n];if(y.autoAddCert){if(!i.originatorInfo)i.originatorInfo={certs:[]};else if(!i.originatorInfo.certs)i.originatorInfo.certs=[];for(var s=0,f=a.length;s<f;s++){addUnique(i.originatorInfo.certs,a[s],function(e,t){return equalNames(e.issuer,t.issuer)&&v(e.serialNumber,t.serialNumber)})}}if(o)t=expand(o.agreement);else o=e.getProvider();if(e.subjectPublicKeyInfo.algorithm.namedCurve!==n.subjectPublicKeyInfo.algorithm.namedCurve)throw new Error("The sender and the recipient have different public key algorithms");return l.importKey("pkcs8",r.encode(),r.privateKeyAlgorithm,false,["deriveKey"])}else{if(o)t=expand(e.subjectPublicKeyInfo.algorithm);else o=e.getProvider();return l.generateKey(t,true,["deriveKey"]).then(function(e){t["public"]=e.publicKey;return e.privateKey})}}).then(function(t){a=t;return l.importKey("spki",e.subjectPublicKeyInfo.encode(),e.subjectPublicKeyInfo.algorithm,false,["deriveKey","deriveBits"])}).then(function(e){t.ukm=getSeed(8);s=expand(o.agreement,{sBox:t.sBox,ukm:t.ukm,public:e});f=expand(t.wrapping||o.wrapping,{ukm:t.ukm});return l.deriveKey(s,a,f,true,["wrapKey"])}).then(function(e){t.wrapping=f;return l.wrapKey("raw",i.contentEncryptionKey,e,f)}).then(function(r){var a;var o=y.useKeyIdentifier&&e.extensions&&e.extensions.subjectKeyIdentifier,s=o?e.extensions.subjectKeyIdentifier:{issuer:e.issuer,serialNumber:e.serialNumber};if(n){var f=n.subjectPublicKeyInfo;a={version:3,originator:{algorithm:f.algorithm,publicKey:f.subjectPublicKey},ukm:t.ukm,keyEncryptionAlgorithm:t,recipientEncryptedKeys:[{rid:s,encryptedKey:h.GostEncryptedKey(t).encode(r)}]}}else{a={version:0,rid:s,keyEncryptionAlgorithm:t,encryptedKey:h.GostEncryptedKey(t).encode({algorithm:t,sessionEncryptedKey:r})}}i.recipientInfos.push(a);return i})},getEnclosed:function getEnclosed(e,t,r,n){var i=this,a,o,s,f,c;return new Promise(call).then(function(){var e=t.getProvider();if(r)i.setEnclosed(r);o=i.encryptedContentInfo.encryptedContent;if(!o)throw new Error("Encrypted content must be specified");c=i.encryptedContentInfo.contentEncryptionAlgorithm;for(var u=0;u<i.recipientInfos.length;u++){var d=i.recipientInfos[u],p=expand(d.keyEncryptionAlgorithm);if(d.rid){if(matchCert(d.rid,t)){var v=h.GostEncryptedKey(p).decode(d.encryptedKey).object;a=v.sessionEncryptedKey;p=expand(p,v.algorithm);s=expand(e.agreement,{ukm:p.ukm,sBox:p.sBox});f=expand(e.wrapping,p.wrapping,{ukm:p.ukm});return p["public"]}}else{var y=d.recipientEncryptedKeys;if(y){for(var b=0;b<y.length;b++){if(matchCert(y[b].rid,t)){p=expand(e.agreement,p,{ukm:d.ukm});a=h.GostEncryptedKey(p).decode(y[b].encryptedKey).object;s=p;f=expand(p.wrapping||e.wrapping,{ukm:d.ukm});var m=d.originator;if(m.algorithm){var g=new h.SubjectPublicKeyInfo({algorithm:m.algorithm,subjectPublicKey:m.publicKey});return l.importKey("spki",g.encode(),g.algorithm,false,["deriveKey","deriveBits"])}else if(n&&matchCert(m,n))return importKey("pkcs",n.subjectPublicKeyInfo.encode(),n.subjectPublicKeyInfo.algorithm,false,["deriveKey","deriveBits"]);else throw Error("Originator certificate not specified or not valid")}}}}}throw new Error("Recipient not found or format not supported")}).then(function(t){s["public"]=t;return l.importKey("pkcs8",e.encode(),e.privateKeyAlgorithm,false,["deriveKey","deriveBits"])}).then(function(e){return l.deriveKey(s,e,f,true,["unwrapKey"])}).then(function(e){return l.unwrapKey("raw",a,e,f,c,false,["decrypt"])}).then(function(e){return l.decrypt(c,e,o)}).then(function(e){return createContentInfo({contentType:i.encryptedContentInfo.contentType,content:e})})}});GostCMS.prototype.EnvelopedDataContentInfo=EnvelopedDataContentInfo;var b=t.gostCMSInstance=new GostCMS},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gostCrypto=undefined;var n=r(80);var i=r(39);var a=r(78);var o=r(77);var s=r(83);var f=r(171);var c=r(172);var u=r(175);var d=t.gostCrypto={coding:i.gostCodingInstance,security:a.gostSecurityInstance,asn1:o.gostASN1Instance,subtle:s.gostSubtleInstance,cert:f.gostCertInstance,cms:c.gostCMSInstance,keys:u.gostKeysInstance};d.getRandomValues=function(e){try{var t=new n.GostRandom;return t.getRandomValues(e)}catch(e){throw new Error("Error occurred during random values generation")}}},,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.gostKeysInstance=undefined;var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.GostKeys=GostKeys;var i=r(78);var a=r(39);var o=r(77);var s=r(83);var f=r(171);var c=r(172);var u=ArrayBuffer;var d=a.gostCodingInstance;var h=i.gostSecurityInstance.providers;var l=o.gostASN1Instance;var p=s.gostSubtleInstance;var v=f.gostCertInstance;var y=c.gostCMSInstance;function expand(){var e={};for(var t=0,r=arguments.length;t<r;t++){var i=arguments[t];if((typeof i==="undefined"?"undefined":n(i))==="object")for(var a in i){if(i.hasOwnProperty(a))e[a]=i[a]}}return e}function defineProperty(e,t,r,i){if((typeof r==="undefined"?"undefined":n(r))!=="object")r={value:r};if(i!==undefined)r.enumerable=i;Object.defineProperty(e,t,r)}function defineProperties(e,t,r){for(var n in t){defineProperty(e,n,t[n],r)}}function extend(e,t,r,n){if(typeof t!=="function"){n=r;r=t;t=function Class(){e.apply(this,arguments)}}t.prototype=Object.create(e.prototype,{constructor:{value:t},superclass:{value:e.prototype}});if(r)defineProperties(t.prototype,r,true);if(e!==Object)for(var i in e){t[i]=e[i]}t.super=e;if(n)defineProperties(t,n,true);return t}function getSeed(e){var t=new Uint8Array(e);gostCrypto.getRandomValues(t);return t.buffer}function call(e){try{e()}catch(e){}}function buffer(e){if(e instanceof u)return e;else if(e&&e.buffer&&e.buffer instanceof u)return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(new Uint8Array(e,e.byteOffset,e.byteLength)).buffer;else throw new DataError("CryptoOperationData required")}function now(e){var t=new Date;if(e)t.setDate(t.getDate()+e);return t}function today(e){var t=now(e);t.setHours(0,0,0,0);return t}function equalBuffers(e,t){var r=new Uint8Array(e),n=new Uint8Array(t);if(r.length!==n.length)return false;for(var i=0,a=r.length;i<a;i++){if(r[i]!==n[i])return false}return true}function generateUUID(){var e=new Uint8Array(getSeed(16)),t="";for(var r=0;r<16;r++){t+=("00"+e[r].toString(16)).slice(-2)}return t.substr(0,8)+"-"+t.substr(8,4)+"-4"+t.substr(13,3)+"-9"+t.substr(17,3)+"-"+t.substr(20,12)}function get32(e,t){var r=new Uint8Array(e,t,4);return r[3]<<24|r[2]<<16|r[1]<<8|r[0]}function set32(e,t,r){var n=new Uint8Array(e,t,4);n[3]=r>>>24;n[2]=r>>>16&255;n[1]=r>>>8&255;n[0]=r&255;return n}function saltSize(e){switch(e.id){case"pbeWithSHAAnd40BitRC2-CBC":case"pbeWithSHAAnd128BitRC2-CBC":return 8;case"pbeUnknownGost":return 16;case"sha1":return 20;default:return 32}}function passwordData(e,t){if(!t)return new u(0);if(e.name.indexOf("CPKDF")>=0){var r=[];for(var n=0;n<t.length;n++){var i=t.charCodeAt(n);r.push(i&255);r.push(i>>>8&255);r.push(0);r.push(0)}return new Uint8Array(r).buffer}else if(e.name.indexOf("PFXKDF")>=0)return d.Chars.decode(t+"\0","unicode");else return d.Chars.decode(t,"utf8")}function GostKeys(){}var b={providerName:"CP-01",days:7305};GostKeys.prototype.options=b;function PKCS8(e){l.PrivateKeyInfo.call(this,e)}extend(l.PrivateKeyInfo,PKCS8,{getPrivateKey:function getPrivateKey(){var e=this.privateKeyAlgorithm.id==="rsaEncryption"?["sign"]:["sign","deriveKey","deriveBits"];return p.importKey("pkcs8",this.encode(),this.privateKeyAlgorithm,"true",e)},setPrivateKey:function setPrivateKey(e){var t=this;return p.exportKey("pkcs8",e).then(function(e){l.PrivateKeyInfo.call(t,e);return t})},generate:function generate(e,t){var r=this;return new Promise(call).then(function(){if(!(e instanceof v.Request))e=new v.Request(e);return e.generate(t)}).then(function(t){l.PrivateKeyInfo.call(r,t);return e})}});GostKeys.prototype.PKCS8=PKCS8;function PKCS8Encrypted(e){l.EncryptedPrivateKeyInfo.call(this,e)}extend(l.EncryptedPrivateKeyInfo,PKCS8Encrypted,{getKey:function getKey(e){var t=this,r;return new Promise(call).then(function(){r=new y.EncryptedDataContentInfo({contentType:"encryptedData",version:0,encryptedContentInfo:{contentType:"data",contentEncryptionAlgorithm:t.encryptionAlgorithm,encryptedContent:t.encryptedData}});return r.getEnclosed(e)}).then(function(e){return PKCS8.decode(e.content)})},getPrivateKey:function getPrivateKey(e){return this.getKey(e).then(function(e){return e.getPrivateKey()})},setKey:function setKey(e,t,r){var n=this,i;return new Promise(call).then(function(){e=new PKCS8(e);i=new y.EncryptedDataContentInfo;return i.encloseContent(e.encode(),t,r||b.providerName)}).then(function(){n.encryptionAlgorithm=i.encryptedContentInfo.contentEncryptionAlgorithm;n.encryptedData=i.encryptedContentInfo.encryptedContent;return n})},setPrivateKey:function setPrivateKey(e,t,r){var n=this;return(new PKCS8).setPrivateKey(e).then(function(e){return n.setKey(e,t,r)})},generate:function generate(e,t,r,n){var i=this;return new Promise(call).then(function(){if(!(e instanceof v.Request))e=new v.Request(e);return e.generate(r)}).then(function(e){return i.setKey(e,t,n)}).then(function(){return e})}});GostKeys.prototype.PKCS8Encrypted=PKCS8Encrypted;function SignalComKeyContainer(e){if(e){var t=this;["mk.db3","masks.db3","kek.opq","rand.opq"].forEach(function(r){t[r]=e[r]})}}extend(Object,SignalComKeyContainer,{getEncryptionKey:function getEncryptionKey(e){var t=this,r=h["SC-01"].wrapping,n=h["SC-01"].encryption,i=h["SC-01"].derivation,a=t["masks.db3"],o=t["mk.db3"],s=t["kek.opq"];return new Promise(call).then(function(){if(!a||!o||!s)throw new Error("Not enougth key container files");if(a.byteLength>32){if(e){return p.importKey("raw",d.Chars.decode(e,"utf8"),i,false,["deriveKey","deriveBits"]).then(function(e){return p.deriveKey(expand(i,{salt:new Uint8Array([0,0,0,0,0,0,0,0])}),e,n,false,["decrypt"])}).then(function(e){var t=new y.EncryptedDataContentInfo(a);return t.getEnclosed(e)}).then(function(e){return e.verify()}).then(function(e){return e.content})}else throw new Error("Key password is required")}else if(e)throw new Error("Key password is not required");return a}).then(function(e){a=e;var t=new Uint8Array(o.byteLength+a.byteLength);t.set(new Uint8Array(o),0);t.set(new Uint8Array(a),o.byteLength);return p.importKey("raw",t.buffer,r,false,["unwrapKey"])}).then(function(e){return p.unwrapKey("raw",s,e,r,n,false,["wrapKey","unwrapKey"])})},generateContainer:function generateContainer(e){var t=this,r=h["SC-01"].wrapping,n=h["SC-01"].encryption,i=h["SC-01"].derivation,a=h["SC-01"].digest,o,s;return new Promise(call).then(function(){return p.generateKey(r,true,["wrapKey"])}).then(function(r){s=r;var o=s.buffer.byteLength;t["mk.db3"]=new Uint8Array(new Uint8Array(s.buffer,0,o-32)).buffer;var f=new Uint8Array(new Uint8Array(s.buffer,o-32,32)).buffer;if(e){var c=new y.EncryptedDataContentInfo,u=new y.DigestedDataContentInfo;return u.encloseContent(f,a).then(function(){u={contentType:"digestedData",content:u.encode()};return p.importKey("raw",d.Chars.decode(e,"utf8"),i,false,["deriveKey","deriveBits"])}).then(function(e){return p.deriveKey(expand(i,{salt:new Uint8Array([0,0,0,0,0,0,0,0])}),e,n,false,["encrypt"])}).then(function(e){return c.encloseContent(u,e,n)}).then(function(){return c.encode()})}return f}).then(function(e){t["masks.db3"]=e;return p.generateKey(n,false,["wrapKey","unwrapKey"])}).then(function(e){o=e;return p.wrapKey("raw",e,s,r)}).then(function(e){t["kek.opq"]=e;return p.generateKey(n,false,["wrapKey","unwrapKey"])}).then(function(e){return p.wrapKey("raw",e,s,r)}).then(function(e){t["rand.opq"]=e;return o})}});GostKeys.prototype.SignalComKeyContainer=SignalComKeyContainer;function SignalComPrivateKeyInfo(e,t){l.GostWrappedPrivateKey.call(this,e);SignalComKeyContainer.call(this,t)}extend(l.GostWrappedPrivateKey,SignalComPrivateKeyInfo,{getKey:function getKey(e){return this.getPrivateKey(e).then(function(e){return(new PKCS8).setPrivateKey(e)})},getPrivateKey:function getPrivateKey(e){var t=this,r=h["SC-01"].wrapping,n;return new Promise(call).then(function(){return t.getEncryptionKey(e,true)}).then(function(e){return p.unwrapKey("raw",t.privateKeyWrapped,e,r,t.privateKeyAlgorithm,true,["sign","deriveKey","deriveBits"])}).then(function(e){n=t.attributes&&t.attributes["id-sc-gostR3410-2001-publicKey"];if(n)return p.generateKey(expand(e.algorithm,{ukm:e.buffer}),e.extractable,e.usages);else return{privateKey:e}}).then(function(e){if(n&&!equalBuffers(e.publicKey.buffer,n))throw new Error("Check public key failed");return e.privateKey})},setKey:function setKey(e,t){var r=this;return new PKCS8(e).getPrivateKey().then(function(e){return r.setPrivateKey(e,t)})},setPrivateKey:function setPrivateKey(e,t){var r=this,n=h["SC-01"].wrapping,i;return new Promise(call).then(function(){return r.getEncryptionKey(t)["catch"](function(){return r.generateContainer(t)})}).then(function(t){return p.wrapKey("raw",e,t,n)}).then(function(t){i=t;return p.generateKey(expand(e.algorithm,{ukm:e.buffer}),true,["sign","verify"])}).then(function(t){r.object={version:0,privateKeyAlgorithm:e.algorithm,privateKeyWrapped:i,attributes:{"id-sc-gostR3410-2001-publicKey":t.publicKey.buffer}};return r})},changePassword:function changePassword(e,t){var r=this;return r.getPrivateKey(e).then(function(e){return r.setPrivateKey(e,t)})},generate:function generate(e,t,r){var n=this,i;return new Promise(call).then(function(){if(!(e instanceof v.Request))e=new v.Request(e);return e.generate(r)}).then(function(e){i=e;return n.setKey(i,t)}).then(function(){return e})}});defineProperties(SignalComPrivateKeyInfo.prototype,SignalComKeyContainer.prototype);GostKeys.prototype.SignalComPrivateKeyInfo=SignalComPrivateKeyInfo;function CryptoProKeyContainer(e){if(e){this.header=l.GostKeyContainer.decode(e.header);this.name=l.GostKeyContainerName.decode(e.name);this.primary=l.GostPrivateKeys.decode(e.primary);this.masks=l.GostPrivateMasks.decode(e.masks);if(e.primary2&&e.masks2){this.primary2=l.GostPrivateKeys.decode(e.primary2);this.masks2=l.GostPrivateMasks.decode(e.masks2)}}}extend(Object,CryptoProKeyContainer,function(){function isKeySize512(e){return e.name.indexOf("-512")>=0||e.length===512}function isVersion2012(e){return!(e.name.indexOf("-94")>=0||e.name.indexOf("-2001")>=0||e.version===1994||e.version===2001)}function derivePasswordKey(e,t,r){var n=isVersion2012(e)?"GOST R 34.11-256":"GOST R 34.11-94/"+(e.sBox||"D-A"),i={name:"CPKDF",hash:n,salt:r,iterations:t?2e3:2};return p.importKey("raw",passwordData(i,t),i,false,["deriveKey","deriveBits"]).then(function(e){return p.deriveKey(i,e,"GOST 28147",false,["sign","verify","encrypt","decrypt"])})}function computePasswordMAC(e,t,r){var n=expand({name:"GOST 28147-MAC"},e.encParams);return derivePasswordKey(e,t,r).then(function(e){return p.sign(n,e,new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]))})}function computeContainerMAC(e,t){var r=expand({name:"GOST 28147-MAC"},e.encParams),n=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);return p.importKey("raw",n,r,false,["sign"]).then(function(e){return p.sign(r,e,t.encode())})}function computeMaskMAC(e,t,r){var n=expand({name:"GOST 28147-MAC"},e.encParams),i=t.byteLength===64?new Uint8Array(new Uint8Array(t,32,32)).buffer:t;return p.importKey("raw",i,n,false,["sign"]).then(function(e){return p.sign(n,e,r)})}function generateMasks(e){var t=expand(e,{mode:"MASK"}),r,n=getSeed(12);t.name=t.name.replace("-DH","");return p.generateKey(t,true,["wrapKey","unwrapKey"]).then(function(e){return p.exportKey("raw",e)}).then(function(t){r=t;return computeMaskMAC(e,r,n)}).then(function(e){return new l.GostPrivateMasks({mask:r,randomStatus:n,hmacRandom:e})})}function computeFP(e){return p.generateKey(expand(e.algorithm,{ukm:e.buffer}),true,["sign","verify"]).then(function(e){return new Uint8Array(new Uint8Array(e.publicKey.buffer,0,8)).buffer})}function unwrapKey(e,t,r,n,i){var a={name:"GOST 28147-ECB",sBox:e.encParams&&e.encParams.sBox},o=expand(e,{mode:"MASK"}),s;o.name=o.name.replace("-DH","");var f;return p.decrypt(a,t,r).then(function(e){f=e;return p.importKey("raw",n,o,"false",["sign","unwrapKey"])}).then(function(t){return p.unwrapKey("raw",f,t,o,e,"true",["sign"])}).then(function(e){s=e;return computeFP(s)}).then(function(e){if(!equalBuffers(e,i))throw new Error("Incorrect fp");return s})}function wrapKey(e,t,r,n){var i={name:"GOST 28147-ECB",sBox:e.encParams&&e.encParams.sBox},a=expand(e,{mode:"MASK"});a.name=a.name.replace("-DH","");return p.importKey("raw",n,a,false,["sign","wrapKey"]).then(function(e){return p.wrapKey("raw",r,e,a)}).then(function(e){return p.encrypt(i,t,e)})}function decryptKey(e,t,r,n,i){var a=e.primaryPrivateKeyParameters.privateKeyAlgorithm;return new Promise(call).then(function(){if(t.hmacKey)throw new Error("Old key format");if(r.randomStatus.byteLength<12)throw new Error("Invalid random status length");return computeMaskMAC(a,r.mask,r.randomStatus)}).then(function(e){if(!equalBuffers(e,r.hmacRandom))throw new Error("Imita for mask is invalid");return derivePasswordKey(a,n,new Uint8Array(r.randomStatus,0,12))}).then(function(n){return i&&t.secondaryKey?unwrapKey(e.secondaryPrivateKeyParameters.privateKeyAlgorithm,n,t.secondaryKey,r.mask,e.secondaryFP):unwrapKey(a,n,t.primaryKey,r.mask,e.primaryFP)})}function encryptKey(e,t,r,n,i,a){return derivePasswordKey(e,n,new Uint8Array(r.randomStatus,0,12)).then(function(t){return wrapKey(e,t,a,r.mask)}).then(function(e){if(!t)t=new l.GostPrivateKeys;if(i){t.secondaryKey=e}else{t.primaryKey=e}return t})}return{getKey:function getKey(e,t){return this.getPrivateKey(e,t).then(function(e){return(new PKCS8).setPrivateKey(e)})},getPrivateKey:function getPrivateKey(e,t){var r=this,n=r.header.keyContainerContent;return decryptKey(n,r.primary,r.masks,e,t)["catch"](function(i){if(r.primary2&&r.masks2)return decryptKey(n,r.primary2,r.masks2,e,t);else throw i})},getCertificate:function getCertificate(e){var t=this,r=t.header.keyContainerContent;return new Promise(call).then(function(){if(e)return new v.X509(r.secondaryCertificate);else return new v.X509(r.primaryCertificate)})},getContainerName:function getContainerName(){return this.name.containerName},setKey:function setKey(e,t,r,n){var i=this;return new PKCS8(e).getPrivateKey().then(function(e){return i.setPrivateKey(e,t,r,n)})},setPrivateKey:function setPrivateKey(e,t,r,n){var i=this,a,o;return new Promise(call).then(function(){i.header=i.header||new l.GostKeyContainer({keyContainerContent:{containerAlgoritmIdentifier:{algorithm:"id-CryptoPro-GostPrivateKeys-V2-Full"},attributes:["kccaReservePrimary","kccaPrimaryKeyAbsent"],extensions:{keyValidity:{notAfter:now(n||b.days)}}}});a=i.header.keyContainerContent;var t=r?a.secondaryPrivateKeyParameters:a.primaryPrivateKeyParameters;if(!t){o=expand(e.algorithm,{sBox:"D-A",encParams:{block:"CFB",sBox:"E-A",keyMeshing:"CP"}});t={attributes:["pkaExportable","pkaExchange","pkaDhAllowed"],privateKeyAlgorithm:o};if(r){if(!a.primaryPrivateKeyParameters)throw new Error("Primary key must be defined first");a.secondaryPrivateKeyParameters=t}else{a.primaryPrivateKeyParameters=t;var s=a.attributes.indexOf("kccaPrimaryKeyAbsent");if(s>=0)a.attributes.splice(s,1)}}else o=t.privateKeyAlgorithm;var f=[];[0,1].forEach(function(e){var t="masks"+(e>0?"2":"");if(!i[t])f.push(generateMasks(o).then(function(e){i[t]=e}))});return Promise.all(f)}).then(function(){var n=[];[0,1].forEach(function(a){var s="primary"+(a>0?"2":""),f="masks"+(a>0?"2":"");n.push(encryptKey(o,i[s],i[f],t,r,e).then(function(e){i[s]=e}))});return Promise.all(n)}).then(function(){return computeFP(e).then(function(e){if(r)a.secondaryFP=e;else a.primaryFP=e})}).then(function(){var e=a.attributes.indexOf("kccaSoftPassword");if(t){if(e<0)a.attributes.push("kccaSoftPassword");return computePasswordMAC(o,t,a.primaryFP)}else{if(e>=0)a.attributes.splice(e,1)}}).then(function(e){if(e)a.hmacPassword=e;return computeContainerMAC(o,a)}).then(function(e){i.header.hmacKeyContainerContent=e;return i})},setCertificate:function setCertificate(e,t,r){var n=this,i,a;return new Promise(call).then(function(){n.header=n.header||new l.GostKeyContainer({keyContainerContent:{containerAlgoritmIdentifier:{algorithm:"id-CryptoPro-GostPrivateKeys-V2-Full"},attributes:["kccaReservePrimary","kccaPrimaryKeyAbsent"],extensions:{keyValidity:{notAfter:now(r||b.days)}}}});i=n.header.keyContainerContent;e=new v.X509(e);a=i.primaryPrivateKeyParameters&&i.primaryPrivateKeyParameters.privateKeyAlgorithm||expand(e.subjectPublicKeyInfo.algorithm,{sBox:"D-A",encParams:{block:"CFB",sBox:"E-A",keyMeshing:"CP"}});return e.getPublicKey()}).then(function(r){if(t){if(i.secondaryFP&&!equalBuffers(i.secondaryFP,new Uint8Array(r.buffer,0,i.secondaryFP.byteLength)))throw new Error("The public key of the certificate does not match the private key");i.secondaryCertificate=e}else{if(i.primaryFP&&!equalBuffers(i.primaryFP,new Uint8Array(r.buffer,0,i.primaryFP.byteLength)))throw new Error("The public key of the certificate does not match the private key");i.primaryCertificate=e}return computeContainerMAC(a,i)}).then(function(e){n.header.hmacKeyContainerContent=e;return n})},setContainerName:function setContainerName(e){this.name=new l.GostKeyContainerName({containerName:e})},verify:function verify(e){var t=this,r,n;return new Promise(call).then(function(){r=t.header.keyContainerContent;n=r.primaryPrivateKeyParameters.privateKeyAlgorithm;return computeContainerMAC(n,r)}).then(function(i){if(!equalBuffers(i,t.header.hmacKeyContainerContent))throw new Error("Container is not valid.");var a=r.attributes.indexOf("kccaSoftPassword")>=0;if(!e&&a)throw new Error("Password is required");if(e&&!a)throw new Error("Password is not reqiured.");if(e)return computePasswordMAC(n,e,r.primaryFP).then(function(e){if(!equalBuffers(e,r.hmacPassword))throw new Error("Password is not valid.");return t});return t})},changePassword:function changePassword(e,t){var r=this,n;return new Promise(call).then(function(){n=r.header.keyContainerContent;if(!n.primaryPrivateKeyParameters)throw new Error("Private key not yet defined");return r.getPrivateKey(e).then(function(e){return r.setPrivateKey(e,t)})}).then(function(){if(n.secondaryPrivateKeyParameters)return r.getPrivateKey(e,true).then(function(e){return r.setPrivateKey(e,t,true)});return r})},generate:function generate(e,t,r){var n=this,i,a;return new Promise(call).then(function(){if(!(e instanceof v.Request))e=new v.Request(e);return e.generate(r)}).then(function(e){a=e;return n.setKey(a,t)}).then(function(){i=new v.X509(e);return i.sign(a)}).then(function(){return n.setCertificate(i)}).then(function(){return e})},encode:function encode(e){return{header:this.header.encode(e),name:this.name.encode(e),masks:this.masks.encode(e),primary:this.primary.encode(e),masks2:this.masks2.encode(e),primary2:this.primary2.encode(e)}}}}());GostKeys.prototype.CryptoProKeyContainer=CryptoProKeyContainer;function ViPNetContainerEntry(e){l.ViPNetInfo.call(this,e||{version:3,keyInfo:{keyClass:1,keyType:43556,flags:1},defenceKeyInfo:{keyClass:1024,keyType:24622,keyUID:getSeed(32),flags:-2147483648}})}extend(l.ViPNetInfo,ViPNetContainerEntry,function(){function getKeyPassword(e){if(e===undefined)e="";var t=d.Chars.decode(e,"win1251"),r;return p.digest("GOST R 34.11-94",t).then(function(e){r=e;var n=new Uint8Array(t.byteLength+r.byteLength);n.set(new Uint8Array(t),0);n.set(new Uint8Array(r),t.byteLength);return p.digest("GOST R 34.11-94",n)}).then(function(e){return p.importKey("raw",e,"GOST 28147",false,["unwrapKey"])}).then(function(e){return p.unwrapKey("raw",r,e,"GOST 28147-MASK/VN","GOST 28147-89","false",["encrypt","decrypt","sign","verify"])})}return{getPrivateKey:function getPrivateKey(e){var t=this,r,n;return new Promise(call).then(function(){return!e||typeof e==="string"?getKeyPassword(e):e}).then(function(i){e=i;r=t.keyPart;n=new Uint8Array(r,0,r.byteLength-4-8);var a=new Uint8Array(r,n.byteLength,4),o=t.keyInfo.encode(),s=new Uint8Array(n.byteLength+o.byteLength);s.set(new Uint8Array(n),0);s.set(new Uint8Array(o),n.byteLength);return p.verify({name:"GOST 28147-89-MAC"},e,a,s)}).then(function(t){if(!t)throw new Error("Invalid key password");var i=new Uint8Array(r,r.byteLength-8,8);return p.decrypt({name:"GOST 28147-89-CFB",iv:i},e,n)}).then(function(e){var r=e.byteLength/2;if(t.keyInfo.keyClass&3===0){return p.importKey("raw",new Int32Array(e,r,r),"GOST 28147",false,["unwrapKey"]).then(function(t){return p.unwrapKey("raw",new Int32Array(e,0,r),t,"GOST 28147-MASK/VN","GOST 28147-89","false",["encrypt","decrypt","sign","verify"])})}else{var n=t.keyInfo.algorithm||t.certificate&&t.certificate.subjectPublicKeyInfo.algorithm;if(!n)throw new Error("Algorithm is not specified");var i=expand(n,{mode:"MASK",procreator:"VN"});i.name=i.name.replace("-DH","");var a=new Uint8Array(e,0,r),o=new Uint8Array(e,r,r);return p.importKey("raw",o,i,"false",["sign","unwrapKey"]).then(function(e){return p.unwrapKey("raw",a,e,i,n,"true",["sign","deriveBits","deriveKey"])}).then(function(e){if(t.publicKey)return p.generateKey(expand(e.algorithm,{ukm:e.buffer}),e.extractable,e.usages);else return{privateKey:e}}).then(function(e){if(t.publicKey&&!equalBuffers(e.publicKey.buffer,t.publicKey))throw new Error("Check public key failed");return e.privateKey})}})},setPrivateKey:function setPrivateKey(e,t,r){var n=this,i,a,o,s;return new Promise(call).then(function(){return!t||typeof t==="string"?getKeyPassword(t):t}).then(function(a){t=a;var o=e.algorithm;n.keyInfo.algorithm=o;n.keyInfo.serialNumber=getSeed(16);n.keyInfo.keyUID=getSeed(8);n.keyInfo.validity={notBefore:today(),notAfter:today(r||b.days)};if(e.type==="private"){i=expand(o,{mode:"MASK",procreator:"VN"});i.name=i.name.replace("-DH","");n.keyInfo.keyClass=1;n.keyInfo.keyType=43556;return p.generateKey(expand(o,{ukm:e.buffer}),true,["sign","verify"]).then(function(e){n.publicKey=e.publicKey.buffer;if(n.certificate){var t=n.certificate.subjectPublicKeyInfo;return p.importKey("spki",t.encode(),t.algorithm,true,["verify"])}}).then(function(e){if(e&&!equalBuffers(e.buffer,n.publicKey))delete n.certificate})}else if(e.type==="secret"){i="GOST 28147/MASK/VN";delete n.certificate;delete n.publicKey;n.keyInfo.keyClass=64;n.keyInfo.keyType=24622}else throw new Error("Invalid key type")}).then(function(){return p.generateKey(i,true,["wrapKey","unwrapKey"])}).then(function(t){a=t;return p.wrapKey("raw",e,a,i)}).then(function(e){o=new Uint8Array(e.byteLength*2);o.set(new Uint8Array(e));return p.exportKey("raw",a)}).then(function(e){o.set(new Uint8Array(e),e.byteLength);s=new Uint8Array(o.byteLength+12);var r={name:"GOST 28147-CFB",iv:getSeed(8)};s.set(new Uint8Array(r.iv),s.byteLength-8);return p.encrypt(r,t,o)}).then(function(e){s.set(new Uint8Array(e));var r=n.keyInfo.encode(),i=new Uint8Array(e.byteLength+r.byteLength);i.set(new Uint8Array(e),0);i.set(new Uint8Array(r),e.byteLength);return p.sign({name:"GOST 28147-89-MAC"},t,i)}).then(function(e){s.set(new Uint8Array(e),s.byteLength-12);n.keyPart=s.buffer;return n})},encode:function encode(e){var t=l.ViPNetInfo.method("encode").call(this),r=new Uint8Array(8+t.byteLength+this.keyPart.byteLength);set32(r.buffer,0,4+t.byteLength+this.keyPart.byteLength);r.set(new Uint8Array(t),4);set32(r.buffer,4+t.byteLength,this.keyPart.byteLength);r.set(new Uint8Array(this.keyPart),8+t.byteLength);if(e==="PEM")return d.Base64.encode(r.buffer);return r.buffer}}}(),{decode:function decode(e){if(typeof e==="string")e=d.Base64.decode(e);e=buffer(e);var t=get32(e,0);if(e.byteLength!==t+4)throw new Error("Invalid container entry size");var r=d.BER.decode(new Uint8Array(e,4,t));var n=l.ViPNetInfo.decode.call(this,r);var i=r.header.byteLength+r.content.byteLength,a=get32(e,4+i);if(e.byteLength!==i+a+8)throw new Error("Invalid container key part size");n.keyPart=new Uint8Array(new Uint8Array(e,i+8,a)).buffer;return n}});GostKeys.prototype.ViPNetContainerEntry=ViPNetContainerEntry;function ViPNetContainer(e){if(e&&(e instanceof u||e.buffer instanceof u||typeof e==="string"))this.decode(e);else{e=e||{};this.fileType=e.fileType||"ITCS";this.fileVersion=e.fileVersion||16;if(e.applicationHeader)this.applicationHeader=e.applicationHeader;this.entries=e.entries||[]}}extend(Object,ViPNetContainer,{getCertificate:function getCertificate(e){var t=this;return new Promise(call).then(function(){var r=t.entries[e||0];if(!r)throw new Error("Entry not defined");if(r.certificate)return new v.X509(r.certificate)})},getKey:function getKey(e,t){return this.getPrivateKey(e,t).then(function(e){return(new PKCS8).setPrivateKey(e)})},getPrivateKey:function getPrivateKey(e,t){var r=this;return new Promise(call).then(function(){var n=r.entries[t||0];if(!n)throw new Error("Entry not defined");return n.getPrivateKey(e)})},setCertificate:function setCertificate(e,t){var r=this,n,e;return new Promise(call).then(function(){n=r.entries[t||0]||(r.entries[t||0]=new ViPNetContainerEntry);e=new v.X509(e);if(n.publicKey)return e.getPublicKey()}).then(function(t){if(t&&!equalBuffers(n.publicKey,t.buffer))throw new Error("Invalid certificate for private key");n.certificate=e;return r})},setKey:function setKey(e,t,r,n){var i=this;return new PKCS8(e).getPrivateKey().then(function(e){return i.setPrivateKey(e,t,r,n)})},setPrivateKey:function setPrivateKey(e,t,r,n){var i=this;return new Promise(call).then(function(){var a=i.entries[r||0]||(i.entries[r||0]=new ViPNetContainerEntry);return a.setPrivateKey(e,t,n)}).then(function(){return i})},changePassword:function changePassword(e,t){var r=this;return new Promise(call).then(function(){return r.getPrivateKey(e).then(function(e){return r.setPrivateKey(e,t)})})},generate:function generate(e,t,r){var n=this,i,a;return new Promise(call).then(function(){if(!(e instanceof v.Request))e=new v.Request(e);return e.generate(r)}).then(function(e){a=e;return n.setKey(a,t)}).then(function(){i=new v.X509(e);return i.sign(a)}).then(function(){return n.setCertificate(i)}).then(function(){return e})},encode:function encode(e){var t=[],r=0;this.entries.forEach(function(e){var n=e.encode();r+=n.byteLength;t.push(n)});var n=this.applicationHeader?this.applicationHeader.byteLength:0,i=new Uint8Array(12+n+r);i.set(new Uint8Array(d.Chars.decode(this.fileType,"ascii")));set32(i.buffer,4,this.fileVersion);set32(i.buffer,8,n);if(n>0)i.set(new Uint8Array(this.applicationHeader),12);var a=12+n;t.forEach(function(e){i.set(new Uint8Array(e),a);a+=e.byteLength});if(e==="PEM")return d.Base64.encode(i.buffer);return i.buffer},decode:function decode(e){e=this.constructor.decode(e);this.fileType=e.fileType;this.fileVersion=e.fileVersion;if(e.applicationHeader)this.applicationHeader=e.applicationHeader;this.entries=e.entries}},{encode:function encode(e,t){return new this(e).encode(t)},decode:function decode(e){if(typeof e==="string")e=d.Base64.decode(e);e=buffer(e);var t=d.Chars.encode(new Uint8Array(e,0,4),"ascii");if(t!=="ITCS"&&t!=="PKEY"&&t!=="_CCK"&&t!=="_LCK")throw new Error("Unsupported ViPNet container type");var r=get32(e,4),n=r>>>16,i=r&65535;if(n!==0&&n!==1||i>255)throw new Error("Unsupported ViPNet container version");var a=get32(e,8),o;if(a>0)o=buffer(new Uint8Array(e,12,a));var s=12+a,f=[];while(s<e.byteLength){var c=get32(e,s);f.push(ViPNetContainerEntry.decode(new Uint8Array(e,s,c+4)));s=s+c+4}return new ViPNetContainer({fileType:t,fileVersion:r,applicationHeader:o,entries:f})}});GostKeys.prototype.ViPNetContainer=ViPNetContainer;function PKCS12(e){l.PFX.call(this,e||{version:3,authSafe:{contentType:"data"}})}extend(l.PFX,PKCS12,function(){function calcHMAC(e,t,r){var n={name:"HMAC",hash:e.hash};return p.importKey("raw",passwordData(e,t),e,false,["deriveKey"]).then(function(t){return p.deriveKey(e,t,n,false,["sign"])}).then(function(e){return p.sign(n,e,r)})}function verifyHMAC(e,t,r,n){return calcHMAC(e,t,n).then(function(e){if(!equalBuffers(r,e))throw new Error("Invalid password, MAC is not verified")})}return{sign:function sign(e,t){var r=this;return new Promise(call).then(function(){if(e){var n,i,a;if(t)a=h[t];else t=h[b.providerName].digest;if(a){n=a.digest;i=a.derivation}else{n=t;i={name:"PFXKDF",hash:n,iterations:2e3}}i=expand(i,{salt:getSeed(saltSize(n)),diversifier:3});var o=r.authSafe.content;return calcHMAC(i,e,o).then(function(e){r.macData={mac:{digestAlgorithm:n,digest:e},macSalt:i.salt,iterations:i.iterations};return r})}else return r})},verify:function verify(e){var t=this,r=t.authSafe,n;return new Promise(call).then(function(){if(r.contentType==="data"){if(t.macData){if(!e)throw new Error("Password must be defined for the MAC verification");n={name:"PFXKDF",hash:t.macData.mac.digestAlgorithm,salt:t.macData.macSalt,iterations:t.macData.iterations,diversifier:3};var i=t.authSafe.content,a=t.macData.mac.digest;return verifyHMAC(n,e,a,i)["catch"](function(){n.name="PBKDF2";return verifyHMAC(n,e,a,i)})}}else throw new Error("Unsupported format")}).then(function(){return t})}}}());GostKeys.prototype.PKCS12=PKCS12;function KeyStore(e){this.entries={};if(e)for(var t in e){this.setEntry(t,e[t])}}extend(Object,KeyStore,{aliases:function aliases(){var e=[];for(var t in this.entries){e.push(t)}return e},containsAlias:function containsAlias(e){return!!this.entries[e]},deleteEntry:function deleteEntry(e){delete this.entries[e]},setEntry:function setEntry(e,t){var r={};if(t.key){try{r.key=new PKCS8(t.key,true)}catch(e){try{r.key=new PKCS8Encrypted(t.key,true)}catch(e){if(t.key instanceof u)r.key=t.key;else throw new Error("Unknown Key format")}}}if(t.certs){var n=t.certs instanceof Array?t.certs:[t.certs];for(var i=0;i<n.length;i++){try{n[i]=new v.X509(n[i])}catch(e){}}r.certs=n}if(t.crls){var a=t.crls instanceof Array?t.crls:[t.crls];for(var i=0;i<a.length;i++){try{a[i]=new v.CRL(a[i])}catch(e){}}r.crls=a}this.entries[e]=r},getEntry:function getEntry(e){return this.entries[e]},load:function load(e,t){var r=this;return new Promise(call).then(function(){e=new PKCS12(e);return e.verify(t)}).then(function(){if(e.authSafe.contentType!=="data")throw new Error("Unsupported PFX format");var r=l.AuthenticatedSafe.decode(e.authSafe.content).object,n=[];r.forEach(function(e){if(e.contentType==="data")n.push(new y.DataContentInfo(e));else if(e.contentType==="encryptedData")n.push(new y.EncryptedDataContentInfo(e).getEnclosed(t));else throw new Error("Unsupported PFX format")});return Promise.all(n)}).then(function(e){var r={};e.forEach(function(e){var t=l.SafeContents.decode(e.content).object;t.forEach(function(e){var t=d.Hex.encode(e.bagAttributes&&e.bagAttributes.localKeyId||getSeed(4),true),n=r[t]||(r[t]={});switch(e.bagId){case"keyBag":n.key=new PKCS8(e.bagValue);break;case"pkcs8ShroudedKeyBag":n.key=new PKCS8Encrypted(e.bagValue);break;case"secretBag":if(e.bagValue.secretTypeId==="secret")n.key=e.bagValue.secretValue;break;case"certBag":var i=n.certs||(n.certs=[]);if(e.bagValue.certId==="x509Certificate")i.push(new v.X509(e.bagValue.certValue));break;case"crlBag":var a=n.crls||(n.crls=[]);if(e.bagValue.crlId==="x509CRL")a.push(new v.CRL(e.bagValue.crlValue));break}if(e.bagAttributes&&e.bagAttributes.friendlyName)n.friendlyName=e.bagAttributes.friendlyName})});var n=[];for(var i in r){n.push(function(e){if(e.key instanceof PKCS8Encrypted)return e.key.getKey(t).then(function(t){e.key=t;return e})["catch"](function(){return e});else return e}(r[i]))}return Promise.all(n)}).then(function(e){e.forEach(function(e){var t=e.friendlyName;if(t){delete e.friendlyName;r.entries[t]=e}else r.entries[generateUUID()]=e});return r})},store:function store(e,t,r){var n=this,i=[],a=[],o=[];return new Promise(call).then(function(){if(r)r=h[r]?h[r].pbes:r;else if(t)r=h[t]?h[t].pbes:h[b.providerName].pbes;else r=h[b.providerName].pbes;var o=1;for(var s in n.entries){var f=new Uint32Array([o]),c=n.entries[s];if(c.key){(function(t,n){if(t instanceof u)a.push({bagId:"secretBag",bagValue:{secretTypeId:"secret",secretValue:t,bagAttributes:n}});else if(t instanceof PKCS8){if(r&&e)i.push((new PKCS8Encrypted).setKey(t,e,r).then(function(e){return{bagId:"pkcs8ShroudedKeyBag",bagValue:e,bagAttributes:n}}));else i.push({bagId:"keyBag",bagValue:t,bagAttributes:n})}else if(t instanceof PKCS8Encrypted)i.push({bagId:"pkcs8ShroudedKeyBag",bagValue:t,bagAttributes:n})})(c.key,{localKeyId:f,friendlyName:s})}if(c.certs){c.certs.forEach(function(e){var t={localKeyId:f};if(e instanceof v.X509)a.push({bagId:"certBag",bagValue:{certId:"x509Certificate",certValue:e},bagAttributes:t})})}if(c.crls){c.crls.forEach(function(e){var t={localKeyId:f};if(e instanceof v.CRL)a.push({bagId:"crlBag",bagValue:{crlId:"x509CRL",crlValue:e},bagAttributes:t})})}}if(i.length>0)return Promise.all(i)}).then(function(t){if(t){var n=l.SafeContents.encode(t);o.push(new y.DataContentInfo({contentType:"data",content:n}))}if(a.length>0){a=l.SafeContents.encode(a);if(r&&e)return(new y.EncryptedDataContentInfo).encloseContent(a,e,r);else return(new y.DataContentInfo).encloseContent(a)}}).then(function(r){o.push(r);o=new l.AuthenticatedSafe(o);var n=new PKCS12;n.authSafe={contentType:"data",content:o.encode()};return n.sign(e,t)})}});GostKeys.prototype.KeyStore=KeyStore;var m=t.gostKeysInstance=new GostKeys},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});var n=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol==="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.expand=expand;function expand(){var e={};for(var t=0,r=arguments.length;t<r;t++){var i=arguments[t];if((typeof i==="undefined"?"undefined":n(i))==="object")for(var a in i){e[a]=i[a]}}return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.GostEngine=t.CryptoGost=undefined;var n=r(173);var i=r(82);t.CryptoGost=n.gostCrypto;t.GostEngine=i.gostEngine}])});
//# sourceMappingURL=CryptoGost.min.js.map