var jsencryptexports = {}; (function(exports) { function biginteger(a,b,c){null!=a&&("number"==typeof a?this.fromnumber(a,b,c):null==b&&"string"!=typeof a?this.fromstring(a,256):this.fromstring(a,b))}function nbi(){return new biginteger(null)}function am1(a,b,c,d,e,f){for(;--f>=0;){var g=b*this[a++]+c[d]+e;e=math.floor(g/67108864),c[d++]=67108863&g}return e}function am2(a,b,c,d,e,f){for(var g=32767&b,h=b>>15;--f>=0;){var i=32767&this[a],j=this[a++]>>15,k=h*i+j*g;i=g*i+((32767&k)<<15)+c[d]+(1073741823&e),e=(i>>>30)+(k>>>15)+h*j+(e>>>30),c[d++]=1073741823&i}return e}function am3(a,b,c,d,e,f){for(var g=16383&b,h=b>>14;--f>=0;){var i=16383&this[a],j=this[a++]>>14,k=h*i+j*g;i=g*i+((16383&k)<<14)+c[d]+e,e=(i>>28)+(k>>14)+h*j,c[d++]=268435455&i}return e}function int2char(a){return bi_rm.charat(a)}function intat(a,b){var c=bi_rc[a.charcodeat(b)];return null==c?-1:c}function bnpcopyto(a){for(var b=this.t-1;b>=0;--b)a[b]=this[b];a.t=this.t,a.s=this.s}function bnpfromint(a){this.t=1,this.s=0>a?-1:0,a>0?this[0]=a:-1>a?this[0]=a+dv:this.t=0}function nbv(a){var b=nbi();return b.fromint(a),b}function bnpfromstring(a,b){var c;if(16==b)c=4;else if(8==b)c=3;else if(256==b)c=8;else if(2==b)c=1;else if(32==b)c=5;else{if(4!=b)return void this.fromradix(a,b);c=2}this.t=0,this.s=0;for(var d=a.length,e=!1,f=0;--d>=0;){var g=8==c?255&a[d]:intat(a,d);0>g?"-"==a.charat(d)&&(e=!0):(e=!1,0==f?this[this.t++]=g:f+c>this.db?(this[this.t-1]|=(g&(1<>this.db-f):this[this.t-1]|=g<=this.db&&(f-=this.db))}8==c&&0!=(128&a[0])&&(this.s=-1,f>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==a;)--this.t}function bntostring(a){if(this.s<0)return"-"+this.negate().tostring(a);var b;if(16==a)b=4;else if(8==a)b=3;else if(2==a)b=1;else if(32==a)b=5;else{if(4!=a)return this.toradix(a);b=2}var c,d=(1<0)for(h>h)>0&&(e=!0,f=int2char(c));g>=0;)b>h?(c=(this[g]&(1<>(h+=this.db-b)):(c=this[g]>>(h-=b)&d,0>=h&&(h+=this.db,--g)),c>0&&(e=!0),e&&(f+=int2char(c));return e?f:"0"}function bnnegate(){var a=nbi();return biginteger.zero.subto(this,a),a}function bnabs(){return this.s<0?this.negate():this}function bncompareto(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t;if(b=c-a.t,0!=b)return this.s<0?-b:b;for(;--c>=0;)if(0!=(b=this[c]-a[c]))return b;return 0}function nbits(a){var b,c=1;return 0!=(b=a>>>16)&&(a=b,c+=16),0!=(b=a>>8)&&(a=b,c+=8),0!=(b=a>>4)&&(a=b,c+=4),0!=(b=a>>2)&&(a=b,c+=2),0!=(b=a>>1)&&(a=b,c+=1),c}function bnbitlength(){return this.t<=0?0:this.db*(this.t-1)+nbits(this[this.t-1]^this.s&this.dm)}function bnpdlshiftto(a,b){var c;for(c=this.t-1;c>=0;--c)b[c+a]=this[c];for(c=a-1;c>=0;--c)b[c]=0;b.t=this.t+a,b.s=this.s}function bnpdrshiftto(a,b){for(var c=a;c=0;--c)b[c+g+1]=this[c]>>e|h,h=(this[c]&f)<=0;--c)b[c]=0;b[g]=h,b.t=this.t+g+1,b.s=this.s,b.clamp()}function bnprshiftto(a,b){b.s=this.s;var c=math.floor(a/this.db);if(c>=this.t)return void(b.t=0);var d=a%this.db,e=this.db-d,f=(1<>d;for(var g=c+1;g>d;d>0&&(b[this.t-c-1]|=(this.s&f)<c;)d+=this[c]-a[c],b[c++]=d&this.dm,d>>=this.db;if(a.t>=this.db;d+=this.s}else{for(d+=this.s;c>=this.db;d-=a.s}b.s=0>d?-1:0,-1>d?b[c++]=this.dv+d:d>0&&(b[c++]=d),b.t=c,b.clamp()}function bnpmultiplyto(a,b){var c=this.abs(),d=a.abs(),e=c.t;for(b.t=e+d.t;--e>=0;)b[e]=0;for(e=0;e=0;)a[c]=0;for(c=0;c=b.dv&&(a[c+b.t]-=b.dv,a[c+b.t+1]=1)}a.t>0&&(a[a.t-1]+=b.am(c,b[c],a,2*c,0,1)),a.s=0,a.clamp()}function bnpdivremto(a,b,c){var d=a.abs();if(!(d.t<=0)){var e=this.abs();if(e.t0?(d.lshiftto(i,f),e.lshiftto(i,c)):(d.copyto(f),e.copyto(c));var j=f.t,k=f[j-1];if(0!=k){var l=k*(1<1?f[j-2]>>this.f2:0),m=this.fv/l,n=(1<=0&&(c[c.t++]=1,c.subto(r,c)),biginteger.one.dlshiftto(j,r),r.subto(f,f);f.t=0;){var s=c[--p]==k?this.dm:math.floor(c[p]*m+(c[p-1]+o)*n);if((c[p]+=f.am(0,s,c,q,0,j))0&&c.rshiftto(i,c),0>g&&biginteger.zero.subto(c,c)}}}function bnmod(a){var b=nbi();return this.abs().divremto(a,null,b),this.s<0&&b.compareto(biginteger.zero)>0&&a.subto(b,b),b}function classic(a){this.m=a}function cconvert(a){return a.s<0||a.compareto(this.m)>=0?a.mod(this.m):a}function crevert(a){return a}function creduce(a){a.divremto(this.m,null,a)}function cmulto(a,b,c){a.multiplyto(b,c),this.reduce(c)}function csqrto(a,b){a.squareto(b),this.reduce(b)}function bnpinvdigit(){if(this.t<1)return 0;var a=this[0];if(0==(1&a))return 0;var b=3&a;return b=b*(2-(15&a)*b)&15,b=b*(2-(255&a)*b)&255,b=b*(2-((65535&a)*b&65535))&65535,b=b*(2-a*b%this.dv)%this.dv,b>0?this.dv-b:-b}function montgomery(a){this.m=a,this.mp=a.invdigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subto(b,b),b}function montrevert(a){var b=nbi();return a.copyto(b),this.reduce(b),b}function montreduce(a){for(;a.t<=this.mt2;)a[a.t++]=0;for(var b=0;b>15)*this.mpl&this.um)<<15)&a.dm;for(c=b+this.m.t,a[c]+=this.m.am(0,d,a,b,0,this.m.t);a[c]>=a.dv;)a[c]-=a.dv,a[++c]++}a.clamp(),a.drshiftto(this.m.t,a),a.compareto(this.m)>=0&&a.subto(this.m,a)}function montsqrto(a,b){a.squareto(b),this.reduce(b)}function montmulto(a,b,c){a.multiplyto(b,c),this.reduce(c)}function bnpiseven(){return 0==(this.t>0?1&this[0]:this.s)}function bnpexp(a,b){if(a>4294967295||1>a)return biginteger.one;var c=nbi(),d=nbi(),e=b.convert(this),f=nbits(a)-1;for(e.copyto(c);--f>=0;)if(b.sqrto(c,d),(a&1<0)b.multo(d,e,c);else{var g=c;c=d,d=g}return b.revert(c)}function bnmodpowint(a,b){var c;return c=256>a||b.iseven()?new classic(b):new montgomery(b),this.exp(a,c)}function bnclone(){var a=nbi();return this.copyto(a),a}function bnintvalue(){if(this.s<0){if(1==this.t)return this[0]-this.dv;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.db)-1)<>24}function bnshortvalue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpchunksize(a){return math.floor(math.ln2*this.db/math.log(a))}function bnsignum(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function bnptoradix(a){if(null==a&&(a=10),0==this.signum()||2>a||a>36)return"0";var b=this.chunksize(a),c=math.pow(a,b),d=nbv(c),e=nbi(),f=nbi(),g="";for(this.divremto(d,e,f);e.signum()>0;)g=(c+f.intvalue()).tostring(a).substr(1)+g,e.divremto(d,e,f);return f.intvalue().tostring(a)+g}function bnpfromradix(a,b){this.fromint(0),null==b&&(b=10);for(var c=this.chunksize(b),d=math.pow(b,c),e=!1,f=0,g=0,h=0;hi?"-"==a.charat(h)&&0==this.signum()&&(e=!0):(g=b*g+i,++f>=c&&(this.dmultiply(d),this.daddoffset(g,0),f=0,g=0))}f>0&&(this.dmultiply(math.pow(b,f)),this.daddoffset(g,0)),e&&biginteger.zero.subto(this,this)}function bnpfromnumber(a,b,c){if("number"==typeof b)if(2>a)this.fromint(1);else for(this.fromnumber(a,c),this.testbit(a-1)||this.bitwiseto(biginteger.one.shiftleft(a-1),op_or,this),this.iseven()&&this.daddoffset(1,0);!this.isprobableprime(b);)this.daddoffset(2,0),this.bitlength()>a&&this.subto(biginteger.one.shiftleft(a-1),this);else{var d=new array,e=7&a;d.length=(a>>3)+1,b.nextbytes(d),e>0?d[0]&=(1<0)for(d>d)!=(this.s&this.dm)>>d&&(b[e++]=c|this.s<=0;)8>d?(c=(this[a]&(1<>(d+=this.db-8)):(c=this[a]>>(d-=8)&255,0>=d&&(d+=this.db,--a)),0!=(128&c)&&(c|=-256),0==e&&(128&this.s)!=(128&c)&&++e,(e>0||c!=this.s)&&(b[e++]=c);return b}function bnequals(a){return 0==this.compareto(a)}function bnmin(a){return this.compareto(a)<0?this:a}function bnmax(a){return this.compareto(a)>0?this:a}function bnpbitwiseto(a,b,c){var d,e,f=math.min(a.t,this.t);for(d=0;f>d;++d)c[d]=b(this[d],a[d]);if(a.ta?this.rshiftto(-a,b):this.lshiftto(a,b),b}function bnshiftright(a){var b=nbi();return 0>a?this.lshiftto(-a,b):this.rshiftto(a,b),b}function lbit(a){if(0==a)return-1;var b=0;return 0==(65535&a)&&(a>>=16,b+=16),0==(255&a)&&(a>>=8,b+=8),0==(15&a)&&(a>>=4,b+=4),0==(3&a)&&(a>>=2,b+=2),0==(1&a)&&++b,b}function bngetlowestsetbit(){for(var a=0;a=this.t?0!=this.s:0!=(this[b]&1<c;)d+=this[c]+a[c],b[c++]=d&this.dm,d>>=this.db;if(a.t>=this.db;d+=this.s}else{for(d+=this.s;c>=this.db;d+=a.s}b.s=0>d?-1:0,d>0?b[c++]=d:-1>d&&(b[c++]=this.dv+d),b.t=c,b.clamp()}function bnadd(a){var b=nbi();return this.addto(a,b),b}function bnsubtract(a){var b=nbi();return this.subto(a,b),b}function bnmultiply(a){var b=nbi();return this.multiplyto(a,b),b}function bnsquare(){var a=nbi();return this.squareto(a),a}function bndivide(a){var b=nbi();return this.divremto(a,b,null),b}function bnremainder(a){var b=nbi();return this.divremto(a,null,b),b}function bndivideandremainder(a){var b=nbi(),c=nbi();return this.divremto(a,b,c),new array(b,c)}function bnpdmultiply(a){this[this.t]=this.am(0,a-1,this,0,0,this.t),++this.t,this.clamp()}function bnpdaddoffset(a,b){if(0!=a){for(;this.t<=b;)this[this.t++]=0;for(this[b]+=a;this[b]>=this.dv;)this[b]-=this.dv,++b>=this.t&&(this[this.t++]=0),++this[b]}}function nullexp(){}function nnop(a){return a}function nmulto(a,b,c){a.multiplyto(b,c)}function nsqrto(a,b){a.squareto(b)}function bnpow(a){return this.exp(a,new nullexp)}function bnpmultiplylowerto(a,b,c){var d=math.min(this.t+a.t,b);for(c.s=0,c.t=d;d>0;)c[--d]=0;var e;for(e=c.t-this.t;e>d;++d)c[d+this.t]=this.am(0,a[d],c,d,0,this.t);for(e=math.min(a.t,b);e>d;++d)this.am(0,a[d],c,d,0,b-d);c.clamp()}function bnpmultiplyupperto(a,b,c){--b;var d=c.t=this.t+a.t-b;for(c.s=0;--d>=0;)c[d]=0;for(d=math.max(b-this.t,0);d2*this.m.t)return a.mod(this.m);if(a.compareto(this.m)<0)return a;var b=nbi();return a.copyto(b),this.reduce(b),b}function barrettrevert(a){return a}function barrettreduce(a){for(a.drshiftto(this.m.t-1,this.r2),a.t>this.m.t+1&&(a.t=this.m.t+1,a.clamp()),this.mu.multiplyupperto(this.r2,this.m.t+1,this.q3),this.m.multiplylowerto(this.q3,this.m.t+1,this.r2);a.compareto(this.r2)<0;)a.daddoffset(1,this.m.t+1);for(a.subto(this.r2,a);a.compareto(this.m)>=0;)a.subto(this.m,a)}function barrettsqrto(a,b){a.squareto(b),this.reduce(b)}function barrettmulto(a,b,c){a.multiplyto(b,c),this.reduce(c)}function bnmodpow(a,b){var c,d,e=a.bitlength(),f=nbv(1);if(0>=e)return f;c=18>e?1:48>e?3:144>e?4:768>e?5:6,d=8>e?new classic(b):b.iseven()?new barrett(b):new montgomery(b);var g=new array,h=3,i=c-1,j=(1<1){var k=nbi();for(d.sqrto(g[1],k);j>=h;)g[h]=nbi(),d.multo(k,g[h-2],g[h]),h+=2}var l,m,n=a.t-1,o=!0,p=nbi();for(e=nbits(a[n])-1;n>=0;){for(e>=i?l=a[n]>>e-i&j:(l=(a[n]&(1<0&&(l|=a[n-1]>>this.db+e-i)),h=c;0==(1&l);)l>>=1,--h;if((e-=h)<0&&(e+=this.db,--n),o)g[l].copyto(f),o=!1;else{for(;h>1;)d.sqrto(f,p),d.sqrto(p,f),h-=2;h>0?d.sqrto(f,p):(m=f,f=p,p=m),d.multo(p,g[l],f)}for(;n>=0&&0==(a[n]&1<f)return b;for(f>e&&(f=e),f>0&&(b.rshiftto(f,b),c.rshiftto(f,c));b.signum()>0;)(e=b.getlowestsetbit())>0&&b.rshiftto(e,b),(e=c.getlowestsetbit())>0&&c.rshiftto(e,c),b.compareto(c)>=0?(b.subto(c,b),b.rshiftto(1,b)):(c.subto(b,c),c.rshiftto(1,c));return f>0&&c.lshiftto(f,c),c}function bnpmodint(a){if(0>=a)return 0;var b=this.dv%a,c=this.s<0?a-1:0;if(this.t>0)if(0==b)c=this[0]%a;else for(var d=this.t-1;d>=0;--d)c=(b*c+this[d])%a;return c}function bnmodinverse(a){var b=a.iseven();if(this.iseven()&&b||0==a.signum())return biginteger.zero;for(var c=a.clone(),d=this.clone(),e=nbv(1),f=nbv(0),g=nbv(0),h=nbv(1);0!=c.signum();){for(;c.iseven();)c.rshiftto(1,c),b?(e.iseven()&&f.iseven()||(e.addto(this,e),f.subto(a,f)),e.rshiftto(1,e)):f.iseven()||f.subto(a,f),f.rshiftto(1,f);for(;d.iseven();)d.rshiftto(1,d),b?(g.iseven()&&h.iseven()||(g.addto(this,g),h.subto(a,h)),g.rshiftto(1,g)):h.iseven()||h.subto(a,h),h.rshiftto(1,h);c.compareto(d)>=0?(c.subto(d,c),b&&e.subto(g,e),f.subto(h,f)):(d.subto(c,d),b&&g.subto(e,g),h.subto(f,h))}return 0!=d.compareto(biginteger.one)?biginteger.zero:h.compareto(a)>=0?h.subtract(a):h.signum()<0?(h.addto(a,h),h.signum()<0?h.add(a):h):h}function bnisprobableprime(a){var b,c=this.abs();if(1==c.t&&c[0]<=lowprimes[lowprimes.length-1]){for(b=0;bd;)d*=lowprimes[e++];for(d=c.modint(d);e>b;)if(d%lowprimes[b++]==0)return!1}return c.millerrabin(a)}function bnpmillerrabin(a){var b=this.subtract(biginteger.one),c=b.getlowestsetbit();if(0>=c)return!1;var d=b.shiftright(c);a=a+1>>1,a>lowprimes.length&&(a=lowprimes.length);for(var e=nbi(),f=0;a>f;++f){e.fromint(lowprimes[math.floor(math.random()*lowprimes.length)]);var g=e.modpow(d,this);if(0!=g.compareto(biginteger.one)&&0!=g.compareto(b)){for(var h=1;h++b;++b)this.s[b]=b;for(c=0,b=0;256>b;++b)c=c+this.s[b]+a[b%a.length]&255,d=this.s[b],this.s[b]=this.s[c],this.s[c]=d;this.i=0,this.j=0}function arc4next(){var a;return this.i=this.i+1&255,this.j=this.j+this.s[this.i]&255,a=this.s[this.i],this.s[this.i]=this.s[this.j],this.s[this.j]=a,this.s[a+this.s[this.i]&255]}function prng_newstate(){return new arcfour}function rng_get_byte(){if(null==rng_state){for(rng_state=prng_newstate();rng_psize>rng_pptr;){var a=math.floor(65536*math.random());rng_pool[rng_pptr++]=255&a}for(rng_state.init(rng_pool),rng_pptr=0;rng_pptra?"0"+a.tostring(16):a.tostring(16)}function pkcs1pad2(a,b){if(b=0&&b>0;){var e=a.charcodeat(d--);128>e?c[--b]=e:e>127&&2048>e?(c[--b]=63&e|128,c[--b]=e>>6|192):(c[--b]=63&e|128,c[--b]=e>>6&63|128,c[--b]=e>>12|224)}c[--b]=0;for(var f=new securerandom,g=new array;b>2;){for(g[0]=0;0==g[0];)f.nextbytes(g);c[--b]=g[0]}return c[--b]=2,c[--b]=0,new biginteger(c)}function rsakey(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}function rsasetpublic(a,b){null!=a&&null!=b&&a.length>0&&b.length>0?(this.n=parsebigint(a,16),this.e=parseint(b,16)):console.error("invalid rsa public key")}function rsadopublic(a){return a.modpowint(this.e,this.n)}function rsaencrypt(a){var b=pkcs1pad2(a,this.n.bitlength()+7>>3);if(null==b)return null;var c=this.dopublic(b);if(null==c)return null;var d=c.tostring(16);return 0==(1&d.length)?d:"0"+d}function pkcs1unpad2(a,b){for(var c=a.tobytearray(),d=0;d=c.length)return null;for(var e="";++df?e+=string.fromcharcode(f):f>191&&224>f?(e+=string.fromcharcode((31&f)<<6|63&c[d+1]),++d):(e+=string.fromcharcode((15&f)<<12|(63&c[d+1])<<6|63&c[d+2]),d+=2)}return e}function rsasetprivate(a,b,c){null!=a&&null!=b&&a.length>0&&b.length>0?(this.n=parsebigint(a,16),this.e=parseint(b,16),this.d=parsebigint(c,16)):console.error("invalid rsa private key")}function rsasetprivateex(a,b,c,d,e,f,g,h){null!=a&&null!=b&&a.length>0&&b.length>0?(this.n=parsebigint(a,16),this.e=parseint(b,16),this.d=parsebigint(c,16),this.p=parsebigint(d,16),this.q=parsebigint(e,16),this.dmp1=parsebigint(f,16),this.dmq1=parsebigint(g,16),this.coeff=parsebigint(h,16)):console.error("invalid rsa private key")}function rsagenerate(a,b){var c=new securerandom,d=a>>1;this.e=parseint(b,16);for(var e=new biginteger(b,16);;){for(;this.p=new biginteger(a-d,1,c),0!=this.p.subtract(biginteger.one).gcd(e).compareto(biginteger.one)||!this.p.isprobableprime(10););for(;this.q=new biginteger(d,1,c),0!=this.q.subtract(biginteger.one).gcd(e).compareto(biginteger.one)||!this.q.isprobableprime(10););if(this.p.compareto(this.q)<=0){var f=this.p;this.p=this.q,this.q=f}var g=this.p.subtract(biginteger.one),h=this.q.subtract(biginteger.one),i=g.multiply(h);if(0==i.gcd(e).compareto(biginteger.one)){this.n=this.p.multiply(this.q),this.d=e.modinverse(i),this.dmp1=this.d.mod(g),this.dmq1=this.d.mod(h),this.coeff=this.q.modinverse(this.p);break}}}function rsadoprivate(a){if(null==this.p||null==this.q)return a.modpow(this.d,this.n);for(var b=a.mod(this.p).modpow(this.dmp1,this.p),c=a.mod(this.q).modpow(this.dmq1,this.q);b.compareto(c)<0;)b=b.add(this.p);return b.subtract(c).multiply(this.coeff).mod(this.p).multiply(this.q).add(c)}function rsadecrypt(a){var b=parsebigint(a,16),c=this.doprivate(b);return null==c?null:pkcs1unpad2(c,this.n.bitlength()+7>>3)}function hex2b64(a){var b,c,d="";for(b=0;b+3<=a.length;b+=3)c=parseint(a.substring(b,b+3),16),d+=b64map.charat(c>>6)+b64map.charat(63&c);for(b+1==a.length?(c=parseint(a.substring(b,b+1),16),d+=b64map.charat(c<<2)):b+2==a.length&&(c=parseint(a.substring(b,b+2),16),d+=b64map.charat(c>>2)+b64map.charat((3&c)<<4));(3&d.length)>0;)d+=b64pad;return d}function b64tohex(a){var b,c,d="",e=0;for(b=0;b>2),c=3&v,e=1):1==e?(d+=int2char(c<<2|v>>4),c=15&v,e=2):2==e?(d+=int2char(c),d+=int2char(v>>2),c=3&v,e=3):(d+=int2char(c<<2|v>>4),d+=int2char(15&v),e=0));return 1==e&&(d+=int2char(c<<2)),d}function b64toba(a){var b,c=b64tohex(a),d=new array;for(b=0;2*b=vv;++vv)bi_rc[rr++]=vv;for(rr="a".charcodeat(0),vv=10;36>vv;++vv)bi_rc[rr++]=vv;for(rr="a".charcodeat(0),vv=10;36>vv;++vv)bi_rc[rr++]=vv;classic.prototype.convert=cconvert,classic.prototype.revert=crevert,classic.prototype.reduce=creduce,classic.prototype.multo=cmulto,classic.prototype.sqrto=csqrto,montgomery.prototype.convert=montconvert,montgomery.prototype.revert=montrevert,montgomery.prototype.reduce=montreduce,montgomery.prototype.multo=montmulto,montgomery.prototype.sqrto=montsqrto,biginteger.prototype.copyto=bnpcopyto,biginteger.prototype.fromint=bnpfromint,biginteger.prototype.fromstring=bnpfromstring,biginteger.prototype.clamp=bnpclamp,biginteger.prototype.dlshiftto=bnpdlshiftto,biginteger.prototype.drshiftto=bnpdrshiftto,biginteger.prototype.lshiftto=bnplshiftto,biginteger.prototype.rshiftto=bnprshiftto,biginteger.prototype.subto=bnpsubto,biginteger.prototype.multiplyto=bnpmultiplyto,biginteger.prototype.squareto=bnpsquareto,biginteger.prototype.divremto=bnpdivremto,biginteger.prototype.invdigit=bnpinvdigit,biginteger.prototype.iseven=bnpiseven,biginteger.prototype.exp=bnpexp,biginteger.prototype.tostring=bntostring,biginteger.prototype.negate=bnnegate,biginteger.prototype.abs=bnabs,biginteger.prototype.compareto=bncompareto,biginteger.prototype.bitlength=bnbitlength,biginteger.prototype.mod=bnmod,biginteger.prototype.modpowint=bnmodpowint,biginteger.zero=nbv(0),biginteger.one=nbv(1),nullexp.prototype.convert=nnop,nullexp.prototype.revert=nnop,nullexp.prototype.multo=nmulto,nullexp.prototype.sqrto=nsqrto,barrett.prototype.convert=barrettconvert,barrett.prototype.revert=barrettrevert,barrett.prototype.reduce=barrettreduce,barrett.prototype.multo=barrettmulto,barrett.prototype.sqrto=barrettsqrto;var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=(1<<26)/lowprimes[lowprimes.length-1];biginteger.prototype.chunksize=bnpchunksize,biginteger.prototype.toradix=bnptoradix,biginteger.prototype.fromradix=bnpfromradix,biginteger.prototype.fromnumber=bnpfromnumber,biginteger.prototype.bitwiseto=bnpbitwiseto,biginteger.prototype.changebit=bnpchangebit,biginteger.prototype.addto=bnpaddto,biginteger.prototype.dmultiply=bnpdmultiply,biginteger.prototype.daddoffset=bnpdaddoffset,biginteger.prototype.multiplylowerto=bnpmultiplylowerto,biginteger.prototype.multiplyupperto=bnpmultiplyupperto,biginteger.prototype.modint=bnpmodint,biginteger.prototype.millerrabin=bnpmillerrabin,biginteger.prototype.clone=bnclone,biginteger.prototype.intvalue=bnintvalue,biginteger.prototype.bytevalue=bnbytevalue,biginteger.prototype.shortvalue=bnshortvalue,biginteger.prototype.signum=bnsignum,biginteger.prototype.tobytearray=bntobytearray,biginteger.prototype.equals=bnequals,biginteger.prototype.min=bnmin,biginteger.prototype.max=bnmax,biginteger.prototype.and=bnand,biginteger.prototype.or=bnor,biginteger.prototype.xor=bnxor,biginteger.prototype.andnot=bnandnot,biginteger.prototype.not=bnnot,biginteger.prototype.shiftleft=bnshiftleft,biginteger.prototype.shiftright=bnshiftright,biginteger.prototype.getlowestsetbit=bngetlowestsetbit,biginteger.prototype.bitcount=bnbitcount,biginteger.prototype.testbit=bntestbit,biginteger.prototype.setbit=bnsetbit,biginteger.prototype.clearbit=bnclearbit,biginteger.prototype.flipbit=bnflipbit,biginteger.prototype.add=bnadd,biginteger.prototype.subtract=bnsubtract,biginteger.prototype.multiply=bnmultiply,biginteger.prototype.divide=bndivide,biginteger.prototype.remainder=bnremainder,biginteger.prototype.divideandremainder=bndivideandremainder,biginteger.prototype.modpow=bnmodpow,biginteger.prototype.modinverse=bnmodinverse,biginteger.prototype.pow=bnpow,biginteger.prototype.gcd=bngcd,biginteger.prototype.isprobableprime=bnisprobableprime,biginteger.prototype.square=bnsquare,arcfour.prototype.init=arc4init,arcfour.prototype.next=arc4next;var rng_psize=256,rng_state,rng_pool,rng_pptr;if(null==rng_pool){rng_pool=new array,rng_pptr=0;var t;if(window.crypto&&window.crypto.getrandomvalues){var z=new uint32array(256);for(window.crypto.getrandomvalues(z),t=0;t=256||rng_pptr>=rng_psize)return void(window.removeeventlistener?window.removeeventlistener("mousemove",onmousemovelistener):window.detachevent&&window.detachevent("onmousemove",onmousemovelistener));this.count+=1;var b=a.x+a.y;rng_pool[rng_pptr++]=255&b};window.addeventlistener?window.addeventlistener("mousemove",onmousemovelistener):window.attachevent&&window.attachevent("onmousemove",onmousemovelistener)}securerandom.prototype.nextbytes=rng_get_bytes,rsakey.prototype.dopublic=rsadopublic,rsakey.prototype.setpublic=rsasetpublic,rsakey.prototype.encrypt=rsaencrypt,rsakey.prototype.doprivate=rsadoprivate,rsakey.prototype.setprivate=rsasetprivate,rsakey.prototype.setprivateex=rsasetprivateex,rsakey.prototype.generate=rsagenerate,rsakey.prototype.decrypt=rsadecrypt,function(){var a=function(a,b,c){var d=new securerandom,e=a>>1;this.e=parseint(b,16);var f=new biginteger(b,16),g=this,h=function(){var b=function(){if(g.p.compareto(g.q)<=0){var a=g.p;g.p=g.q,g.q=a}var b=g.p.subtract(biginteger.one),d=g.q.subtract(biginteger.one),e=b.multiply(d);0==e.gcd(f).compareto(biginteger.one)?(g.n=g.p.multiply(g.q),g.d=f.modinverse(e),g.dmp1=g.d.mod(b),g.dmq1=g.d.mod(d),g.coeff=g.q.modinverse(g.p),settimeout(function(){c()},0)):settimeout(h,0)},i=function(){g.q=nbi(),g.q.fromnumberasync(e,1,d,function(){g.q.subtract(biginteger.one).gcda(f,function(a){0==a.compareto(biginteger.one)&&g.q.isprobableprime(10)?settimeout(b,0):settimeout(i,0)})})},j=function(){g.p=nbi(),g.p.fromnumberasync(a-e,1,d,function(){g.p.subtract(biginteger.one).gcda(f,function(a){0==a.compareto(biginteger.one)&&g.p.isprobableprime(10)?settimeout(i,0):settimeout(j,0)})})};settimeout(j,0)};settimeout(h,0)};rsakey.prototype.generateasync=a;var b=function(a,b){var c=this.s<0?this.negate():this.clone(),d=a.s<0?a.negate():a.clone();if(c.compareto(d)<0){var e=c;c=d,d=e}var f=c.getlowestsetbit(),g=d.getlowestsetbit();if(0>g)return void b(c);g>f&&(g=f),g>0&&(c.rshiftto(g,c),d.rshiftto(g,d));var h=function(){(f=c.getlowestsetbit())>0&&c.rshiftto(f,c),(f=d.getlowestsetbit())>0&&d.rshiftto(f,d),c.compareto(d)>=0?(c.subto(d,c),c.rshiftto(1,c)):(d.subto(c,d),d.rshiftto(1,d)),c.signum()>0?settimeout(h,0):(g>0&&d.lshiftto(g,d),settimeout(function(){b(d)},0))};settimeout(h,10)};biginteger.prototype.gcda=b;var c=function(a,b,c,d){if("number"==typeof b)if(2>a)this.fromint(1);else{this.fromnumber(a,c),this.testbit(a-1)||this.bitwiseto(biginteger.one.shiftleft(a-1),op_or,this),this.iseven()&&this.daddoffset(1,0);var e=this,f=function(){e.daddoffset(2,0),e.bitlength()>a&&e.subto(biginteger.one.shiftleft(a-1),e),e.isprobableprime(b)?settimeout(function(){d()},0):settimeout(f,0)};settimeout(f,0)}else{var g=new array,h=7&a;g.length=(a>>3)+1,b.nextbytes(g),h>0?g[0]&=(1<f;f++)e+="f";var g=new biginteger(e,16),h=g.xor(a).add(biginteger.one);b=h.tostring(16).replace(/^-/,"")}return b},this.getpemstringfromhex=function(a,b){var c=cryptojs.enc.hex.parse(a),d=cryptojs.enc.base64.stringify(c),e=d.replace(/(.{64})/g,"$1\r\n");return e=e.replace(/\r\n$/,""),"-----begin "+b+"-----\r\n"+e+"\r\n-----end "+b+"-----\r\n"}},kjur.asn1.asn1object=function(){var a="";this.getlengthhexfromvalue=function(){if("undefined"==typeof this.hv||null==this.hv)throw"this.hv is null or undefined.";if(this.hv.length%2==1)throw"value hex must be even length: n="+a.length+",v="+this.hv;var b=this.hv.length/2,c=b.tostring(16);if(c.length%2==1&&(c="0"+c),128>b)return c;var d=c.length/2;if(d>15)throw"asn.1 length too long to represent by 8x: n = "+b.tostring(16);var e=128+d;return e.tostring(16)+c},this.getencodedhex=function(){return(null==this.htlv||this.ismodified)&&(this.hv=this.getfreshvaluehex(),this.hl=this.getlengthhexfromvalue(),this.htlv=this.ht+this.hl+this.hv,this.ismodified=!1),this.htlv},this.getvaluehex=function(){return this.getencodedhex(),this.hv},this.getfreshvaluehex=function(){return""}},kjur.asn1.derabstractstring=function(a){kjur.asn1.derabstractstring.superclass.constructor.call(this);this.getstring=function(){return this.s},this.setstring=function(a){this.htlv=null,this.ismodified=!0,this.s=a,this.hv=stohex(this.s)},this.setstringhex=function(a){this.htlv=null,this.ismodified=!0,this.s=null,this.hv=a},this.getfreshvaluehex=function(){return this.hv},"undefined"!=typeof a&&("undefined"!=typeof a.str?this.setstring(a.str):"undefined"!=typeof a.hex&&this.setstringhex(a.hex))},jsx.extend(kjur.asn1.derabstractstring,kjur.asn1.asn1object),kjur.asn1.derabstracttime=function(){kjur.asn1.derabstracttime.superclass.constructor.call(this);this.localdatetoutc=function(a){utc=a.gettime()+6e4*a.gettimezoneoffset();var b=new date(utc);return b},this.formatdate=function(a,b){var c=this.zeropadding,d=this.localdatetoutc(a),e=string(d.getfullyear());"utc"==b&&(e=e.substr(2,2));var f=c(string(d.getmonth()+1),2),g=c(string(d.getdate()),2),h=c(string(d.gethours()),2),i=c(string(d.getminutes()),2),j=c(string(d.getseconds()),2);return e+f+g+h+i+j+"z"},this.zeropadding=function(a,b){return a.length>=b?a:new array(b-a.length+1).join("0")+a},this.getstring=function(){return this.s},this.setstring=function(a){this.htlv=null,this.ismodified=!0,this.s=a,this.hv=stohex(this.s)},this.setbydatevalue=function(a,b,c,d,e,f){var g=new date(date.utc(a,b-1,c,d,e,f,0));this.setbydate(g)},this.getfreshvaluehex=function(){return this.hv}},jsx.extend(kjur.asn1.derabstracttime,kjur.asn1.asn1object),kjur.asn1.derabstractstructured=function(a){kjur.asn1.derabstractstring.superclass.constructor.call(this);this.setbyasn1objectarray=function(a){this.htlv=null,this.ismodified=!0,this.asn1array=a},this.appendasn1object=function(a){this.htlv=null,this.ismodified=!0,this.asn1array.push(a)},this.asn1array=new array,"undefined"!=typeof a&&"undefined"!=typeof a.array&&(this.asn1array=a.array)},jsx.extend(kjur.asn1.derabstractstructured,kjur.asn1.asn1object),kjur.asn1.derboolean=function(){kjur.asn1.derboolean.superclass.constructor.call(this),this.ht="01",this.htlv="0101ff"},jsx.extend(kjur.asn1.derboolean,kjur.asn1.asn1object),kjur.asn1.derinteger=function(a){kjur.asn1.derinteger.superclass.constructor.call(this),this.ht="02",this.setbybiginteger=function(a){this.htlv=null,this.ismodified=!0,this.hv=kjur.asn1.asn1util.biginttomintwoscomplementshex(a)},this.setbyinteger=function(a){var b=new biginteger(string(a),10);this.setbybiginteger(b)},this.setvaluehex=function(a){this.hv=a},this.getfreshvaluehex=function(){return this.hv},"undefined"!=typeof a&&("undefined"!=typeof a.bigint?this.setbybiginteger(a.bigint):"undefined"!=typeof a["int"]?this.setbyinteger(a["int"]):"undefined"!=typeof a.hex&&this.setvaluehex(a.hex))},jsx.extend(kjur.asn1.derinteger,kjur.asn1.asn1object),kjur.asn1.derbitstring=function(a){kjur.asn1.derbitstring.superclass.constructor.call(this),this.ht="03",this.sethexvalueincludingunusedbits=function(a){this.htlv=null,this.ismodified=!0,this.hv=a},this.setunusedbitsandhexvalue=function(a,b){if(0>a||a>7)throw"unused bits shall be from 0 to 7: u = "+a;var c="0"+a;this.htlv=null,this.ismodified=!0,this.hv=c+b},this.setbybinarystring=function(a){a=a.replace(/0+$/,"");var b=8-a.length%8;8==b&&(b=0);for(var c=0;b>=c;c++)a+="0";for(var d="",c=0;cc;c++)b[c]=!1;return b},this.getfreshvaluehex=function(){return this.hv},"undefined"!=typeof a&&("undefined"!=typeof a.hex?this.sethexvalueincludingunusedbits(a.hex):"undefined"!=typeof a.bin?this.setbybinarystring(a.bin):"undefined"!=typeof a.array&&this.setbybooleanarray(a.array))},jsx.extend(kjur.asn1.derbitstring,kjur.asn1.asn1object),kjur.asn1.deroctetstring=function(a){kjur.asn1.deroctetstring.superclass.constructor.call(this,a),this.ht="04"},jsx.extend(kjur.asn1.deroctetstring,kjur.asn1.derabstractstring),kjur.asn1.dernull=function(){kjur.asn1.dernull.superclass.constructor.call(this),this.ht="05",this.htlv="0500"},jsx.extend(kjur.asn1.dernull,kjur.asn1.asn1object),kjur.asn1.derobjectidentifier=function(a){var b=function(a){var b=a.tostring(16);return 1==b.length&&(b="0"+b),b},c=function(a){var c="",d=new biginteger(a,10),e=d.tostring(2),f=7-e.length%7;7==f&&(f=0);for(var g="",h=0;f>h;h++)g+="0";e=g+e;for(var h=0;hd;++d)b[e.charat(d)]=d;for(e=e.tolowercase(),d=10;16>d;++d)b[e.charat(d)]=d;for(d=0;d=2?(g[g.length]=h,h=0,i=0):h<<=4}}if(i)throw"hex encoding incomplete: 4 bits missing";return g},window.hex=c}(),function(a){"use strict";var b,c={};c.decode=function(c){var d;if(b===a){var e="abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789+/",f="= \f\n\r 聽\u2028\u2029";for(b=[],d=0;64>d;++d)b[e.charat(d)]=d;for(d=0;d=4?(g[g.length]=h>>16,g[g.length]=h>>8&255,g[g.length]=255&h,h=0,i=0):h<<=6}}switch(i){case 1:throw"base64 encoding incomplete: at least 2 bits missing";case 2:g[g.length]=h>>10;break;case 3:g[g.length]=h>>16,g[g.length]=h>>8&255}return g},c.re=/-----begin [^-]+-----([a-za-z0-9+\/=\s]+)-----end [^-]+-----|begin-base64[^\n]+\n([a-za-z0-9+\/=\s]+)====/,c.unarmor=function(a){var b=c.re.exec(a);if(b)if(b[1])a=b[1];else{if(!b[2])throw"regexp out of sync";a=b[2]}return c.decode(a)},window.base64=c}(),function(a){"use strict";function b(a,c){a instanceof b?(this.enc=a.enc,this.pos=a.pos):(this.enc=a,this.pos=c)}function c(a,b,c,d,e){this.stream=a,this.header=b,this.length=c,this.tag=d,this.sub=e}var d=100,e="鈥�",f={tag:function(a,b){var c=document.createelement(a);return c.classname=b,c},text:function(a){return document.createtextnode(a)}};b.prototype.get=function(b){if(b===a&&(b=this.pos++),b>=this.enc.length)throw"requesting byte offset "+b+" on a stream of length "+this.enc.length;return this.enc[b]},b.prototype.hexdigits="0123456789abcdef",b.prototype.hexbyte=function(a){return this.hexdigits.charat(a>>4&15)+this.hexdigits.charat(15&a)},b.prototype.hexdump=function(a,b,c){for(var d="",e=a;b>e;++e)if(d+=this.hexbyte(this.get(e)),c!==!0)switch(15&e){case 7:d+=" ";break;case 15:d+="\n";break;default:d+=" "}return d},b.prototype.parsestringiso=function(a,b){for(var c="",d=a;b>d;++d)c+=string.fromcharcode(this.get(d));return c},b.prototype.parsestringutf=function(a,b){for(var c="",d=a;b>d;){var e=this.get(d++);c+=string.fromcharcode(128>e?e:e>191&&224>e?(31&e)<<6|63&this.get(d++):(15&e)<<12|(63&this.get(d++))<<6|63&this.get(d++))}return c},b.prototype.parsestringbmp=function(a,b){for(var c="",d=a;b>d;d+=2){var e=this.get(d),f=this.get(d+1);c+=string.fromcharcode((e<<8)+f)}return c},b.prototype.retime=/^((?:1[89]|2\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)?)?$/,b.prototype.parsetime=function(a,b){var c=this.parsestringiso(a,b),d=this.retime.exec(c);return d?(c=d[1]+"-"+d[2]+"-"+d[3]+" "+d[4],d[5]&&(c+=":"+d[5],d[6]&&(c+=":"+d[6],d[7]&&(c+="."+d[7]))),d[8]&&(c+=" utc","z"!=d[8]&&(c+=d[8],d[9]&&(c+=":"+d[9]))),c):"unrecognized time: "+c},b.prototype.parseinteger=function(a,b){var c=b-a;if(c>4){c<<=3;var d=this.get(a);if(0===d)c-=8;else for(;128>d;)d<<=1,--c;return"("+c+" bit)"}for(var e=0,f=a;b>f;++f)e=e<<8|this.get(f);return e},b.prototype.parsebitstring=function(a,b){var c=this.get(a),d=(b-a-1<<3)-c,e="("+d+" bit)";if(20>=d){var f=c;e+=" ";for(var g=b-1;g>a;--g){for(var h=this.get(g),i=f;8>i;++i)e+=h>>i&1?"1":"0";f=0}}return e},b.prototype.parseoctetstring=function(a,b){var c=b-a,f="("+c+" byte) ";c>d&&(b=a+d);for(var g=a;b>g;++g)f+=this.hexbyte(this.get(g));return c>d&&(f+=e),f},b.prototype.parseoid=function(a,b){for(var c="",d=0,e=0,f=a;b>f;++f){var g=this.get(f);if(d=d<<7|127&g,e+=7,!(128&g)){if(""===c){var h=80>d?40>d?0:1:2;c=h+"."+(d-40*h)}else c+="."+(e>=31?"bigint":d);d=e=0}}return c},c.prototype.typename=function(){if(this.tag===a)return"unknown";var b=this.tag>>6,c=(this.tag>>5&1,31&this.tag);switch(b){case 0:switch(c){case 0:return"eoc";case 1:return"boolean";case 2:return"integer";case 3:return"bit_string";case 4:return"octet_string";case 5:return"null";case 6:return"object_identifier";case 7:return"objectdescriptor";case 8:return"external";case 9:return"real";case 10:return"enumerated";case 11:return"embedded_pdv";case 12:return"utf8string";case 16:return"sequence";case 17:return"set";case 18:return"numericstring";case 19:return"printablestring";case 20:return"teletexstring";case 21:return"videotexstring";case 22:return"ia5string";case 23:return"utctime";case 24:return"generalizedtime";case 25:return"graphicstring";case 26:return"visiblestring";case 27:return"generalstring";case 28:return"universalstring";case 30:return"bmpstring";default:return"universal_"+c.tostring(16)}case 1:return"application_"+c.tostring(16);case 2:return"["+c+"]";case 3:return"private_"+c.tostring(16)}},c.prototype.reseemsascii=/^[ -~]+$/,c.prototype.content=function(){if(this.tag===a)return null;var b=this.tag>>6,c=31&this.tag,f=this.poscontent(),g=math.abs(this.length);if(0!==b){if(null!==this.sub)return"("+this.sub.length+" elem)";var h=this.stream.parsestringiso(f,f+math.min(g,d));return this.reseemsascii.test(h)?h.substring(0,2*d)+(h.length>2*d?e:""):this.stream.parseoctetstring(f,f+g)}switch(c){case 1:return 0===this.stream.get(f)?"false":"true";case 2:return this.stream.parseinteger(f,f+g);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parsebitstring(f,f+g);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseoctetstring(f,f+g);case 6:return this.stream.parseoid(f,f+g);case 16:case 17:return"("+this.sub.length+" elem)";case 12:return this.stream.parsestringutf(f,f+g);case 18:case 19:case 20:case 21:case 22:case 26:return this.stream.parsestringiso(f,f+g);case 30:return this.stream.parsestringbmp(f,f+g);case 23:case 24:return this.stream.parsetime(f,f+g)}return null},c.prototype.tostring=function(){return this.typename()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},c.prototype.print=function(b){if(b===a&&(b=""),document.writeln(b+this),null!==this.sub){b+=" ";for(var c=0,d=this.sub.length;d>c;++c)this.sub[c].print(b)}},c.prototype.toprettystring=function(b){b===a&&(b="");var c=b+this.typename()+" @"+this.stream.pos;if(this.length>=0&&(c+="+"),c+=this.length,32&this.tag?c+=" (constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(c+=" (encapsulates)"),c+="\n",null!==this.sub){b+=" ";for(var d=0,e=this.sub.length;e>d;++d)c+=this.sub[d].toprettystring(b)}return c},c.prototype.todom=function(){var a=f.tag("div","node");a.asn1=this;var b=f.tag("div","head"),c=this.typename().replace(/_/g," ");b.innerhtml=c;var d=this.content();if(null!==d){d=string(d).replace(/",c+="length: "+this.header+"+",c+=this.length>=0?this.length:-this.length+" (undefined)",32&this.tag?c+="
(constructed)":3!=this.tag&&4!=this.tag||null===this.sub||(c+="
(encapsulates)"),null!==d&&(c+="
value:
"+d+"","object"==typeof oids&&6==this.tag)){var h=oids[d];h&&(h.d&&(c+="
"+h.d),h.c&&(c+="
"+h.c),h.w&&(c+="
(warning!)"))}g.innerhtml=c,a.appendchild(g);var i=f.tag("div","sub");if(null!==this.sub)for(var j=0,k=this.sub.length;k>j;++j)i.appendchild(this.sub[j].todom());return a.appendchild(i),b.onclick=function(){a.classname="node collapsed"==a.classname?"node":"node collapsed"},a},c.prototype.posstart=function(){return this.stream.pos},c.prototype.poscontent=function(){return this.stream.pos+this.header},c.prototype.posend=function(){return this.stream.pos+this.header+math.abs(this.length)},c.prototype.fakehover=function(a){this.node.classname+=" hover",a&&(this.head.classname+=" hover")},c.prototype.fakeout=function(a){var b=/ ?hover/;this.node.classname=this.node.classname.replace(b,""),a&&(this.head.classname=this.head.classname.replace(b,""))},c.prototype.tohexdom_sub=function(a,b,c,d,e){if(!(d>=e)){var g=f.tag("span",b);g.appendchild(f.text(c.hexdump(d,e))),a.appendchild(g)}},c.prototype.tohexdom=function(b){var c=f.tag("span","hex");if(b===a&&(b=c),this.head.hexnode=c,this.head.onmouseover=function(){this.hexnode.classname="hexcurrent"},this.head.onmouseout=function(){this.hexnode.classname="hex"},c.asn1=this,c.onmouseover=function(){var a=!b.selected;a&&(b.selected=this.asn1,this.classname="hexcurrent"),this.asn1.fakehover(a)},c.onmouseout=function(){var a=b.selected==this.asn1;this.asn1.fakeout(a),a&&(b.selected=null,this.classname="hex")},this.tohexdom_sub(c,"tag",this.stream,this.posstart(),this.posstart()+1),this.tohexdom_sub(c,this.length>=0?"dlen":"ulen",this.stream,this.posstart()+1,this.poscontent()),null===this.sub)c.appendchild(f.text(this.stream.hexdump(this.poscontent(),this.posend())));else if(this.sub.length>0){var d=this.sub[0],e=this.sub[this.sub.length-1];this.tohexdom_sub(c,"intro",this.stream,this.poscontent(),d.posstart());for(var g=0,h=this.sub.length;h>g;++g)c.appendchild(this.sub[g].tohexdom(b));this.tohexdom_sub(c,"outro",this.stream,e.posend(),this.posend())}return c},c.prototype.tohexstring=function(){return this.stream.hexdump(this.posstart(),this.posend(),!0)},c.decodelength=function(a){var b=a.get(),c=127&b;if(c==b)return c;if(c>3)throw"length over 24 bits not supported at position "+(a.pos-1);if(0===c)return-1;b=0;for(var d=0;c>d;++d)b=b<<8|a.get();return b},c.hascontent=function(a,d,e){if(32&a)return!0;if(3>a||a>4)return!1;var f=new b(e);3==a&&f.get();var g=f.get();if(g>>6&1)return!1;try{var h=c.decodelength(f);return f.pos-e.pos+h==d}catch(i){return!1}},c.decode=function(a){a instanceof b||(a=new b(a,0));var d=new b(a),e=a.get(),f=c.decodelength(a),g=a.pos-d.pos,h=null;if(c.hascontent(e,f,a)){var i=a.pos;if(3==e&&a.get(),h=[],f>=0){for(var j=i+f;a.posd;++d){var f=new b(a[d].value,0),g=c.decodelength(f);g!=a[d].expected&&document.write("in test["+d+"] expected "+a[d].expected+" got "+g+"\n")}},window.asn1=c}(),asn1.prototype.gethexstringvalue=function(){var a=this.tohexstring(),b=2*this.header,c=2*this.length;return a.substr(b,c)},rsakey.prototype.parsekey=function(a){try{var b=0,c=0,d=/^\s*(?:[0-9a-fa-f][0-9a-fa-f]\s*)+$/,e=d.test(a)?hex.decode(a):base64.unarmor(a),f=asn1.decode(e);if(3===f.sub.length&&(f=f.sub[2].sub[0]),9===f.sub.length){b=f.sub[1].gethexstringvalue(),this.n=parsebigint(b,16),c=f.sub[2].gethexstringvalue(),this.e=parseint(c,16);var g=f.sub[3].gethexstringvalue();this.d=parsebigint(g,16);var h=f.sub[4].gethexstringvalue();this.p=parsebigint(h,16);var i=f.sub[5].gethexstringvalue();this.q=parsebigint(i,16);var j=f.sub[6].gethexstringvalue();this.dmp1=parsebigint(j,16);var k=f.sub[7].gethexstringvalue();this.dmq1=parsebigint(k,16);var l=f.sub[8].gethexstringvalue();this.coeff=parsebigint(l,16)}else{if(2!==f.sub.length)return!1;var m=f.sub[1],n=m.sub[0];b=n.sub[0].gethexstringvalue(),this.n=parsebigint(b,16),c=n.sub[1].gethexstringvalue(),this.e=parseint(c,16)}return!0}catch(o){return!1}},rsakey.prototype.getprivatebasekey=function(){var a={array:[new kjur.asn1.derinteger({"int":0}),new kjur.asn1.derinteger({bigint:this.n}),new kjur.asn1.derinteger({"int":this.e}),new kjur.asn1.derinteger({bigint:this.d}),new kjur.asn1.derinteger({bigint:this.p}),new kjur.asn1.derinteger({bigint:this.q}),new kjur.asn1.derinteger({bigint:this.dmp1}),new kjur.asn1.derinteger({bigint:this.dmq1}),new kjur.asn1.derinteger({bigint:this.coeff})]},b=new kjur.asn1.dersequence(a);return b.getencodedhex()},rsakey.prototype.getprivatebasekeyb64=function(){return hex2b64(this.getprivatebasekey())},rsakey.prototype.getpublicbasekey=function(){var a={array:[new kjur.asn1.derobjectidentifier({oid:"1.2.840.113549.1.1.1"}),new kjur.asn1.dernull]},b=new kjur.asn1.dersequence(a);a={array:[new kjur.asn1.derinteger({bigint:this.n}),new kjur.asn1.derinteger({"int":this.e})]};var c=new kjur.asn1.dersequence(a);a={hex:"00"+c.getencodedhex()};var d=new kjur.asn1.derbitstring(a);a={array:[b,d]};var e=new kjur.asn1.dersequence(a);return e.getencodedhex()},rsakey.prototype.getpublicbasekeyb64=function(){return hex2b64(this.getpublicbasekey())},rsakey.prototype.wordwrap=function(a,b){if(b=b||64,!a)return a;var c="(.{1,"+b+"})( +|$\n?)|(.{1,"+b+"})";return a.match(regexp(c,"g")).join("\n")},rsakey.prototype.getprivatekey=function(){var a="-----begin rsa private key-----\n";return a+=this.wordwrap(this.getprivatebasekeyb64())+"\n",a+="-----end rsa private key-----"},rsakey.prototype.getpublickey=function(){var a="-----begin public key-----\n";return a+=this.wordwrap(this.getpublicbasekeyb64())+"\n",a+="-----end public key-----"},rsakey.prototype.haspublickeyproperty=function(a){return a=a||{},a.hasownproperty("n")&&a.hasownproperty("e")},rsakey.prototype.hasprivatekeyproperty=function(a){return a=a||{},a.hasownproperty("n")&&a.hasownproperty("e")&&a.hasownproperty("d")&&a.hasownproperty("p")&&a.hasownproperty("q")&&a.hasownproperty("dmp1")&&a.hasownproperty("dmq1")&&a.hasownproperty("coeff")},rsakey.prototype.parsepropertiesfrom=function(a){this.n=a.n,this.e=a.e,a.hasownproperty("d")&&(this.d=a.d,this.p=a.p,this.q=a.q,this.dmp1=a.dmp1,this.dmq1=a.dmq1,this.coeff=a.coeff)};var jsencryptrsakey=function(a){rsakey.call(this),a&&("string"==typeof a?this.parsekey(a):(this.hasprivatekeyproperty(a)||this.haspublickeyproperty(a))&&this.parsepropertiesfrom(a))};jsencryptrsakey.prototype=new rsakey,jsencryptrsakey.prototype.constructor=jsencryptrsakey;var jsencrypt=function(a){a=a||{},this.default_key_size=parseint(a.default_key_size)||1024,this.default_public_exponent=a.default_public_exponent||"010001",this.log=a.log||!1,this.key=null};jsencrypt.prototype.setkey=function(a){this.log&&this.key&&console.warn("a key was already set, overriding existing."),this.key=new jsencryptrsakey(a)},jsencrypt.prototype.setprivatekey=function(a){this.setkey(a)},jsencrypt.prototype.setpublickey=function(a){this.setkey(a)},jsencrypt.prototype.decrypt=function(a){try{return this.getkey().decrypt(b64tohex(a))}catch(b){return!1}},jsencrypt.prototype.encrypt=function(a){try{return hex2b64(this.getkey().encrypt(a))}catch(b){return!1}},jsencrypt.prototype.getkey=function(a){if(!this.key){if(this.key=new jsencryptrsakey,a&&"[object function]"==={}.tostring.call(a))return void this.key.generateasync(this.default_key_size,this.default_public_exponent,a);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},jsencrypt.prototype.getprivatekey=function(){return this.getkey().getprivatekey()},jsencrypt.prototype.getprivatekeyb64=function(){return this.getkey().getprivatebasekeyb64()},jsencrypt.prototype.getpublickey=function(){return this.getkey().getpublickey()},jsencrypt.prototype.getpublickeyb64=function(){return this.getkey().getpublicbasekeyb64()};exports.jsencrypt = jsencrypt; })(jsencryptexports); var jsencrypt = jsencryptexports.jsencrypt;