6 lines
172 KiB
JavaScript
6 lines
172 KiB
JavaScript
/*! OpenPGPjs.org this is LGPL licensed code, see LICENSE/our website for more information.- v0.0.1 - 2013-10-18 */(function e(t,r,i){function n(o,a){if(!r[o]){if(!t[o]){var h="function"==typeof require&&require;if(!a&&h)return h(o,!0);if(s)return s(o,!0);throw Error("Cannot find module '"+o+"'")}var c=r[o]={exports:{}};t[o][0].call(c.exports,function(r){var e=t[o][1][r];return n(e?e:r)},c,c.exports,e,t,r,i)}return r[o].exports}for(var s="function"==typeof require&&require,o=0;i.length>o;o++)n(i[o]);return n})({1:[function(t,r){JXG={exists:function(t){return function(r){return!(r===t||null===r)}}()},JXG.decompress=function(t){return unescape(new JXG.Util.Unzip(JXG.Util.Base64.decodeAsArray(t)).unzip()[0][0])},JXG.Util={},JXG.Util.Unzip=function(t){function r(){return N+=8,x.length>P?x[P++]:-1}function e(){K=1}function i(){var t;return N++,t=1&K,K>>=1,0==K&&(K=r(),t=1&K,K=128|K>>1),t}function n(t){for(var r=0,e=t;e--;)r=r<<1|i();return t&&(r=j[r]>>8-t),r}function s(){_=0}function o(t){y++,A[_++]=t,v.push(String.fromCharCode(t)),32768==_&&(_=0)}function a(){this.b0=0,this.b1=0,this.jump=null,this.jumppos=-1}function h(){for(;;){if(q[U]>=V)return-1;if(F[q[U]]==U)return q[U]++;q[U]++}}function c(){var t,r=z[L];if(k&&document.write("<br>len:"+U+" treepos:"+L),17==U)return-1;if(L++,U++,t=h(),k&&document.write("<br>IsPat "+t),t>=0)r.b0=t,k&&document.write("<br>b0 "+r.b0);else if(r.b0=32768,k&&document.write("<br>b0 "+r.b0),c())return-1;if(t=h(),t>=0)r.b1=t,k&&document.write("<br>b1 "+r.b1),r.jump=null;else if(r.b1=32768,k&&document.write("<br>b1 "+r.b1),r.jump=z[L],r.jumppos=L,c())return-1;return U--,0}function u(t,r,e,i){var n;for(k&&document.write("currentTree "+t+" numval "+r+" lengths "+e+" show "+i),z=t,L=0,F=e,V=r,n=0;17>n;n++)q[n]=0;if(U=0,c())return k&&alert("invalid huffman tree\n"),-1;if(k){document.write("<br>Tree: "+z.length);for(var s=0;32>s;s++)document.write("Places["+s+"].b0="+z[s].b0+"<br>"),document.write("Places["+s+"].b1="+z[s].b1+"<br>")}return 0}function p(t){for(var r,e,n,s=0,o=t[s];;)if(n=i(),k&&document.write("b="+n),n){if(!(32768&o.b1))return k&&document.write("ret1"),o.b1;for(o=o.jump,r=t.length,e=0;r>e;e++)if(t[e]===o){s=e;break}}else{if(!(32768&o.b0))return k&&document.write("ret2"),o.b0;s++,o=t[s]}return k&&document.write("ret3"),-1}function l(){var t,h,c,l,f;do{switch(t=i(),c=n(2)){case 0:k&&alert("Stored\n");break;case 1:k&&alert("Fixed Huffman codes\n");break;case 2:k&&alert("Dynamic Huffman codes\n");break;case 3:k&&alert("Reserved block type!!\n");break;default:k&&alert("Unexpected value %d!\n",c)}if(0==c){var d,g;for(e(),d=r(),d|=r()<<8,g=r(),g|=r()<<8,65535&(d^~g)&&document.write("BlockLen checksum mismatch\n");d--;)h=r(),o(h)}else if(1==c)for(var m;;)if(m=j[n(7)]>>1,m>23?(m=m<<1|i(),m>199?(m-=128,m=m<<1|i()):(m-=48,m>143&&(m+=136))):m+=256,256>m)o(m);else{if(256==m)break;var f,y;for(m-=257,f=n(O[m])+T[m],m=j[n(5)]>>3,E[m]>8?(y=n(8),y|=n(E[m]-8)<<8):y=n(E[m]),y+=I[m],m=0;f>m;m++){var h=A[32767&_-y];o(h)}}else if(2==c){var m,b,v,w,C,S=Array(320);for(v=257+n(5),w=1+n(5),C=4+n(4),m=0;19>m;m++)S[m]=0;for(m=0;C>m;m++)S[B[m]]=n(3);for(f=H.length,l=0;f>l;l++)H[l]=new a;if(u(H,19,S,0))return s(),1;if(k){document.write("<br>distanceTree");for(var x=0;H.length>x;x++)document.write("<br>"+H[x].b0+" "+H[x].b1+" "+H[x].jump+" "+H[x].jumppos)}b=v+w,l=0;var P=-1;for(k&&document.write("<br>n="+b+" bits: "+N+"<br>");b>l;)if(P++,m=p(H),k&&document.write("<br>"+P+" i:"+l+" decode: "+m+" bits "+N+"<br>"),16>m)S[l++]=m;else if(16==m){var K;if(m=3+n(2),l+m>b)return s(),1;for(K=l?S[l-1]:0;m--;)S[l++]=K}else{if(m=17==m?3+n(3):11+n(7),l+m>b)return s(),1;for(;m--;)S[l++]=0}for(f=G.length,l=0;f>l;l++)G[l]=new a;if(u(G,v,S,0))return s(),1;for(f=G.length,l=0;f>l;l++)H[l]=new a;var D=[];for(l=v;S.length>l;l++)D[l-v]=S[l];if(u(H,w,D,0))return s(),1;k&&document.write("<br>literalTree");t:for(;;)if(m=p(G),m>=256){var f,y;if(m-=256,0==m)break;for(m--,f=n(O[m])+T[m],m=p(H),E[m]>8?(y=n(8),y|=n(E[m]-8)<<8):y=n(E[m]),y+=I[m];f--;){if(0>_-y)break t;var h=A[32767&_-y];o(h)}}else o(m)}}while(!t);return s(),e(),0}function f(){k&&alert("NEXTFILE"),v=[];var t=[];if(S=!1,t[0]=r(),t[1]=r(),k&&alert("type: "+t[0]+" "+t[1]),t[0]==parseInt("78",16)&&t[1]==parseInt("da",16)&&(k&&alert("GEONExT-GZIP"),l(),k&&alert(v.join("")),C[w]=Array(2),C[w][0]=v.join(""),C[w][1]="geonext.gxt",w++),t[0]==parseInt("78",16)&&t[1]==parseInt("9c",16)&&(k&&alert("ZLIB"),l(),k&&alert(v.join("")),C[w]=Array(2),C[w][0]=v.join(""),C[w][1]="ZLIB",w++),t[0]==parseInt("1f",16)&&t[1]==parseInt("8b",16)&&(k&&alert("GZIP"),d(),k&&alert(v.join("")),C[w]=Array(2),C[w][0]=v.join(""),C[w][1]="file",w++),t[0]==parseInt("50",16)&&t[1]==parseInt("4b",16)&&(S=!0,t[2]=r(),t[3]=r(),t[2]==parseInt("3",16)&&t[3]==parseInt("4",16))){t[0]=r(),t[1]=r(),k&&alert("ZIP-Version: "+t[1]+" "+t[0]/10+"."+t[0]%10),g=r(),g|=r()<<8,k&&alert("gpflags: "+g);var e=r();e|=r()<<8,k&&alert("method: "+e),r(),r(),r(),r();var i=r();i|=r()<<8,i|=r()<<16,i|=r()<<24;var n=r();n|=r()<<8,n|=r()<<16,n|=r()<<24;var s=r();s|=r()<<8,s|=r()<<16,s|=r()<<24,k&&alert("local CRC: "+i+"\nlocal Size: "+s+"\nlocal CompSize: "+n);var o=r();o|=r()<<8;var a=r();for(a|=r()<<8,k&&alert("filelen "+o),c=0,M=[];o--;){var h=r();"/"==h|":"==h?c=0:D-1>c&&(M[c++]=String.fromCharCode(h))}k&&alert("nameBuf: "+M),b||(b=M);for(var c=0;a>c;)h=r(),c++;m=4294967295,y=0,(s=0)&&k&&alert("skipdir"),8==e&&(l(),k&&alert(v.join("")),C[w]=Array(2),C[w][0]=v.join(""),C[w][1]=M.join(""),w++),d()}}function d(){var t,e,i,n,s,o,a=[];if(8&g&&(a[0]=r(),a[1]=r(),a[2]=r(),a[3]=r(),a[0]==parseInt("50",16)&&a[1]==parseInt("4b",16)&&a[2]==parseInt("07",16)&&a[3]==parseInt("08",16)?(t=r(),t|=r()<<8,t|=r()<<16,t|=r()<<24):t=a[0]|a[1]<<8|a[2]<<16|a[3]<<24,e=r(),e|=r()<<8,e|=r()<<16,e|=r()<<24,i=r(),i|=r()<<8,i|=r()<<16,i|=r()<<24,k&&alert("CRC:")),S&&f(),a[0]=r(),8!=a[0])return k&&alert("Unknown compression method!"),0;if(g=r(),k&&g&~parseInt("1f",16)&&alert("Unknown flags set!"),r(),r(),r(),r(),r(),n=r(),4&g)for(a[0]=r(),a[2]=r(),U=a[0]+256*a[1],k&&alert("Extra field size: "+U),s=0;U>s;s++)r();if(8&g){for(s=0,M=[];o=r();)("7"==o||":"==o)&&(s=0),D-1>s&&(M[s++]=o);k&&alert("original file name: "+M)}if(16&g)for(;o=r(););2&g&&(r(),r()),l(),t=r(),t|=r()<<8,t|=r()<<16,t|=r()<<24,i=r(),i|=r()<<8,i|=r()<<16,i|=r()<<24,S&&f()}var g,m,y,b,v=[],k=!1,w=0,C=[],A=Array(32768),_=0,S=!1,j=[0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,3,131,67,195,35,163,99,227,19,147,83,211,51,179,115,243,11,139,75,203,43,171,107,235,27,155,91,219,59,187,123,251,7,135,71,199,39,167,103,231,23,151,87,215,55,183,119,247,15,143,79,207,47,175,111,239,31,159,95,223,63,191,127,255],T=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],O=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,99,99],I=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],E=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],x=t,P=0,K=1,N=0,D=256,M=[],R=288,G=Array(R),H=Array(32),L=0,z=null;Array(64),Array(64);var U=0,q=Array(17);q[0]=0;var F,V;JXG.Util.Unzip.prototype.unzipFile=function(t){var r;for(this.unzip(),r=0;C.length>r;r++)if(C[r][1]==t)return C[r][0]},JXG.Util.Unzip.prototype.deflate=function(){return v=[],S=!1,l(),k&&alert(v.join("")),C[w]=Array(2),C[w][0]=v.join(""),C[w][1]="DEFLATE",w++,C},JXG.Util.Unzip.prototype.unzip=function(){return k&&alert(x),f(),C}},JXG.Util.Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(t){var r,e,i,n,s,o,a,h=[],c=0;for(t=JXG.Util.Base64._utf8_encode(t);t.length>c;)r=t.charCodeAt(c++),e=t.charCodeAt(c++),i=t.charCodeAt(c++),n=r>>2,s=(3&r)<<4|e>>4,o=(15&e)<<2|i>>6,a=63&i,isNaN(e)?o=a=64:isNaN(i)&&(a=64),h.push([this._keyStr.charAt(n),this._keyStr.charAt(s),this._keyStr.charAt(o),this._keyStr.charAt(a)].join(""));return h.join("")},decode:function(t,r){var e,i,n,s,o,a,h,c=[],u=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");t.length>u;)s=this._keyStr.indexOf(t.charAt(u++)),o=this._keyStr.indexOf(t.charAt(u++)),a=this._keyStr.indexOf(t.charAt(u++)),h=this._keyStr.indexOf(t.charAt(u++)),e=s<<2|o>>4,i=(15&o)<<4|a>>2,n=(3&a)<<6|h,c.push(String.fromCharCode(e)),64!=a&&c.push(String.fromCharCode(i)),64!=h&&c.push(String.fromCharCode(n));return c=c.join(""),r&&(c=JXG.Util.Base64._utf8_decode(c)),c},_utf8_encode:function(t){t=t.replace(/\r\n/g,"\n");for(var r="",e=0;t.length>e;e++){var i=t.charCodeAt(e);128>i?r+=String.fromCharCode(i):i>127&&2048>i?(r+=String.fromCharCode(192|i>>6),r+=String.fromCharCode(128|63&i)):(r+=String.fromCharCode(224|i>>12),r+=String.fromCharCode(128|63&i>>6),r+=String.fromCharCode(128|63&i))}return r},_utf8_decode:function(t){for(var r=[],e=0,i=0,n=0,s=0;t.length>e;)i=t.charCodeAt(e),128>i?(r.push(String.fromCharCode(i)),e++):i>191&&224>i?(n=t.charCodeAt(e+1),r.push(String.fromCharCode((31&i)<<6|63&n)),e+=2):(n=t.charCodeAt(e+1),s=t.charCodeAt(e+2),r.push(String.fromCharCode((15&i)<<12|(63&n)<<6|63&s)),e+=3);return r.join("")},_destrip:function(t,r){var e,i,n=[],s=[];for(null==r&&(r=76),t.replace(/ /g,""),e=t.length/r,i=0;e>i;i++)n[i]=t.substr(i*r,r);for(e!=t.length/r&&(n[n.length]=t.substr(e*r,t.length-e*r)),i=0;n.length>i;i++)s.push(n[i]);return s.join("\n")},decodeAsArray:function(t){var r,e=this.decode(t),i=[];for(r=0;e.length>r;r++)i[r]=e.charCodeAt(r);return i},decodeGEONExT:function(t){return decodeAsArray(destrip(t),!1)}},JXG.Util.asciiCharCodeAt=function(t,r){var e=t.charCodeAt(r);if(e>255)switch(e){case 8364:e=128;break;case 8218:e=130;break;case 402:e=131;break;case 8222:e=132;break;case 8230:e=133;break;case 8224:e=134;break;case 8225:e=135;break;case 710:e=136;break;case 8240:e=137;break;case 352:e=138;break;case 8249:e=139;break;case 338:e=140;break;case 381:e=142;break;case 8216:e=145;break;case 8217:e=146;break;case 8220:e=147;break;case 8221:e=148;break;case 8226:e=149;break;case 8211:e=150;break;case 8212:e=151;break;case 732:e=152;break;case 8482:e=153;break;case 353:e=154;break;case 8250:e=155;break;case 339:e=156;break;case 382:e=158;break;case 376:e=159;break;default:}return e},JXG.Util.utf8Decode=function(t){var r,e=[],i=0,n=0,s=0;if(!JXG.exists(t))return"";for(;t.length>i;)n=t.charCodeAt(i),128>n?(e.push(String.fromCharCode(n)),i++):n>191&&224>n?(s=t.charCodeAt(i+1),e.push(String.fromCharCode((31&n)<<6|63&s)),i+=2):(s=t.charCodeAt(i+1),r=t.charCodeAt(i+2),e.push(String.fromCharCode((15&n)<<12|(63&s)<<6|63&r)),i+=3);return e.join("")},JXG.Util.genUUID=function(){for(var t,r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),e=Array(36),i=0,n=0;36>n;n++)8==n||13==n||18==n||23==n?e[n]="-":14==n?e[n]="4":(2>=i&&(i=0|33554432+16777216*Math.random()),t=15&i,i>>=4,e[n]=r[19==n?8|3&t:t]);return e.join("")},r.exports=JXG},{}],2:[function(t,r){var e=t("../enums.js"),i=function(){this.prefer_hash_algorithm=e.hash.sha256,this.encryption_cipher=e.symmetric.aes256,this.compression=e.compression.zip,this.show_version=!0,this.show_comment=!0,this.integrity_protect=!0,this.keyserver="keyserver.linux.it",this.versionstring="OpenPGP.js v0.0.1.20131018",this.commentstring="http://openpgpjs.org",this.debug=!1};r.exports=new i},{"../enums.js":27}],3:[function(t,r){function e(){function t(){var t=JSON.parse(window.localStorage.getItem("config"));null===t?(this.config=this.default_config,this.write()):this.config=t}function r(){window.localStorage.setItem("config",JSON.stringify(this.config))}this.read=t,this.write=r}r.exports=e},{}],4:[function(t,r){var e=t("../util"),i=t("./cipher");r.exports={encrypt:function(t,r,s,o,a){r=new i[r](o);var h=r.blockSize,c=Array(h),u=Array(h);t=t+t.charAt(h-2)+t.charAt(h-1),e.print_debug("prefixrandom:"+e.hexstrdump(t));for(var p="",l=0;h>l;l++)c[l]=0;u=r.encrypt(c);for(var l=0;h>l;l++)p+=String.fromCharCode(u[l]^t.charCodeAt(l));for(var l=0;h>l;l++)c[l]=p.charCodeAt(l);if(u=r.encrypt(c),p+=String.fromCharCode(u[0]^t.charCodeAt(h)),p+=String.fromCharCode(u[1]^t.charCodeAt(h+1)),a)for(var l=0;h>l;l++)c[l]=p.charCodeAt(l+2);else for(var l=0;h>l;l++)c[l]=p.charCodeAt(l);if(u=r.encrypt(c,o),a){for(var l=0;h>l;l++)p+=String.fromCharCode(u[l]^s.charCodeAt(l));for(n=h+2;s.length>n;n+=h){for(var l=0;h>l;l++)c[l]=p.charCodeAt(n+l);u=r.encrypt(c);for(var l=0;h>l;l++)p+=String.fromCharCode(u[l]^s.charCodeAt(n-2+l))}}else{s=" "+s;for(var l=2;h>l;l++)p+=String.fromCharCode(u[l]^s.charCodeAt(l));var f=p.substring(0,2*h).split(""),d=p.substring(h);for(n=h;s.length>n;n+=h){for(var l=0;h>l;l++)c[l]=d.charCodeAt(l);d="",u=r.encrypt(c);for(var l=0;h>l;l++)f.push(String.fromCharCode(u[l]^s.charCodeAt(n+l))),d+=String.fromCharCode(u[l]^s.charCodeAt(n+l))}p=f.join("")}return p=p.substring(0,s.length+2+h)},mdc:function(t,r,n){t=new i[t](r);var s,o=t.blockSize,a=Array(o),h=Array(o);for(s=0;o>s;s++)a[s]=0;for(a=t.encrypt(a),s=0;o>s;s++)h[s]=n.charCodeAt(s),a[s]^=h[s];return h=t.encrypt(h),e.bin2str(a)+String.fromCharCode(h[0]^n.charCodeAt(o))+String.fromCharCode(h[1]^n.charCodeAt(o+1))},decrypt:function(t,r,e,n){t=new i[t](r);var s,o=t.blockSize,a=Array(o),h=Array(o),c="",u=[];for(s=0;o>s;s++)a[s]=0;for(a=t.encrypt(a,r),s=0;o>s;s++)h[s]=e.charCodeAt(s),a[s]^=h[s];if(h=t.encrypt(h,r),a[o-2]!=(h[0]^e.charCodeAt(o))||a[o-1]!=(h[1]^e.charCodeAt(o+1)))throw Error("Invalid data.");if(n){for(s=0;o>s;s++)a[s]=e.charCodeAt(s+2);for(c=o+2;e.length>c;c+=o)for(h=t.encrypt(a),s=0;o>s&&e.length>s+c;s++)a[s]=e.charCodeAt(c+s),u.push(String.fromCharCode(h[s]^a[s]))}else{for(s=0;o>s;s++)a[s]=e.charCodeAt(s);for(c=o;e.length>c;c+=o)for(h=t.encrypt(a),s=0;o>s&&e.length>s+c;s++)a[s]=e.charCodeAt(c+s),u.push(String.fromCharCode(h[s]^a[s]))}var c=n?0:2;return u=u.join(""),u=u.substring(c,e.length-o-2+c)},normalEncrypt:function(t,r,n,s){t=new i[t](r);var o=t.blockSize,a="",h="",c=0,u=[],p=[];for(h=s.substring(0,o);n.length>o*c;){var l=t.encrypt(e.str2bin(h));a=n.substring(c*o,c*o+o);for(var f=0;a.length>f;f++)p.push(String.fromCharCode(a.charCodeAt(f)^l[f]));h=p.join(""),p=[],u.push(h),c++}return u.join("")},normalDecrypt:function(t,r,n,s){t=new i[t](r);var o=t.blockSize,a="",h=0,c=[],u=0;if(null==s)for(var p=0;o>p;p++)a+=String.fromCharCode(0);else a=s.substring(0,o);for(;n.length>o*h;){var l=t.encrypt(e.str2bin(a));a=n.substring(h*o+u,h*o+o+u);for(var p=0;a.length>p;p++)c.push(String.fromCharCode(a.charCodeAt(p)^l[p]));h++}return c.join("")}}},{"../util":56,"./cipher":9}],5:[function(t,r){function e(t){return 255&t}function i(t){return 255&t>>8}function n(t){return 255&t>>16}function s(t){return 255&t>>24}function o(t,r,e,n){return i(g[255&t])|i(g[255&r>>8])<<8|i(g[255&e>>16])<<16|i(g[n>>>24])<<24}function a(t){var r,e,i=t.length,n=Array(i/4);if(t&&!(i%4)){for(r=0,e=0;i>e;e+=4)n[r++]=t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24;return n}}function h(t){var r,o=0,a=t.length,h=Array(4*a);for(r=0;a>r;r++)h[o++]=e(t[r]),h[o++]=i(t[r]),h[o++]=n(t[r]),h[o++]=s(t[r]);return h}function c(t){var r,o,a,h,c,u,p=Array(k+1),g=t.length,m=Array(v),y=Array(v),b=0;if(16==g)u=10,r=4;else if(24==g)u=12,r=6;else{if(32!=g)return l.print_error("aes.js: Invalid key-length for AES key:"+g),void 0;u=14,r=8}for(o=0;k+1>o;o++)p[o]=Array(4);for(o=0,a=0;g>a;a++,o+=4)m[a]=t.charCodeAt(o)|t.charCodeAt(o+1)<<8|t.charCodeAt(o+2)<<16|t.charCodeAt(o+3)<<24;for(a=r-1;a>=0;a--)y[a]=m[a];for(h=0,c=0,a=0;r>a&&u+1>h;){for(;r>a&&4>c;a++,c++)p[h][c]=y[a];4==c&&(h++,c=0)}for(;u+1>h;){var w=y[r-1];if(y[0]^=d[i(w)]|d[n(w)]<<8|d[s(w)]<<16|d[e(w)]<<24,y[0]^=f[b++],8!=r)for(a=1;r>a;a++)y[a]^=y[a-1];else{for(a=1;r/2>a;a++)y[a]^=y[a-1];for(w=y[r/2-1],y[r/2]^=d[e(w)]|d[i(w)]<<8|d[n(w)]<<16|d[s(w)]<<24,a=r/2+1;r>a;a++)y[a]^=y[a-1]}for(a=0;r>a&&u+1>h;){for(;r>a&&4>c;a++,c++)p[h][c]=y[a];4==c&&(h++,c=0)}}return this.rounds=u,this.rk=p,this}function u(t,r){var e,i,n,s,c,u=a(t),p=r.rounds,l=u[0],f=u[1],d=u[2],v=u[3];for(e=0;p-1>e;e++)i=l^r.rk[e][0],n=f^r.rk[e][1],s=d^r.rk[e][2],c=v^r.rk[e][3],l=g[255&i]^m[255&n>>8]^y[255&s>>16]^b[c>>>24],f=g[255&n]^m[255&s>>8]^y[255&c>>16]^b[i>>>24],d=g[255&s]^m[255&c>>8]^y[255&i>>16]^b[n>>>24],v=g[255&c]^m[255&i>>8]^y[255&n>>16]^b[s>>>24];return e=p-1,i=l^r.rk[e][0],n=f^r.rk[e][1],s=d^r.rk[e][2],c=v^r.rk[e][3],u[0]=o(i,n,s,c)^r.rk[p][0],u[1]=o(n,s,c,i)^r.rk[p][1],u[2]=o(s,c,i,n)^r.rk[p][2],u[3]=o(c,i,n,s)^r.rk[p][3],h(u)}function p(t){var r=function(t){this.key=c(t),this.encrypt=function(t){return u(t,this.key)}};return r.blockSize=r.prototype.blockSize=16,r.keySize=r.prototype.keySize=t/8,r}var l=t("../../util"),f=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],d=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],g=[2774754246,2222750968,2574743534,2373680118,234025727,3177933782,2976870366,1422247313,1345335392,50397442,2842126286,2099981142,436141799,1658312629,3870010189,2591454956,1170918031,2642575903,1086966153,2273148410,368769775,3948501426,3376891790,200339707,3970805057,1742001331,4255294047,3937382213,3214711843,4154762323,2524082916,1539358875,3266819957,486407649,2928907069,1780885068,1513502316,1094664062,49805301,1338821763,1546925160,4104496465,887481809,150073849,2473685474,1943591083,1395732834,1058346282,201589768,1388824469,1696801606,1589887901,672667696,2711000631,251987210,3046808111,151455502,907153956,2608889883,1038279391,652995533,1764173646,3451040383,2675275242,453576978,2659418909,1949051992,773462580,756751158,2993581788,3998898868,4221608027,4132590244,1295727478,1641469623,3467883389,2066295122,1055122397,1898917726,2542044179,4115878822,1758581177,0,753790401,1612718144,536673507,3367088505,3982187446,3194645204,1187761037,3653156455,1262041458,3729410708,3561770136,3898103984,1255133061,1808847035,720367557,3853167183,385612781,3309519750,3612167578,1429418854,2491778321,3477423498,284817897,100794884,2172616702,4031795360,1144798328,3131023141,3819481163,4082192802,4272137053,3225436288,2324664069,2912064063,3164445985,1211644016,83228145,3753688163,3249976951,1977277103,1663115586,806359072,452984805,250868733,1842533055,1288555905,336333848,890442534,804056259,3781124030,2727843637,3427026056,957814574,1472513171,4071073621,2189328124,1195195770,2892260552,3881655738,723065138,2507371494,2690670784,2558624025,3511635870,2145180835,1713513028,2116692564,2878378043,2206763019,3393603212,703524551,3552098411,1007948840,2044649127,3797835452,487262998,1994120109,1004593371,1446130276,1312438900,503974420,3679013266,168166924,1814307912,3831258296,1573044895,1859376061,4021070915,2791465668,2828112185,2761266481,937747667,2339994098,854058965,1137232011,1496790894,3077402074,2358086913,1691735473,3528347292,3769215305,3027004632,4199962284,133494003,636152527,2942657994,2390391540,3920539207,403179536,3585784431,2289596656,1864705354,1915629148,605822008,4054230615,3350508659,1371981463,602466507,2094914977,2624877800,555687742,3712699286,3703422305,2257292045,2240449039,2423288032,1111375484,3300242801,2858837708,3628615824,84083462,32962295,302911004,2741068226,1597322602,4183250862,3501832553,2441512471,1489093017,656219450,3114180135,954327513,335083755,3013122091,856756514,3144247762,1893325225,2307821063,2811532339,3063651117,572399164,2458355477,552200649,1238290055,4283782570,2015897680,2061492133,2408352771,4171342169,2156497161,386731290,3669999461,837215959,3326231172,3093850320,3275833730,2962856233,1999449434,286199582,3417354363,4233385128,3602627437,974525996],m=[1667483301,2088564868,2004348569,2071721613,4076011277,1802229437,1869602481,3318059348,808476752,16843267,1734856361,724260477,4278118169,3621238114,2880130534,1987505306,3402272581,2189565853,3385428288,2105408135,4210749205,1499050731,1195871945,4042324747,2913812972,3570709351,2728550397,2947499498,2627478463,2762232823,1920132246,3233848155,3082253762,4261273884,2475900334,640044138,909536346,1061125697,4160222466,3435955023,875849820,2779075060,3857043764,4059166984,1903288979,3638078323,825320019,353708607,67373068,3351745874,589514341,3284376926,404238376,2526427041,84216335,2593796021,117902857,303178806,2155879323,3806519101,3958099238,656887401,2998042573,1970662047,151589403,2206408094,741103732,437924910,454768173,1852759218,1515893998,2694863867,1381147894,993752653,3604395873,3014884814,690573947,3823361342,791633521,2223248279,1397991157,3520182632,0,3991781676,538984544,4244431647,2981198280,1532737261,1785386174,3419114822,3200149465,960066123,1246401758,1280088276,1482207464,3486483786,3503340395,4025468202,2863288293,4227591446,1128498885,1296931543,859006549,2240090516,1162185423,4193904912,33686534,2139094657,1347461360,1010595908,2678007226,2829601763,1364304627,2745392638,1077969088,2408514954,2459058093,2644320700,943222856,4126535940,3166462943,3065411521,3671764853,555827811,269492272,4294960410,4092853518,3537026925,3452797260,202119188,320022069,3974939439,1600110305,2543269282,1145342156,387395129,3301217111,2812761586,2122251394,1027439175,1684326572,1566423783,421081643,1936975509,1616953504,2172721560,1330618065,3705447295,572671078,707417214,2425371563,2290617219,1179028682,4008625961,3099093971,336865340,3739133817,1583267042,185275933,3688607094,3772832571,842163286,976909390,168432670,1229558491,101059594,606357612,1549580516,3267534685,3553869166,2896970735,1650640038,2442213800,2509582756,3840201527,2038035083,3890730290,3368586051,926379609,1835915959,2374828428,3587551588,1313774802,2846444e3,1819072692,1448520954,4109693703,3941256997,1701169839,2054878350,2930657257,134746136,3132780501,2021191816,623200879,774790258,471611428,2795919345,3031724999,3334903633,3907570467,3722289532,1953818780,522141217,1263245021,3183305180,2341145990,2324303749,1886445712,1044282434,3048567236,1718013098,1212715224,50529797,4143380225,235805714,1633796771,892693087,1465364217,3115936208,2256934801,3250690392,488454695,2661164985,3789674808,4177062675,2560109491,286335539,1768542907,3654920560,2391672713,2492740519,2610638262,505297954,2273777042,3924412704,3469641545,1431677695,673730680,3755976058,2357986191,2711706104,2307459456,218962455,3216991706,3873888049,1111655622,1751699640,1094812355,2576951728,757946999,252648977,2964356043,1414834428,3149622742,370551866],y=[1673962851,2096661628,2012125559,2079755643,4076801522,1809235307,1876865391,3314635973,811618352,16909057,1741597031,727088427,4276558334,3618988759,2874009259,1995217526,3398387146,2183110018,3381215433,2113570685,4209972730,1504897881,1200539975,4042984432,2906778797,3568527316,2724199842,2940594863,2619588508,2756966308,1927583346,3231407040,3077948087,4259388669,2470293139,642542118,913070646,1065238847,4160029431,3431157708,879254580,2773611685,3855693029,4059629809,1910674289,3635114968,828527409,355090197,67636228,3348452039,591815971,3281870531,405809176,2520228246,84545285,2586817946,118360327,304363026,2149292928,3806281186,3956090603,659450151,2994720178,1978310517,152181513,2199756419,743994412,439627290,456535323,1859957358,1521806938,2690382752,1386542674,997608763,3602342358,3011366579,693271337,3822927587,794718511,2215876484,1403450707,3518589137,0,3988860141,541089824,4242743292,2977548465,1538714971,1792327274,3415033547,3194476990,963791673,1251270218,1285084236,1487988824,3481619151,3501943760,4022676207,2857362858,4226619131,1132905795,1301993293,862344499,2232521861,1166724933,4192801017,33818114,2147385727,1352724560,1014514748,2670049951,2823545768,1369633617,2740846243,1082179648,2399505039,2453646738,2636233885,946882616,4126213365,3160661948,3061301686,3668932058,557998881,270544912,4293204735,4093447923,3535760850,3447803085,202904588,321271059,3972214764,1606345055,2536874647,1149815876,388905239,3297990596,2807427751,2130477694,1031423805,1690872932,1572530013,422718233,1944491379,1623236704,2165938305,1335808335,3701702620,574907938,710180394,2419829648,2282455944,1183631942,4006029806,3094074296,338181140,3735517662,1589437022,185998603,3685578459,3772464096,845436466,980700730,169090570,1234361161,101452294,608726052,1555620956,3265224130,3552407251,2890133420,1657054818,2436475025,2503058581,3839047652,2045938553,3889509095,3364570056,929978679,1843050349,2365688973,3585172693,1318900302,2840191145,1826141292,1454176854,4109567988,3939444202,1707781989,2062847610,2923948462,135272456,3127891386,2029029496,625635109,777810478,473441308,2790781350,3027486644,3331805638,3905627112,3718347997,1961401460,524165407,1268178251,3177307325,2332919435,2316273034,1893765232,1048330814,3044132021,1724688998,1217452104,50726147,4143383030,236720654,1640145761,896163637,1471084887,3110719673,2249691526,3248052417,490350365,2653403550,3789109473,4176155640,2553000856,287453969,1775418217,3651760345,2382858638,2486413204,2603464347,507257374,2266337927,3922272489,3464972750,1437269845,676362280,3752164063,2349043596,2707028129,2299101321,219813645,3211123391,3872862694,1115997762,1758509160,1099088705,2569646233,760903469,253628687,2960903088,1420360788,3144537787,371997206],b=[3332727651,4169432188,4003034999,4136467323,4279104242,3602738027,3736170351,2438251973,1615867952,33751297,3467208551,1451043627,3877240574,3043153879,1306962859,3969545846,2403715786,530416258,2302724553,4203183485,4011195130,3001768281,2395555655,4211863792,1106029997,3009926356,1610457762,1173008303,599760028,1408738468,3835064946,2606481600,1975695287,3776773629,1034851219,1282024998,1817851446,2118205247,4110612471,2203045068,1750873140,1374987685,3509904869,4178113009,3801313649,2876496088,1649619249,708777237,135005188,2505230279,1181033251,2640233411,807933976,933336726,168756485,800430746,235472647,607523346,463175808,3745374946,3441880043,1315514151,2144187058,3936318837,303761673,496927619,1484008492,875436570,908925723,3702681198,3035519578,1543217312,2767606354,1984772923,3076642518,2110698419,1383803177,3711886307,1584475951,328696964,2801095507,3110654417,0,3240947181,1080041504,3810524412,2043195825,3069008731,3569248874,2370227147,1742323390,1917532473,2497595978,2564049996,2968016984,2236272591,3144405200,3307925487,1340451498,3977706491,2261074755,2597801293,1716859699,294946181,2328839493,3910203897,67502594,4269899647,2700103760,2017737788,632987551,1273211048,2733855057,1576969123,2160083008,92966799,1068339858,566009245,1883781176,4043634165,1675607228,2009183926,2943736538,1113792801,540020752,3843751935,4245615603,3211645650,2169294285,403966988,641012499,3274697964,3202441055,899848087,2295088196,775493399,2472002756,1441965991,4236410494,2051489085,3366741092,3135724893,841685273,3868554099,3231735904,429425025,2664517455,2743065820,1147544098,1417554474,1001099408,193169544,2362066502,3341414126,1809037496,675025940,2809781982,3168951902,371002123,2910247899,3678134496,1683370546,1951283770,337512970,2463844681,201983494,1215046692,3101973596,2673722050,3178157011,1139780780,3299238498,967348625,832869781,3543655652,4069226873,3576883175,2336475336,1851340599,3669454189,25988493,2976175573,2631028302,1239460265,3635702892,2902087254,4077384948,3475368682,3400492389,4102978170,1206496942,270010376,1876277946,4035475576,1248797989,1550986798,941890588,1475454630,1942467764,2538718918,3408128232,2709315037,3902567540,1042358047,2531085131,1641856445,226921355,260409994,3767562352,2084716094,1908716981,3433719398,2430093384,100991747,4144101110,470945294,3265487201,1784624437,2935576407,1775286713,395413126,2572730817,975641885,666476190,3644383713,3943954680,733190296,573772049,3535497577,2842745305,126455438,866620564,766942107,1008868894,361924487,3374377449,2269761230,2868860245,1350051880,2776293343,59739276,1509466529,159418761,437718285,1708834751,3610371814,2227585602,3501746280,2193834305,699439513,1517759789,504434447,2076946608,2835108948,1842789307,742004246],v=8,k=14;r.exports={};var w=[128,192,256];for(var C in w)r.exports[w[C]]=p(w[C])},{"../../util":56}],6:[function(t,r){function e(){}function i(t){this.bf=new e,this.bf.init(n.str2bin(t)),this.encrypt=function(t){return this.bf.encrypt_block(t)}}e.prototype.BLOCKSIZE=8,e.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],e.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],e.prototype.NN=16,e.prototype._clean=function(t){if(0>t){var r=2147483647&t;
|
|
t=r+2147483648}return t},e.prototype._F=function(t){var r,e,i,n,s;return n=255&t,t>>>=8,i=255&t,t>>>=8,e=255&t,t>>>=8,r=255&t,s=this.sboxes[0][r]+this.sboxes[1][e],s^=this.sboxes[2][i],s+=this.sboxes[3][n]},e.prototype._encrypt_block=function(t){var r,e=t[0],i=t[1];for(r=0;this.NN>r;++r){e^=this.parray[r],i=this._F(e)^i;var n=e;e=i,i=n}e^=this.parray[this.NN+0],i^=this.parray[this.NN+1],t[0]=this._clean(i),t[1]=this._clean(e)},e.prototype.encrypt_block=function(t){var r,e=[0,0],i=this.BLOCKSIZE/2;for(r=0;this.BLOCKSIZE/2>r;++r)e[0]=e[0]<<8|255&t[r+0],e[1]=e[1]<<8|255&t[r+i];this._encrypt_block(e);var n=[];for(r=0;this.BLOCKSIZE/2>r;++r)n[r+0]=255&e[0]>>>24-8*r,n[r+i]=255&e[1]>>>24-8*r;return n},e.prototype._decrypt_block=function(t){var r,e=t[0],i=t[1];for(r=this.NN+1;r>1;--r){e^=this.parray[r],i=this._F(e)^i;var n=e;e=i,i=n}e^=this.parray[1],i^=this.parray[0],t[0]=this._clean(i),t[1]=this._clean(e)},e.prototype.init=function(t){var r,e=0;for(this.parray=[],r=0;this.NN+2>r;++r){var i,n=0;for(i=0;4>i;++i)n=n<<8|255&t[e],++e>=t.length&&(e=0);this.parray[r]=this.PARRAY[r]^n}for(this.sboxes=[],r=0;4>r;++r)for(this.sboxes[r]=[],e=0;256>e;++e)this.sboxes[r][e]=this.SBOXES[r][e];var s=[0,0];for(r=0;this.NN+2>r;r+=2)this._encrypt_block(s),this.parray[r+0]=s[0],this.parray[r+1]=s[1];for(r=0;4>r;++r)for(e=0;256>e;e+=2)this._encrypt_block(s),this.sboxes[r][e+0]=s[0],this.sboxes[r][e+1]=s[1]};var n=t("../../util");r.exports=i,r.exports.keySize=i.prototype.keySize=16,r.exports.blockSize=i.prototype.blockSize=16},{"../../util":56}],7:[function(t,r){function e(){function t(t,r,e){var i=r+t,n=i<<e|i>>>32-e;return(o[0][n>>>24]^o[1][255&n>>>16])-o[2][255&n>>>8]+o[3][255&n]}function r(t,r,e){var i=r^t,n=i<<e|i>>>32-e;return o[0][n>>>24]-o[1][255&n>>>16]+o[2][255&n>>>8]^o[3][255&n]}function e(t,r,e){var i=r-t,n=i<<e|i>>>32-e;return(o[0][n>>>24]+o[1][255&n>>>16]^o[2][255&n>>>8])-o[3][255&n]}this.BlockSize=8,this.KeySize=16,this.setKey=function(t){return this.masking=Array(16),this.rotate=Array(16),this.reset(),t.length!=this.KeySize?(n.print_error("cast5.js: CAST-128: keys must be 16 bytes"),!1):(this.keySchedule(t),!0)},this.reset=function(){for(var t=0;16>t;t++)this.masking[t]=0,this.rotate[t]=0},this.getBlockSize=function(){return BlockSize},this.encrypt=function(i){for(var n=Array(i.length),s=0;i.length>s;s+=8){var o,a=i[s]<<24|i[s+1]<<16|i[s+2]<<8|i[s+3],h=i[s+4]<<24|i[s+5]<<16|i[s+6]<<8|i[s+7];o=h,h=a^t(h,this.masking[0],this.rotate[0]),a=o,o=h,h=a^r(h,this.masking[1],this.rotate[1]),a=o,o=h,h=a^e(h,this.masking[2],this.rotate[2]),a=o,o=h,h=a^t(h,this.masking[3],this.rotate[3]),a=o,o=h,h=a^r(h,this.masking[4],this.rotate[4]),a=o,o=h,h=a^e(h,this.masking[5],this.rotate[5]),a=o,o=h,h=a^t(h,this.masking[6],this.rotate[6]),a=o,o=h,h=a^r(h,this.masking[7],this.rotate[7]),a=o,o=h,h=a^e(h,this.masking[8],this.rotate[8]),a=o,o=h,h=a^t(h,this.masking[9],this.rotate[9]),a=o,o=h,h=a^r(h,this.masking[10],this.rotate[10]),a=o,o=h,h=a^e(h,this.masking[11],this.rotate[11]),a=o,o=h,h=a^t(h,this.masking[12],this.rotate[12]),a=o,o=h,h=a^r(h,this.masking[13],this.rotate[13]),a=o,o=h,h=a^e(h,this.masking[14],this.rotate[14]),a=o,o=h,h=a^t(h,this.masking[15],this.rotate[15]),a=o,n[s]=255&h>>>24,n[s+1]=255&h>>>16,n[s+2]=255&h>>>8,n[s+3]=255&h,n[s+4]=255&a>>>24,n[s+5]=255&a>>>16,n[s+6]=255&a>>>8,n[s+7]=255&a}return n},this.decrypt=function(i){for(var n=Array(i.length),s=0;i.length>s;s+=8){var o,a=i[s]<<24|i[s+1]<<16|i[s+2]<<8|i[s+3],h=i[s+4]<<24|i[s+5]<<16|i[s+6]<<8|i[s+7];o=h,h=a^t(h,this.masking[15],this.rotate[15]),a=o,o=h,h=a^e(h,this.masking[14],this.rotate[14]),a=o,o=h,h=a^r(h,this.masking[13],this.rotate[13]),a=o,o=h,h=a^t(h,this.masking[12],this.rotate[12]),a=o,o=h,h=a^e(h,this.masking[11],this.rotate[11]),a=o,o=h,h=a^r(h,this.masking[10],this.rotate[10]),a=o,o=h,h=a^t(h,this.masking[9],this.rotate[9]),a=o,o=h,h=a^e(h,this.masking[8],this.rotate[8]),a=o,o=h,h=a^r(h,this.masking[7],this.rotate[7]),a=o,o=h,h=a^t(h,this.masking[6],this.rotate[6]),a=o,o=h,h=a^e(h,this.masking[5],this.rotate[5]),a=o,o=h,h=a^r(h,this.masking[4],this.rotate[4]),a=o,o=h,h=a^t(h,this.masking[3],this.rotate[3]),a=o,o=h,h=a^e(h,this.masking[2],this.rotate[2]),a=o,o=h,h=a^r(h,this.masking[1],this.rotate[1]),a=o,o=h,h=a^t(h,this.masking[0],this.rotate[0]),a=o,n[s]=255&h>>>24,n[s+1]=255&h>>>16,n[s+2]=255&h>>>8,n[s+3]=255&h,n[s+4]=255&a>>>24,n[s+5]=255&a>>16,n[s+6]=255&a>>8,n[s+7]=255&a}return n};var i=Array(4);i[0]=Array(4),i[0][0]=[4,0,13,15,12,14,8],i[0][1]=[5,2,16,18,17,19,10],i[0][2]=[6,3,23,22,21,20,9],i[0][3]=[7,1,26,25,27,24,11],i[1]=Array(4),i[1][0]=[0,6,21,23,20,22,16],i[1][1]=[1,4,0,2,1,3,18],i[1][2]=[2,5,7,6,5,4,17],i[1][3]=[3,7,10,9,11,8,19],i[2]=Array(4),i[2][0]=[4,0,13,15,12,14,8],i[2][1]=[5,2,16,18,17,19,10],i[2][2]=[6,3,23,22,21,20,9],i[2][3]=[7,1,26,25,27,24,11],i[3]=Array(4),i[3][0]=[0,6,21,23,20,22,16],i[3][1]=[1,4,0,2,1,3,18],i[3][2]=[2,5,7,6,5,4,17],i[3][3]=[3,7,10,9,11,8,19];var s=Array(4);s[0]=Array(4),s[0][0]=[24,25,23,22,18],s[0][1]=[26,27,21,20,22],s[0][2]=[28,29,19,18,25],s[0][3]=[30,31,17,16,28],s[1]=Array(4),s[1][0]=[3,2,12,13,8],s[1][1]=[1,0,14,15,13],s[1][2]=[7,6,8,9,3],s[1][3]=[5,4,10,11,7],s[2]=Array(4),s[2][0]=[19,18,28,29,25],s[2][1]=[17,16,30,31,28],s[2][2]=[23,22,24,25,18],s[2][3]=[21,20,26,27,22],s[3]=Array(4),s[3][0]=[8,9,7,6,3],s[3][1]=[10,11,5,4,7],s[3][2]=[12,13,3,2,8],s[3][3]=[14,15,1,0,13],this.keySchedule=function(t){for(var r=Array(8),e=Array(32),n=0;4>n;n++){var a=4*n;r[n]=t[a]<<24|t[a+1]<<16|t[a+2]<<8|t[a+3]}for(var h=[6,7,4,5],c=0,u=0;2>u;u++)for(var p=0;4>p;p++){for(var a=0;4>a;a++){var l=i[p][a],f=r[l[1]];f^=o[4][255&r[l[2]>>>2]>>>24-8*(3&l[2])],f^=o[5][255&r[l[3]>>>2]>>>24-8*(3&l[3])],f^=o[6][255&r[l[4]>>>2]>>>24-8*(3&l[4])],f^=o[7][255&r[l[5]>>>2]>>>24-8*(3&l[5])],f^=o[h[a]][255&r[l[6]>>>2]>>>24-8*(3&l[6])],r[l[0]]=f}for(var a=0;4>a;a++){var d=s[p][a],f=o[4][255&r[d[0]>>>2]>>>24-8*(3&d[0])];f^=o[5][255&r[d[1]>>>2]>>>24-8*(3&d[1])],f^=o[6][255&r[d[2]>>>2]>>>24-8*(3&d[2])],f^=o[7][255&r[d[3]>>>2]>>>24-8*(3&d[3])],f^=o[4+a][255&r[d[4]>>>2]>>>24-8*(3&d[4])],e[c]=f,c++}}for(var n=0;16>n;n++)this.masking[n]=e[n],this.rotate[n]=31&e[16+n]};var o=Array(8);o[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],o[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],o[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],o[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],o[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],o[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],o[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],o[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function i(t){this.cast5=new e,this.cast5.setKey(n.str2bin(t)),this.encrypt=function(t){return this.cast5.encrypt(t)}}var n=t("../../util");r.exports=i,r.exports.blockSize=i.prototype.blockSize=8,r.exports.keySize=i.prototype.keySize=16},{"../../util":56}],8:[function(t,r){function e(t,r,e,i,n,a){var h,c,u,p,l,f,d,g,m,y,b,v,k,w,C=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],A=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],_=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],S=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],j=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],T=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],O=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],I=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696],E=0,B=r.length,x=0,P=32==t.length?3:9;
|
|
for(g=3==P?e?[0,32,2]:[30,-2,-2]:e?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],e&&(r=s(r,a),B=r.length),result="",tempresult="",1==i&&(m=n.charCodeAt(E++)<<24|n.charCodeAt(E++)<<16|n.charCodeAt(E++)<<8|n.charCodeAt(E++),b=n.charCodeAt(E++)<<24|n.charCodeAt(E++)<<16|n.charCodeAt(E++)<<8|n.charCodeAt(E++),E=0);B>E;){for(f=r.charCodeAt(E++)<<24|r.charCodeAt(E++)<<16|r.charCodeAt(E++)<<8|r.charCodeAt(E++),d=r.charCodeAt(E++)<<24|r.charCodeAt(E++)<<16|r.charCodeAt(E++)<<8|r.charCodeAt(E++),1==i&&(e?(f^=m,d^=b):(y=m,v=b,m=f,b=d)),u=252645135&(f>>>4^d),d^=u,f^=u<<4,u=65535&(f>>>16^d),d^=u,f^=u<<16,u=858993459&(d>>>2^f),f^=u,d^=u<<2,u=16711935&(d>>>8^f),f^=u,d^=u<<8,u=1431655765&(f>>>1^d),d^=u,f^=u<<1,f=f<<1|f>>>31,d=d<<1|d>>>31,c=0;P>c;c+=3){for(k=g[c+1],w=g[c+2],h=g[c];h!=k;h+=w)p=d^t[h],l=(d>>>4|d<<28)^t[h+1],u=f,f=d,d=u^(A[63&p>>>24]|S[63&p>>>16]|T[63&p>>>8]|I[63&p]|C[63&l>>>24]|_[63&l>>>16]|j[63&l>>>8]|O[63&l]);u=f,f=d,d=u}f=f>>>1|f<<31,d=d>>>1|d<<31,u=1431655765&(f>>>1^d),d^=u,f^=u<<1,u=16711935&(d>>>8^f),f^=u,d^=u<<8,u=858993459&(d>>>2^f),f^=u,d^=u<<2,u=65535&(f>>>16^d),d^=u,f^=u<<16,u=252645135&(f>>>4^d),d^=u,f^=u<<4,1==i&&(e?(m=f,b=d):(f^=y,d^=v)),tempresult+=String.fromCharCode(f>>>24,255&f>>>16,255&f>>>8,255&f,d>>>24,255&d>>>16,255&d>>>8,255&d),x+=8,512==x&&(result+=tempresult,tempresult="",x=0)}return result+=tempresult,e||(result=o(result,a)),result}function n(t){pc2bytes0=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],pc2bytes1=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],pc2bytes2=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],pc2bytes3=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],pc2bytes4=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],pc2bytes5=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],pc2bytes6=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],pc2bytes7=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],pc2bytes8=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],pc2bytes9=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],pc2bytes10=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],pc2bytes11=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],pc2bytes12=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],pc2bytes13=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261];for(var r,e,n,s=t.length>8?3:1,o=Array(32*s),a=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],h=0,c=0,u=0;s>u;u++)for(left=t.charCodeAt(h++)<<24|t.charCodeAt(h++)<<16|t.charCodeAt(h++)<<8|t.charCodeAt(h++),right=t.charCodeAt(h++)<<24|t.charCodeAt(h++)<<16|t.charCodeAt(h++)<<8|t.charCodeAt(h++),n=252645135&(left>>>4^right),right^=n,left^=n<<4,n=65535&(right>>>-16^left),left^=n,right^=n<<-16,n=858993459&(left>>>2^right),right^=n,left^=n<<2,n=65535&(right>>>-16^left),left^=n,right^=n<<-16,n=1431655765&(left>>>1^right),right^=n,left^=n<<1,n=16711935&(right>>>8^left),left^=n,right^=n<<8,n=1431655765&(left>>>1^right),right^=n,left^=n<<1,n=left<<8|240&right>>>20,left=right<<24|16711680&right<<8|65280&right>>>8|240&right>>>24,right=n,i=0;a.length>i;i++)a[i]?(left=left<<2|left>>>26,right=right<<2|right>>>26):(left=left<<1|left>>>27,right=right<<1|right>>>27),left&=-15,right&=-15,r=pc2bytes0[left>>>28]|pc2bytes1[15&left>>>24]|pc2bytes2[15&left>>>20]|pc2bytes3[15&left>>>16]|pc2bytes4[15&left>>>12]|pc2bytes5[15&left>>>8]|pc2bytes6[15&left>>>4],e=pc2bytes7[right>>>28]|pc2bytes8[15&right>>>24]|pc2bytes9[15&right>>>20]|pc2bytes10[15&right>>>16]|pc2bytes11[15&right>>>12]|pc2bytes12[15&right>>>8]|pc2bytes13[15&right>>>4],n=65535&(e>>>16^r),o[c++]=r^n,o[c++]=e^n<<16;return o}function s(t,r){var e=8-t.length%8;return 2==r&&8>e?t+=" ".substr(0,e):1==r?t+=String.fromCharCode(e,e,e,e,e,e,e,e).substr(0,e):!r&&8>e&&(t+="\0\0\0\0\0\0\0\0".substr(0,e)),t}function o(t,r){if(2==r)t=t.replace(/ *$/g,"");else if(1==r){var e=t.charCodeAt(t.length-1);t=t.substr(0,t.length-e)}else r||(t=t.replace(/\0*$/g,""));return t}function a(t){this.key=[];for(var r=0;3>r;r++)this.key.push(t.substr(8*r,8));this.encrypt=function(t){return c.str2bin(e(n(this.key[2]),e(n(this.key[1]),e(n(this.key[0]),c.bin2str(t),!0,0,null,null),!1,0,null,null),!0,0,null,null))}}function h(t){this.key=t,this.encrypt=function(t,r){var i=n(this.key);return c.str2bin(e(i,c.bin2str(t),!0,0,null,r))},this.decrypt=function(t,r){var i=n(this.key);return c.str2bin(e(i,c.bin2str(t),!1,0,null,r))}}var c=t("../../util");a.keySize=a.prototype.keySize=24,a.blockSize=a.prototype.blockSize=8,r.exports={des:a,originalDes:h}},{"../../util":56}],9:[function(t,r){var e=t("./des.js");r.exports={des:e.des,originalDes:e.originalDes,cast5:t("./cast5.js"),twofish:t("./twofish.js"),blowfish:t("./blowfish.js")};var i=t("./aes.js");for(var n in i)r.exports["aes"+n]=i[n]},{"./aes.js":5,"./blowfish.js":6,"./cast5.js":7,"./des.js":8,"./twofish.js":10}],10:[function(t,r){function e(t,r){return(t<<r|t>>>32-r)&h}function i(t,r){return t[r]|t[r+1]<<8|t[r+2]<<16|t[r+3]<<24}function n(t,r,e){t.splice(r,4,255&e,255&e>>>8,255&e>>>16,255&e>>>24)}function s(t,r){return 255&t>>>8*r}function o(){function t(t){function r(t){return t^t>>2^[0,90,180,238][3&t]}function n(t){return t^t>>1^t>>2^[0,238,180,90][3&t]}function o(t,r){var e,i,n;for(e=0;8>e;e++)i=r>>>24,r=r<<8&h|t>>>24,t=t<<8&h,n=i<<1,128&i&&(n^=333),r^=i^n<<16,n^=i>>>1,1&i&&(n^=166),r^=n<<24|n<<8;return r}function a(t,r){var e,i,n,s;return e=r>>4,i=15&r,n=j[t][e^i],s=T[t][E[i]^B[e]],I[t][E[s]^B[n]]<<4|O[t][n^s]}function c(t,r){var e=s(t,0),i=s(t,1),n=s(t,2),o=s(t,3);switch(m){case 4:e=x[1][e]^s(r[3],0),i=x[0][i]^s(r[3],1),n=x[0][n]^s(r[3],2),o=x[1][o]^s(r[3],3);case 3:e=x[1][e]^s(r[2],0),i=x[1][i]^s(r[2],1),n=x[0][n]^s(r[2],2),o=x[0][o]^s(r[2],3);case 2:e=x[0][x[0][e]^s(r[1],0)]^s(r[0],0),i=x[0][x[1][i]^s(r[1],1)]^s(r[0],1),n=x[1][x[0][n]^s(r[1],2)]^s(r[0],2),o=x[1][x[1][o]^s(r[1],3)]^s(r[0],3)}return P[0][e]^P[1][i]^P[2][n]^P[3][o]}d=t;var u,p,l,f,g,m,y,k,w,C=[],A=[],_=[],S=[],j=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],T=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],O=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],I=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],E=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],B=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],x=[[],[]],P=[[],[],[],[]];for(d=d.slice(0,32),u=d.length;16!=u&&24!=u&&32!=u;)d[u++]=0;for(u=0;d.length>u;u+=4)_[u>>2]=i(d,u);for(u=0;256>u;u++)x[0][u]=a(0,u),x[1][u]=a(1,u);for(u=0;256>u;u++)y=x[1][u],k=r(y),w=n(y),P[0][u]=y+(k<<8)+(w<<16)+(w<<24),P[2][u]=k+(w<<8)+(y<<16)+(w<<24),y=x[0][u],k=r(y),w=n(y),P[1][u]=w+(w<<8)+(k<<16)+(y<<24),P[3][u]=k+(y<<8)+(w<<16)+(k<<24);for(m=_.length/2,u=0;m>u;u++)p=_[u+u],C[u]=p,l=_[u+u+1],A[u]=l,S[m-u-1]=o(p,l);for(u=0;40>u;u+=2)p=16843009*u,l=p+16843009,p=c(p,C),l=e(c(l,A),8),b[u]=p+l&h,b[u+1]=e(p+2*l,9);for(u=0;256>u;u++)switch(p=l=f=g=u,m){case 4:p=x[1][p]^s(S[3],0),l=x[0][l]^s(S[3],1),f=x[0][f]^s(S[3],2),g=x[1][g]^s(S[3],3);case 3:p=x[1][p]^s(S[2],0),l=x[1][l]^s(S[2],1),f=x[0][f]^s(S[2],2),g=x[0][g]^s(S[2],3);case 2:v[0][u]=P[0][x[0][x[0][p]^s(S[1],0)]^s(S[0],0)],v[1][u]=P[1][x[0][x[1][l]^s(S[1],1)]^s(S[0],1)],v[2][u]=P[2][x[1][x[0][f]^s(S[1],2)]^s(S[0],2)],v[3][u]=P[3][x[1][x[1][g]^s(S[1],3)]^s(S[0],3)]}}function r(t){return v[0][s(t,0)]^v[1][s(t,1)]^v[2][s(t,2)]^v[3][s(t,3)]}function o(t){return v[0][s(t,3)]^v[1][s(t,0)]^v[2][s(t,1)]^v[3][s(t,2)]}function a(t,i){var n=r(i[0]),s=o(i[1]);i[2]=e(i[2]^n+s+b[4*t+8]&h,31),i[3]=e(i[3],1)^n+2*s+b[4*t+9]&h,n=r(i[2]),s=o(i[3]),i[0]=e(i[0]^n+s+b[4*t+10]&h,31),i[1]=e(i[1],1)^n+2*s+b[4*t+11]&h}function c(t,i){var n=r(i[0]),s=o(i[1]);i[2]=e(i[2],1)^n+s+b[4*t+10]&h,i[3]=e(i[3]^n+2*s+b[4*t+11]&h,31),n=r(i[2]),s=o(i[3]),i[0]=e(i[0],1)^n+s+b[4*t+8]&h,i[1]=e(i[1]^n+2*s+b[4*t+9]&h,31)}function u(){b=[],v=[[],[],[],[]]}function p(t,r){g=t,m=r;for(var e=[i(g,m)^b[0],i(g,m+4)^b[1],i(g,m+8)^b[2],i(g,m+12)^b[3]],s=0;8>s;s++)a(s,e);return n(g,m,e[2]^b[4]),n(g,m+4,e[3]^b[5]),n(g,m+8,e[0]^b[6]),n(g,m+12,e[1]^b[7]),m+=16,g}function l(t,r){g=t,m=r;for(var e=[i(g,m)^b[4],i(g,m+4)^b[5],i(g,m+8)^b[6],i(g,m+12)^b[7]],s=7;s>=0;s--)c(s,e);n(g,m,e[2]^b[0]),n(g,m+4,e[3]^b[1]),n(g,m+8,e[0]^b[2]),n(g,m+12,e[1]^b[3]),m+=16}function f(){return g}var d=null,g=null,m=-1,y=null;y="twofish";var b=[],v=[[],[],[],[]];return{name:"twofish",blocksize:16,open:t,close:u,encrypt:p,decrypt:l,finalize:f}}function a(t){this.tf=o(),this.tf.open(c.str2bin(t),0),this.encrypt=function(t){return this.tf.encrypt([].concat(t),0)}}var h=4294967295,c=t("../../util");r.exports=a,r.exports.keySize=a.prototype.keySize=32,r.exports.blockSize=a.prototype.blockSize=16},{"../../util":56}],11:[function(t,r){var e=t("./random.js"),i=t("./cipher"),n=t("./public_key"),s=t("../type/mpi.js");r.exports={publicKeyEncrypt:function(t,r,e){var i=function(){switch(t){case"rsa_encrypt":case"rsa_encrypt_sign":var i=new n.rsa,s=r[0].toBigInteger(),o=r[1].toBigInteger(),a=e.toBigInteger();return[i.encrypt(a,o,s)];case"elgamal":var h=new n.elgamal,c=r[0].toBigInteger(),u=r[1].toBigInteger(),p=r[2].toBigInteger(),a=e.toBigInteger();return h.encrypt(a,u,c,p);default:return[]}}();return i.map(function(t){var r=new s;return r.fromBigInteger(t),r})},publicKeyDecrypt:function(t,r,e){var i=function(){switch(t){case"rsa_encrypt_sign":case"rsa_encrypt":var i=new n.rsa,s=r[2].toBigInteger(),o=r[3].toBigInteger(),a=r[4].toBigInteger(),h=r[5].toBigInteger(),c=e[0].toBigInteger();return i.decrypt(c,s,o,a,h);case"elgamal":var u=new n.elgamal,p=r[3].toBigInteger(),l=e[0].toBigInteger(),f=e[1].toBigInteger(),o=r[0].toBigInteger();return u.decrypt(l,f,o,p);default:return null}}(),o=new s;return o.fromBigInteger(i),o},getPrivateMpiCount:function(t){switch(t){case"rsa_encrypt":case"rsa_encrypt_sign":case"rsa_sign":return 4;case"elgamal":return 1;case"dsa":return 1;default:throw Error("Unknown algorithm")}},getPublicMpiCount:function(t){switch(t){case"rsa_encrypt":case"rsa_encrypt_sign":case"rsa_sign":return 2;case"elgamal":return 3;case"dsa":return 4;default:throw Error("Unknown algorithm.")}},generateMpi:function(t,r){var e=function(){switch(t){case"rsa_encrypt":case"rsa_encrypt_sign":case"rsa_sign":var e=new n.rsa,i=e.generate(r,"10001"),s=[];return s.push(i.n),s.push(i.ee),s.push(i.d),s.push(i.p),s.push(i.q),s.push(i.u),s;default:throw Error("Unsupported algorithm for key generation.")}}();return e.map(function(t){var r=new s;return r.fromBigInteger(t),r})},getPrefixRandom:function(t){return e.getRandomBytes(i[t].blockSize)},generateSessionKey:function(t){return e.getRandomBytes(i[t].keySize)}}},{"../type/mpi.js":54,"./cipher":9,"./public_key":20,"./random.js":23}],12:[function(t,r){var e=t("./sha.js");r.exports={md5:t("./md5.js"),sha1:e.sha1,sha256:e.sha256,sha224:e.sha224,sha384:e.sha384,sha512:e.sha512,ripemd:t("./ripe-md.js"),digest:function(t,r){switch(t){case 1:return this.md5(r);case 2:return this.sha1(r);case 3:return this.ripemd(r);case 8:return this.sha256(r);case 9:return this.sha384(r);case 10:return this.sha512(r);case 11:return this.sha224(r);default:throw Error("Invalid hash function.")}},getHashByteLength:function(t){switch(t){case 1:return 16;case 2:case 3:return 20;case 8:return 32;case 9:return 48;case 10:return 64;case 11:return 28;default:throw Error("Invalid hash algorithm.")}}}},{"./md5.js":13,"./ripe-md.js":14,"./sha.js":15}],13:[function(t,r){function e(t){var r=f(t),e=g.hex2bin(r);return e}function i(t,r){var e=t[0],i=t[1],n=t[2],c=t[3];e=s(e,i,n,c,r[0],7,-680876936),c=s(c,e,i,n,r[1],12,-389564586),n=s(n,c,e,i,r[2],17,606105819),i=s(i,n,c,e,r[3],22,-1044525330),e=s(e,i,n,c,r[4],7,-176418897),c=s(c,e,i,n,r[5],12,1200080426),n=s(n,c,e,i,r[6],17,-1473231341),i=s(i,n,c,e,r[7],22,-45705983),e=s(e,i,n,c,r[8],7,1770035416),c=s(c,e,i,n,r[9],12,-1958414417),n=s(n,c,e,i,r[10],17,-42063),i=s(i,n,c,e,r[11],22,-1990404162),e=s(e,i,n,c,r[12],7,1804603682),c=s(c,e,i,n,r[13],12,-40341101),n=s(n,c,e,i,r[14],17,-1502002290),i=s(i,n,c,e,r[15],22,1236535329),e=o(e,i,n,c,r[1],5,-165796510),c=o(c,e,i,n,r[6],9,-1069501632),n=o(n,c,e,i,r[11],14,643717713),i=o(i,n,c,e,r[0],20,-373897302),e=o(e,i,n,c,r[5],5,-701558691),c=o(c,e,i,n,r[10],9,38016083),n=o(n,c,e,i,r[15],14,-660478335),i=o(i,n,c,e,r[4],20,-405537848),e=o(e,i,n,c,r[9],5,568446438),c=o(c,e,i,n,r[14],9,-1019803690),n=o(n,c,e,i,r[3],14,-187363961),i=o(i,n,c,e,r[8],20,1163531501),e=o(e,i,n,c,r[13],5,-1444681467),c=o(c,e,i,n,r[2],9,-51403784),n=o(n,c,e,i,r[7],14,1735328473),i=o(i,n,c,e,r[12],20,-1926607734),e=a(e,i,n,c,r[5],4,-378558),c=a(c,e,i,n,r[8],11,-2022574463),n=a(n,c,e,i,r[11],16,1839030562),i=a(i,n,c,e,r[14],23,-35309556),e=a(e,i,n,c,r[1],4,-1530992060),c=a(c,e,i,n,r[4],11,1272893353),n=a(n,c,e,i,r[7],16,-155497632),i=a(i,n,c,e,r[10],23,-1094730640),e=a(e,i,n,c,r[13],4,681279174),c=a(c,e,i,n,r[0],11,-358537222),n=a(n,c,e,i,r[3],16,-722521979),i=a(i,n,c,e,r[6],23,76029189),e=a(e,i,n,c,r[9],4,-640364487),c=a(c,e,i,n,r[12],11,-421815835),n=a(n,c,e,i,r[15],16,530742520),i=a(i,n,c,e,r[2],23,-995338651),e=h(e,i,n,c,r[0],6,-198630844),c=h(c,e,i,n,r[7],10,1126891415),n=h(n,c,e,i,r[14],15,-1416354905),i=h(i,n,c,e,r[5],21,-57434055),e=h(e,i,n,c,r[12],6,1700485571),c=h(c,e,i,n,r[3],10,-1894986606),n=h(n,c,e,i,r[10],15,-1051523),i=h(i,n,c,e,r[1],21,-2054922799),e=h(e,i,n,c,r[8],6,1873313359),c=h(c,e,i,n,r[15],10,-30611744),n=h(n,c,e,i,r[6],15,-1560198380),i=h(i,n,c,e,r[13],21,1309151649),e=h(e,i,n,c,r[4],6,-145523070),c=h(c,e,i,n,r[11],10,-1120210379),n=h(n,c,e,i,r[2],15,718787259),i=h(i,n,c,e,r[9],21,-343485551),t[0]=d(e,t[0]),t[1]=d(i,t[1]),t[2]=d(n,t[2]),t[3]=d(c,t[3])}function n(t,r,e,i,n,s){return r=d(d(r,t),d(i,s)),d(r<<n|r>>>32-n,e)}function s(t,r,e,i,s,o,a){return n(r&e|~r&i,t,r,s,o,a)}function o(t,r,e,i,s,o,a){return n(r&i|e&~i,t,r,s,o,a)}function a(t,r,e,i,s,o,a){return n(r^e^i,t,r,s,o,a)}function h(t,r,e,i,s,o,a){return n(e^(r|~i),t,r,s,o,a)}function c(t){txt="";var r,e=t.length,n=[1732584193,-271733879,-1732584194,271733878];for(r=64;t.length>=r;r+=64)i(n,u(t.substring(r-64,r)));t=t.substring(r-64);var s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(r=0;t.length>r;r++)s[r>>2]|=t.charCodeAt(r)<<(r%4<<3);if(s[r>>2]|=128<<(r%4<<3),r>55)for(i(n,s),r=0;16>r;r++)s[r]=0;return s[14]=8*e,i(n,s),n}function u(t){var r,e=[];for(r=0;64>r;r+=4)e[r>>2]=t.charCodeAt(r)+(t.charCodeAt(r+1)<<8)+(t.charCodeAt(r+2)<<16)+(t.charCodeAt(r+3)<<24);return e}function p(t){for(var r="",e=0;4>e;e++)r+=m[15&t>>8*e+4]+m[15&t>>8*e];return r}function l(t){for(var r=0;t.length>r;r++)t[r]=p(t[r]);return t.join("")}function f(t){return l(c(t))}function d(t,r){return 4294967295&t+r}function d(t,r){var e=(65535&t)+(65535&r),i=(t>>16)+(r>>16)+(e>>16);return i<<16|65535&e}var g=t("../../util/util.js"),m="0123456789abcdef".split("");"5d41402abc4b2a76b9719d911017c592"!=f("hello"),r.exports=e},{"../../util/util.js":56}],14:[function(t,r){function e(t,r){return new Number(t<<r|t>>>32-r)}function i(t,r,e){return new Number(t^r^e)}function n(t,r,e){return new Number(t&r|~t&e)}function s(t,r,e){return new Number((t|~r)^e)}function o(t,r,e){return new Number(t&e|r&~e)}function a(t,r,e){return new Number(t^(r|~e))}function h(t,r,h,c,u,p,l,f){switch(f){case 0:t+=i(r,h,c)+p+0;break;case 1:t+=n(r,h,c)+p+1518500249;break;case 2:t+=s(r,h,c)+p+1859775393;break;case 3:t+=o(r,h,c)+p+2400959708;break;case 4:t+=a(r,h,c)+p+2840853838;break;case 5:t+=a(r,h,c)+p+1352829926;break;case 6:t+=o(r,h,c)+p+1548603684;break;case 7:t+=s(r,h,c)+p+1836072691;break;case 8:t+=n(r,h,c)+p+2053994217;break;case 9:t+=i(r,h,c)+p+0;break;default:document.write("Bogus round number")}t=e(t,l)+u,h=e(h,10),t&=4294967295,r&=4294967295,h&=4294967295,c&=4294967295,u&=4294967295;var d=[];return d[0]=t,d[1]=r,d[2]=h,d[3]=c,d[4]=u,d[5]=p,d[6]=l,d}function c(t){t[0]=1732584193,t[1]=4023233417,t[2]=2562383102,t[3]=271733878,t[4]=3285377520}function u(t,r){blockA=[],blockB=[];for(var e,i=0;5>i;i++)blockA[i]=new Number(t[i]),blockB[i]=new Number(t[i]);for(var n=0,s=0;5>s;s++)for(var i=0;16>i;i++)e=h(blockA[(n+0)%5],blockA[(n+1)%5],blockA[(n+2)%5],blockA[(n+3)%5],blockA[(n+4)%5],r[b[s][i]],y[s][i],s),blockA[(n+0)%5]=e[0],blockA[(n+1)%5]=e[1],blockA[(n+2)%5]=e[2],blockA[(n+3)%5]=e[3],blockA[(n+4)%5]=e[4],n+=4;n=0;for(var s=5;10>s;s++)for(var i=0;16>i;i++)e=h(blockB[(n+0)%5],blockB[(n+1)%5],blockB[(n+2)%5],blockB[(n+3)%5],blockB[(n+4)%5],r[b[s][i]],y[s][i],s),blockB[(n+0)%5]=e[0],blockB[(n+1)%5]=e[1],blockB[(n+2)%5]=e[2],blockB[(n+3)%5]=e[3],blockB[(n+4)%5]=e[4],n+=4;blockB[3]+=blockA[2]+t[1],t[1]=t[2]+blockA[3]+blockB[4],t[2]=t[3]+blockA[4]+blockB[0],t[3]=t[4]+blockA[0]+blockB[1],t[4]=t[0]+blockA[1]+blockB[2],t[0]=blockB[3]}function p(t){for(var r=0;16>r;r++)t[r]=0}function l(t,r,e,i){var n=Array(16);p(n);for(var s=0,o=0;(63&e)>o;o++)n[o>>>2]^=(255&r.charCodeAt(s++))<<8*(3&o);if(n[15&e>>>2]^=1<<8*(3&e)+7,(63&e)>55){u(t,n);var n=Array(16);p(n)}n[14]=e<<3,n[15]=e>>>29|i<<3,u(t,n)}function f(t){var r=(255&t.charCodeAt(3))<<24;return r|=(255&t.charCodeAt(2))<<16,r|=(255&t.charCodeAt(1))<<8,r|=255&t.charCodeAt(0)}function d(t){var r,e,i=Array(m/32),n=Array(m/8);c(i),r=t.length;var s=Array(16);p(s);for(var o=0,e=r;e>63;e-=64){for(var a=0;16>a;a++)s[a]=f(t.substr(o,4)),o+=4;u(i,s)}l(i,t.substr(o),r,0);for(var a=0;m/8>a;a+=4)n[a]=255&i[a>>>2],n[a+1]=255&i[a>>>2]>>>8,n[a+2]=255&i[a>>>2]>>>16,n[a+3]=255&i[a>>>2]>>>24;return n}function g(t){for(var r=d(t),e="",i=0;m/8>i;i++)e+=String.fromCharCode(r[i]);return e}var m=160,y=[[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],[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]],b=[[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],[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]];r.exports=g},{}],15:[function(t,r){var e=function(){var t=8,r="",e=0,i=function(t,r){this.highOrder=t,this.lowOrder=r},n=function(r){var e,i=[],n=(1<<t)-1,s=r.length*t;for(e=0;s>e;e+=t)i[e>>5]|=(r.charCodeAt(e/t)&n)<<32-t-e%32;return i},s=function(t){var r,e,i=[],n=t.length;for(r=0;n>r;r+=2){if(e=parseInt(t.substr(r,2),16),isNaN(e))return"INVALID HEX STRING";i[r>>3]|=e<<24-4*(r%8)}return i},o=function(t){var r,i,n=e?"0123456789ABCDEF":"0123456789abcdef",s="",o=4*t.length;for(r=0;o>r;r+=1)i=t[r>>2]>>8*(3-r%4),s+=n.charAt(15&i>>4)+n.charAt(15&i);return s},a=function(t){var e,i,n,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o="",a=4*t.length;for(e=0;a>e;e+=3)for(n=(255&t[e>>2]>>8*(3-e%4))<<16|(255&t[e+1>>2]>>8*(3-(e+1)%4))<<8|255&t[e+2>>2]>>8*(3-(e+2)%4),i=0;4>i;i+=1)o+=32*t.length>=8*e+6*i?s.charAt(63&n>>6*(3-i)):r;return o},h=function(t){for(var r="",e=255,i=0;32*t.length>i;i+=8)r+=String.fromCharCode(t[i>>5]>>>24-i%32&e);return r},c=function(t,r){return t<<r|t>>>32-r},u=function(t,r){return t>>>r|t<<32-r},p=function(t,r){return 32>=r?new i(t.highOrder>>>r|t.lowOrder<<32-r,t.lowOrder>>>r|t.highOrder<<32-r):new i(t.lowOrder>>>r|t.highOrder<<32-r,t.highOrder>>>r|t.lowOrder<<32-r)},l=function(t,r){return t>>>r},f=function(t,r){return 32>=r?new i(t.highOrder>>>r,t.lowOrder>>>r|t.highOrder<<32-r):new i(0,t.highOrder<<32-r)},d=function(t,r,e){return t^r^e},g=function(t,r,e){return t&r^~t&e},m=function(t,r,e){return new i(t.highOrder&r.highOrder^~t.highOrder&e.highOrder,t.lowOrder&r.lowOrder^~t.lowOrder&e.lowOrder)},y=function(t,r,e){return t&r^t&e^r&e},b=function(t,r,e){return new i(t.highOrder&r.highOrder^t.highOrder&e.highOrder^r.highOrder&e.highOrder,t.lowOrder&r.lowOrder^t.lowOrder&e.lowOrder^r.lowOrder&e.lowOrder)},v=function(t){return u(t,2)^u(t,13)^u(t,22)},k=function(t){var r=p(t,28),e=p(t,34),n=p(t,39);return new i(r.highOrder^e.highOrder^n.highOrder,r.lowOrder^e.lowOrder^n.lowOrder)},w=function(t){return u(t,6)^u(t,11)^u(t,25)},C=function(t){var r=p(t,14),e=p(t,18),n=p(t,41);return new i(r.highOrder^e.highOrder^n.highOrder,r.lowOrder^e.lowOrder^n.lowOrder)},A=function(t){return u(t,7)^u(t,18)^l(t,3)},_=function(t){var r=p(t,1),e=p(t,8),n=f(t,7);return new i(r.highOrder^e.highOrder^n.highOrder,r.lowOrder^e.lowOrder^n.lowOrder)},S=function(t){return u(t,17)^u(t,19)^l(t,10)},j=function(t){var r=p(t,19),e=p(t,61),n=f(t,6);return new i(r.highOrder^e.highOrder^n.highOrder,r.lowOrder^e.lowOrder^n.lowOrder)},T=function(t,r){var e=(65535&t)+(65535&r),i=(t>>>16)+(r>>>16)+(e>>>16);return(65535&i)<<16|65535&e},O=function(t,r,e,i){var n=(65535&t)+(65535&r)+(65535&e)+(65535&i),s=(t>>>16)+(r>>>16)+(e>>>16)+(i>>>16)+(n>>>16);return(65535&s)<<16|65535&n},I=function(t,r,e,i,n){var s=(65535&t)+(65535&r)+(65535&e)+(65535&i)+(65535&n),o=(t>>>16)+(r>>>16)+(e>>>16)+(i>>>16)+(n>>>16)+(s>>>16);return(65535&o)<<16|65535&s},E=function(t,r){var e,n,s,o;return e=(65535&t.lowOrder)+(65535&r.lowOrder),n=(t.lowOrder>>>16)+(r.lowOrder>>>16)+(e>>>16),s=(65535&n)<<16|65535&e,e=(65535&t.highOrder)+(65535&r.highOrder)+(n>>>16),n=(t.highOrder>>>16)+(r.highOrder>>>16)+(e>>>16),o=(65535&n)<<16|65535&e,new i(o,s)},B=function(t,r,e,n){var s,o,a,h;return s=(65535&t.lowOrder)+(65535&r.lowOrder)+(65535&e.lowOrder)+(65535&n.lowOrder),o=(t.lowOrder>>>16)+(r.lowOrder>>>16)+(e.lowOrder>>>16)+(n.lowOrder>>>16)+(s>>>16),a=(65535&o)<<16|65535&s,s=(65535&t.highOrder)+(65535&r.highOrder)+(65535&e.highOrder)+(65535&n.highOrder)+(o>>>16),o=(t.highOrder>>>16)+(r.highOrder>>>16)+(e.highOrder>>>16)+(n.highOrder>>>16)+(s>>>16),h=(65535&o)<<16|65535&s,new i(h,a)},x=function(t,r,e,n,s){var o,a,h,c;return o=(65535&t.lowOrder)+(65535&r.lowOrder)+(65535&e.lowOrder)+(65535&n.lowOrder)+(65535&s.lowOrder),a=(t.lowOrder>>>16)+(r.lowOrder>>>16)+(e.lowOrder>>>16)+(n.lowOrder>>>16)+(s.lowOrder>>>16)+(o>>>16),h=(65535&a)<<16|65535&o,o=(65535&t.highOrder)+(65535&r.highOrder)+(65535&e.highOrder)+(65535&n.highOrder)+(65535&s.highOrder)+(a>>>16),a=(t.highOrder>>>16)+(r.highOrder>>>16)+(e.highOrder>>>16)+(n.highOrder>>>16)+(s.highOrder>>>16)+(o>>>16),c=(65535&a)<<16|65535&o,new i(c,h)},P=function(t,r){var e,i,n,s,o,a,h,u,p,l=[],f=g,m=d,b=y,v=c,k=T,w=I,C=[1732584193,4023233417,2562383102,271733878,3285377520],A=[1518500249,1518500249,1518500249,1518500249,1518500249,1518500249,1518500249,1518500249,1518500249,1518500249,1518500249,1518500249,1518500249,1518500249,1518500249,1518500249,1518500249,1518500249,1518500249,1518500249,1859775393,1859775393,1859775393,1859775393,1859775393,1859775393,1859775393,1859775393,1859775393,1859775393,1859775393,1859775393,1859775393,1859775393,1859775393,1859775393,1859775393,1859775393,1859775393,1859775393,2400959708,2400959708,2400959708,2400959708,2400959708,2400959708,2400959708,2400959708,2400959708,2400959708,2400959708,2400959708,2400959708,2400959708,2400959708,2400959708,2400959708,2400959708,2400959708,2400959708,3395469782,3395469782,3395469782,3395469782,3395469782,3395469782,3395469782,3395469782,3395469782,3395469782,3395469782,3395469782,3395469782,3395469782,3395469782,3395469782,3395469782,3395469782,3395469782,3395469782];for(t[r>>5]|=128<<24-r%32,t[(r+65>>9<<4)+15]=r,p=t.length,h=0;p>h;h+=16){for(e=C[0],i=C[1],n=C[2],s=C[3],o=C[4],u=0;80>u;u+=1)l[u]=16>u?t[u+h]:v(l[u-3]^l[u-8]^l[u-14]^l[u-16],1),a=20>u?w(v(e,5),f(i,n,s),o,A[u],l[u]):40>u?w(v(e,5),m(i,n,s),o,A[u],l[u]):60>u?w(v(e,5),b(i,n,s),o,A[u],l[u]):w(v(e,5),m(i,n,s),o,A[u],l[u]),o=s,s=n,n=v(i,30),i=e,e=a;C[0]=k(e,C[0]),C[1]=k(i,C[1]),C[2]=k(n,C[2]),C[3]=k(s,C[3]),C[4]=k(o,C[4])}return C},K=function(t,r,e){var n,s,o,a,h,c,u,p,l,f,d,P,K,N,D,M,R,G,H,L,z,U,q,F,V,Z,X,J,Y,W=[];for("SHA-224"===e||"SHA-256"===e?(P=64,K=(r+65>>9<<4)+15,M=16,R=1,X=Number,G=T,H=O,L=I,z=A,U=S,q=v,F=w,Z=y,V=g,J=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],d="SHA-224"===e?[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]:[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]):("SHA-384"===e||"SHA-512"===e)&&(P=80,K=(r+128>>10<<5)+31,M=32,R=2,X=i,G=E,H=B,L=x,z=_,U=j,q=k,F=C,Z=b,V=m,J=[new X(1116352408,3609767458),new X(1899447441,602891725),new X(3049323471,3964484399),new X(3921009573,2173295548),new X(961987163,4081628472),new X(1508970993,3053834265),new X(2453635748,2937671579),new X(2870763221,3664609560),new X(3624381080,2734883394),new X(310598401,1164996542),new X(607225278,1323610764),new X(1426881987,3590304994),new X(1925078388,4068182383),new X(2162078206,991336113),new X(2614888103,633803317),new X(3248222580,3479774868),new X(3835390401,2666613458),new X(4022224774,944711139),new X(264347078,2341262773),new X(604807628,2007800933),new X(770255983,1495990901),new X(1249150122,1856431235),new X(1555081692,3175218132),new X(1996064986,2198950837),new X(2554220882,3999719339),new X(2821834349,766784016),new X(2952996808,2566594879),new X(3210313671,3203337956),new X(3336571891,1034457026),new X(3584528711,2466948901),new X(113926993,3758326383),new X(338241895,168717936),new X(666307205,1188179964),new X(773529912,1546045734),new X(1294757372,1522805485),new X(1396182291,2643833823),new X(1695183700,2343527390),new X(1986661051,1014477480),new X(2177026350,1206759142),new X(2456956037,344077627),new X(2730485921,1290863460),new X(2820302411,3158454273),new X(3259730800,3505952657),new X(3345764771,106217008),new X(3516065817,3606008344),new X(3600352804,1432725776),new X(4094571909,1467031594),new X(275423344,851169720),new X(430227734,3100823752),new X(506948616,1363258195),new X(659060556,3750685593),new X(883997877,3785050280),new X(958139571,3318307427),new X(1322822218,3812723403),new X(1537002063,2003034995),new X(1747873779,3602036899),new X(1955562222,1575990012),new X(2024104815,1125592928),new X(2227730452,2716904306),new X(2361852424,442776044),new X(2428436474,593698344),new X(2756734187,3733110249),new X(3204031479,2999351573),new X(3329325298,3815920427),new X(3391569614,3928383900),new X(3515267271,566280711),new X(3940187606,3454069534),new X(4118630271,4000239992),new X(116418474,1914138554),new X(174292421,2731055270),new X(289380356,3203993006),new X(460393269,320620315),new X(685471733,587496836),new X(852142971,1086792851),new X(1017036298,365543100),new X(1126000580,2618297676),new X(1288033470,3409855158),new X(1501505948,4234509866),new X(1607167915,987167468),new X(1816402316,1246189591)],d="SHA-384"===e?[new X(3418070365,3238371032),new X(1654270250,914150663),new X(2438529370,812702999),new X(355462360,4144912697),new X(1731405415,4290775857),new X(41048885895,1750603025),new X(3675008525,1694076839),new X(1203062813,3204075428)]:[new X(1779033703,4089235720),new X(3144134277,2227873595),new X(1013904242,4271175723),new X(2773480762,1595750129),new X(1359893119,2917565137),new X(2600822924,725511199),new X(528734635,4215389547),new X(1541459225,327033209)]),t[r>>5]|=128<<24-r%32,t[K]=r,Y=t.length,N=0;Y>N;N+=M){for(n=d[0],s=d[1],o=d[2],a=d[3],h=d[4],c=d[5],u=d[6],p=d[7],D=0;P>D;D+=1)W[D]=16>D?new X(t[D*R+N],t[D*R+N+1]):H(U(W[D-2]),W[D-7],z(W[D-15]),W[D-16]),l=L(p,F(h),V(h,c,u),J[D],W[D]),f=G(q(n),Z(n,s,o)),p=u,u=c,c=h,h=G(a,l),a=o,o=s,s=n,n=G(l,f);d[0]=G(n,d[0]),d[1]=G(s,d[1]),d[2]=G(o,d[2]),d[3]=G(a,d[3]),d[4]=G(h,d[4]),d[5]=G(c,d[5]),d[6]=G(u,d[6]),d[7]=G(p,d[7])}switch(e){case"SHA-224":return[d[0],d[1],d[2],d[3],d[4],d[5],d[6]];case"SHA-256":return d;case"SHA-384":return[d[0].highOrder,d[0].lowOrder,d[1].highOrder,d[1].lowOrder,d[2].highOrder,d[2].lowOrder,d[3].highOrder,d[3].lowOrder,d[4].highOrder,d[4].lowOrder,d[5].highOrder,d[5].lowOrder];case"SHA-512":return[d[0].highOrder,d[0].lowOrder,d[1].highOrder,d[1].lowOrder,d[2].highOrder,d[2].lowOrder,d[3].highOrder,d[3].lowOrder,d[4].highOrder,d[4].lowOrder,d[5].highOrder,d[5].lowOrder,d[6].highOrder,d[6].lowOrder,d[7].highOrder,d[7].lowOrder];default:return[]}},N=function(r,e){if(this.sha1=null,this.sha224=null,this.sha256=null,this.sha384=null,this.sha512=null,this.strBinLen=null,this.strToHash=null,"HEX"===e){if(0!==r.length%2)return"TEXT MUST BE IN BYTE INCREMENTS";this.strBinLen=4*r.length,this.strToHash=s(r)}else{if("ASCII"!==e&&void 0!==e)return"UNKNOWN TEXT INPUT TYPE";this.strBinLen=r.length*t,this.strToHash=n(r)}};return N.prototype={getHash:function(t,r){var e=null,i=this.strToHash.slice();switch(r){case"HEX":e=o;break;case"B64":e=a;break;case"ASCII":e=h;break;default:return"FORMAT NOT RECOGNIZED"}switch(t){case"SHA-1":return null===this.sha1&&(this.sha1=P(i,this.strBinLen)),e(this.sha1);case"SHA-224":return null===this.sha224&&(this.sha224=K(i,this.strBinLen,t)),e(this.sha224);case"SHA-256":return null===this.sha256&&(this.sha256=K(i,this.strBinLen,t)),e(this.sha256);case"SHA-384":return null===this.sha384&&(this.sha384=K(i,this.strBinLen,t)),e(this.sha384);case"SHA-512":return null===this.sha512&&(this.sha512=K(i,this.strBinLen,t)),e(this.sha512);default:return"HASH NOT RECOGNIZED"}},getHMAC:function(r,e,i,c){var u,p,l,f,d,g,m,y,b,v=[],k=[];switch(c){case"HEX":u=o;break;case"B64":u=a;break;case"ASCII":u=h;break;default:return"FORMAT NOT RECOGNIZED"}switch(i){case"SHA-1":l=64,b=160;break;case"SHA-224":l=64,b=224;break;case"SHA-256":l=64,b=256;break;case"SHA-384":l=128,b=384;break;case"SHA-512":l=128,b=512;break;default:return"HASH NOT RECOGNIZED"}if("HEX"===e){if(0!==r.length%2)return"KEY MUST BE IN BYTE INCREMENTS";p=s(r),y=4*r.length}else{if("ASCII"!==e)return"UNKNOWN KEY INPUT TYPE";p=n(r),y=r.length*t}for(f=8*l,m=l/4-1,y/8>l?(p="SHA-1"===i?P(p,y):K(p,y,i),p[m]&=4294967040):l>y/8&&(p[m]&=4294967040),d=0;m>=d;d+=1)v[d]=909522486^p[d],k[d]=1549556828^p[d];return"SHA-1"===i?(g=P(v.concat(this.strToHash),f+this.strBinLen),g=P(k.concat(g),f+b)):(g=K(v.concat(this.strToHash),f+this.strBinLen,i),g=K(k.concat(g),f+b,i)),u(g)}},N}();r.exports={sha1:function(t){var r=new e(t,"ASCII");return r.getHash("SHA-1","ASCII")},sha224:function(t){var r=new e(t,"ASCII");return r.getHash("SHA-224","ASCII")},sha256:function(t){var r=new e(t,"ASCII");return r.getHash("SHA-256","ASCII")},sha384:function(t){var r=new e(t,"ASCII");return r.getHash("SHA-384","ASCII")},sha512:function(t){var r=new e(t,"ASCII");return r.getHash("SHA-512","ASCII")}}},{}],16:[function(t,r){r.exports={cipher:t("./cipher"),hash:t("./hash"),cfb:t("./cfb.js"),publicKey:t("./public_key"),signature:t("./signature.js"),random:t("./random.js"),pkcs1:t("./pkcs1.js")};var e=t("./crypto.js");
|
|
for(var i in e)r.exports[i]=e[i]},{"./cfb.js":4,"./cipher":9,"./crypto.js":11,"./hash":12,"./pkcs1.js":17,"./public_key":20,"./random.js":23,"./signature.js":24}],17:[function(t,r){hash_headers=[],hash_headers[1]=[48,32,48,12,6,8,42,134,72,134,247,13,2,5,5,0,4,16],hash_headers[3]=[48,33,48,9,6,5,43,36,3,2,1,5,0,4,20],hash_headers[2]=[48,33,48,9,6,5,43,14,3,2,26,5,0,4,20],hash_headers[8]=[48,49,48,13,6,9,96,134,72,1,101,3,4,2,1,5,0,4,32],hash_headers[9]=[48,65,48,13,6,9,96,134,72,1,101,3,4,2,2,5,0,4,48],hash_headers[10]=[48,81,48,13,6,9,96,134,72,1,101,3,4,2,3,5,0,4,64],hash_headers[11]=[48,49,48,13,6,9,96,134,72,1,101,3,4,2,4,5,0,4,28];var e=(t("./crypto.js"),t("./random.js")),i=t("../util"),n=t("./public_key/jsbn.js"),s=t("./hash");r.exports={eme:{encode:function(t,r){if(t.length>r-11)return-1;var i="";i+=String.fromCharCode(0),i+=String.fromCharCode(2);for(var n=0;r-t.length-3>n;n++)i+=String.fromCharCode(e.getPseudoRandom(1,255));return i+=String.fromCharCode(0),i+=t},decode:function(t,r){if(r>t.length&&(t=String.fromCharCode(0)+t),12>t.length||0!=t.charCodeAt(0)||2!=t.charCodeAt(1))return-1;for(var e=2;0!=t.charCodeAt(e)&&t.length>e;)e++;return t.substring(e+1,t.length)}},emsa:{encode:function(t,r,e){var o="";o+=String.fromCharCode(0),o+=String.fromCharCode(1);for(var a=0;e-hash_headers[t].length-3-s.getHashByteLength(t)>a;a++)o+=String.fromCharCode(255);o+=String.fromCharCode(0);for(var a=0;hash_headers[t].length>a;a++)o+=String.fromCharCode(hash_headers[t][a]);return o+=s.digest(t,r),new n(i.hexstrdump(o),16)},decode:function(t,r){var e=0;if(0==r.charCodeAt(0))e++;else{if(1!=r.charCodeAt(0))return-1;e++}for(;255==r.charCodeAt(e);)e++;if(0!=r.charCodeAt(e++))return-1;var i=0;for(i=0;hash_headers[t].length>i&&r.length>i+e;i++)if(r.charCodeAt(i+e)!=hash_headers[t][i])return-1;return e+=i,r.substring(e).length<s.getHashByteLength(t)?-1:r.substring(e)}}}},{"../util":56,"./crypto.js":11,"./hash":12,"./public_key/jsbn.js":21,"./random.js":23}],18:[function(t,r){function e(){function t(t,r,e,a,h,c){var u=o.getLeftNBits(s.digest(t,r),h.bitLength()),p=new i(o.hexstrdump(u),16),l=n.getRandomBigIntegerInRange(i.ONE.add(i.ONE),h.subtract(i.ONE)),f=e.modPow(l,a).mod(h),d=l.modInverse(h).multiply(p.add(c.multiply(f))).mod(h),g=[];return g[0]=f.toMPI(),g[1]=d.toMPI(),g}function r(t){var r=openpgp.config.config.prefer_hash_algorithm;switch(Math.round(t.bitLength()/8)){case 20:return 2!=r&&r>11&&10!=r&&8>r?2:r;case 28:return r>11&&8>r?11:r;case 32:return r>10&&8>r?8:r;default:return o.print_debug("DSA select hash algorithm: returning null for an unknown length of q"),null}}function e(t,r,e,n,a,h,c,u){var p=o.getLeftNBits(s.digest(t,n),h.bitLength()),l=new i(o.hexstrdump(p),16);if(i.ZERO.compareTo(r)>0||r.compareTo(h)>0||i.ZERO.compareTo(e)>0||e.compareTo(h)>0)return o.print_error("invalid DSA Signature"),null;var f=e.modInverse(h),d=l.multiply(f).mod(h),g=r.multiply(f).mod(h);return c.modPow(d,a).multiply(u.modPow(g,a)).mod(a).mod(h)}this.select_hash_algorithm=r,this.sign=t,this.verify=e}var i=t("./jsbn.js"),n=t("../random.js"),s=t("../hash"),o=t("../../util");r.exports=e},{"../../util":56,"../hash":12,"../random.js":23,"./jsbn.js":21}],19:[function(t,r){function e(){function t(t,r,e,s){var o=i.ONE.add(i.ONE),a=e.subtract(o),h=n.getRandomBigIntegerInRange(o,a);h=h.mod(a).add(i.ONE);var c=[];return c[0]=r.modPow(h,e),c[1]=s.modPow(h,e).multiply(t).mod(e),c}function r(t,r,e,i){return s.print_debug("Elgamal Decrypt:\nc1:"+s.hexstrdump(t.toMPI())+"\n"+"c2:"+s.hexstrdump(r.toMPI())+"\n"+"p:"+s.hexstrdump(e.toMPI())+"\n"+"x:"+s.hexstrdump(i.toMPI())),t.modPow(i,e).modInverse(e).multiply(r).mod(e)}this.encrypt=t,this.decrypt=r}var i=t("./jsbn.js"),n=t("../random.js"),s=t("../../util");r.exports=e},{"../../util":56,"../random.js":23,"./jsbn.js":21}],20:[function(t,r){r.exports={rsa:t("./rsa.js"),elgamal:t("./elgamal.js"),dsa:t("./dsa.js")}},{"./dsa.js":18,"./elgamal.js":19,"./rsa.js":22}],21:[function(t,r){function e(t,r,e){null!=t&&("number"==typeof t?this.fromNumber(t,r,e):null==r&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,r))}function i(){return new e(null)}function n(t,r,e,i,n,s){for(;--s>=0;){var o=r*this[t++]+e[i]+n;n=Math.floor(o/67108864),e[i++]=67108863&o}return n}function s(t){return ne.charAt(t)}function o(t,r){var e=se[t.charCodeAt(r)];return null==e?-1:e}function a(t){for(var r=this.t-1;r>=0;--r)t[r]=this[r];t.t=this.t,t.s=this.s}function h(t){this.t=1,this.s=0>t?-1:0,t>0?this[0]=t:-1>t?this[0]=t+DV:this.t=0}function c(t){var r=i();return r.fromInt(t),r}function u(t,r){var i;if(16==r)i=4;else if(8==r)i=3;else if(256==r)i=8;else if(2==r)i=1;else if(32==r)i=5;else{if(4!=r)return this.fromRadix(t,r),void 0;i=2}this.t=0,this.s=0;for(var n=t.length,s=!1,a=0;--n>=0;){var h=8==i?255&t[n]:o(t,n);0>h?"-"==t.charAt(n)&&(s=!0):(s=!1,0==a?this[this.t++]=h:a+i>this.DB?(this[this.t-1]|=(h&(1<<this.DB-a)-1)<<a,this[this.t++]=h>>this.DB-a):this[this.t-1]|=h<<a,a+=i,a>=this.DB&&(a-=this.DB))}8==i&&0!=(128&t[0])&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),s&&e.ZERO.subTo(this,this)}function p(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t}function l(t){if(0>this.s)return"-"+this.negate().toString(t);var r;if(16==t)r=4;else if(8==t)r=3;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return this.toRadix(t);r=2}var e,i=(1<<r)-1,n=!1,o="",a=this.t,h=this.DB-a*this.DB%r;if(a-->0)for(this.DB>h&&(e=this[a]>>h)>0&&(n=!0,o=s(e));a>=0;)r>h?(e=(this[a]&(1<<h)-1)<<r-h,e|=this[--a]>>(h+=this.DB-r)):(e=this[a]>>(h-=r)&i,0>=h&&(h+=this.DB,--a)),e>0&&(n=!0),n&&(o+=s(e));return n?o:"0"}function f(){var t=i();return e.ZERO.subTo(this,t),t}function d(){return 0>this.s?this.negate():this}function g(t){var r=this.s-t.s;if(0!=r)return r;var e=this.t;if(r=e-t.t,0!=r)return r;for(;--e>=0;)if(0!=(r=this[e]-t[e]))return r;return 0}function m(t){var r,e=1;return 0!=(r=t>>>16)&&(t=r,e+=16),0!=(r=t>>8)&&(t=r,e+=8),0!=(r=t>>4)&&(t=r,e+=4),0!=(r=t>>2)&&(t=r,e+=2),0!=(r=t>>1)&&(t=r,e+=1),e}function y(){return 0>=this.t?0:this.DB*(this.t-1)+m(this[this.t-1]^this.s&this.DM)}function b(t,r){var e;for(e=this.t-1;e>=0;--e)r[e+t]=this[e];for(e=t-1;e>=0;--e)r[e]=0;r.t=this.t+t,r.s=this.s}function v(t,r){for(var e=t;this.t>e;++e)r[e-t]=this[e];r.t=Math.max(this.t-t,0),r.s=this.s}function k(t,r){var e,i=t%this.DB,n=this.DB-i,s=(1<<n)-1,o=Math.floor(t/this.DB),a=this.s<<i&this.DM;for(e=this.t-1;e>=0;--e)r[e+o+1]=this[e]>>n|a,a=(this[e]&s)<<i;for(e=o-1;e>=0;--e)r[e]=0;r[o]=a,r.t=this.t+o+1,r.s=this.s,r.clamp()}function w(t,r){r.s=this.s;var e=Math.floor(t/this.DB);if(e>=this.t)return r.t=0,void 0;var i=t%this.DB,n=this.DB-i,s=(1<<i)-1;r[0]=this[e]>>i;for(var o=e+1;this.t>o;++o)r[o-e-1]|=(this[o]&s)<<n,r[o-e]=this[o]>>i;i>0&&(r[this.t-e-1]|=(this.s&s)<<n),r.t=this.t-e,r.clamp()}function C(t,r){for(var e=0,i=0,n=Math.min(t.t,this.t);n>e;)i+=this[e]-t[e],r[e++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i-=t.s;this.t>e;)i+=this[e],r[e++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;t.t>e;)i-=t[e],r[e++]=i&this.DM,i>>=this.DB;i-=t.s}r.s=0>i?-1:0,-1>i?r[e++]=this.DV+i:i>0&&(r[e++]=i),r.t=e,r.clamp()}function A(t,r){var i=this.abs(),n=t.abs(),s=i.t;for(r.t=s+n.t;--s>=0;)r[s]=0;for(s=0;n.t>s;++s)r[s+i.t]=i.am(0,n[s],r,s,0,i.t);r.s=0,r.clamp(),this.s!=t.s&&e.ZERO.subTo(r,r)}function _(t){for(var r=this.abs(),e=t.t=2*r.t;--e>=0;)t[e]=0;for(e=0;r.t-1>e;++e){var i=r.am(e,r[e],t,2*e,0,1);(t[e+r.t]+=r.am(e+1,2*r[e],t,2*e+1,i,r.t-e-1))>=r.DV&&(t[e+r.t]-=r.DV,t[e+r.t+1]=1)}t.t>0&&(t[t.t-1]+=r.am(e,r[e],t,2*e,0,1)),t.s=0,t.clamp()}function S(t,r,n){var s=t.abs();if(!(0>=s.t)){var o=this.abs();if(o.t<s.t)return null!=r&&r.fromInt(0),null!=n&&this.copyTo(n),void 0;null==n&&(n=i());var a=i(),h=this.s,c=t.s,u=this.DB-m(s[s.t-1]);u>0?(s.lShiftTo(u,a),o.lShiftTo(u,n)):(s.copyTo(a),o.copyTo(n));var p=a.t,l=a[p-1];if(0!=l){var f=l*(1<<this.F1)+(p>1?a[p-2]>>this.F2:0),d=this.FV/f,g=(1<<this.F1)/f,y=1<<this.F2,b=n.t,v=b-p,k=null==r?i():r;for(a.dlShiftTo(v,k),n.compareTo(k)>=0&&(n[n.t++]=1,n.subTo(k,n)),e.ONE.dlShiftTo(p,k),k.subTo(a,a);p>a.t;)a[a.t++]=0;for(;--v>=0;){var w=n[--b]==l?this.DM:Math.floor(n[b]*d+(n[b-1]+y)*g);if(w>(n[b]+=a.am(0,w,n,v,0,p)))for(a.dlShiftTo(v,k),n.subTo(k,n);n[b]<--w;)n.subTo(k,n)}null!=r&&(n.drShiftTo(p,r),h!=c&&e.ZERO.subTo(r,r)),n.t=p,n.clamp(),u>0&&n.rShiftTo(u,n),0>h&&e.ZERO.subTo(n,n)}}}function j(t){var r=i();return this.abs().divRemTo(t,null,r),0>this.s&&r.compareTo(e.ZERO)>0&&t.subTo(r,r),r}function T(t){this.m=t}function O(t){return 0>t.s||t.compareTo(this.m)>=0?t.mod(this.m):t}function I(t){return t}function E(t){t.divRemTo(this.m,null,t)}function B(t,r,e){t.multiplyTo(r,e),this.reduce(e)}function x(t,r){t.squareTo(r),this.reduce(r)}function P(){if(1>this.t)return 0;var t=this[0];if(0==(1&t))return 0;var r=3&t;return r=15&r*(2-(15&t)*r),r=255&r*(2-(255&t)*r),r=65535&r*(2-(65535&(65535&t)*r)),r=r*(2-t*r%this.DV)%this.DV,r>0?this.DV-r:-r}function K(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}function N(t){var r=i();return t.abs().dlShiftTo(this.m.t,r),r.divRemTo(this.m,null,r),0>t.s&&r.compareTo(e.ZERO)>0&&this.m.subTo(r,r),r}function D(t){var r=i();return t.copyTo(r),this.reduce(r),r}function M(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var r=0;this.m.t>r;++r){var e=32767&t[r],i=e*this.mpl+((e*this.mph+(t[r]>>15)*this.mpl&this.um)<<15)&t.DM;for(e=r+this.m.t,t[e]+=this.m.am(0,i,t,r,0,this.m.t);t[e]>=t.DV;)t[e]-=t.DV,t[++e]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function R(t,r){t.squareTo(r),this.reduce(r)}function G(t,r,e){t.multiplyTo(r,e),this.reduce(e)}function H(){return 0==(this.t>0?1&this[0]:this.s)}function L(t,r){if(t>4294967295||1>t)return e.ONE;var n=i(),s=i(),o=r.convert(this),a=m(t)-1;for(o.copyTo(n);--a>=0;)if(r.sqrTo(n,s),(t&1<<a)>0)r.mulTo(s,o,n);else{var h=n;n=s,s=h}return r.revert(n)}function z(t,r){var e;return e=256>t||r.isEven()?new T(r):new K(r),this.exp(t,e)}function U(){var t=i();return this.copyTo(t),t}function q(){if(0>this.s){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)<<this.DB|this[0]}function F(){return 0==this.t?this.s:this[0]<<24>>24}function V(){return 0==this.t?this.s:this[0]<<16>>16}function Z(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function X(){return 0>this.s?-1:0>=this.t||1==this.t&&0>=this[0]?0:1}function J(t){if(null==t&&(t=10),0==this.signum()||2>t||t>36)return"0";var r=this.chunkSize(t),e=Math.pow(t,r),n=c(e),s=i(),o=i(),a="";for(this.divRemTo(n,s,o);s.signum()>0;)a=(e+o.intValue()).toString(t).substr(1)+a,s.divRemTo(n,s,o);return o.intValue().toString(t)+a}function Y(t,r){this.fromInt(0),null==r&&(r=10);for(var i=this.chunkSize(r),n=Math.pow(r,i),s=!1,a=0,h=0,c=0;t.length>c;++c){var u=o(t,c);0>u?"-"==t.charAt(c)&&0==this.signum()&&(s=!0):(h=r*h+u,++a>=i&&(this.dMultiply(n),this.dAddOffset(h,0),a=0,h=0))}a>0&&(this.dMultiply(Math.pow(r,a)),this.dAddOffset(h,0)),s&&e.ZERO.subTo(this,this)}function W(t,r,i){if("number"==typeof r)if(2>t)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),sr,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var n=[],s=7&t;n.length=(t>>3)+1,r.nextBytes(n),s>0?n[0]&=(1<<s)-1:n[0]=0,this.fromString(n,256)}}function Q(){var t=this.t,r=[];r[0]=this.s;var e,i=this.DB-t*this.DB%8,n=0;if(t-->0)for(this.DB>i&&(e=this[t]>>i)!=(this.s&this.DM)>>i&&(r[n++]=e|this.s<<this.DB-i);t>=0;)8>i?(e=(this[t]&(1<<i)-1)<<8-i,e|=this[--t]>>(i+=this.DB-8)):(e=255&this[t]>>(i-=8),0>=i&&(i+=this.DB,--t)),(n>0||e!=this.s)&&(r[n++]=e);return r}function $(t){return 0==this.compareTo(t)}function tr(t){return 0>this.compareTo(t)?this:t}function rr(t){return this.compareTo(t)>0?this:t}function er(t,r,e){var i,n,s=Math.min(t.t,this.t);for(i=0;s>i;++i)e[i]=r(this[i],t[i]);if(t.t<this.t){for(n=t.s&this.DM,i=s;this.t>i;++i)e[i]=r(this[i],n);e.t=this.t}else{for(n=this.s&this.DM,i=s;t.t>i;++i)e[i]=r(n,t[i]);e.t=t.t}e.s=r(this.s,t.s),e.clamp()}function ir(t,r){return t&r}function nr(t){var r=i();return this.bitwiseTo(t,ir,r),r}function sr(t,r){return t|r}function or(t){var r=i();return this.bitwiseTo(t,sr,r),r}function ar(t,r){return t^r}function hr(t){var r=i();return this.bitwiseTo(t,ar,r),r}function cr(t,r){return t&~r}function ur(t){var r=i();return this.bitwiseTo(t,cr,r),r}function pr(){for(var t=i(),r=0;this.t>r;++r)t[r]=this.DM&~this[r];return t.t=this.t,t.s=~this.s,t}function lr(t){var r=i();return 0>t?this.rShiftTo(-t,r):this.lShiftTo(t,r),r}function fr(t){var r=i();return 0>t?this.lShiftTo(-t,r):this.rShiftTo(t,r),r}function dr(t){if(0==t)return-1;var r=0;return 0==(65535&t)&&(t>>=16,r+=16),0==(255&t)&&(t>>=8,r+=8),0==(15&t)&&(t>>=4,r+=4),0==(3&t)&&(t>>=2,r+=2),0==(1&t)&&++r,r}function gr(){for(var t=0;this.t>t;++t)if(0!=this[t])return t*this.DB+dr(this[t]);return 0>this.s?this.t*this.DB:-1}function mr(t){for(var r=0;0!=t;)t&=t-1,++r;return r}function yr(){for(var t=0,r=this.s&this.DM,e=0;this.t>e;++e)t+=mr(this[e]^r);return t}function br(t){var r=Math.floor(t/this.DB);return r>=this.t?0!=this.s:0!=(this[r]&1<<t%this.DB)}function vr(t,r){var i=e.ONE.shiftLeft(t);return this.bitwiseTo(i,r,i),i}function kr(t){return this.changeBit(t,sr)}function wr(t){return this.changeBit(t,cr)}function Cr(t){return this.changeBit(t,ar)}function Ar(t,r){for(var e=0,i=0,n=Math.min(t.t,this.t);n>e;)i+=this[e]+t[e],r[e++]=i&this.DM,i>>=this.DB;if(t.t<this.t){for(i+=t.s;this.t>e;)i+=this[e],r[e++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;t.t>e;)i+=t[e],r[e++]=i&this.DM,i>>=this.DB;i+=t.s}r.s=0>i?-1:0,i>0?r[e++]=i:-1>i&&(r[e++]=this.DV+i),r.t=e,r.clamp()}function _r(t){var r=i();return this.addTo(t,r),r}function Sr(t){var r=i();return this.subTo(t,r),r}function jr(t){var r=i();return this.multiplyTo(t,r),r}function Tr(){var t=i();return this.squareTo(t),t}function Or(t){var r=i();return this.divRemTo(t,r,null),r}function Ir(t){var r=i();return this.divRemTo(t,null,r),r}function Er(t){var r=i(),e=i();return this.divRemTo(t,r,e),[r,e]}function Br(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function xr(t,r){if(0!=t){for(;r>=this.t;)this[this.t++]=0;for(this[r]+=t;this[r]>=this.DV;)this[r]-=this.DV,++r>=this.t&&(this[this.t++]=0),++this[r]}}function Pr(){}function Kr(t){return t}function Nr(t,r,e){t.multiplyTo(r,e)}function Dr(t,r){t.squareTo(r)}function Mr(t){return this.exp(t,new Pr)}function Rr(t,r,e){var i=Math.min(this.t+t.t,r);for(e.s=0,e.t=i;i>0;)e[--i]=0;var n;for(n=e.t-this.t;n>i;++i)e[i+this.t]=this.am(0,t[i],e,i,0,this.t);for(n=Math.min(t.t,r);n>i;++i)this.am(0,t[i],e,i,0,r-i);e.clamp()}function Gr(t,r,e){--r;var i=e.t=this.t+t.t-r;for(e.s=0;--i>=0;)e[i]=0;for(i=Math.max(r-this.t,0);t.t>i;++i)e[this.t+i-r]=this.am(r-i,t[i],e,0,0,this.t+i-r);e.clamp(),e.drShiftTo(1,e)}function Hr(t){this.r2=i(),this.q3=i(),e.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}function Lr(t){if(0>t.s||t.t>2*this.m.t)return t.mod(this.m);if(0>t.compareTo(this.m))return t;var r=i();return t.copyTo(r),this.reduce(r),r}function zr(t){return t}function Ur(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);0>t.compareTo(this.r2);)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function qr(t,r){t.squareTo(r),this.reduce(r)}function Fr(t,r,e){t.multiplyTo(r,e),this.reduce(e)}function Vr(t,r){var e,n,s=t.bitLength(),o=c(1);if(0>=s)return o;e=18>s?1:48>s?3:144>s?4:768>s?5:6,n=8>s?new T(r):r.isEven()?new Hr(r):new K(r);var a=[],h=3,u=e-1,p=(1<<e)-1;if(a[1]=n.convert(this),e>1){var l=i();for(n.sqrTo(a[1],l);p>=h;)a[h]=i(),n.mulTo(l,a[h-2],a[h]),h+=2}var f,d,g=t.t-1,y=!0,b=i();for(s=m(t[g])-1;g>=0;){for(s>=u?f=t[g]>>s-u&p:(f=(t[g]&(1<<s+1)-1)<<u-s,g>0&&(f|=t[g-1]>>this.DB+s-u)),h=e;0==(1&f);)f>>=1,--h;if(0>(s-=h)&&(s+=this.DB,--g),y)a[f].copyTo(o),y=!1;else{for(;h>1;)n.sqrTo(o,b),n.sqrTo(b,o),h-=2;h>0?n.sqrTo(o,b):(d=o,o=b,b=d),n.mulTo(b,a[f],o)}for(;g>=0&&0==(t[g]&1<<s);)n.sqrTo(o,b),d=o,o=b,b=d,0>--s&&(s=this.DB-1,--g)}return n.revert(o)}function Zr(t){var r=0>this.s?this.negate():this.clone(),e=0>t.s?t.negate():t.clone();if(0>r.compareTo(e)){var i=r;r=e,e=i}var n=r.getLowestSetBit(),s=e.getLowestSetBit();if(0>s)return r;for(s>n&&(s=n),s>0&&(r.rShiftTo(s,r),e.rShiftTo(s,e));r.signum()>0;)(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),r.compareTo(e)>=0?(r.subTo(e,r),r.rShiftTo(1,r)):(e.subTo(r,e),e.rShiftTo(1,e));return s>0&&e.lShiftTo(s,e),e}function Xr(t){if(0>=t)return 0;var r=this.DV%t,e=0>this.s?t-1:0;if(this.t>0)if(0==r)e=this[0]%t;else for(var i=this.t-1;i>=0;--i)e=(r*e+this[i])%t;return e}function Jr(t){var r=t.isEven();if(this.isEven()&&r||0==t.signum())return e.ZERO;for(var i=t.clone(),n=this.clone(),s=c(1),o=c(0),a=c(0),h=c(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),r?(s.isEven()&&o.isEven()||(s.addTo(this,s),o.subTo(t,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),r?(a.isEven()&&h.isEven()||(a.addTo(this,a),h.subTo(t,h)),a.rShiftTo(1,a)):h.isEven()||h.subTo(t,h),h.rShiftTo(1,h);i.compareTo(n)>=0?(i.subTo(n,i),r&&s.subTo(a,s),o.subTo(h,o)):(n.subTo(i,n),r&&a.subTo(s,a),h.subTo(o,h))}return 0!=n.compareTo(e.ONE)?e.ZERO:h.compareTo(t)>=0?h.subtract(t):0>h.signum()?(h.addTo(t,h),0>h.signum()?h.add(t):h):h}function Yr(t){var r,e=this.abs();if(1==e.t&&e[0]<=oe[oe.length-1]){for(r=0;oe.length>r;++r)if(e[0]==oe[r])return!0;return!1}if(e.isEven())return!1;for(r=1;oe.length>r;){for(var i=oe[r],n=r+1;oe.length>n&&ae>i;)i*=oe[n++];for(i=e.modInt(i);n>r;)if(0==i%oe[r++])return!1}return e.millerRabin(t)}function m(t){var r,e=1;return 0!=(r=t>>>16)&&(t=r,e+=16),0!=(r=t>>8)&&(t=r,e+=8),0!=(r=t>>4)&&(t=r,e+=4),0!=(r=t>>2)&&(t=r,e+=2),0!=(r=t>>1)&&(t=r,e+=1),e}function Wr(){var t=this.toByteArray(),r=8*(t.length-1)+m(t[0]),e="";return e+=String.fromCharCode((65280&r)>>8),e+=String.fromCharCode(255&r),e+=te.bin2str(t)}function Qr(t){var r=this.subtract(e.ONE),n=r.getLowestSetBit();if(0>=n)return!1;var s=r.shiftRight(n);t=t+1>>1,t>oe.length&&(t=oe.length);for(var o,a=i(),h=[],c=0;t>c;++c){for(;o=oe[Math.floor(Math.random()*oe.length)],-1!=h.indexOf(o););h.push(o),a.fromInt(o);var u=a.modPow(s,this);if(0!=u.compareTo(e.ONE)&&0!=u.compareTo(r)){for(var o=1;n>o++&&0!=u.compareTo(r);)if(u=u.modPowInt(2,this),0==u.compareTo(e.ONE))return!1;if(0!=u.compareTo(r))return!1}}return!0}var $r,te=t("../../util");e.prototype.am=n,$r=26,e.prototype.DB=$r,e.prototype.DM=(1<<$r)-1,e.prototype.DV=1<<$r;var re=52;e.prototype.FV=Math.pow(2,re),e.prototype.F1=re-$r,e.prototype.F2=2*$r-re;var ee,ie,ne="0123456789abcdefghijklmnopqrstuvwxyz",se=[];for(ee="0".charCodeAt(0),ie=0;9>=ie;++ie)se[ee++]=ie;for(ee="a".charCodeAt(0),ie=10;36>ie;++ie)se[ee++]=ie;for(ee="A".charCodeAt(0),ie=10;36>ie;++ie)se[ee++]=ie;T.prototype.convert=O,T.prototype.revert=I,T.prototype.reduce=E,T.prototype.mulTo=B,T.prototype.sqrTo=x,K.prototype.convert=N,K.prototype.revert=D,K.prototype.reduce=M,K.prototype.mulTo=G,K.prototype.sqrTo=R,e.prototype.copyTo=a,e.prototype.fromInt=h,e.prototype.fromString=u,e.prototype.clamp=p,e.prototype.dlShiftTo=b,e.prototype.drShiftTo=v,e.prototype.lShiftTo=k,e.prototype.rShiftTo=w,e.prototype.subTo=C,e.prototype.multiplyTo=A,e.prototype.squareTo=_,e.prototype.divRemTo=S,e.prototype.invDigit=P,e.prototype.isEven=H,e.prototype.exp=L,e.prototype.toString=l,e.prototype.negate=f,e.prototype.abs=d,e.prototype.compareTo=g,e.prototype.bitLength=y,e.prototype.mod=j,e.prototype.modPowInt=z,e.ZERO=c(0),e.ONE=c(1),r.exports=e,Pr.prototype.convert=Kr,Pr.prototype.revert=Kr,Pr.prototype.mulTo=Nr,Pr.prototype.sqrTo=Dr,Hr.prototype.convert=Lr,Hr.prototype.revert=zr,Hr.prototype.reduce=Ur,Hr.prototype.mulTo=Fr,Hr.prototype.sqrTo=qr;var oe=[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],ae=(1<<26)/oe[oe.length-1],e=t("./jsbn.js");e.prototype.chunkSize=Z,e.prototype.toRadix=J,e.prototype.fromRadix=Y,e.prototype.fromNumber=W,e.prototype.bitwiseTo=er,e.prototype.changeBit=vr,e.prototype.addTo=Ar,e.prototype.dMultiply=Br,e.prototype.dAddOffset=xr,e.prototype.multiplyLowerTo=Rr,e.prototype.multiplyUpperTo=Gr,e.prototype.modInt=Xr,e.prototype.millerRabin=Qr,e.prototype.clone=U,e.prototype.intValue=q,e.prototype.byteValue=F,e.prototype.shortValue=V,e.prototype.signum=X,e.prototype.toByteArray=Q,e.prototype.equals=$,e.prototype.min=tr,e.prototype.max=rr,e.prototype.and=nr,e.prototype.or=or,e.prototype.xor=hr,e.prototype.andNot=ur,e.prototype.not=pr,e.prototype.shiftLeft=lr,e.prototype.shiftRight=fr,e.prototype.getLowestSetBit=gr,e.prototype.bitCount=yr,e.prototype.testBit=br,e.prototype.setBit=kr,e.prototype.clearBit=wr,e.prototype.flipBit=Cr,e.prototype.add=_r,e.prototype.subtract=Sr,e.prototype.multiply=jr,e.prototype.divide=Or,e.prototype.remainder=Ir,e.prototype.divideAndRemainder=Er,e.prototype.modPow=Vr,e.prototype.modInverse=Jr,e.prototype.pow=Mr,e.prototype.gcd=Zr,e.prototype.isProbablePrime=Yr,e.prototype.toMPI=Wr,e.prototype.square=Tr},{"../../util":56,"./jsbn.js":21}],22:[function(t,r){function e(){function t(t){for(var r=0;t.length>r;r++)t[r]=o.getSecureRandomOctet()}this.nextBytes=t}function i(){function t(t,r,e,i,o){var a=t.mod(e).modPow(r.mod(e.subtract(n.ONE)),e),h=t.mod(i).modPow(r.mod(i.subtract(n.ONE)),i);s.print_debug("rsa.js decrypt\nxpn:"+s.hexstrdump(a.toMPI())+"\nxqn:"+s.hexstrdump(h.toMPI()));var c=h.subtract(a);return 0==c[0]?(c=a.subtract(h),c=c.multiply(o).mod(i),c=i.subtract(c)):c=c.multiply(o).mod(i),c.multiply(e).add(a)}function r(t,r,e){return t.modPowInt(r,e)}function i(t,r,e){return t.modPow(r,e)}function o(t,r,e){return t.modPowInt(r,e)}function a(){this.n=null,this.e=0,this.ee=null,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.u=null}function h(t,r){var i=new a,s=new e,o=t>>1;for(i.e=parseInt(r,16),i.ee=new n(r,16);;){for(;i.p=new n(t-o,1,s),0!=i.p.subtract(n.ONE).gcd(i.ee).compareTo(n.ONE)||!i.p.isProbablePrime(10););for(;i.q=new n(o,1,s),0!=i.q.subtract(n.ONE).gcd(i.ee).compareTo(n.ONE)||!i.q.isProbablePrime(10););if(0>=i.p.compareTo(i.q)){var h=i.p;i.p=i.q,i.q=h}var c=i.p.subtract(n.ONE),u=i.q.subtract(n.ONE),p=c.multiply(u);if(0==p.gcd(i.ee).compareTo(n.ONE)){i.n=i.p.multiply(i.q),i.d=i.ee.modInverse(p),i.dmp1=i.d.mod(c),i.dmq1=i.d.mod(u),i.u=i.p.modInverse(i.q);break}}return i}this.encrypt=r,this.decrypt=t,this.verify=o,this.sign=i,this.generate=h,this.keyObject=a}var n=t("./jsbn.js"),s=t("../../util"),o=t("../random.js");r.exports=i},{"../../util":56,"../random.js":23,"./jsbn.js":21}],23:[function(t,r){var e=t("../type/mpi.js");r.exports={getRandomBytes:function(t){for(var r="",e=0;t>e;e++)r+=String.fromCharCode(this.getSecureRandomOctet());return r},getPseudoRandom:function(t,r){return Math.round(Math.random()*(r-t))+t},getSecureRandom:function(t,r){var e=new Uint32Array(1);window.crypto.getRandomValues(e);for(var i=(r-t).toString(2).length;(e[0]&Math.pow(2,i)-1)>r-t;)window.crypto.getRandomValues(e);return t+Math.abs(e[0]&Math.pow(2,i)-1)},getSecureRandomOctet:function(){var t=new Uint32Array(1);return window.crypto.getRandomValues(t),255&t[0]},getRandomBigInteger:function(t){if(0>t)return null;var r=Math.floor((t+7)/8),i=this.getRandomBytes(r);t%8>0&&(i=String.fromCharCode(Math.pow(2,t%8)-1&i.charCodeAt(0))+i.substring(1));var n=new e;return n.fromBytes(i),n.toBigInteger()},getRandomBigIntegerInRange:function(t,r){if(!(0>=r.compareTo(t))){for(var e=r.subtract(t),i=this.getRandomBigInteger(e.bitLength());i>e;)i=this.getRandomBigInteger(e.bitLength());return t.add(i)}}}},{"../type/mpi.js":54}],24:[function(t,r){var e=t("./public_key"),i=t("./pkcs1.js"),n=t("./hash");r.exports={verify:function(t,r,s,o,a){var h=n.digest(r,a);switch(t){case 1:case 2:case 3:var c=new e.rsa,u=o[0].toBigInteger(),p=o[1].toBigInteger(),l=s[0].toBigInteger(),f=c.verify(l,p,u),d=i.emsa.decode(r,f.toMPI().substring(2));if(-1==d)throw Error("PKCS1 padding in message or key incorrect. Aborting...");return d==h;case 16:throw Error("signing with Elgamal is not defined in the OpenPGP standard.");case 17:var g=new e.dsa,m=s[0].toBigInteger(),y=s[1].toBigInteger(),b=o[0].toBigInteger(),v=o[1].toBigInteger(),k=o[2].toBigInteger(),w=o[3].toBigInteger(),C=a,f=g.verify(r,m,y,C,b,v,k,w);return 0==f.compareTo(m);default:throw Error("Invalid signature algorithm.")}},sign:function(t,r,n,s){switch(r){case 1:case 2:case 3:var o=new e.rsa,a=n[2].toBigInteger(),h=n[0].toBigInteger(),c=i.emsa.encode(t,s,n[0].byteLength());return o.sign(c,a,h).toMPI();case 17:var u=new e.dsa,p=n[0].toBigInteger(),l=n[1].toBigInteger(),f=n[2].toBigInteger();n[3].toBigInteger();var d=n[4].toBigInteger(),c=s,g=u.sign(t,c,f,p,l,d);return""+g[0]+(""+g[1]);case 16:throw Error("Signing with Elgamal is not defined in the OpenPGP standard.");default:throw Error("Invalid signature algorithm.")}}}},{"./hash":12,"./pkcs1.js":17,"./public_key":20}],25:[function(t,r){function e(t){var r=t.split("-----");return r[1].match(/BEGIN PGP MESSAGE, PART \d+\/\d+/)?u.armor.multipart_section:r[1].match(/BEGIN PGP MESSAGE, PART \d+/)?u.armor.multipart_last:r[1].match(/BEGIN PGP SIGNED MESSAGE/)?u.armor.signed:r[1].match(/BEGIN PGP MESSAGE/)?u.armor.message:r[1].match(/BEGIN PGP PUBLIC KEY BLOCK/)?u.armor.public_key:r[1].match(/BEGIN PGP PRIVATE KEY BLOCK/)?u.armor.private_key:void 0}function i(t){var r="";return t.show_version&&(r+="Version: "+t.versionstring+"\r\n"),t.show_comment&&(r+="Comment: "+t.commentstring+"\r\n"),r+="\r\n"}function n(t){var r=o(t),e=""+String.fromCharCode(r>>16)+String.fromCharCode(255&r>>8)+String.fromCharCode(255&r);return c.encode(e)}function s(t,r){var e=n(t),i=r;return e[0]==i[0]&&e[1]==i[1]&&e[2]==i[2]}function o(t){for(var r=11994318,e=0;t.length-e>16;)r=r<<8^p[255&(r>>16^t.charCodeAt(e))],r=r<<8^p[255&(r>>16^t.charCodeAt(e+1))],r=r<<8^p[255&(r>>16^t.charCodeAt(e+2))],r=r<<8^p[255&(r>>16^t.charCodeAt(e+3))],r=r<<8^p[255&(r>>16^t.charCodeAt(e+4))],r=r<<8^p[255&(r>>16^t.charCodeAt(e+5))],r=r<<8^p[255&(r>>16^t.charCodeAt(e+6))],r=r<<8^p[255&(r>>16^t.charCodeAt(e+7))],r=r<<8^p[255&(r>>16^t.charCodeAt(e+8))],r=r<<8^p[255&(r>>16^t.charCodeAt(e+9))],r=r<<8^p[255&(r>>16^t.charCodeAt(e+10))],r=r<<8^p[255&(r>>16^t.charCodeAt(e+11))],r=r<<8^p[255&(r>>16^t.charCodeAt(e+12))],r=r<<8^p[255&(r>>16^t.charCodeAt(e+13))],r=r<<8^p[255&(r>>16^t.charCodeAt(e+14))],r=r<<8^p[255&(r>>16^t.charCodeAt(e+15))],e+=16;for(var i=e;t.length>i;i++)r=r<<8^p[255&(r>>16^t.charCodeAt(e++))];return 16777215&r}function a(t){t=t.replace(/\r/g,"");var r=e(t);if(2!=r){var i=t.split("-----"),o={openpgp:c.decode(i[2].split("\n\n")[1].split("\n=")[0].replace(/\n- /g,"\n")),type:r};return s(o.openpgp,i[2].split("\n\n")[1].split("\n=")[1].split("\n")[0])?o:(util.print_error("Ascii armor integrity check on message failed: '"+i[2].split("\n\n")[1].split("\n=")[1].split("\n")[0]+"' should be '"+n(o))+"'",!1)}var i=t.split("-----"),a={text:i[2].replace(/\n- /g,"\n").split("\n\n")[1],openpgp:base64_decode(i[4].split("\n\n")[1].split("\n=")[0]),type:r};return s(a.openpgp,i[4].split("\n\n")[1].split("\n=")[1])?a:(util.print_error("Ascii armor integrity check on message failed"),!1)}function h(t,r,e,s,o){var a="";switch(t){case u.armor.multipart_section:a+="-----BEGIN PGP MESSAGE, PART "+s+"/"+o+"-----\r\n",a+=i(e),a+=c.encode(r),a+="\r\n="+n(r)+"\r\n",a+="-----END PGP MESSAGE, PART "+s+"/"+o+"-----\r\n";break;case u.armor.mutlipart_last:a+="-----BEGIN PGP MESSAGE, PART "+s+"-----\r\n",a+=i(e),a+=c.encode(r),a+="\r\n="+n(r)+"\r\n",a+="-----END PGP MESSAGE, PART "+s+"-----\r\n";break;case u.armor.signed:a+="\r\n-----BEGIN PGP SIGNED MESSAGE-----\r\nHash: "+r.hash+"\r\n\r\n",a+=r.text.replace(/\n-/g,"\n- -"),a+="\r\n-----BEGIN PGP SIGNATURE-----\r\n",a+=i(e),a+=c.encode(r.openpgp),a+="\r\n="+n(r.openpgp)+"\r\n",a+="-----END PGP SIGNATURE-----\r\n";break;case u.armor.message:a+="-----BEGIN PGP MESSAGE-----\r\n",a+=i(e),a+=c.encode(r),a+="\r\n="+n(r)+"\r\n",a+="-----END PGP MESSAGE-----\r\n";break;case u.armor.public_key:a+="-----BEGIN PGP PUBLIC KEY BLOCK-----\r\n",a+=i(e),a+=c.encode(r),a+="\r\n="+n(r)+"\r\n",a+="-----END PGP PUBLIC KEY BLOCK-----\r\n\r\n";break;case u.armor.private_key:a+="-----BEGIN PGP PRIVATE KEY BLOCK-----\r\n",a+=i(e),a+=c.encode(r),a+="\r\n="+n(r)+"\r\n",a+="-----END PGP PRIVATE KEY BLOCK-----\r\n"}return a}var c=t("./base64.js"),u=t("../enums.js"),p=[0,8801531,25875725,17603062,60024545,51751450,35206124,44007191,128024889,120049090,103502900,112007375,70412248,78916387,95990485,88014382,264588937,256049778,240098180,248108927,207005800,215016595,232553829,224014750,140824496,149062475,166599357,157832774,200747345,191980970,176028764,184266919,520933865,529177874,512099556,503334943,480196360,471432179,487973381,496217854,414011600,405478443,422020573,430033190,457094705,465107658,448029500,439496647,281648992,273666971,289622637,298124950,324696449,333198714,315665548,307683447,392699481,401494690,383961940,375687087,352057528,343782467,359738805,368533838,1041867730,1050668841,1066628831,1058355748,1032471859,1024199112,1006669886,1015471301,968368875,960392720,942864358,951368477,975946762,984451313,1000411399,992435708,836562267,828023200,810956886,818967725,844041146,852051777,868605623,860066380,914189410,922427545,938981743,930215316,904825475,896059e3,878993294,887231349,555053627,563297984,547333942,538569677,579245274,570480673,588005847,596249900,649392898,640860153,658384399,666397428,623318499,631331096,615366894,606833685,785398962,777416777,794487231,802989380,759421523,767923880,751374174,743392165,695319947,704115056,687564934,679289981,719477610,711202705,728272487,737067676,2083735460,2092239711,2109313705,2101337682,2141233477,2133257662,2116711496,2125215923,2073216669,2064943718,2048398224,2057199467,2013339772,2022141063,2039215473,2030942602,1945504045,1936737750,1920785440,1929023707,1885728716,1893966647,1911503553,1902736954,1951893524,1959904495,1977441561,1968902626,2009362165,2000822798,1984871416,1992881923,1665111629,1673124534,1656046400,1647513531,1621913772,1613380695,1629922721,1637935450,1688082292,1679317903,1695859321,1704103554,1728967061,1737211246,1720132760,1711368291,1828378820,1820103743,1836060105,1844855090,1869168165,1877963486,1860430632,1852155859,1801148925,1809650950,1792118e3,1784135691,1757986588,1750004711,1765960209,1774462698,1110107254,1118611597,1134571899,1126595968,1102643863,1094667884,1077139354,1085643617,1166763343,1158490548,1140961346,1149762745,1176011694,1184812885,1200772771,1192499800,1307552511,1298785796,1281720306,1289958153,1316768798,1325007077,1341561107,1332794856,1246636998,1254647613,1271201483,1262662192,1239272743,1230733788,1213667370,1221678289,1562785183,1570797924,1554833554,1546300521,1588974462,1580441477,1597965939,1605978760,1518843046,1510078557,1527603627,1535847760,1494504007,1502748348,1486784330,1478020017,1390639894,1382365165,1399434779,1408230112,1366334967,1375129868,1358579962,1350304769,1430452783,1438955220,1422405410,1414423513,1456544974,1448562741,1465633219,1474135352];r.exports={encode:h,decode:a}},{"../enums.js":27,"./base64.js":26}],26:[function(t,r){function e(t){var r,e,i,s="",o=0,a=0,h=t.length;
|
|
for(i=0;h>i;i++)e=t.charCodeAt(i),0==a?(s+=n.charAt(63&e>>2),r=(3&e)<<4):1==a?(s+=n.charAt(r|15&e>>4),r=(15&e)<<2):2==a&&(s+=n.charAt(r|3&e>>6),o+=1,0==o%60&&(s+="\n"),s+=n.charAt(63&e)),o+=1,0==o%60&&(s+="\n"),a+=1,3==a&&(a=0);return a>0&&(s+=n.charAt(r),o+=1,0==o%60&&(s+="\n"),s+="=",o+=1),1==a&&(0==o%60&&(s+="\n"),s+="="),s}function i(t){var r,e,i="",s=0,o=0,a=t.length;for(e=0;a>e;e++)r=n.indexOf(t.charAt(e)),r>=0&&(s&&(i+=String.fromCharCode(o|255&r>>6-s)),s=7&s+2,o=255&r<<s);return i}var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";r.exports={encode:e,decode:i}},{}],27:[function(t,r){var e={s2k:{simple:0,salted:1,iterated:3,gnu:101},publicKey:{rsa_encrypt_sign:1,rsa_encrypt:2,rsa_sign:3,elgamal:16,dsa:17},symmetric:{plaintext:0,idea:1,tripledes:2,cast5:3,blowfish:4,aes128:7,aes192:8,aes256:9,twofish:10},compression:{uncompressed:0,zip:1,zlib:2,bzip2:3},hash:{md5:1,sha1:2,ripemd:3,sha256:8,sha384:9,sha512:10,sha224:11},packet:{public_key_encrypted_session_key:1,signature:2,sym_encrypted_session_key:3,one_pass_signature:4,secret_key:5,public_key:6,secret_subkey:7,compressed:8,symmetrically_encrypted:9,marker:10,literal:11,trust:12,userid:13,public_subkey:14,user_attribute:17,sym_encrypted_integrity_protected:18,modification_detection_code:19},literal:{binary:"b".charCodeAt(),text:"t".charCodeAt(),utf8:"u".charCodeAt()},signature:{binary:0,text:1,standalone:2,cert_generic:16,cert_persona:17,cert_casual:18,cert_positive:19,cert_revocation:48,subkey_binding:24,key_binding:25,key:31,key_revocation:32,subkey_revocation:40,timestamp:64,third_party:80},signatureSubpacket:{signature_creation_time:2,signature_expiration_time:3,exportable_certification:4,trust_signature:5,regular_expression:6,revocable:7,reserved:8,key_expiration_time:9,placeholder_backwards_compatibility:10,preferred_symmetric_algorithms:11,revocation_key:12,issuer:16,notification_data:20,preferred_hash_algorithms:21,preferred_compression_algorithms:22,key_server_preferences:23,preferred_key_server:24,primary_user_id:25,policy_uri:26,key_flags:27,signers_user_id:28,reason_for_revocation:29,features:30,signature_target:31,embedded_signature:32},armor:{multipart_section:0,multipart_last:1,signed:2,message:3,public_key:4,private_key:5},write:function(t,r){if("number"==typeof r&&(r=this.read(t,r)),void 0!==t[r])return t[r];throw Error("Invalid enum value.")},read:function(t,r){for(var e in t)if(t[e]==r)return e;throw Error("Invalid enum value.")}};r.exports=e},{}],28:[function(t,r){var e=t("./crypto");r.exports=t("./openpgp.js"),r.exports.util=t("./util"),r.exports.packet=t("./packet"),r.exports.mpi=t("./type/mpi.js"),r.exports.s2k=t("./type/s2k.js"),r.exports.keyid=t("./type/keyid.js"),r.exports.armor=t("./encoding/armor.js"),r.exports.enums=t("./enums.js"),r.exports.config=t("./config");for(var i in e)r.exports[i]=e[i]},{"./config":2,"./crypto":16,"./encoding/armor.js":25,"./enums.js":27,"./openpgp.js":30,"./packet":35,"./type/keyid.js":53,"./type/mpi.js":54,"./type/s2k.js":55,"./util":56}],29:[function(t,r){var e=t("./packet"),i=t("./enums.js");r.exports=function(){this.packets=new e.list,this.getKey=function(){for(var t=0;this.packets.length>t;t++)if(this.packets[t].tag==i.packet.public_key||this.packets[t].tag==i.packet.secret_key)return this.packets[t];return null},this.getSubkeys=function(){for(var t=[],r=0;this.packets.length>r;r++)(this.packets[r].tag==i.packet.public_subkey||this.packets[r].tag==i.packet.secret_subkey)&&t.push(this.packets[r]);return t},this.getAllKeys=function(){return[this.getKey()].concat(this.getSubkeys())},this.getSigningKey=function(){var t=["rsa_encrypt_sign","rsa_sign","dsa"];t=t.map(function(t){return openpgp.publickey[t]});var r=this.getAllKeys();for(var e in r)if(-1!=t.indexOf(r[e].public_algorithm))return r[e];return null},this.getEncryptionKey=function(){for(var t=function(t){return t.algorithm!=i.read(i.publicKey,i.publicKey.dsa)&&t.algorithm!=i.read(i.publicKey,i.publicKey.rsa_sign)},r=this.getSubkeys(),e=0;r.length>e;e++)if(t(r[e]))return r[e];var n=this.getKey();return t(n)?n:null},this.decrypt=function(t){var r=this.getAllKeys();for(var e in r)(r[e].tag==i.packet.secret_subkey||r[e].tag==i.packet.secret_key)&&r[e].decrypt(t)}}},{"./enums.js":27,"./packet":35}],30:[function(t,r){function e(){function t(t){var e=i.decode(t.replace(/\r/g,"")).openpgp;return r(e)}function r(t){var r=new n.list;return r.read(t),r}function e(t,r){var e=new n.list,s=new n.literal;s.set(r,"utf8");var u=a.generateSessionKey(o.read(o.symmetric,c.encryption_cipher));t.forEach(function(t){var r=new h;r.packets=t;var i=r.getEncryptionKey();if(i){var s=new n.public_key_encrypted_session_key;s.publicKeyId=i.getKeyId(),s.publicKeyAlgorithm=i.algorithm,s.sessionKey=u,s.sessionKeyAlgorithm=o.read(o.symmetric,c.encryption_cipher),s.encrypt(i),e.push(s)}});var p;p=c.integrity_protect?new n.sym_encrypted_integrity_protected:new n.symmetrically_encrypted,p.packets=s,p.encrypt(o.read(o.symmetric,c.encryption_cipher),u),e.push(p);var l=i.encode(o.armor.message,e.write(),c);return l}function u(t,r,e,s){var a=new n.list,h=new n.secret_key;h.algorithm=o.read(o.publicKey,t),h.generate(r),h.encrypt(s);var c=new n.userid;c.read(e);var u={};u.userid=c,u.key=h;var p=new n.signature;p.issuerKeyId=h.getKeyId().write(),p.signatureType=o.signature.cert_generic,p.publicKeyAlgorithm=t,p.hashAlgorithm=o.hash.sha256,p.sign(h,u);var l=new n.secret_subkey;l.algorithm=o.read(o.publicKey,t),l.generate(r),l.encrypt(s),u={},u.key=h,u.bind=l;var f=new n.signature;f.issuerKeyId=l.getKeyId().write(),f.signatureType=o.signature.subkey_binding,f.publicKeyAlgorithm=t,f.hashAlgorithm=o.hash.sha256,f.sign(l,u),a.push(h),a.push(c),a.push(p),a.push(l),a.push(f);var d=i.encode(o.armor.private_key,a.write(),this.config);return d}function p(t,r,e){var n,o="",a=(new openpgp_packet_literaldata).write_packet(e.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n"));for(s.print_debug_hexstr_dump("literal_packet: |"+a+"|\n",a),n=0;r.length>n;n++){var h=new openpgp_packet_onepasssignature,c="";c=0===n?h.write_packet(1,openpgp.config.config.prefer_hash_algorithm,t,!1):h.write_packet(1,openpgp.config.config.prefer_hash_algorithm,t,!1),s.print_debug_hexstr_dump("onepasssigstr: |"+c+"|\n",c);var u=(new openpgp_packet_signature).write_message_signature(1,e.replace(/\r\n/g,"\n").replace(/\n/g,"\r\n"),t);s.print_debug_hexstr_dump("datasignature: |"+u.openpgp+"|\n",u.openpgp),o=0===n?c+a+u.openpgp:c+o+u.openpgp}s.print_debug_hexstr_dump("signed packet: |"+o+"|\n",o);var p=openpgp_crypto_generateSessionKey(openpgp.config.config.encryption_cipher),l="";for(n=0;r.length>n;n++){var f=r[n].getEncryptionKey();if(null===f)return s.print_error("no encryption key found! Key is for signing only."),null;l+=(new openpgp_packet_encryptedsessionkey).write_pub_key_packet(f.getKeyId(),f.MPIs,f.publicKeyAlgorithm,openpgp.config.config.encryption_cipher,p)}return l+=openpgp.config.config.integrity_protect?(new openpgp_packet_encryptedintegrityprotecteddata).write_packet(openpgp.config.config.encryption_cipher,p,o):(new openpgp_packet_encrypteddata).write_packet(openpgp.config.config.encryption_cipher,p,o),i.encode(3,l,null,null)}function l(t,r){var e=(new openpgp_packet_signature).write_message_signature(1,r.replace(/\r\n/g,"\n").replace(/\n/,"\r\n"),t),n={text:r.replace(/\r\n/g,"\n").replace(/\n/,"\r\n"),openpgp:e.openpgp,hash:e.hash};return i.encode(2,n,null,null)}this.tostring="",this.generateKeyPair=u,this.write_signed_message=l,this.write_signed_and_encrypted_message=p,this.encryptMessage=e,this.readArmoredPackets=t,this.readDearmoredPackets=r}var i=t("./encoding/armor.js"),n=t("./packet"),s=t("./util"),o=t("./enums.js"),a=t("./crypto"),h=t("./key.js"),c=t("./config");r.exports=new e},{"./config":2,"./crypto":16,"./encoding/armor.js":25,"./enums.js":27,"./key.js":29,"./packet":35,"./util":56}],31:[function(t,r){var e=t("./packet"),i=t("./enums.js"),n=t("./encoding/armor.js"),s=function(){function t(){var t=JSON.parse(window.localStorage.getItem("armoredPacketlists"));(null===t||0===t.length)&&(t=[]),this.armoredPacketlists=t;for(var r,i=0;t.length>i;i++)r=new e.list,r.read(t[i]),this.parsedPacketlists.push(r)}function r(){window.localStorage.setItem("armoredPacketlists",JSON.stringify(this.armoredPacketlists))}function s(t,r){var e,n=!1;return r=r.toLowerCase(),t.tag==i.packet.userid&&(e=t.userid,e=e.split("<")[1].split("<")[0].trim.toLowerCase(),e==r&&(n=!0)),n}function o(t,r){return t.getKeyId&&t.getKeyId().write()==r?!0:!1}function a(t,r,e,i){for(var n,s=0;i.length>s;s++)if(n=i[s],identityMatch=t(n,r),e?n.tag==e&&(packetMatch=!0):packetMatch=!0,packetMatch&&identityMatch)return!0;return!1}function h(t,r,e){for(var i,n,s,o=[],h=0;this.parsedPacketlists.length>h;h++)n=!1,s=!1,i=this.parsedPacketlists[h],a(t,r,e,i)&&o.push(i);return o}function c(t){return h(s,t,i.packet.public_key)}function u(){return h(s,email,i.packet.secret_key)}function p(t){return this.checkForIdentityAndPacketMatch(o,t)}function l(t){this.armoredPacketlists.push(t);var r=n.decode(t.replace(/\r/g,"")).openpgp;return packetlist=new e.list,packetlist.read(r),this.parsedPacketlists.push(packetlist),!0}function f(t){return this.publicKey[t]}function d(t){var r=this.publicKeys.splice(t,1);return this.store(),r}this.armoredPacketlists=[],this.parsedPacketlists=[],this.init=t,this.store=r,this.checkForIdentityAndPacketMatch=h,this.getPublicKeyForAddress=c,this.getPrivateKeyForAddress=u,this.getPacketlistsForKeyId=p,this.importPacketlist=l,this.exportPublicKey=f,this.removePublicKey=d};r.exports=new s},{"./encoding/armor.js":25,"./enums.js":27,"./packet":35}],32:[function(){},{}],33:[function(t,r){var e=t("../enums.js");r.exports={compressed:t("./compressed.js"),sym_encrypted_integrity_protected:t("./sym_encrypted_integrity_protected.js"),public_key_encrypted_session_key:t("./public_key_encrypted_session_key.js"),sym_encrypted_session_key:t("./sym_encrypted_session_key.js"),literal:t("./literal.js"),public_key:t("./public_key.js"),symmetrically_encrypted:t("./symmetrically_encrypted.js"),marker:t("./marker.js"),public_subkey:t("./public_subkey.js"),user_attribute:t("./user_attribute.js"),one_pass_signature:t("./one_pass_signature.js"),secret_key:t("./secret_key.js"),userid:t("./userid.js"),secret_subkey:t("./secret_subkey.js"),signature:t("./signature.js"),trust:t("./trust.js")};for(var i in e.packet){var n=r.exports[i];void 0!=n&&(n.prototype.tag=e.packet[i])}},{"../enums.js":27,"./compressed.js":34,"./literal.js":36,"./marker.js":37,"./one_pass_signature.js":38,"./public_key.js":41,"./public_key_encrypted_session_key.js":42,"./public_subkey.js":43,"./secret_key.js":44,"./secret_subkey.js":45,"./signature.js":46,"./sym_encrypted_integrity_protected.js":47,"./sym_encrypted_session_key.js":48,"./symmetrically_encrypted.js":49,"./trust.js":50,"./user_attribute.js":51,"./userid.js":52}],34:[function(t,r){var e=t("../enums.js"),i=t("../compression/jxg.js"),n=t("../encoding/base64.js");r.exports=function(){this.packets,this.algorithm="uncompressed",this.compressed=null,this.read=function(t){this.algorithm=e.read(e.compression,t.charCodeAt(0)),this.compressed=t.substr(1),this.decompress()},this.write=function(){return null==this.compressed&&this.compress(),String.fromCharCode(e.write(e.compression,this.algorithm))+this.compressed},this.decompress=function(){var t;switch(this.algorithm){case"uncompressed":t=this.compressed;break;case"zip":var r=this.compressed,e=n.encode(r).replace(/\n/g,""),s=new i.Util.Unzip(i.Util.Base64.decodeAsArray(e));t=unescape(s.deflate()[0][0]);break;case"zlib":var o=this.compressed.charCodeAt(0)%16;if(8==o){var r=this.compressed.substring(0,this.compressed.length-4),e=n.encode(r).replace(/\n/g,"");t=i.decompress(e);break}util.print_error("Compression algorithm ZLIB only supports DEFLATE compression method.");break;case"bzip2":throw Error("Compression algorithm BZip2 [BZ2] is not implemented.");default:throw Error("Compression algorithm unknown :"+this.alogrithm)}this.packets.read(t)},this.compress=function(){switch(this.algorithm){case"uncompressed":this.compressed=this.packets.write();break;case"zip":util.print_error("Compression algorithm ZIP [RFC1951] is not implemented.");break;case"zlib":util.print_error("Compression algorithm ZLIB [RFC1950] is not implemented.");break;case"bzip2":util.print_error("Compression algorithm BZip2 [BZ2] is not implemented.");break;default:util.print_error("Compression algorithm unknown :"+this.type)}}}},{"../compression/jxg.js":1,"../encoding/base64.js":26,"../enums.js":27}],35:[function(t,r){t("../enums.js"),r.exports={list:t("./packetlist.js")};var e=t("./all_packets.js");for(var i in e)r.exports[i]=e[i]},{"../enums.js":27,"./all_packets.js":33,"./packetlist.js":40}],36:[function(t,r){var e=t("../util"),i=t("../enums.js");r.exports=function(){this.format="utf8",this.data="",this.date=new Date,this.set=function(t,r){this.format=r,this.data=t},this.setBytes=function(t,r){this.format=r,"utf8"==r&&(t=e.decode_utf8(t)),this.data=t},this.getBytes=function(){return"utf8"==this.format?e.encode_utf8(this.data):this.data},this.read=function(t){var r=i.read(i.literal,t[0].charCodeAt()),n=t.charCodeAt(1);this.filename=e.decode_utf8(t.substr(2,n)),this.date=e.readDate(t.substr(2+n,4));var s=t.substring(6+n);this.setBytes(s,r)},this.write=function(){var t=e.encode_utf8("msg.txt"),r=this.getBytes(),n="";return n+=String.fromCharCode(i.write(i.literal,this.format)),n+=String.fromCharCode(t.length),n+=t,n+=e.writeDate(this.date),n+=r}}},{"../enums.js":27,"../util":56}],37:[function(t,r){function e(){this.read=function(t){return 80==t[0].charCodeAt()&&71==t[1].charCodeAt()&&80==t[2].charCodeAt()?!0:!1}}r.exports=e},{}],38:[function(t,r){var e=t("../enums.js"),i=t("../type/keyid.js");r.exports=function(){this.version=null,this.type=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.signingKeyId=null,this.flags=null,this.read=function(t){var r=0;return this.version=t.charCodeAt(r++),this.type=e.read(e.signature,t.charCodeAt(r++)),this.hashAlgorithm=e.read(e.hash,t.charCodeAt(r++)),this.publicKeyAlgorithm=e.read(e.publicKey,t.charCodeAt(r++)),this.signingKeyId=new i,this.signingKeyId.read(t.substr(r)),r+=8,this.flags=t.charCodeAt(r++),this},this.write=function(t,r,i,n,s){var o="";return o+=String.fromCharCode(3),o+=String.fromCharCode(e.write(e.signature,t)),o+=String.fromCharCode(e.write(e.hash,this.hashAlgorithm)),o+=String.fromCharCode(e.write(e.publicKey,i.algorithm)),o+=i.getKeyId().write(),o+=s?String.fromCharCode(0):String.fromCharCode(1)}}},{"../enums.js":27,"../type/keyid.js":53}],39:[function(t,r){var e=(t("../enums.js"),t("../util"));r.exports={readSimpleLength:function(t){var r,i=0,n=t[0].charCodeAt();return 192>n?(i=t[0].charCodeAt(),r=1):255>n?(i=(t[0].charCodeAt()-192<<8)+t[1].charCodeAt()+192,r=2):255==n&&(i=e.readNumber(t.substr(1,4)),r=5),{len:i,offset:r}},writeSimpleLength:function(t){var r="";return 192>t?r+=String.fromCharCode(t):t>191&&8384>t?(r+=String.fromCharCode((t-192>>8)+192),r+=String.fromCharCode(255&t-192)):(r+=String.fromCharCode(255),r+=e.writeNumber(t,4)),r},writeHeader:function(t,r){var e="";return e+=String.fromCharCode(192|t),e+=this.writeSimpleLength(r)},writeOldHeader:function(t,r){var i="";return 256>r?(i+=String.fromCharCode(128|t<<2),i+=String.fromCharCode(r)):65536>r?(i+=String.fromCharCode(1|(128|t<<2)),i+=e.writeNumber(r,2)):(i+=String.fromCharCode(2|(128|t<<2)),i+=e.writeNumber(r,4)),i},read:function(t,r,i){if(null==t||r>=t.length||2>t.substring(r).length||0==(128&t[r].charCodeAt()))return e.print_error("Error during parsing. This message / key is probably not containing a valid OpenPGP format."),null;var n,s=r,o=-1,a=-1;a=0,0!=(64&t[s].charCodeAt())&&(a=1);var h;a?o=63&t[s].charCodeAt():(o=(63&t[s].charCodeAt())>>2,h=3&t[s].charCodeAt()),s++;var c=null,u=-1;if(a)if(192>t[s].charCodeAt())n=t[s++].charCodeAt(),e.print_debug("1 byte length:"+n);else if(t[s].charCodeAt()>=192&&224>t[s].charCodeAt())n=(t[s++].charCodeAt()-192<<8)+t[s++].charCodeAt()+192,e.print_debug("2 byte length:"+n);else if(t[s].charCodeAt()>223&&255>t[s].charCodeAt()){n=1<<(31&t[s++].charCodeAt()),e.print_debug("4 byte length:"+n);var p=s+n;for(c=t.substring(s,s+n);;){if(192>t[p].charCodeAt()){var l=t[p++].charCodeAt();n+=l,c+=t.substring(p,p+l),p+=l;break}if(t[p].charCodeAt()>=192&&224>t[p].charCodeAt()){var l=(t[p++].charCodeAt()-192<<8)+t[p++].charCodeAt()+192;n+=l,c+=t.substring(p,p+l),p+=l;break}if(!(t[p].charCodeAt()>223&&255>t[p].charCodeAt())){p++;var l=t[p++].charCodeAt()<<24|t[p++].charCodeAt()<<16|t[p++].charCodeAt()<<8|t[p++].charCodeAt();c+=t.substring(p,p+l),n+=l,p+=l;break}var l=1<<(31&t[p++].charCodeAt());n+=l,c+=t.substring(p,p+l),p+=l}u=p}else s++,n=t[s++].charCodeAt()<<24|t[s++].charCodeAt()<<16|t[s++].charCodeAt()<<8|t[s++].charCodeAt();else switch(h){case 0:n=t[s++].charCodeAt();break;case 1:n=t[s++].charCodeAt()<<8|t[s++].charCodeAt();break;case 2:n=t[s++].charCodeAt()<<24|t[s++].charCodeAt()<<16|t[s++].charCodeAt()<<8|t[s++].charCodeAt();break;default:n=i}return-1==u&&(u=n),null==c&&(c=t.substring(s,s+u)),{tag:o,packet:c,offset:s+u}}}},{"../enums.js":27,"../util":56}],40:[function(t,r){var e=t("./packet.js"),i=t("./all_packets.js"),n=t("../enums.js");r.exports=function s(){this.length=0,this.read=function(t){for(var r=0;t.length>r;){var s=e.read(t,r,t.length-r);r=s.offset;var o=n.read(n.packet,s.tag),a=new i[o];this.push(a),a.read(s.packet)}},this.write=function(){for(var t="",r=0;this.length>r;r++){var i=this[r].write();t+=e.writeHeader(this[r].tag,i.length),t+=i}return t},this.push=function(t){t.packets=new s,this[this.length]=t,this.length++}}},{"../enums.js":27,"./all_packets.js":33,"./packet.js":39}],41:[function(t,r){var e=t("../util"),i=t("../type/mpi.js"),n=t("../type/keyid.js"),s=t("../enums.js"),o=t("../crypto");r.exports=function(){this.created=new Date,this.mpi=[],this.algorithm="rsa_sign",this.readPublicKey=this.read=function(t){var r=t[0].charCodeAt();if(4==r){this.created=e.readDate(t.substr(1,4)),this.algorithm=s.read(s.publicKey,t[5].charCodeAt());var n=o.getPublicMpiCount(this.algorithm);this.mpi=[];for(var a=t.substr(6),h=0,c=0;n>c&&a.length>h;c++)this.mpi[c]=new i,h+=this.mpi[c].read(a.substr(h)),h>a.length&&e.print_error("openpgp.packet.keymaterial.js\nerror reading MPI @:"+h);return h+6}throw Error("Version "+r+" of the key packet is unsupported.")},this.writePublicKey=this.write=function(){var t=String.fromCharCode(4);t+=e.writeDate(this.created),t+=String.fromCharCode(s.write(s.publicKey,this.algorithm));for(var r=o.getPublicMpiCount(this.algorithm),i=0;r>i;i++)t+=this.mpi[i].write();return t},this.writeOld=function(){var t=this.writePublicKey();return String.fromCharCode(153)+e.writeNumber(t.length,2)+t},this.getKeyId=function(){var t=new n;return t.read(this.getFingerprint().substr(12,8)),t},this.getFingerprint=function(){var t=this.writeOld();return o.hash.sha1(t,t.length)}}},{"../crypto":16,"../enums.js":27,"../type/keyid.js":53,"../type/mpi.js":54,"../util":56}],42:[function(t,r){var e=t("../type/keyid.js"),i=t("../util"),n=t("../type/mpi.js"),s=t("../enums.js"),o=t("../crypto");r.exports=function(){this.version=3,this.publicKeyId=new e,this.publicKeyAlgorithm="rsa_encrypt",this.sessionKey=null,this.sessionKeyAlgorithm="aes256",this.encrypted=[],this.read=function(t){this.version=t[0].charCodeAt(),this.publicKeyId.read(t.substr(1)),this.publicKeyAlgorithm=s.read(s.publicKey,t[9].charCodeAt());var r=10,e=function(t){switch(t){case"rsa_encrypt":case"rsa_encrypt_sign":return 1;case"elgamal":return 2;default:throw Error("Invalid algorithm.")}}(this.publicKeyAlgorithm);this.encrypted=[];for(var i=0;e>i;i++){var o=new n;r+=o.read(t.substr(r)),this.encrypted.push(o)}},this.write=function(){var t=String.fromCharCode(this.version);t+=this.publicKeyId.write(),t+=String.fromCharCode(s.write(s.publicKey,this.publicKeyAlgorithm));for(var r=0;this.encrypted.length>r;r++)t+=this.encrypted[r].write();return t},this.encrypt=function(t){var r=String.fromCharCode(s.write(s.symmetric,this.sessionKeyAlgorithm));r+=this.sessionKey;var e=i.calc_checksum(this.sessionKey);r+=i.writeNumber(e,2);var a=new n;a.fromBytes(o.pkcs1.eme.encode(r,t.mpi[0].byteLength())),this.encrypted=o.publicKeyEncrypt(this.publicKeyAlgorithm,t.mpi,a)},this.decrypt=function(t){var r=o.publicKeyDecrypt(this.publicKeyAlgorithm,t.mpi,this.encrypted).toBytes(),e=i.readNumber(r.substr(r.length-2)),n=o.pkcs1.eme.decode(r,t.mpi[0].byteLength()),t=n.substring(1,n.length-2);if(e!=i.calc_checksum(t))throw Error("Checksum mismatch");this.sessionKey=t,this.sessionKeyAlgorithm=s.read(s.symmetric,n.charCodeAt(0))}}},{"../crypto":16,"../enums.js":27,"../type/keyid.js":53,"../type/mpi.js":54,"../util":56}],43:[function(t,r){var e=t("./public_key.js");r.exports=function(){e.call(this)}},{"./public_key.js":41}],44:[function(t,r){function e(){function t(t){return"sha1"==t?20:2}function r(t){return"sha1"==t?o.hash.sha1:function(t){return s.writeNumber(s.calc_checksum(t),2)}}function e(e,i,n){var s=t(e),h=r(e),c=i.substr(i.length-s);i=i.substr(0,i.length-s);var u=h(i);if(u!=c)throw Error("Hash mismatch.");for(var p=o.getPrivateMpiCount(n),l=0,f=[],d=0;p>d&&i.length>l;d++)f[d]=new a,l+=f[d].read(i.substr(l));return f}function c(t,e,i){for(var n="",s=o.getPublicMpiCount(e),a=s;i.length>a;a++)n+=i[a].write();return n+=r(t)(n)}function u(t,r,e){return t.produce_key(r,o.cipher[e].keySize)}i.call(this),this.encrypted=null,this.read=function(t){var r=this.readPublicKey(t);t=t.substr(r);var i=t[0].charCodeAt();i?this.encrypted=t:this.mpi=this.mpi.concat(e("mod",t.substr(1),this.algorithm))},this.write=function(){var t=this.writePublicKey();return this.encrypted?t+=this.encrypted:(t+=String.fromCharCode(0),t+=c("mod",this.algorithm,this.mpi)),t},this.encrypt=function(t){var r=new h,e="aes256",i=c("sha1",this.algorithm,this.mpi),s=u(r,t,e),a=o.cipher[e].blockSize,p=o.random.getRandomBytes(a);this.encrypted="",this.encrypted+=String.fromCharCode(254),this.encrypted+=String.fromCharCode(n.write(n.symmetric,e)),this.encrypted+=r.write(),this.encrypted+=p,this.encrypted+=o.cfb.normalEncrypt(e,s,i,p)},this.decrypt=function(t){if(this.encrypted){var r,i,s=0,a=this.encrypted[s++].charCodeAt();if(255==a||254==a){r=this.encrypted[s++].charCodeAt(),r=n.read(n.symmetric,r);var c=new h;s+=c.read(this.encrypted.substr(s)),i=u(c,t,r)}else r=a,r=n.read(n.symmetric,r),i=o.hash.md5(t);var p=this.encrypted.substr(s,o.cipher[r].blockSize);s+=p.length;var l,f=this.encrypted.substr(s);l=o.cfb.normalDecrypt(r,i,f,p);var d=254==a?"sha1":"mod";this.mpi=this.mpi.concat(e(d,l,this.algorithm))}},this.generate=function(t){this.mpi=o.generateMpi(this.algorithm,t)}}var i=t("./public_key.js"),n=t("../enums.js"),s=t("../util"),o=t("../crypto"),a=t("../type/mpi.js"),h=t("../type/s2k.js");e.prototype=new i,r.exports=e},{"../crypto":16,"../enums.js":27,"../type/mpi.js":54,"../type/s2k.js":55,"../util":56,"./public_key.js":41}],45:[function(t,r){var e=t("./secret_key.js");r.exports=function(){e.call(this)}},{"./secret_key.js":44}],46:[function(t,r){var e=t("../util"),i=t("./packet.js"),n=t("../enums.js"),s=t("../crypto"),o=t("../type/mpi.js");r.exports=function a(){function t(t,r){var e="";return e+=i.writeSimpleLength(r.length+1),e+=String.fromCharCode(t),e+=r}this.signatureType=null,this.hashAlgorithm=null,this.publicKeyAlgorithm=null,this.signatureData=null,this.signedHashValue=null,this.mpi=null,this.created=null,this.signatureExpirationTime=null,this.signatureNeverExpires=null,this.exportable=null,this.trustLevel=null,this.trustAmount=null,this.regularExpression=null,this.revocable=null,this.keyExpirationTime=null,this.keyNeverExpires=null,this.preferredSymmetricAlgorithms=null,this.revocationKeyClass=null,this.revocationKeyAlgorithm=null,this.revocationKeyFingerprint=null,this.issuerKeyId=null,this.notation={},this.preferredHashAlgorithms=null,this.preferredCompressionAlgorithms=null,this.keyServerPreferences=null,this.preferredKeyServer=null,this.isPrimaryUserID=null,this.policyURI=null,this.keyFlags=null,this.signersUserId=null,this.reasonForRevocationFlag=null,this.reasonForRevocationString=null,this.signatureTargetPublicKeyAlgorithm=null,this.signatureTargetHashAlgorithm=null,this.signatureTargetHash=null,this.embeddedSignature=null,this.verified=!1,this.read=function(t){function r(t,r){for(var n=e.readNumber(t.substr(0,2)),s=2;2+n>s;){var o=i.readSimpleLength(t.substr(s));s+=o.offset,r&&this.read_sub_packet(t.substr(s,o.len)),s+=o.len}return s}var n=0,s=t[n++].charCodeAt();switch(s){case 3:5!=t[n++].charCodeAt()&&e.print_debug("openpgp.packet.signature.js\ninvalid One-octet length of following hashed material.MUST be 5. @:"+(n-1)),this.signatureType=t[n++].charCodeAt(),this.created=e.readDate(t.substr(n,4)),n+=4,this.signatureData=t.substring(position,n),this.issuerKeyId=t.substring(n,n+8),n+=8,this.publicKeyAlgorithm=t[n++].charCodeAt(),this.hashAlgorithm=t[n++].charCodeAt();break;case 4:this.signatureType=t[n++].charCodeAt(),this.publicKeyAlgorithm=t[n++].charCodeAt(),this.hashAlgorithm=t[n++].charCodeAt(),n+=r.call(this,t.substr(n),!0),this.signatureData=t.substr(0,n),n+=r.call(this,t.substr(n),!1);break;default:throw Error("Version "+s+" of the signature is unsupported.")}this.signedHashValue=t.substr(n,2),n+=2,this.signature=t.substr(n)},this.write=function(){return this.signatureData+e.writeNumber(0,2)+this.signedHashValue+this.signature},this.sign=function(r,i){var o=n.write(n.signature,this.signatureType),a=n.write(n.publicKey,this.publicKeyAlgorithm),h=n.write(n.hash,this.hashAlgorithm),c=String.fromCharCode(4);c+=String.fromCharCode(o),c+=String.fromCharCode(a),c+=String.fromCharCode(h);var u=t(n.signatureSubpacket.signature_creation_time,e.writeDate(new Date)),p=t(n.signatureSubpacket.issuer,r.getKeyId().write());c+=e.writeNumber(u.length+p.length,2),c+=u+p,this.signatureData=c;var l=this.calculateTrailer(),f=this.toSign(o,i)+this.signatureData+l,d=s.hash.digest(h,f);this.signedHashValue=d.substr(0,2),this.signature=s.signature.sign(h,a,r.mpi,f)},this.read_sub_packet=function(t){function r(t,r){this[t]=[];for(var e=0;r.length>e;e++)this[t].push(r[e].charCodeAt())}var i=0,n=127&t[i++].charCodeAt();switch(n){case 2:this.created=e.readDate(t.substr(i));break;case 3:var o=e.readDate(t.substr(i));this.signatureNeverExpires=0==o.getTime(),this.signatureExpirationTime=o;break;case 4:this.exportable=1==t[i++].charCodeAt();break;case 5:this.trustLevel=t[i++].charCodeAt(),this.trustAmount=t[i++].charCodeAt();break;case 6:this.regularExpression=t.substr(i);break;case 7:this.revocable=1==t[i++].charCodeAt();break;case 9:var o=e.readDate(t.substr(i));this.keyExpirationTime=o,this.keyNeverExpires=0==o.getTime();break;case 11:for(this.preferredSymmetricAlgorithms=[];i!=t.length;)this.preferredSymmetricAlgorithms.push(t[i++].charCodeAt());break;case 12:this.revocationKeyClass=t[i++].charCodeAt(),this.revocationKeyAlgorithm=t[i++].charCodeAt(),this.revocationKeyFingerprint=t.substr(i,20);break;case 16:this.issuerKeyId=t.substr(i,8);break;case 20:if(128!=t[i].charCodeAt())throw Error("Unsupported notation flag.");i+=4;var h=e.writeNumber(t.substr(i,2));i+=2;var c=e.writeNumber(t.substr(i,2));i+=2;var u=t.substr(i,h),p=t.substr(i+h,c);this.notation[u]=p;break;case 21:r.call(this,"preferredHashAlgorithms",t.substr(i));break;case 22:r.call(this,"preferredCompressionAlgorithms ",t.substr(i));break;case 23:r.call(this,"keyServerPreferencess",t.substr(i));break;case 24:this.preferredKeyServer=t.substr(i);break;case 25:this.isPrimaryUserID=0!=t[i++];break;case 26:this.policyURI=t.substr(i);break;case 27:r.call(this,"keyFlags",t.substr(i));break;case 28:this.signersUserId+=t.substr(i);break;case 29:this.reasonForRevocationFlag=t[i++].charCodeAt(),this.reasonForRevocationString=t.substr(i);break;case 30:r.call(this,"features",t.substr(i));break;case 31:this.signatureTargetPublicKeyAlgorithm=t[i++].charCodeAt(),this.signatureTargetHashAlgorithm=t[i++].charCodeAt();var l=s.getHashByteLength(this.signatureTargetHashAlgorithm);this.signatureTargetHash=t.substr(i,l);break;case 32:this.embeddedSignature=new a,this.embeddedSignature.read(t.substr(i));break;default:e.print_error("openpgp.packet.signature.js\nunknown signature subpacket type "+n+" @:"+i+" subplen:"+subplen+" len:"+l)}},this.toSign=function(t,r){var i=n.signature;switch(t){case i.binary:return r.getBytes();case i.text:return this.toSign(i.binary,r).replace(/\r\n/g,"\n").replace(/\n/g,"\r\n");case i.standalone:return"";case i.cert_generic:case i.cert_persona:case i.cert_casual:case i.cert_positive:case i.cert_revocation:var s,o;if(void 0!==r.userid)o=180,s=r.userid;else{if(void 0===r.userattribute)throw Error("Either a userid or userattribute packet needs to be supplied for certification.");o=209,s=r.userattribute}var a=s.write();return this.toSign(i.key,r)+String.fromCharCode(o)+e.writeNumber(a.length,4)+a;case i.subkey_binding:case i.key_binding:return this.toSign(i.key,r)+this.toSign(i.key,{key:r.bind});case i.key:if(void 0==r.key)throw Error("Key packet is required for this sigtature.");return r.key.writeOld();case i.key_revocation:case i.subkey_revocation:return this.toSign(i.key,r);case i.timestamp:return"";case i.thrid_party:throw Error("Not implemented");default:throw Error("Unknown signature type.")}},this.calculateTrailer=function(){var t="";return t+=String.fromCharCode(4),t+=String.fromCharCode(255),t+=e.writeNumber(this.signatureData.length,4)},this.verify=function(t,r){var e=n.write(n.signature,this.signatureType),i=n.write(n.publicKey,this.publicKeyAlgorithm),a=n.write(n.hash,this.hashAlgorithm),h=this.toSign(e,r),c=this.calculateTrailer(),u=0;i>0&&4>i?u=1:17==i&&(u=2);for(var p=[],l=0,f=0;u>f;f++)p[f]=new o,l+=p[f].read(this.signature.substr(l));return this.verified=s.signature.verify(i,a,p,t.mpi,h+this.signatureData+c),this.verified}}},{"../crypto":16,"../enums.js":27,"../type/mpi.js":54,"../util":56,"./packet.js":39}],47:[function(t,r){var e=(t("../util"),t("../crypto"));r.exports=function(){this.encrypted=null,this.modification=!1,this.packets,this.read=function(t){var r=t[0].charCodeAt();if(1!=r)throw Error("Invalid packet version.");this.encrypted=t.substr(1)},this.write=function(){return String.fromCharCode(1)+this.encrypted},this.encrypt=function(t,r){var i=this.packets.write(),n=e.getPrefixRandom(t),s=n+n.charAt(n.length-2)+n.charAt(n.length-1),o=i;o+=String.fromCharCode(211),o+=String.fromCharCode(20),o+=e.hash.sha1(s+o),this.encrypted=e.cfb.encrypt(n,t,o,r,!1).substring(0,s.length+o.length)},this.decrypt=function(t,r){var i=e.cfb.decrypt(t,r,this.encrypted,!1);this.hash=e.hash.sha1(e.cfb.mdc(t,r,this.encrypted)+i.substring(0,i.length-20));var n=i.substr(i.length-20,20);if(this.hash!=n)throw Error("Modification detected.");this.packets.read(i.substr(0,i.length-22))}}},{"../crypto":16,"../util":56}],48:[function(t,r){var e=t("../type/s2k.js"),i=t("../enums.js"),n=t("../crypto");r.exports=function(){this.tag=3,this.sessionKeyEncryptionAlgorithm=null,this.sessionKeyAlgorithm="aes256",this.encrypted=null,this.s2k=new e,this.read=function(t){this.version=t[0].charCodeAt();var r=i.read(i.symmetric,t[1].charCodeAt()),e=this.s2k.read(t.substr(2)),n=e+2;t.length>n?(this.encrypted=t.substr(n),this.sessionKeyEncryptionAlgorithm=r):this.sessionKeyAlgorithm=r},this.write=function(){var t=null==this.encrypted?this.sessionKeyAlgorithm:this.sessionKeyEncryptionAlgorithm,r=String.fromCharCode(this.version)+String.fromCharCode(i.write(i.symmetric,t))+this.s2k.write();return null!=this.encrypted&&(r+=this.encrypted),r},this.decrypt=function(t){var r=null!=this.sessionKeyEncryptionAlgorithm?this.sessionKeyEncryptionAlgorithm:this.sessionKeyAlgorithm,e=n.cipher[r].keySize,s=this.s2k.produce_key(t,e);if(null==this.encrypted)this.sessionKey=s;else{var o=n.cfb.decrypt(this.sessionKeyEncryptionAlgorithm,s,this.encrypted,!0);this.sessionKeyAlgorithm=i.read(i.symmetric,o[0].keyCodeAt()),this.sessionKey=o.substr(1)}},this.encrypt=function(t){var r=n.getKeyLength(this.sessionKeyEncryptionAlgorithm),e=this.s2k.produce_key(t,r),s=String.fromCharCode(i.write(i.symmetric,this.sessionKeyAlgorithm))+n.getRandomBytes(n.getKeyLength(this.sessionKeyAlgorithm));
|
|
this.encrypted=n.cfb.encrypt(n.getPrefixRandom(this.sessionKeyEncryptionAlgorithm),this.sessionKeyEncryptionAlgorithm,e,s,!0)}}},{"../crypto":16,"../enums.js":27,"../type/s2k.js":55}],49:[function(t,r){var e=t("../crypto");r.exports=function(){this.encrypted=null,this.packets,this.read=function(t){this.encrypted=t},this.write=function(){return this.encrypted},this.decrypt=function(t,r){var i=e.cfb.decrypt(t,r,this.encrypted,!0);this.packets.read(i)},this.encrypt=function(t,r){var i=this.packets.write();this.encrypted=e.cfb.encrypt(e.getPrefixRandom(t),t,i,r,!0)}}},{"../crypto":16}],50:[function(t,r){r.exports=function(){}},{}],51:[function(t,r){r.exports=function(){this.tag=17,this.attributes=[],this.read=function(t){for(var r=0;t.length>r;){var e=openpgp_packet.read_simple_length(t);r+=e.offset,this.attributes.push(t.substr(r,e.len)),r+=e.len}}}},{}],52:[function(t,r){var e=t("../util");r.exports=function(){this.userid="",this.read=function(t){this.userid=e.decode_utf8(t)},this.write=function(){return e.encode_utf8(this.userid)}}},{"../util":56}],53:[function(t,r){r.exports=function(){for(var t="",r=0;8>r;r++)t+=String.fromCharCode(0);this.read=function(t){this.bytes=t.substr(0,8)},this.write=function(){return this.bytes}}},{}],54:[function(t,r){var e=t("../crypto/public_key/jsbn.js"),i=t("../util");r.exports=function(){this.data=null,this.read=function(t){var r=t[0].charCodeAt()<<8|t[1].charCodeAt(),e=Math.ceil(r/8),i=t.substr(2,e);return this.fromBytes(i),2+e},this.fromBytes=function(t){this.data=new e(i.hexstrdump(t),16)},this.toBytes=function(){return this.write().substr(2)},this.byteLength=function(){return this.toBytes().length},this.write=function(){return this.data.toMPI()},this.toBigInteger=function(){return this.data.clone()},this.fromBigInteger=function(t){this.data=t.clone()}}},{"../crypto/public_key/jsbn.js":21,"../util":56}],55:[function(t,r){var e=t("../enums.js"),i=t("../util"),n=t("../crypto");r.exports=function(){this.algorithm="sha256",this.type="iterated",this.c=96,this.salt=n.random.getRandomBytes(8);var t=6;this.get_count=function(){return 16+(15&this.c)<<(this.c>>4)+t},this.read=function(t){var r=0;switch(this.type=e.read(e.s2k,t[r++].charCodeAt()),this.algorithm=e.read(e.hash,t[r++].charCodeAt()),this.type){case"simple":break;case"salted":this.salt=t.substr(r,8),r+=8;break;case"iterated":this.salt=t.substr(r,8),r+=8,this.c=t[r++].charCodeAt();break;case"gnu":if("GNU"!=t.substr(r,3))throw Error("Unknown s2k type.");r+=3;var i=1e3+t[r++].charCodeAt();if(1001!=i)throw Error("Unknown s2k gnu protection mode.");this.type=i;break;default:throw Error("Unknown s2k type.")}return r},this.write=function(){var t=String.fromCharCode(e.write(e.s2k,this.type));switch(t+=String.fromCharCode(e.write(e.hash,this.algorithm)),this.type){case"simple":break;case"salted":t+=this.salt;break;case"iterated":t+=this.salt,t+=String.fromCharCode(this.c)}return t},this.produce_key=function(t,r){function s(r,i){var s=e.write(e.hash,i.algorithm);switch(i.type){case"simple":return n.hash.digest(s,r+t);case"salted":return n.hash.digest(s,r+i.salt+t);case"iterated":var o=[],a=i.get_count();for(data=i.salt+t;a>o.length*data.length;)o.push(data);return o=o.join(""),o.length>a&&(o=o.substr(0,a)),n.hash.digest(s,r+o)}}t=i.encode_utf8(t);for(var o="",a="";r>=o.length;)o+=s(a,this),a+=String.fromCharCode(0);return o.substr(0,r)}}},{"../crypto":16,"../enums.js":27,"../util":56}],56:[function(t,r){var e=function(){this.readNumber=function(t){for(var r=0,e=0;t.length>e;e++)r<<=8,r+=t[e].charCodeAt();return r},this.writeNumber=function(t,r){for(var e="",i=0;r>i;i++)e+=String.fromCharCode(255&t>>8*(r-i-1));return e},this.readDate=function(t){var r=this.readNumber(t),e=new Date;return e.setTime(1e3*r),e},this.writeDate=function(t){var r=Math.round(t.getTime()/1e3);return this.writeNumber(r,4)},this.emailRegEx=/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/,this.debug=!1,this.hexdump=function(t){for(var r,e=[],i=t.length,n=0,s=0;i>n;){for(r=t.charCodeAt(n++).toString(16);2>r.length;)r="0"+r;e.push(" "+r),s++,0==s%32&&e.push("\n ")}return e.join("")},this.hexstrdump=function(t){if(null==t)return"";for(var r,e=[],i=t.length,n=0;i>n;){for(r=t[n++].charCodeAt().toString(16);2>r.length;)r="0"+r;e.push(""+r)}return e.join("")},this.hex2bin=function(t){for(var r="",e=0;t.length>e;e+=2)r+=String.fromCharCode(parseInt(t.substr(e,2),16));return r},this.hexidump=function(t){for(var r,e=[],i=t.length,n=0;i>n;){for(r=t[n++].toString(16);2>r.length;)r="0"+r;e.push(""+r)}return e.join("")},this.encode_utf8=function(t){return unescape(encodeURIComponent(t))},this.decode_utf8=function(t){return decodeURIComponent(escape(t))};var t=function(t,r){for(var e=0;t.length>e;e++)r[e]=t.charCodeAt(e);return r},r=function(t){for(var r=[],e=0;t.length>e;e++)r.push(String.fromCharCode(t[e]));return r.join("")};this.str2bin=function(r){return t(r,Array(r.length))},this.bin2str=r,this.str2Uint8Array=function(r){return t(r,new Uint8Array(new ArrayBuffer(r.length)))},this.Uint8Array2str=r,this.calc_checksum=function(t){for(var r={s:0,add:function(t){this.s=(this.s+t)%65536}},e=0;t.length>e;e++)r.add(t.charCodeAt(e));return r.s},this.print_debug=function(t){this.debug&&console.log(t)},this.print_debug_hexstr_dump=function(t,r){this.debug&&(t+=this.hexstrdump(r),console.log(t))},this.print_error=function(t){if(this.debug)throw t;console.log(t)},this.print_info=function(t){this.debug&&console.log(t)},this.print_warning=function(t){console.log(t)},this.getLeftNBits=function(t,r){var e=r%8;if(0==e)return t.substring(0,r/8);var i=(r-e)/8+1,n=t.substring(0,i);return this.shiftRight(n,8-e)},this.shiftRight=function(t,r){var e=util.str2bin(t);if(0==r%8)return t;for(var i=e.length-1;i>=0;i--)e[i]>>=r%8,i>0&&(e[i]|=255&e[i-1]<<8-r%8);return util.bin2str(e)},this.get_hashAlgorithmString=function(t){switch(t){case 1:return"MD5";case 2:return"SHA1";case 3:return"RIPEMD160";case 8:return"SHA256";case 9:return"SHA384";case 10:return"SHA512";case 11:return"SHA224"}return"unknown"}};r.exports=new e},{}]},{},[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56]); |