secret-sharing.js
Version:
Shamir's Secret Sharing Scheme for javascript - https://www.virtualcapitalofamerica.com
2 lines • 45.6 kB
JavaScript
/*! secret-sharing.js - v1.3.0 - 2018-04-05 */
var _0x1889=["encrypt","ccm: invalid tag length","bug","ccm: can't deal with 4GiB or more data","ocb2","ocb iv must be 128 bits","pmac","decrypt","ocb: tag doesn't match","gcm","corrupt","gcm: tag doesn't match","misc","hmac","blockSize","update","mac","encrypt on already updated hmac called!","digest","finalize","prng","isReady","random","number","object","seeded","progress","getProgress","valueOf","addEventListener","load","mousemove","keypress","devicemotion","accelerometerCollector","touchmove","touchCollector","attachEvent","onload","loadTimeCollector","onmousemove","removeEventListener","detachEvent","mouseCollector","keyboardCollector","offsetX","offsetY","addEntropy","changedTouches","clientX","pageY","accelerationIncludingGravity","orientation","hasOwnProperty","performance","function","now","loadtime","apply","crypto","randomBytes","crypto['randomBytes']","getRandomValues","msCrypto","crypto['getRandomValues']","console","log","There was an error collecting entropy from the browser:","json","defaults","adata","salt","json encrypt: invalid parameters","key","ecc","elGamal","kem","kemtag","arrayBuffer","encode","json decrypt: invalid parameters","cachedPbkdf2","secretKey","unkem","match","json encode: invalid property name","boolean","json encode: unsupported type","split","json decode: this isn't json!","true","required parameter overridden","iter","randomWords","firstSalt","pbkdf2","exports","secrets","join","nodeCryptoRandomBytes","browserSJCLRandom","rng","Padding must be multiples of no larger than 1024 bits.","bits","Invalid hex character.","Invalid binary character.","abs","testRandom","typeCSPRNG","browserCryptoGetRandomValues","logs","exps","maxShares","radix","toUpperCase","Share id must be an integer between 1 and ","minBits","maxBits","Number of bits must be an integer between ",", inclusive.","Invalid RNG type argument : '","size","primitivePolynomials","setRNG","startCollectors","seedRNG","Initialization failed.","cryptoGetRandomValues","cryptoRandomBytes","extractShareComponents","Mismatched shares: Different bit settings.","init","Invalid share : Number of bits must be an integer between ","^([a-kA-K3-9]{1})([a-fA-F0-9]{","})([a-fA-F0-9]+)$","exec","The share data provided is invalid : ","Random number generator is invalid "," Supply an CSPRNG of the form function(bits){} that returns a string containing 'bits' number of random 1's and 0's.","(Not a function).","(Output is not a string).","(Binary string output not parseable to an Integer).","(Output length is greater than config.bits).","(Output length is less than config.bits).","bytesPerChar","maxBytesPerChar","Bytes per character must be an integer between 1 and ","). Maximum allowable is 256^bytes-1 (","). To convert this character, use at least "," bytes.","Input must be a hexadecimal string.","Number of bits must be an Integer between 1 and 65536.","SJCL isn't finished seeding the RNG yet. Needs new entropy added or more mouse movement.","Number of shares must be an integer between 2 and 2^bits-1 (","LN2","), inclusive. To create "," shares, use at least ","Threshold number of shares must be an integer between 2 and 2^bits-1 (","), inclusive.","), inclusive. To use a threshold of ",", use at least "," bits.","Threshold number of shares was "," shares specified as the total to generate.","Zero-pad length must be an integer between 0 and 1024 inclusive.","Invalid 'id' or 'shares' Array argument to newShare().","toString","CORRUPT: ","message","INVALID: ","NOT READY: ","cipher","exception","invalid aes key size","slice","aes","prototype","invalid aes block size","length","bitArray","clamp","floor","concat","getPartial","ceil","bitLength","push","partial","pop","codec","utf8String","fromCharCode","charCodeAt","hex","substr","replace","0123456789ABCDEFGHIJKLMNOPQRSTUV","base32","BASE","REMAINING","charAt","base32hex","indexOf","toBits","invalid","this isn't ","fromBits","base64","ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/","base64url","hash","sha256","reset","string","undefined","subarray","splice","pow","ccm","mode","ccm: iv must be at least 7 bytes","bitSlice","data","equal","tag","ccm: tag doesn't match"];!function(t,x){!function(x){for(;--x;)t.push(t.shift())}(++x)}(_0x1889,166);var _0x9188=function(x,t){return _0x1889[x-=0]},sjcl={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(x){this[_0x9188("0x0")]=function(){return _0x9188("0x1")+this.message},this[_0x9188("0x2")]=x},invalid:function(x){this[_0x9188("0x0")]=function(){return _0x9188("0x3")+this[_0x9188("0x2")]},this[_0x9188("0x2")]=x},bug:function(x){this[_0x9188("0x0")]=function(){return"BUG: "+this[_0x9188("0x2")]},this[_0x9188("0x2")]=x},notReady:function(x){this.toString=function(){return _0x9188("0x4")+this[_0x9188("0x2")]},this[_0x9188("0x2")]=x}}};function t(x,t,e){if(4!==t.length)throw new(sjcl[_0x9188("0x6")].invalid)(_0x9188("0xb"));var r=x.b[e],n=t[0]^r[0],_=t[e?3:1]^r[1],i=t[2]^r[2];t=t[e?1:3]^r[3];var s,o,c,a,f=r[_0x9188("0xc")]/4-2,l=4,h=[0,0,0,0];x=(s=x.s[e])[0];var u=s[1],d=s[2],p=s[3],w=s[4];for(a=0;a<f;a++)s=x[n>>>24]^u[_>>16&255]^d[i>>8&255]^p[255&t]^r[l],o=x[_>>>24]^u[i>>16&255]^d[t>>8&255]^p[255&n]^r[l+1],c=x[i>>>24]^u[t>>16&255]^d[n>>8&255]^p[255&_]^r[l+2],t=x[t>>>24]^u[n>>16&255]^d[_>>8&255]^p[255&i]^r[l+3],l+=4,n=s,_=o,i=c;for(a=0;a<4;a++)h[e?3&-a:a]=w[n>>>24]<<24^w[_>>16&255]<<16^w[i>>8&255]<<8^w[255&t]^r[l++],s=n,n=_,_=i,i=t,t=s;return h}function u(x,t){var e,r,n,_=x.F,i=x.b,s=_[0],o=_[1],c=_[2],a=_[3],f=_[4],l=_[5],h=_[6],u=_[7];for(e=0;e<64;e++)e<16?r=t[e]:(r=t[e+1&15],n=t[e+14&15],r=t[15&e]=(r>>>7^r>>>18^r>>>3^r<<25^r<<14)+(n>>>17^n>>>19^n>>>10^n<<15^n<<13)+t[15&e]+t[e+9&15]|0),r=r+u+(f>>>6^f>>>11^f>>>25^f<<26^f<<21^f<<7)+(h^f&(l^h))+i[e],u=h,h=l,l=f,f=a+r|0,a=c,c=o,s=r+((o=s)&c^a&(o^c))+(o>>>2^o>>>13^o>>>22^o<<30^o<<19^o<<10)|0;_[0]=_[0]+s|0,_[1]=_[1]+o|0,_[2]=_[2]+c|0,_[3]=_[3]+a|0,_[4]=_[4]+f|0,_[5]=_[5]+l|0,_[6]=_[6]+h|0,_[7]=_[7]+u|0}function A(x,t){var e,r=sjcl.random.K[x],n=[];for(e in r)r[_0x9188("0x71")](e)&&n[_0x9188("0x14")](r[e]);for(e=0;e<n[_0x9188("0xc")];e++)n[e](t)}function C(x,t){"undefined"!=typeof window&&window[_0x9188("0x72")]&&_0x9188("0x73")===typeof window[_0x9188("0x72")].now?x[_0x9188("0x6b")](window[_0x9188("0x72")][_0x9188("0x74")](),t,"loadtime"):x[_0x9188("0x6b")]((new Date)[_0x9188("0x58")](),t,_0x9188("0x75"))}function y(x){x.b=z(x)[_0x9188("0x10")](z(x)),x.L=new(sjcl[_0x9188("0x5")].aes)(x.b)}function z(x){for(var t=0;t<4&&(x.h[t]=x.h[t]+1|0,!x.h[t]);t++);return x.L[_0x9188("0x3c")](x.h)}function B(x,t){return function(){t[_0x9188("0x76")](x,arguments)}}sjcl[_0x9188("0x5")].aes=function(x){this.s[0][0][0]||this.O();var t,e,r,n,_=this.s[0][4],i=this.s[1],s=1;if(4!==(t=x.length)&&6!==t&&8!==t)throw new(sjcl[_0x9188("0x6")].invalid)(_0x9188("0x7"));for(this.b=[r=x[_0x9188("0x8")](0),n=[]],x=t;x<4*t+28;x++)e=r[x-1],(0==x%t||8===t&&4==x%t)&&(e=_[e>>>24]<<24^_[e>>16&255]<<16^_[e>>8&255]<<8^_[255&e],0==x%t&&(e=e<<8^e>>>24^s<<24,s=s<<1^283*(s>>7))),r[x]=r[x-t]^e;for(t=0;x;t++,x--)e=r[3&t?x:x-4],n[t]=x<=4||t<4?e:i[0][_[e>>>24]]^i[1][_[e>>16&255]]^i[2][_[e>>8&255]]^i[3][_[255&e]]},sjcl[_0x9188("0x5")][_0x9188("0x9")][_0x9188("0xa")]={encrypt:function(x){return t(this,x,0)},decrypt:function(x){return t(this,x,1)},s:[[[],[],[],[],[]],[[],[],[],[],[]]],O:function(){var x,t,e,r,n,_,i,s=this.s[0],o=this.s[1],c=s[4],a=o[4],f=[],l=[];for(x=0;x<256;x++)l[(f[x]=x<<1^283*(x>>7))^x]=x;for(t=e=0;!c[t];t^=r||1,e=l[e]||1)for(_=(_=e^e<<1^e<<2^e<<3^e<<4)>>8^255&_^99,i=16843009*(n=f[x=f[r=f[a[c[t]=_]=t]]])^65537*x^257*r^16843008*t,n=257*f[_]^16843008*_,x=0;x<4;x++)s[x][t]=n=n<<24^n>>>8,o[x][_]=i=i<<24^i>>>8;for(x=0;x<5;x++)s[x]=s[x][_0x9188("0x8")](0),o[x]=o[x][_0x9188("0x8")](0)}},sjcl[_0x9188("0xd")]={bitSlice:function(x,t,e){return x=sjcl.bitArray.$(x[_0x9188("0x8")](t/32),32-(31&t))[_0x9188("0x8")](1),void 0===e?x:sjcl[_0x9188("0xd")][_0x9188("0xe")](x,e-t)},extract:function(x,t,e){var r=Math[_0x9188("0xf")](-t-e&31);return(-32&(t+e-1^t)?x[t/32|0]<<32-r^x[t/32+1|0]>>>r:x[t/32|0]>>>r)&(1<<e)-1},concat:function(x,t){if(0===x[_0x9188("0xc")]||0===t[_0x9188("0xc")])return x[_0x9188("0x10")](t);var e=x[x[_0x9188("0xc")]-1],r=sjcl[_0x9188("0xd")][_0x9188("0x11")](e);return 32===r?x.concat(t):sjcl.bitArray.$(t,r,0|e,x[_0x9188("0x8")](0,x[_0x9188("0xc")]-1))},bitLength:function(x){var t=x[_0x9188("0xc")];return 0===t?0:32*(t-1)+sjcl.bitArray[_0x9188("0x11")](x[t-1])},clamp:function(x,t){if(32*x[_0x9188("0xc")]<t)return x;var e=(x=x[_0x9188("0x8")](0,Math[_0x9188("0x12")](t/32)))[_0x9188("0xc")];return t&=31,0<e&&t&&(x[e-1]=sjcl.bitArray.partial(t,x[e-1]&2147483648>>t-1,1)),x},partial:function(x,t,e){return 32===x?t:(e?0|t:t<<32-x)+1099511627776*x},getPartial:function(x){return Math.round(x/1099511627776)||32},equal:function(x,t){if(sjcl[_0x9188("0xd")][_0x9188("0x13")](x)!==sjcl[_0x9188("0xd")][_0x9188("0x13")](t))return!1;var e,r=0;for(e=0;e<x[_0x9188("0xc")];e++)r|=x[e]^t[e];return 0===r},$:function(x,t,e,r){var n;for(void(n=0)===r&&(r=[]);32<=t;t-=32)r[_0x9188("0x14")](e),e=0;if(0===t)return r.concat(x);for(n=0;n<x[_0x9188("0xc")];n++)r.push(e|x[n]>>>t),e=x[n]<<32-t;return n=x[_0x9188("0xc")]?x[x.length-1]:0,x=sjcl[_0x9188("0xd")].getPartial(n),r[_0x9188("0x14")](sjcl.bitArray[_0x9188("0x15")](t+x&31,32<t+x?e:r[_0x9188("0x16")](),1)),r},i:function(x,t){return[x[0]^t[0],x[1]^t[1],x[2]^t[2],x[3]^t[3]]},byteswapM:function(x){var t,e;for(t=0;t<x[_0x9188("0xc")];++t)e=x[t],x[t]=e>>>24|e>>>8&65280|(65280&e)<<8|e<<24;return x}},sjcl[_0x9188("0x17")][_0x9188("0x18")]={fromBits:function(x){var t,e,r="",n=sjcl.bitArray[_0x9188("0x13")](x);for(t=0;t<n/8;t++)0==(3&t)&&(e=x[t/4]),r+=String[_0x9188("0x19")](e>>>8>>>8>>>8),e<<=8;return decodeURIComponent(escape(r))},toBits:function(x){x=unescape(encodeURIComponent(x));var t,e=[],r=0;for(t=0;t<x[_0x9188("0xc")];t++)r=r<<8|x[_0x9188("0x1a")](t),3==(3&t)&&(e.push(r),r=0);return 3&t&&e[_0x9188("0x14")](sjcl[_0x9188("0xd")][_0x9188("0x15")](8*(3&t),r)),e}},sjcl.codec[_0x9188("0x1b")]={fromBits:function(x){var t,e="";for(t=0;t<x[_0x9188("0xc")];t++)e+=(0xf00000000000+(0|x[t]))[_0x9188("0x0")](16)[_0x9188("0x1c")](4);return e.substr(0,sjcl[_0x9188("0xd")].bitLength(x)/4)},toBits:function(x){var t,e,r=[];for(e=(x=x[_0x9188("0x1d")](/\s|0x/g,""))[_0x9188("0xc")],x+="00000000",t=0;t<x[_0x9188("0xc")];t+=8)r.push(0^parseInt(x[_0x9188("0x1c")](t,8),16));return sjcl[_0x9188("0xd")][_0x9188("0xe")](r,4*e)}},sjcl.codec.base32={B:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",X:_0x9188("0x1e"),BITS:32,BASE:5,REMAINING:27,fromBits:function(x,t,e){var r=sjcl.codec[_0x9188("0x1f")][_0x9188("0x20")],n=sjcl[_0x9188("0x17")][_0x9188("0x1f")][_0x9188("0x21")],_="",i=0,s=sjcl[_0x9188("0x17")][_0x9188("0x1f")].B,o=0,c=sjcl[_0x9188("0xd")].bitLength(x);for(e&&(s=sjcl[_0x9188("0x17")].base32.X),e=0;_[_0x9188("0xc")]*r<c;)_+=s[_0x9188("0x22")]((o^x[e]>>>i)>>>n),i<r?(o=x[e]<<r-i,i+=n,e++):(o<<=r,i-=r);for(;7&_[_0x9188("0xc")]&&!t;)_+="=";return _},toBits:function(x,t){x=x[_0x9188("0x1d")](/\s|=/g,"").toUpperCase();var e,r,n=sjcl[_0x9188("0x17")][_0x9188("0x1f")].BITS,_=sjcl.codec[_0x9188("0x1f")][_0x9188("0x20")],i=sjcl.codec[_0x9188("0x1f")].REMAINING,s=[],o=0,c=sjcl.codec[_0x9188("0x1f")].B,a=0,f=_0x9188("0x1f");for(t&&(c=sjcl[_0x9188("0x17")].base32.X,f=_0x9188("0x23")),e=0;e<x[_0x9188("0xc")];e++){if((r=c[_0x9188("0x24")](x[_0x9188("0x22")](e)))<0){if(!t)try{return sjcl[_0x9188("0x17")].base32hex[_0x9188("0x25")](x)}catch(o){}throw new(sjcl[_0x9188("0x6")][_0x9188("0x26")])(_0x9188("0x27")+f+"!")}i<o?(o-=i,s[_0x9188("0x14")](a^r>>>o),a=r<<n-o):a^=r<<n-(o+=_)}return 56&o&&s[_0x9188("0x14")](sjcl[_0x9188("0xd")][_0x9188("0x15")](56&o,a,1)),s}},sjcl.codec.base32hex={fromBits:function(x,t){return sjcl[_0x9188("0x17")][_0x9188("0x1f")][_0x9188("0x28")](x,t,1)},toBits:function(x){return sjcl.codec[_0x9188("0x1f")][_0x9188("0x25")](x,1)}},sjcl[_0x9188("0x17")][_0x9188("0x29")]={B:_0x9188("0x2a"),fromBits:function(x,t,e){var r="",n=0,_=sjcl[_0x9188("0x17")][_0x9188("0x29")].B,i=0,s=sjcl[_0x9188("0xd")][_0x9188("0x13")](x);for(e&&(_=_.substr(0,62)+"-_"),e=0;6*r[_0x9188("0xc")]<s;)r+=_[_0x9188("0x22")]((i^x[e]>>>n)>>>26),n<6?(i=x[e]<<6-n,n+=26,e++):(i<<=6,n-=6);for(;3&r[_0x9188("0xc")]&&!t;)r+="=";return r},toBits:function(x,t){x=x[_0x9188("0x1d")](/\s|=/g,"");var e,r,n=[],_=0,i=sjcl[_0x9188("0x17")][_0x9188("0x29")].B,s=0;for(t&&(i=i[_0x9188("0x1c")](0,62)+"-_"),e=0;e<x.length;e++){if((r=i[_0x9188("0x24")](x[_0x9188("0x22")](e)))<0)throw new(sjcl[_0x9188("0x6")][_0x9188("0x26")])("this isn't base64!");26<_?(_-=26,n[_0x9188("0x14")](s^r>>>_),s=r<<32-_):s^=r<<32-(_+=6)}return 56&_&&n[_0x9188("0x14")](sjcl[_0x9188("0xd")][_0x9188("0x15")](56&_,s,1)),n}},sjcl[_0x9188("0x17")][_0x9188("0x2b")]={fromBits:function(x){return sjcl.codec[_0x9188("0x29")][_0x9188("0x28")](x,1,1)},toBits:function(x){return sjcl[_0x9188("0x17")][_0x9188("0x29")][_0x9188("0x25")](x,1)}},sjcl[_0x9188("0x2c")][_0x9188("0x2d")]=function(x){this.b[0]||this.O(),x?(this.F=x.F.slice(0),this.A=x.A[_0x9188("0x8")](0),this.l=x.l):this[_0x9188("0x2e")]()},sjcl[_0x9188("0x2c")][_0x9188("0x2d")].hash=function(x){return(new(sjcl[_0x9188("0x2c")][_0x9188("0x2d")])).update(x).finalize()},sjcl[_0x9188("0x2c")][_0x9188("0x2d")].prototype={blockSize:512,reset:function(){return this.F=this.Y[_0x9188("0x8")](0),this.A=[],this.l=0,this},update:function(x){_0x9188("0x2f")===typeof x&&(x=sjcl[_0x9188("0x17")].utf8String[_0x9188("0x25")](x));var t,e=this.A=sjcl[_0x9188("0xd")].concat(this.A,x);if(t=this.l,9007199254740991<(x=this.l=t+sjcl[_0x9188("0xd")].bitLength(x)))throw new(sjcl[_0x9188("0x6")].invalid)("Cannot hash more than 2^53 - 1 bits");if(_0x9188("0x30")!==typeof Uint32Array){var r=new Uint32Array(e),n=0;for(t=512+t-(512+t&511);t<=x;t+=512)u(this,r[_0x9188("0x31")](16*n,16*(n+1))),n+=1;e[_0x9188("0x32")](0,16*n)}else for(t=512+t-(512+t&511);t<=x;t+=512)u(this,e[_0x9188("0x32")](0,16));return this},finalize:function(){var x,t=this.A,e=this.F;for(x=(t=sjcl[_0x9188("0xd")].concat(t,[sjcl[_0x9188("0xd")][_0x9188("0x15")](1,1)]))[_0x9188("0xc")]+2;15&x;x++)t[_0x9188("0x14")](0);for(t[_0x9188("0x14")](Math[_0x9188("0xf")](this.l/4294967296)),t[_0x9188("0x14")](0|this.l);t[_0x9188("0xc")];)u(this,t.splice(0,16));return this[_0x9188("0x2e")](),e},Y:[],b:[],O:function(){function x(x){return 4294967296*(x-Math[_0x9188("0xf")](x))|0}for(var t,e,r=0,n=2;r<64;n++){for(e=!0,t=2;t*t<=n;t++)if(0==n%t){e=!1;break}e&&(r<8&&(this.Y[r]=x(Math[_0x9188("0x33")](n,.5))),this.b[r]=x(Math[_0x9188("0x33")](n,1/3)),r++)}}},sjcl.mode.ccm={name:_0x9188("0x34"),G:[],listenProgress:function(x){sjcl[_0x9188("0x35")][_0x9188("0x34")].G.push(x)},unListenProgress:function(x){-1<(x=sjcl.mode[_0x9188("0x34")].G[_0x9188("0x24")](x))&&sjcl[_0x9188("0x35")].ccm.G[_0x9188("0x32")](x,1)},fa:function(x){var t,e=sjcl[_0x9188("0x35")][_0x9188("0x34")].G[_0x9188("0x8")]();for(t=0;t<e[_0x9188("0xc")];t+=1)e[t](x)},encrypt:function(x,t,e,r,n){var _,i=t[_0x9188("0x8")](0),s=sjcl[_0x9188("0xd")],o=s[_0x9188("0x13")](e)/8,c=s[_0x9188("0x13")](i)/8;if(n=n||64,r=r||[],o<7)throw new(sjcl.exception[_0x9188("0x26")])(_0x9188("0x36"));for(_=2;_<4&&c>>>8*_;_++);return _<15-o&&(_=15-o),e=s[_0x9188("0xe")](e,8*(15-_)),t=sjcl[_0x9188("0x35")].ccm.V(x,t,e,r,n,_),i=sjcl.mode.ccm.C(x,i,e,t,n,_),s[_0x9188("0x10")](i.data,i.tag)},decrypt:function(x,t,e,r,n){n=n||64,r=r||[];var _=sjcl.bitArray,i=_[_0x9188("0x13")](e)/8,s=_[_0x9188("0x13")](t),o=_[_0x9188("0xe")](t,s-n),c=_[_0x9188("0x37")](t,s-n);s=(s-n)/8;if(i<7)throw new(sjcl[_0x9188("0x6")].invalid)(_0x9188("0x36"));for(t=2;t<4&&s>>>8*t;t++);if(t<15-i&&(t=15-i),e=_.clamp(e,8*(15-t)),o=sjcl[_0x9188("0x35")][_0x9188("0x34")].C(x,o,e,c,n,t),x=sjcl.mode[_0x9188("0x34")].V(x,o[_0x9188("0x38")],e,r,n,t),!_[_0x9188("0x39")](o[_0x9188("0x3a")],x))throw new sjcl.exception.corrupt(_0x9188("0x3b"));return o.data},na:function(x,t,e,r,n,_){var i=[],s=sjcl[_0x9188("0xd")],o=s.i;if(r=[s[_0x9188("0x15")](8,(t.length?64:0)|r-2<<2|_-1)],(r=s[_0x9188("0x10")](r,e))[3]|=n,r=x[_0x9188("0x3c")](r),t[_0x9188("0xc")])for((e=s[_0x9188("0x13")](t)/8)<=65279?i=[s[_0x9188("0x15")](16,e)]:e<=4294967295&&(i=s[_0x9188("0x10")]([s[_0x9188("0x15")](16,65534)],[e])),i=s[_0x9188("0x10")](i,t),t=0;t<i.length;t+=4)r=x[_0x9188("0x3c")](o(r,i.slice(t,t+4)[_0x9188("0x10")]([0,0,0])));return r},V:function(x,t,e,r,n,_){var i=sjcl[_0x9188("0xd")],s=i.i;if((n/=8)%2||n<4||16<n)throw new(sjcl[_0x9188("0x6")][_0x9188("0x26")])(_0x9188("0x3d"));if(4294967295<r[_0x9188("0xc")]||4294967295<t[_0x9188("0xc")])throw new(sjcl[_0x9188("0x6")][_0x9188("0x3e")])(_0x9188("0x3f"));for(e=sjcl.mode[_0x9188("0x34")].na(x,r,e,n,i.bitLength(t)/8,_),r=0;r<t[_0x9188("0xc")];r+=4)e=x[_0x9188("0x3c")](s(e,t.slice(r,r+4)[_0x9188("0x10")]([0,0,0])));return i[_0x9188("0xe")](e,8*n)},C:function(x,t,e,r,n,_){var i,s=sjcl[_0x9188("0xd")];i=s.i;var o=t[_0x9188("0xc")],c=s[_0x9188("0x13")](t),a=o/50,f=a;if(e=s[_0x9188("0x10")]([s.partial(8,_-1)],e).concat([0,0,0])[_0x9188("0x8")](0,4),r=s[_0x9188("0x37")](i(r,x.encrypt(e)),0,n),!o)return{tag:r,data:[]};for(i=0;i<o;i+=4)a<i&&(sjcl[_0x9188("0x35")][_0x9188("0x34")].fa(i/o),a+=f),e[3]++,n=x.encrypt(e),t[i]^=n[0],t[i+1]^=n[1],t[i+2]^=n[2],t[i+3]^=n[3];return{tag:r,data:s.clamp(t,c)}}},sjcl.mode[_0x9188("0x40")]={name:_0x9188("0x40"),encrypt:function(x,t,e,r,n,_){if(128!==sjcl.bitArray[_0x9188("0x13")](e))throw new(sjcl.exception[_0x9188("0x26")])(_0x9188("0x41"));var i,s=sjcl[_0x9188("0x35")][_0x9188("0x40")].S,o=sjcl[_0x9188("0xd")],c=o.i,a=[0,0,0,0];e=s(x.encrypt(e));var f,l=[];for(r=r||[],n=n||64,i=0;i+4<t.length;i+=4)a=c(a,f=t[_0x9188("0x8")](i,i+4)),l=l[_0x9188("0x10")](c(e,x[_0x9188("0x3c")](c(e,f)))),e=s(e);return f=t.slice(i),t=o[_0x9188("0x13")](f),i=x[_0x9188("0x3c")](c(e,[0,0,0,t])),a=c(a,c((f=o[_0x9188("0xe")](c(f[_0x9188("0x10")]([0,0,0]),i),t))[_0x9188("0x10")]([0,0,0]),i)),a=x.encrypt(c(a,c(e,s(e)))),r[_0x9188("0xc")]&&(a=c(a,_?r:sjcl[_0x9188("0x35")][_0x9188("0x40")][_0x9188("0x42")](x,r))),l.concat(o[_0x9188("0x10")](f,o[_0x9188("0xe")](a,n)))},decrypt:function(x,t,e,r,n,_){if(128!==sjcl[_0x9188("0xd")].bitLength(e))throw new(sjcl[_0x9188("0x6")][_0x9188("0x26")])("ocb iv must be 128 bits");n=n||64;var i,s,o=sjcl.mode[_0x9188("0x40")].S,c=sjcl.bitArray,a=c.i,f=[0,0,0,0],l=o(x[_0x9188("0x3c")](e)),h=sjcl[_0x9188("0xd")][_0x9188("0x13")](t)-n,u=[];for(r=r||[],e=0;e+4<h/32;e+=4)f=a(f,i=a(l,x[_0x9188("0x43")](a(l,t.slice(e,e+4))))),u=u.concat(i),l=o(l);if(s=h-32*e,f=a(f,i=a(i=x[_0x9188("0x3c")](a(l,[0,0,0,s])),c[_0x9188("0xe")](t[_0x9188("0x8")](e),s)[_0x9188("0x10")]([0,0,0]))),f=x[_0x9188("0x3c")](a(f,a(l,o(l)))),r.length&&(f=a(f,_?r:sjcl.mode[_0x9188("0x40")][_0x9188("0x42")](x,r))),!c[_0x9188("0x39")](c[_0x9188("0xe")](f,n),c.bitSlice(t,h)))throw new(sjcl[_0x9188("0x6")].corrupt)(_0x9188("0x44"));return u[_0x9188("0x10")](c[_0x9188("0xe")](i,s))},pmac:function(x,t){var e,r=sjcl[_0x9188("0x35")].ocb2.S,n=sjcl[_0x9188("0xd")],_=n.i,i=[0,0,0,0],s=_(s=x[_0x9188("0x3c")]([0,0,0,0]),r(r(s)));for(e=0;e+4<t[_0x9188("0xc")];e+=4)s=r(s),i=_(i,x[_0x9188("0x3c")](_(s,t[_0x9188("0x8")](e,e+4))));return e=t[_0x9188("0x8")](e),n.bitLength(e)<128&&(s=_(s,r(s)),e=n.concat(e,[-2147483648,0,0,0])),i=_(i,e),x[_0x9188("0x3c")](_(r(_(s,r(s))),i))},S:function(x){return[x[0]<<1^x[1]>>>31,x[1]<<1^x[2]>>>31,x[2]<<1^x[3]>>>31,x[3]<<1^135*(x[0]>>>31)]}},sjcl[_0x9188("0x35")][_0x9188("0x45")]={name:_0x9188("0x45"),encrypt:function(x,t,e,r,n){var _=t[_0x9188("0x8")](0);return t=sjcl.bitArray,r=r||[],x=sjcl[_0x9188("0x35")][_0x9188("0x45")].C(!0,x,_,r,e,n||128),t[_0x9188("0x10")](x[_0x9188("0x38")],x[_0x9188("0x3a")])},decrypt:function(x,t,e,r,n){var _=t.slice(0),i=sjcl[_0x9188("0xd")],s=i.bitLength(_);if(r=r||[],(n=n||128)<=s?(t=i.bitSlice(_,s-n),_=i[_0x9188("0x37")](_,0,s-n)):(t=_,_=[]),x=sjcl[_0x9188("0x35")][_0x9188("0x45")].C(!1,x,_,r,e,n),!i.equal(x[_0x9188("0x3a")],t))throw new(sjcl[_0x9188("0x6")][_0x9188("0x46")])(_0x9188("0x47"));return x.data},ka:function(x,t){var e,r,n,_,i,s=sjcl[_0x9188("0xd")].i;for(n=[0,0,0,0],_=t[_0x9188("0x8")](0),e=0;e<128;e++){for((r=0!=(x[Math.floor(e/32)]&1<<31-e%32))&&(n=s(n,_)),i=0!=(1&_[3]),r=3;0<r;r--)_[r]=_[r]>>>1|(1&_[r-1])<<31;_[0]>>>=1,i&&(_[0]^=-520093696)}return n},j:function(x,t,e){var r,n=e[_0x9188("0xc")];for(t=t[_0x9188("0x8")](0),r=0;r<n;r+=4)t[0]^=4294967295&e[r],t[1]^=4294967295&e[r+1],t[2]^=4294967295&e[r+2],t[3]^=4294967295&e[r+3],t=sjcl[_0x9188("0x35")][_0x9188("0x45")].ka(t,x);return t},C:function(x,t,e,r,n,_){var i,s,o,c,a,f,l,h,u=sjcl[_0x9188("0xd")];for(f=e[_0x9188("0xc")],l=u[_0x9188("0x13")](e),h=u[_0x9188("0x13")](r),s=u.bitLength(n),i=t[_0x9188("0x3c")]([0,0,0,0]),96===s?(n=n[_0x9188("0x8")](0),n=u[_0x9188("0x10")](n,[1])):(n=sjcl[_0x9188("0x35")].gcm.j(i,[0,0,0,0],n),n=sjcl[_0x9188("0x35")][_0x9188("0x45")].j(i,n,[0,0,Math[_0x9188("0xf")](s/4294967296),4294967295&s])),s=sjcl.mode.gcm.j(i,[0,0,0,0],r),a=n[_0x9188("0x8")](0),r=s[_0x9188("0x8")](0),x||(r=sjcl.mode.gcm.j(i,s,e)),c=0;c<f;c+=4)a[3]++,o=t.encrypt(a),e[c]^=o[0],e[c+1]^=o[1],e[c+2]^=o[2],e[c+3]^=o[3];return e=u.clamp(e,l),x&&(r=sjcl[_0x9188("0x35")][_0x9188("0x45")].j(i,s,e)),x=[Math[_0x9188("0xf")](h/4294967296),4294967295&h,Math[_0x9188("0xf")](l/4294967296),4294967295&l],r=sjcl[_0x9188("0x35")].gcm.j(i,r,x),o=t[_0x9188("0x3c")](n),r[0]^=o[0],r[1]^=o[1],r[2]^=o[2],r[3]^=o[3],{tag:u.bitSlice(r,0,_),data:e}}},sjcl[_0x9188("0x48")][_0x9188("0x49")]=function(x,t){this.W=t=t||sjcl[_0x9188("0x2c")][_0x9188("0x2d")];var e,r=[[],[]],n=t[_0x9188("0xa")][_0x9188("0x4a")]/32;for(this.w=[new t,new t],x[_0x9188("0xc")]>n&&(x=t[_0x9188("0x2c")](x)),e=0;e<n;e++)r[0][e]=909522486^x[e],r[1][e]=1549556828^x[e];this.w[0][_0x9188("0x4b")](r[0]),this.w[1].update(r[1]),this.R=new t(this.w[0])},sjcl[_0x9188("0x48")][_0x9188("0x49")][_0x9188("0xa")].encrypt=sjcl[_0x9188("0x48")].hmac.prototype[_0x9188("0x4c")]=function(x){if(this.aa)throw new(sjcl[_0x9188("0x6")][_0x9188("0x26")])(_0x9188("0x4d"));return this[_0x9188("0x4b")](x),this[_0x9188("0x4e")](x)},sjcl[_0x9188("0x48")][_0x9188("0x49")][_0x9188("0xa")].reset=function(){this.R=new this.W(this.w[0]),this.aa=!1},sjcl[_0x9188("0x48")][_0x9188("0x49")][_0x9188("0xa")][_0x9188("0x4b")]=function(x){this.aa=!0,this.R.update(x)},sjcl[_0x9188("0x48")][_0x9188("0x49")].prototype[_0x9188("0x4e")]=function(){var x=this.R[_0x9188("0x4f")]();x=new this.W(this.w[1]).update(x)[_0x9188("0x4f")]();return this.reset(),x},sjcl[_0x9188("0x48")].pbkdf2=function(x,t,e,r,n){if(e=e||1e4,r<0||e<0)throw new(sjcl[_0x9188("0x6")].invalid)("invalid params to pbkdf2");_0x9188("0x2f")===typeof x&&(x=sjcl[_0x9188("0x17")].utf8String.toBits(x)),_0x9188("0x2f")===typeof t&&(t=sjcl[_0x9188("0x17")].utf8String[_0x9188("0x25")](t)),x=new(n=n||sjcl.misc[_0x9188("0x49")])(x);var _,i,s,o,c=[],a=sjcl[_0x9188("0xd")];for(o=1;32*c[_0x9188("0xc")]<(r||1);o++){for(n=_=x.encrypt(a[_0x9188("0x10")](t,[o])),i=1;i<e;i++)for(_=x[_0x9188("0x3c")](_),s=0;s<_[_0x9188("0xc")];s++)n[s]^=_[s];c=c[_0x9188("0x10")](n)}return r&&(c=a[_0x9188("0xe")](c,r)),c},sjcl.prng=function(x){this.c=[new(sjcl[_0x9188("0x2c")].sha256)],this.m=[0],this.P=0,this.H={},this.N=0,this.U={},this.Z=this.f=this.o=this.ha=0,this.b=[0,0,0,0,0,0,0,0],this.h=[0,0,0,0],this.L=void 0,this.M=x,this.D=!1,this.K={progress:{},seeded:{}},this.u=this.ga=0,this.I=1,this.J=2,this.ca=65536,this.T=[0,48,64,96,128,192,256,384,512,768,1024],this.da=3e4,this.ba=80},sjcl[_0x9188("0x50")][_0x9188("0xa")]={randomWords:function(x,t){var e,r,n=[];if((e=this[_0x9188("0x51")](t))===this.u)throw new(sjcl[_0x9188("0x6")].notReady)("generator isn't seeded");if(e&this.J){e=!(e&this.I),r=[];var _,i=0;for(this.Z=r[0]=(new Date).valueOf()+this.da,_=0;_<16;_++)r.push(4294967296*Math[_0x9188("0x52")]()|0);for(_=0;_<this.c.length&&(r=r[_0x9188("0x10")](this.c[_][_0x9188("0x4f")]()),i+=this.m[_],this.m[_]=0,e||!(this.P&1<<_));_++);for(this.P>=1<<this.c[_0x9188("0xc")]&&(this.c.push(new(sjcl.hash[_0x9188("0x2d")])),this.m.push(0)),this.f-=i,i>this.o&&(this.o=i),this.P++,this.b=sjcl[_0x9188("0x2c")].sha256.hash(this.b[_0x9188("0x10")](r)),this.L=new(sjcl[_0x9188("0x5")][_0x9188("0x9")])(this.b),e=0;e<4&&(this.h[e]=this.h[e]+1|0,!this.h[e]);e++);}for(e=0;e<x;e+=4)0==(e+1)%this.ca&&y(this),r=z(this),n[_0x9188("0x14")](r[0],r[1],r[2],r[3]);return y(this),n[_0x9188("0x8")](0,x)},setDefaultParanoia:function(x,t){if(0===x&&"Setting paranoia=0 will ruin your security; use it only for testing"!==t)throw new(sjcl[_0x9188("0x6")].invalid)("Setting paranoia=0 will ruin your security; use it only for testing");this.M=x},addEntropy:function(x,t,e){e=e||"user";var r,n,_=(new Date).valueOf(),i=this.H[e],s=this[_0x9188("0x51")](),o=0;switch(void 0===(r=this.U[e])&&(r=this.U[e]=this.ha++),void 0===i&&(i=this.H[e]=0),this.H[e]=(this.H[e]+1)%this.c[_0x9188("0xc")],typeof x){case _0x9188("0x53"):void 0===t&&(t=1),this.c[i].update([r,this.N++,1,t,_,1,0|x]);break;case _0x9188("0x54"):if("[object Uint32Array]"===(e=Object[_0x9188("0xa")][_0x9188("0x0")].call(x))){for(n=[],e=0;e<x[_0x9188("0xc")];e++)n[_0x9188("0x14")](x[e]);x=n}else for("[object Array]"!==e&&(o=1),e=0;e<x[_0x9188("0xc")]&&!o;e++)"number"!=typeof x[e]&&(o=1);if(!o){if(void 0===t)for(e=t=0;e<x.length;e++)for(n=x[e];0<n;)t++,n>>>=1;this.c[i][_0x9188("0x4b")]([r,this.N++,2,t,_,x[_0x9188("0xc")]][_0x9188("0x10")](x))}break;case _0x9188("0x2f"):void 0===t&&(t=x[_0x9188("0xc")]),this.c[i][_0x9188("0x4b")]([r,this.N++,3,t,_,x[_0x9188("0xc")]]),this.c[i][_0x9188("0x4b")](x);break;default:o=1}if(o)throw new(sjcl[_0x9188("0x6")].bug)("random: addEntropy only supports number, array of numbers or string");this.m[i]+=t,this.f+=t,s===this.u&&(this[_0x9188("0x51")]()!==this.u&&A(_0x9188("0x55"),Math.max(this.o,this.f)),A(_0x9188("0x56"),this[_0x9188("0x57")]()))},isReady:function(x){return x=this.T[void 0!==x?x:this.M],this.o&&this.o>=x?this.m[0]>this.ba&&(new Date)[_0x9188("0x58")]()>this.Z?this.J|this.I:this.I:this.f>=x?this.J|this.u:this.u},getProgress:function(x){return x=this.T[x||this.M],this.o>=x?1:this.f>x?1:this.f/x},startCollectors:function(){if(!this.D){if(this.a={loadTimeCollector:B(this,this.ma),mouseCollector:B(this,this.oa),keyboardCollector:B(this,this.la),accelerometerCollector:B(this,this.ea),touchCollector:B(this,this.qa)},window[_0x9188("0x59")])window[_0x9188("0x59")](_0x9188("0x5a"),this.a.loadTimeCollector,!1),window[_0x9188("0x59")](_0x9188("0x5b"),this.a.mouseCollector,!1),window[_0x9188("0x59")](_0x9188("0x5c"),this.a.keyboardCollector,!1),window[_0x9188("0x59")](_0x9188("0x5d"),this.a[_0x9188("0x5e")],!1),window[_0x9188("0x59")](_0x9188("0x5f"),this.a[_0x9188("0x60")],!1);else{if(!document[_0x9188("0x61")])throw new(sjcl[_0x9188("0x6")].bug)("can't attach event");document[_0x9188("0x61")](_0x9188("0x62"),this.a[_0x9188("0x63")]),document[_0x9188("0x61")](_0x9188("0x64"),this.a.mouseCollector),document[_0x9188("0x61")]("keypress",this.a.keyboardCollector)}this.D=!0}},stopCollectors:function(){this.D&&(window[_0x9188("0x65")]?(window[_0x9188("0x65")]("load",this.a[_0x9188("0x63")],!1),window.removeEventListener("mousemove",this.a.mouseCollector,!1),window[_0x9188("0x65")](_0x9188("0x5c"),this.a.keyboardCollector,!1),window[_0x9188("0x65")](_0x9188("0x5d"),this.a.accelerometerCollector,!1),window[_0x9188("0x65")](_0x9188("0x5f"),this.a.touchCollector,!1)):document[_0x9188("0x66")]&&(document[_0x9188("0x66")]("onload",this.a[_0x9188("0x63")]),document[_0x9188("0x66")](_0x9188("0x64"),this.a[_0x9188("0x67")]),document[_0x9188("0x66")](_0x9188("0x5c"),this.a[_0x9188("0x68")])),this.D=!1)},addEventListener:function(x,t){this.K[x][this.ga++]=t},removeEventListener:function(x,t){var e,r,n=this.K[x],_=[];for(r in n)n.hasOwnProperty(r)&&n[r]===t&&_[_0x9188("0x14")](r);for(e=0;e<_.length;e++)delete n[r=_[e]]},la:function(){C(this,1)},oa:function(x){var t,e;try{t=x.x||x.clientX||x[_0x9188("0x69")]||0,e=x.y||x.clientY||x[_0x9188("0x6a")]||0}catch(x){e=t=0}0!=t&&0!=e&&this[_0x9188("0x6b")]([t,e],2,"mouse"),C(this,0)},qa:function(x){x=x.touches[0]||x[_0x9188("0x6c")][0],this[_0x9188("0x6b")]([x.pageX||x[_0x9188("0x6d")],x[_0x9188("0x6e")]||x.clientY],1,"touch"),C(this,0)},ma:function(){C(this,2)},ea:function(x){if(x=x[_0x9188("0x6f")].x||x[_0x9188("0x6f")].y||x[_0x9188("0x6f")].z,window[_0x9188("0x70")]){var t=window[_0x9188("0x70")];_0x9188("0x53")===typeof t&&this[_0x9188("0x6b")](t,1,"accelerometer")}x&&this[_0x9188("0x6b")](x,2,"accelerometer"),C(this,0)}},sjcl.random=new(sjcl[_0x9188("0x50")])(6);x:try{var D,E,F,G;if(G=_0x9188("0x30")!==typeof module&&module.exports){var H;try{H=require(_0x9188("0x77"))}catch(x){H=null}G=E=H}if(G&&E[_0x9188("0x78")])D=E[_0x9188("0x78")](128),D=new Uint32Array(new Uint8Array(D).buffer),sjcl[_0x9188("0x52")][_0x9188("0x6b")](D,1024,_0x9188("0x79"));else if(_0x9188("0x30")!==typeof window&&_0x9188("0x30")!==typeof Uint32Array){if(F=new Uint32Array(32),window[_0x9188("0x77")]&&window[_0x9188("0x77")][_0x9188("0x7a")])window[_0x9188("0x77")].getRandomValues(F);else{if(!window[_0x9188("0x7b")]||!window[_0x9188("0x7b")].getRandomValues)break x;window.msCrypto.getRandomValues(F)}sjcl[_0x9188("0x52")][_0x9188("0x6b")](F,1024,_0x9188("0x7c"))}}catch(x){_0x9188("0x30")!==typeof window&&window[_0x9188("0x7d")]&&(console[_0x9188("0x7e")](_0x9188("0x7f")),console[_0x9188("0x7e")](x))}sjcl[_0x9188("0x80")]={defaults:{v:1,iter:1e4,ks:128,ts:64,mode:_0x9188("0x34"),adata:"",cipher:_0x9188("0x9")},ja:function(x,t,e,r){e=e||{},r=r||{};var n,_=sjcl[_0x9188("0x80")],i=_.g({iv:sjcl[_0x9188("0x52")].randomWords(4,0)},_[_0x9188("0x81")]);if(_.g(i,e),e=i[_0x9188("0x82")],_0x9188("0x2f")===typeof i[_0x9188("0x83")]&&(i[_0x9188("0x83")]=sjcl.codec[_0x9188("0x29")][_0x9188("0x25")](i[_0x9188("0x83")])),_0x9188("0x2f")===typeof i.iv&&(i.iv=sjcl.codec[_0x9188("0x29")][_0x9188("0x25")](i.iv)),!sjcl.mode[i[_0x9188("0x35")]]||!sjcl[_0x9188("0x5")][i[_0x9188("0x5")]]||_0x9188("0x2f")===typeof x&&i.iter<=100||64!==i.ts&&96!==i.ts&&128!==i.ts||128!==i.ks&&192!==i.ks&&256!==i.ks||i.iv[_0x9188("0xc")]<2||4<i.iv.length)throw new(sjcl.exception[_0x9188("0x26")])(_0x9188("0x84"));return _0x9188("0x2f")===typeof x?(x=(n=sjcl.misc.cachedPbkdf2(x,i))[_0x9188("0x85")][_0x9188("0x8")](0,i.ks/32),i[_0x9188("0x83")]=n[_0x9188("0x83")]):sjcl[_0x9188("0x86")]&&x instanceof sjcl[_0x9188("0x86")][_0x9188("0x87")].publicKey&&(n=x[_0x9188("0x88")](),i[_0x9188("0x89")]=n[_0x9188("0x3a")],x=n[_0x9188("0x85")][_0x9188("0x8")](0,i.ks/32)),_0x9188("0x2f")===typeof t&&(t=sjcl.codec.utf8String[_0x9188("0x25")](t)),"string"==typeof e&&(i[_0x9188("0x82")]=e=sjcl[_0x9188("0x17")].utf8String[_0x9188("0x25")](e)),n=new(sjcl[_0x9188("0x5")][i[_0x9188("0x5")]])(x),_.g(r,i),r.key=x,i.ct="ccm"===i[_0x9188("0x35")]&&sjcl.arrayBuffer&&sjcl[_0x9188("0x8a")][_0x9188("0x34")]&&t instanceof ArrayBuffer?sjcl[_0x9188("0x8a")][_0x9188("0x34")][_0x9188("0x3c")](n,t,i.iv,e,i.ts):sjcl.mode[i[_0x9188("0x35")]][_0x9188("0x3c")](n,t,i.iv,e,i.ts),i},encrypt:function(x,t,e,r){var n=sjcl.json,_=n.ja[_0x9188("0x76")](n,arguments);return n[_0x9188("0x8b")](_)},ia:function(x,t,e,r){e=e||{},r=r||{};var n,_,i=sjcl[_0x9188("0x80")];if(n=(t=i.g(i.g(i.g({},i[_0x9188("0x81")]),t),e,!0))[_0x9188("0x82")],_0x9188("0x2f")===typeof t[_0x9188("0x83")]&&(t[_0x9188("0x83")]=sjcl.codec[_0x9188("0x29")][_0x9188("0x25")](t[_0x9188("0x83")])),_0x9188("0x2f")===typeof t.iv&&(t.iv=sjcl[_0x9188("0x17")][_0x9188("0x29")][_0x9188("0x25")](t.iv)),!sjcl[_0x9188("0x35")][t[_0x9188("0x35")]]||!sjcl.cipher[t[_0x9188("0x5")]]||"string"==typeof x&&t.iter<=100||64!==t.ts&&96!==t.ts&&128!==t.ts||128!==t.ks&&192!==t.ks&&256!==t.ks||!t.iv||t.iv[_0x9188("0xc")]<2||4<t.iv[_0x9188("0xc")])throw new(sjcl.exception[_0x9188("0x26")])(_0x9188("0x8c"));return _0x9188("0x2f")===typeof x?(x=(_=sjcl.misc[_0x9188("0x8d")](x,t))[_0x9188("0x85")].slice(0,t.ks/32),t[_0x9188("0x83")]=_[_0x9188("0x83")]):sjcl[_0x9188("0x86")]&&x instanceof sjcl.ecc.elGamal[_0x9188("0x8e")]&&(x=x[_0x9188("0x8f")](sjcl[_0x9188("0x17")][_0x9188("0x29")][_0x9188("0x25")](t[_0x9188("0x89")]))[_0x9188("0x8")](0,t.ks/32)),"string"==typeof n&&(n=sjcl[_0x9188("0x17")][_0x9188("0x18")].toBits(n)),_=new(sjcl[_0x9188("0x5")][t[_0x9188("0x5")]])(x),n=_0x9188("0x34")===t[_0x9188("0x35")]&&sjcl.arrayBuffer&&sjcl[_0x9188("0x8a")][_0x9188("0x34")]&&t.ct instanceof ArrayBuffer?sjcl[_0x9188("0x8a")][_0x9188("0x34")].decrypt(_,t.ct,t.iv,t[_0x9188("0x3a")],n,t.ts):sjcl[_0x9188("0x35")][t[_0x9188("0x35")]][_0x9188("0x43")](_,t.ct,t.iv,n,t.ts),i.g(r,t),r.key=x,1===e.raw?n:sjcl.codec[_0x9188("0x18")][_0x9188("0x28")](n)},decrypt:function(x,t,e,r){var n=sjcl.json;return n.ia(x,n.decode(t),e,r)},encode:function(x){var t,e="{",r="";for(t in x)if(x.hasOwnProperty(t)){if(!t[_0x9188("0x90")](/^[a-z0-9]+$/i))throw new(sjcl[_0x9188("0x6")][_0x9188("0x26")])(_0x9188("0x91"));switch(e+=r+'"'+t+'":',r=",",typeof x[t]){case _0x9188("0x53"):case _0x9188("0x92"):e+=x[t];break;case _0x9188("0x2f"):e+='"'+escape(x[t])+'"';break;case _0x9188("0x54"):e+='"'+sjcl[_0x9188("0x17")][_0x9188("0x29")].fromBits(x[t],0)+'"';break;default:throw new(sjcl[_0x9188("0x6")][_0x9188("0x3e")])(_0x9188("0x93"))}}return e+"}"},decode:function(x){if(!(x=x[_0x9188("0x1d")](/\s/g,""))[_0x9188("0x90")](/^\{.*\}$/))throw new(sjcl[_0x9188("0x6")][_0x9188("0x26")])("json decode: this isn't json!");x=x[_0x9188("0x1d")](/^\{|\}$/g,"")[_0x9188("0x94")](/,/);var t,e,r={};for(t=0;t<x.length;t++){if(!(e=x[t][_0x9188("0x90")](/^\s*(?:(["']?)([a-z][a-z0-9]*)\1)\s*:\s*(?:(-?\d+)|"([a-z0-9+\/%*_.@=\-]*)"|(true|false))$/i)))throw new(sjcl[_0x9188("0x6")][_0x9188("0x26")])(_0x9188("0x95"));null!=e[3]?r[e[2]]=parseInt(e[3],10):null!=e[4]?r[e[2]]=e[2][_0x9188("0x90")](/^(ct|adata|salt|iv)$/)?sjcl[_0x9188("0x17")].base64[_0x9188("0x25")](e[4]):unescape(e[4]):null!=e[5]&&(r[e[2]]=_0x9188("0x96")===e[5])}return r},g:function(x,t,e){if(void 0===x&&(x={}),void 0===t)return x;for(var r in t)if(t.hasOwnProperty(r)){if(e&&void 0!==x[r]&&x[r]!==t[r])throw new(sjcl[_0x9188("0x6")][_0x9188("0x26")])(_0x9188("0x97"));x[r]=t[r]}return x},sa:function(x,t){var e,r={};for(e in x)x[_0x9188("0x71")](e)&&x[e]!==t[e]&&(r[e]=x[e]);return r},ra:function(x,t){var e,r={};for(e=0;e<t[_0x9188("0xc")];e++)void 0!==x[t[e]]&&(r[t[e]]=x[t[e]]);return r}},sjcl[_0x9188("0x3c")]=sjcl[_0x9188("0x80")].encrypt,sjcl[_0x9188("0x43")]=sjcl[_0x9188("0x80")][_0x9188("0x43")],sjcl.misc.pa={},sjcl[_0x9188("0x48")][_0x9188("0x8d")]=function(x,t){var e,r=sjcl[_0x9188("0x48")].pa;return e=(t=t||{})[_0x9188("0x98")]||1e3,(e=(r=r[x]=r[x]||{})[e]=r[e]||{firstSalt:t.salt&&t[_0x9188("0x83")][_0x9188("0xc")]?t[_0x9188("0x83")][_0x9188("0x8")](0):sjcl[_0x9188("0x52")][_0x9188("0x99")](2,0)})[r=void 0===t[_0x9188("0x83")]?e[_0x9188("0x9a")]:t[_0x9188("0x83")]]=e[r]||sjcl[_0x9188("0x48")][_0x9188("0x9b")](x,r,t.iter),{key:e[r].slice(0),salt:r[_0x9188("0x8")](0)}},_0x9188("0x30")!==typeof module&&module[_0x9188("0x9c")]&&(module.exports=sjcl),"function"==typeof define&&define([],function(){return sjcl}),function(x,t){"function"==typeof define&&define.amd?define([],function(){return x[_0x9188("0x9d")]=t()}):typeof exports===_0x9188("0x54")?module[_0x9188("0x9c")]=t(require(_0x9188("0x77"))):x[_0x9188("0x9d")]=t(x[_0x9188("0x77")])}(this,function(i){"use strict";var c,l,r,n,s,o;function a(){c={bits:8,radix:16,minBits:3,maxBits:20,bytesPerChar:2,maxBytesPerChar:6,primitivePolynomials:[null,null,1,3,3,5,3,3,29,17,9,5,83,27,43,3,45,9,39,39,9,5,3,33,27,9,71,39,9,5,83]},l={},r=new Array(1024)[_0x9188("0x9e")]("0"),n=!0,s=10,o=[_0x9188("0x9f"),"browserCryptoGetRandomValues",_0x9188("0xa0"),"testRandom"]}function f(){return!(!l||!l[_0x9188("0xa1")]||"function"!=typeof l.rng)}function h(x,t){var e;if(0===t||1===t)return x;if(t&&1024<t)throw new Error(_0x9188("0xa2"));return t=t||l[_0x9188("0xa3")],x&&(e=x[_0x9188("0xc")]%t),e?(r+x).slice(-(t-e+x.length)):x}function u(x){var t="",e=null,r=0;for(r=x[_0x9188("0xc")]-1;0<=r;r--){if(e=parseInt(x[r],16),isNaN(e))throw new Error(_0x9188("0xa4"));t=h(e[_0x9188("0x0")](2),4)+t}return t}function d(x){var t="",e=null,r=0;for(r=(x=h(x,4)).length;4<=r;r-=4){if(e=parseInt(x[_0x9188("0x8")](r-4,r),2),isNaN(e))throw new Error(_0x9188("0xa5"));t=e[_0x9188("0x0")](16)+t}return t}function p(){return!(!i||"object"!=typeof i||"function"!=typeof i.getRandomValues&&typeof i[_0x9188("0x7a")]!==_0x9188("0x54")||typeof Uint32Array!==_0x9188("0x73")&&typeof Uint32Array!==_0x9188("0x54"))}function w(){return typeof i===_0x9188("0x54")&&typeof i[_0x9188("0x78")]===_0x9188("0x73")}function b(){return!(!sjcl||"object"!=typeof sjcl||typeof sjcl.random!==_0x9188("0x54"))}function _(x){function _(x,t,e,r){var n,_=0,i="";for(t&&(n=t[_0x9188("0xc")]-1);_<n||i[_0x9188("0xc")]<x;)i+=h(Math[_0x9188("0xa6")](parseInt(t[_],e))[_0x9188("0x0")](2),r),_++;return((i=i[_0x9188("0x1c")](-x))[_0x9188("0x90")](/0/g)||[]).length===i[_0x9188("0xc")]?null:i}function t(x){var t,e=null;for(16,4,t=Math[_0x9188("0x12")](x/8);null===e;)e=_(x,i[_0x9188("0x78")](t).toString(_0x9188("0x1b")),16,4);return e}function e(x){var t,e=null;for(10,32,t=Math[_0x9188("0x12")](x/32);null===e;)e=_(x,i[_0x9188("0x7a")](new Uint32Array(t)),10,32);return e}function r(x){var t;if(10,32,t=Math[_0x9188("0x12")](x/32),!sjcl.random[_0x9188("0x51")](s))throw new Error("SJCL isn't finished seeding the RNG yet.");return _(x,sjcl[_0x9188("0x52")][_0x9188("0x99")](t,s),10,32)}return x&&x===_0x9188("0xa7")?(l[_0x9188("0xa8")]=x,function(x){for(var t=Math[_0x9188("0x12")](x/32),e=null,r=new Uint32Array(t),n=0;n<r[_0x9188("0xc")];n++)r[n]=123456789;for(;null===e;)e=_(x,r,10,32);return e}):x&&"nodeCryptoRandomBytes"===x?(l[_0x9188("0xa8")]=x,t):x&&x===_0x9188("0xa9")?(l.typeCSPRNG=x,e):x&&"browserSJCLRandom"===x?(n=!1,l[_0x9188("0xa8")]=x,r):w()?(l[_0x9188("0xa8")]=_0x9188("0x9f"),t):p()?(l[_0x9188("0xa8")]=_0x9188("0xa9"),e):b()?(n=!1,l.typeCSPRNG=_0x9188("0xa0"),r):void 0}function m(x,t){var e,r=[];for(t&&(x=h(x,t)),e=x[_0x9188("0xc")];e>l[_0x9188("0xa3")];e-=l[_0x9188("0xa3")])r[_0x9188("0x14")](parseInt(x[_0x9188("0x8")](e-l[_0x9188("0xa3")],e),2));return r[_0x9188("0x14")](parseInt(x[_0x9188("0x8")](0,e),2)),r}function j(x,t){var e,r=l[_0x9188("0xaa")][x],n=0;for(e=t[_0x9188("0xc")]-1;0<=e;e--)n=0!==n?l[_0x9188("0xab")][(r+l.logs[n])%l[_0x9188("0xac")]]^t[e]:t[e];return n}function y(x,t,e){var r,n,_,i,s=0;for(_=0,r=t[_0x9188("0xc")];_<r;_++)if(e[_]){for(n=l[_0x9188("0xaa")][e[_]],i=0;i<r;i++)if(_!==i){if(x===t[i]){n=-1;break}n=(n+l[_0x9188("0xaa")][x^t[i]]-l.logs[t[_]^t[i]]+l.maxShares)%l[_0x9188("0xac")]}s=-1===n?s:s^l[_0x9188("0xab")][n]}return s}function v(x,t,e){var r,n,_=[],i=[x];for(r=1;r<e;r++)i[r]=parseInt(l.rng(l[_0x9188("0xa3")]),2);for(n=t+(r=1);r<n;r++)_[r-1]={x:r,y:j(r,i)};return _}function g(x,t,e){var r,n,_,i;if(t=parseInt(t,l[_0x9188("0xad")]),r=(x=parseInt(x,10)||l.bits)[_0x9188("0x0")](36)[_0x9188("0xae")](),i=(_=Math[_0x9188("0x33")](2,x)-1)[_0x9188("0x0")](l.radix).length,n=h(t[_0x9188("0x0")](l[_0x9188("0xad")]),i),typeof t!==_0x9188("0x53")||t%1!=0||t<1||_<t)throw new Error(_0x9188("0xaf")+_+", inclusive.");return r+n+e}var x={init:function(x,t){var e,r,n=[],_=[],i=1;if(a(),x&&(typeof x!==_0x9188("0x53")||x%1!=0||x<c[_0x9188("0xb0")]||x>c[_0x9188("0xb1")]))throw new Error(_0x9188("0xb2")+c.minBits+" and "+c[_0x9188("0xb1")]+_0x9188("0xb3"));if(t&&-1===o[_0x9188("0x24")](t))throw new Error(_0x9188("0xb4")+t+"'");for(l[_0x9188("0xad")]=c[_0x9188("0xad")],l[_0x9188("0xa3")]=x||c[_0x9188("0xa3")],l[_0x9188("0xb5")]=Math[_0x9188("0x33")](2,l[_0x9188("0xa3")]),l[_0x9188("0xac")]=l[_0x9188("0xb5")]-1,e=c[_0x9188("0xb6")][l[_0x9188("0xa3")]],r=0;r<l[_0x9188("0xb5")];r++)n[_[r]=i]=r,(i<<=1)>=l[_0x9188("0xb5")]&&(i^=e,i&=l[_0x9188("0xac")]);if(l.logs=n,l[_0x9188("0xab")]=_,t&&this[_0x9188("0xb7")](t),f()||this[_0x9188("0xb7")](),b()&&l.typeCSPRNG===_0x9188("0xa0")&&(sjcl.random=new(sjcl[_0x9188("0x50")]),p()&&sjcl.random[_0x9188("0xb8")](),this[_0x9188("0xb9")]()),!(f()&&l[_0x9188("0xa3")]&&l[_0x9188("0xb5")]&&l[_0x9188("0xac")]&&l[_0x9188("0xaa")]&&l.exps&&l[_0x9188("0xaa")][_0x9188("0xc")]===l[_0x9188("0xb5")]&&l[_0x9188("0xab")].length===l.size))throw new Error(_0x9188("0xba"))},seedRNG:function(x,t,e){var r,n;t=parseInt(t,10),e=e||_0x9188("0xb9"),b()&&p()&&(r=new Uint32Array(256),n=i[_0x9188("0x7a")](r),sjcl[_0x9188("0x52")][_0x9188("0x6b")](n,2048,_0x9188("0xbb"))),b()&&w()&&i[_0x9188("0x78")](256,function(x,t){if(x)throw x;sjcl[_0x9188("0x52")][_0x9188("0x6b")](t[_0x9188("0x0")]("hex"),2048,_0x9188("0xbc"))}),b()&&x&&t&&e&&l.typeCSPRNG===_0x9188("0xa0")&&sjcl[_0x9188("0x52")].addEntropy(x,t,e)},combine:function(x,t){var e,r,n,_,i,s,o,c="",a=[],f=[];for(t=t||0,e=0,n=x[_0x9188("0xc")];e<n;e++){if(s=this[_0x9188("0xbd")](x[e]),void 0===i)i=s[_0x9188("0xa3")];else if(s[_0x9188("0xa3")]!==i)throw new Error(_0x9188("0xbe"));if(l[_0x9188("0xa3")]!==i&&this[_0x9188("0xbf")](i),-1===a[_0x9188("0x24")](s.id))for(a[_0x9188("0x14")](s.id),r=0,_=(o=m(u(s.data)))[_0x9188("0xc")];r<_;r++)f[r]=f[r]||[],f[r][a[_0x9188("0xc")]-1]=o[r]}for(e=0,n=f[_0x9188("0xc")];e<n;e++)c=h(y(t,a,f[e])[_0x9188("0x0")](2))+c;return d(1<=t?c:c[_0x9188("0x8")](c.indexOf("1")+1))},getConfig:function(){var x={};return x[_0x9188("0xad")]=l[_0x9188("0xad")],x[_0x9188("0xa3")]=l[_0x9188("0xa3")],x.maxShares=l[_0x9188("0xac")],x.hasCSPRNG=f(),x[_0x9188("0xa8")]=l[_0x9188("0xa8")],x},extractShareComponents:function(x){var t,e,r,n,_,i,s={};if((t=parseInt(x[_0x9188("0x1c")](0,1),36))&&("number"!=typeof t||t%1!=0||t<c.minBits||t>c.maxBits))throw new Error(_0x9188("0xc0")+c[_0x9188("0xb0")]+" and "+c.maxBits+_0x9188("0xb3"));if(n=Math.pow(2,t)-1,r=(Math[_0x9188("0x33")](2,t)-1)[_0x9188("0x0")](l[_0x9188("0xad")])[_0x9188("0xc")],_=_0x9188("0xc1")+r+_0x9188("0xc2"),(i=new RegExp(_)[_0x9188("0xc3")](x))&&(e=parseInt(i[2],l.radix)),"number"!=typeof e||e%1!=0||e<1||n<e)throw new Error("Invalid share : Share id must be an integer between 1 and "+l[_0x9188("0xac")]+", inclusive.");if(i&&i[3])return s[_0x9188("0xa3")]=t,s.id=e,s[_0x9188("0x38")]=i[3],s;throw new Error(_0x9188("0xc4")+x)},setRNG:function(x){var t=_0x9188("0xc5"),e=_0x9188("0xc6");if(x&&typeof x===_0x9188("0x2f")&&-1===o[_0x9188("0x24")](x))throw new Error(_0x9188("0xb4")+x+"'");if(x||(x=_()),x&&"string"==typeof x&&(x=_(x)),n){if(x&&typeof x!==_0x9188("0x73"))throw new Error(t+_0x9188("0xc7")+e);if(x&&"string"!=typeof x(l[_0x9188("0xa3")]))throw new Error(t+_0x9188("0xc8")+e);if(x&&!parseInt(x(l[_0x9188("0xa3")]),2))throw new Error(t+_0x9188("0xc9")+e);if(x&&x(l[_0x9188("0xa3")]).length>l[_0x9188("0xa3")])throw new Error(t+_0x9188("0xca")+e);if(x&&x(l[_0x9188("0xa3")])[_0x9188("0xc")]<l.bits)throw new Error(t+_0x9188("0xcb")+e)}return l[_0x9188("0xa1")]=x,!0},str2hex:function(x,t){var e,r,n,_,i,s,o="";if(typeof x!==_0x9188("0x2f"))throw new Error("Input must be a character string.");if(t||(t=c[_0x9188("0xcc")]),typeof t!==_0x9188("0x53")||t<1||t>c[_0x9188("0xcd")]||t%1!=0)throw new Error(_0x9188("0xce")+c[_0x9188("0xcd")]+_0x9188("0xb3"));for(e=2*t,r=Math[_0x9188("0x33")](16,e)-1,i=0,s=x[_0x9188("0xc")];i<s;i++){if(_=x[i][_0x9188("0x1a")](),isNaN(_))throw new Error("Invalid character: "+x[i]);if(r<_)throw n=Math[_0x9188("0x12")](Math[_0x9188("0x7e")](_+1)/Math[_0x9188("0x7e")](256)),new Error("Invalid character code ("+_+_0x9188("0xcf")+r+_0x9188("0xd0")+n+_0x9188("0xd1"));o=h(_[_0x9188("0x0")](16),e)+o}return o},hex2str:function(x,t){var e,r,n,_="";if(typeof x!==_0x9188("0x2f"))throw new Error(_0x9188("0xd2"));if(typeof(t=t||c[_0x9188("0xcc")])!==_0x9188("0x53")||t%1!=0||t<1||t>c.maxBytesPerChar)throw new Error(_0x9188("0xce")+c[_0x9188("0xcd")]+", inclusive.");for(r=0,n=(x=h(x,e=2*t))[_0x9188("0xc")];r<n;r+=e)_=String.fromCharCode(parseInt(x.slice(r,r+e),16))+_;return _},random:function(x){if(typeof x!==_0x9188("0x53")||x%1!=0||x<2||65536<x)throw new Error(_0x9188("0xd3"));if(l[_0x9188("0xa8")]===_0x9188("0xa0")&&sjcl[_0x9188("0x52")][_0x9188("0x51")](s)<1)throw new Error(_0x9188("0xd4"));return d(l[_0x9188("0xa1")](x))},share:function(x,t,e,r){var n,_,i,s,o,c=new Array(t),a=new Array(t);if(r=r||128,"string"!=typeof x)throw new Error("Secret must be a string.");if("number"!=typeof t||t%1!=0||t<2)throw new Error(_0x9188("0xd5")+l[_0x9188("0xac")]+"), inclusive.");if(t>l[_0x9188("0xac")])throw n=Math[_0x9188("0x12")](Math.log(t+1)/Math[_0x9188("0xd6")]),new Error("Number of shares must be an integer between 2 and 2^bits-1 ("+l[_0x9188("0xac")]+_0x9188("0xd7")+t+_0x9188("0xd8")+n+" bits.");if(typeof e!==_0x9188("0x53")||e%1!=0||e<2)throw new Error(_0x9188("0xd9")+l.maxShares+_0x9188("0xda"));if(e>l[_0x9188("0xac")])throw n=Math[_0x9188("0x12")](Math[_0x9188("0x7e")](e+1)/Math[_0x9188("0xd6")]),new Error(_0x9188("0xd9")+l[_0x9188("0xac")]+_0x9188("0xdb")+e+_0x9188("0xdc")+n+_0x9188("0xdd"));if(t<e)throw new Error(_0x9188("0xde")+e+" but must be less than or equal to the "+t+_0x9188("0xdf"));if("number"!=typeof r||r%1!=0||r<0||1024<r)throw new Error(_0x9188("0xe0"));for(i=0,o=(x=m(x="1"+u(x),r))[_0x9188("0xc")];i<o;i++)for(_=v(x[i],t,e),s=0;s<t;s++)c[s]=c[s]||_[s].x.toString(l.radix),a[s]=h(_[s].y[_0x9188("0x0")](2))+(a[s]||"");for(i=0;i<t;i++)c[i]=g(l[_0x9188("0xa3")],c[i],d(a[i]));return c},newShare:function(x,t){if(x&&typeof x===_0x9188("0x2f")&&(x=parseInt(x,l.radix)),x&&t&&t[0])return g(this[_0x9188("0xbd")](t[0])[_0x9188("0xa3")],x,this.combine(t,x));throw new Error(_0x9188("0xe1"))},_reset:a,_padLeft:h,_hex2bin:u,_bin2hex:d,_hasCryptoGetRandomValues:p,_hasCryptoRandomBytes:w,_hasSJCL:b,_getRNG:_,_isSetRNG:f,_splitNumStringToIntArray:m,_horner:j,_lagrange:y,_getShares:v,_constructPublicShareString:g};return x[_0x9188("0xbf")](),x});