From 051253c3831831aaa581c769e7ac11057afd92d4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20Obernd=C3=B6rfer?=
")+"
INFO:\t'+a.replace(/\n/g,"
")+"
WARNING:\t'+
a.replace(/\n/g,"
")+"
>=q;C-=q;e=B;c=A;d=D;a=ea;case ea:for(q=e;C>=c[q+1];C-=c[q+1];r=c[q];if(0!==(r&16)){g=r&15;j=c[q+2];a=ca;break}if(0===(r&64)){e=r;d=q/3+c[q+2];break}a=Y;y.msg="invalid distance code";V=u;w.bitb=U;w.bitk=C;y.avail_in=s;y.total_in+=v-y.next_in_index;y.next_in_index=v;w.write=x;return w.inflate_flush(y,V);case ca:for(q=g;C>=q;C-=q;a=da;case da:for(q= -x-j;0>q;)q+=w.end;for(;0!==b;){if(0===o&&(x==w.end&&0!==w.read&&(x=0,o=xa.avail_out)c=a.avail_out;0!==c&&b==l&&(b=h);a.avail_out-=c;a.total_out+=c;a.next_out.set(e.window.subarray(f,f+c),d);d+=c;f+=c;if(f==e.end){f=0;if(e.write==e.end)e.write=0;c=e.write-f;if(c>a.avail_out)c=a.avail_out; -0!==c&&b==l&&(b=h);a.avail_out-=c;a.total_out+=c;a.next_out.set(e.window.subarray(f,f+c),d);d+=c;f+=c}a.next_out_index=d;e.read=f;return b};e.proc=function(a,c){var d,q,r,l,C,v,s;l=a.next_in_index;C=a.avail_in;q=e.bitb;r=e.bitk;v=e.write;for(s=v r;){if(0!==C)c=h;else return e.bitb=q,e.bitk=r,a.avail_in=C,a.total_in+=l-a.next_in_index,a.next_in_index=l,e.write=v,e.inflate_flush(a,c);C--;q|=(a.read_byte(l++)&255)< >>1){case 0:q>>>= -3;r-=3;d=r&7;q>>>=d;r-=d;f=ha;break;case 1:d=[];var x=[],z=[[]],ba=[[]];b.inflate_trees_fixed(d,x,z,ba,a);o.init(d[0],x[0],z[0],0,ba[0],0,a);q>>>=3;r-=3;f=sa;break;case 2:q>>>=3;r-=3;f=T;break;case 3:return q>>>=3,r-=3,f=ma,a.msg="invalid block type",c=u,e.bitb=q,e.bitk=r,a.avail_in=C,a.total_in+=l-a.next_in_index,a.next_in_index=l,e.write=v,e.inflate_flush(a,c)}break;case ha:for(;32>r;){if(0!==C)c=h;else return e.bitb=q,e.bitk=r,a.avail_in=C,a.total_in+=l-a.next_in_index,a.next_in_index=l,e.write= -v,e.inflate_flush(a,c);C--;q|=(a.read_byte(l++)&255)< >>16&65535)!=(q&65535))return f=ma,a.msg="invalid stored block lengths",c=u,e.bitb=q,e.bitk=r,a.avail_in=C,a.total_in+=l-a.next_in_index,a.next_in_index=l,e.write=v,e.inflate_flush(a,c);g=q&65535;q=r=0;f=0!==g?P:0!==Y?B:K;break;case P:if(0===C||0===s&&(v==e.end&&0!==e.read&&(v=0,s=v C&&(d=C);d>s&&(d=s);e.window.set(a.read_buf(l,d),v);l+=d;C-=d;v+=d;s-=d;if(0!==(g-=d))break;f=0!==Y?B:K;break;case T:for(;14>r;){if(0!==C)c=h;else return e.bitb=q,e.bitk=r,a.avail_in=C,a.total_in+=l-a.next_in_index,a.next_in_index=l,e.write=v,e.inflate_flush(a,c);C--;q|=(a.read_byte(l++)&255)< >5&31))return f=ma, -a.msg="too many length or distance symbols",c=u,e.bitb=q,e.bitk=r,a.avail_in=C,a.total_in+=l-a.next_in_index,a.next_in_index=l,e.write=v,e.inflate_flush(a,c);d=258+(d&31)+(d>>5&31);if(!E||E.length >>=14;r-=14;Q=0;f=ga;case ga:for(;Q<4+(j>>>10);){for(;3>r;){if(0!==C)c=h;else return e.bitb=q,e.bitk=r,a.avail_in=C,a.total_in+=l-a.next_in_index,a.next_in_index=l,e.write=v,e.inflate_flush(a,c);C--;q|=(a.read_byte(l++)&255)< >>=3;r-=3}for(;19> -Q;)E[aa[Q++]]=0;N[0]=7;d=D.inflate_trees_bits(E,N,t,A,a);if(d!=h)return c=d,c==u&&(E=null,f=ma),e.bitb=q,e.bitk=r,a.avail_in=C,a.total_in+=l-a.next_in_index,a.next_in_index=l,e.write=v,e.inflate_flush(a,c);Q=0;f=oa;case oa:for(;;){d=j;if(!(Q<258+(d&31)+(d>>5&31)))break;for(d=N[0];r z)q>>>=d,r-=d,E[Q++]=z;else{s=18==z?7:z-14;for(x=18==z?11:3;r >>=d;r-=d;x+=q&p[s];q>>>=s;r-=s;s=Q;d=j;if(s+x>258+(d&31)+(d>>5&31)||16==z&&1>s)return E=null,f=ma,a.msg="invalid bit length repeat",c=u,e.bitb=q,e.bitk=r,a.avail_in=C,a.total_in+=l-a.next_in_index,a.next_in_index=l,e.write=v,e.inflate_flush(a,c);z= -16==z?E[s-1]:0;do E[s++]=z;while(0!==--x);Q=s}}t[0]=-1;s=[];x=[];z=[];ba=[];s[0]=9;x[0]=6;d=j;d=D.inflate_trees_dynamic(257+(d&31),1+(d>>5&31),E,s,x,z,ba,A,a);if(d!=h)return d==u&&(E=null,f=ma),c=d,e.bitb=q,e.bitk=r,a.avail_in=C,a.total_in+=l-a.next_in_index,a.next_in_index=l,e.write=v,e.inflate_flush(a,c);o.init(s[0],x[0],A,z[0],A,ba[0],a);f=sa;case sa:e.bitb=q;e.bitk=r;a.avail_in=C;a.total_in+=l-a.next_in_index;a.next_in_index=l;e.write=v;if((c=o.proc(e,a,c))!=k)return e.inflate_flush(a,c);c=h; -o.free(a);l=a.next_in_index;C=a.avail_in;q=e.bitb;r=e.bitk;v=e.write;s=v e||15 >4)+8>a.istate.wbits){a.istate.mode=pa;a.msg="invalid window size";a.istate.marker=5;break}a.istate.mode=ja;case ja:if(0===a.avail_in)return c;c=b;a.avail_in--;a.total_in++;d=a.read_byte(a.next_in_index++)&255;if(0!==((a.istate.method<<8)+d)%31){a.istate.mode=pa;a.msg="incorrect header check";a.istate.marker=5;break}if(0===(d&ia)){a.istate.mode=ra;break}a.istate.mode= -wa;case wa:if(0===a.avail_in)return c;c=b;a.avail_in--;a.total_in++;a.istate.need=(a.read_byte(a.next_in_index++)&255)<<24&4278190080;a.istate.mode=xa;case xa:if(0===a.avail_in)return c;c=b;a.avail_in--;a.total_in++;a.istate.need+=(a.read_byte(a.next_in_index++)&255)<<16&16711680;a.istate.mode=ya;case ya:if(0===a.avail_in)return c;c=b;a.avail_in--;a.total_in++;a.istate.need+=(a.read_byte(a.next_in_index++)&255)<<8&65280;a.istate.mode=za;case za:if(0===a.avail_in)return c;a.avail_in--;a.total_in++; -a.istate.need+=a.read_byte(a.next_in_index++)&255;a.istate.mode=ta;return j;case ta:return a.istate.mode=pa,a.msg="need dictionary",a.istate.marker=0,m;case ra:c=a.istate.blocks.proc(a,c);if(c==u){a.istate.mode=pa;a.istate.marker=0;break}c==h&&(c=b);if(c!=k)return c;a.istate.blocks.reset(a,a.istate.was);a.istate.mode=Aa;case Aa:return k;case pa:return u;default:return m}};b.inflateSetDictionary=function(a,b,c){var d=0,e=c;if(!a||!a.istate||a.istate.mode!=ta)return m;e>=1< e;)b.read_byte(d)==t[e]?e++:e=0!==b.read_byte(d)?0:4-e,d++,c--;b.total_in+=d-b.next_in_index;b.next_in_index=d;b.avail_in=c;b.istate.marker=e;if(4!=e)return u;c=b.total_in;d=b.total_out;a(b);b.total_in=c;b.total_out=d;b.istate.mode= -ra;return h};b.inflateSyncPoint=function(a){return!a||!a.istate||!a.istate.blocks?m:a.istate.blocks.sync_point()}}function f(){}function g(){var a=new f,b=L,c=new Uint8Array(512),d=!1;a.inflateInit();a.next_out=c;this.append=function(e,f){var g,j=[],Q=0,E=0,m=0,N;if(0!==e.length){a.next_in_index=0;a.next_in=e;a.avail_in=e.length;do{a.next_out_index=0;a.avail_out=512;if(0===a.avail_in&&!d)a.next_in_index=0,d=!0;g=a.inflate(b);if(d&&g==l)return-1;if(g!=h&&g!=k)throw"inflating: "+a.msg;if((d||g==k)&& -a.avail_out==e.length)return-1;a.next_out_index&&(512==a.next_out_index?j.push(new Uint8Array(c)):j.push(new Uint8Array(c.subarray(0,a.next_out_index))));m+=a.next_out_index;if(f&&0 e;e++)8==e||13==e||18==e||23==e?b[e]="-":14==e?b[e]="4":(2>=c&&(c=33554432+16777216*Math.random()|0),d=c&15,c>>=4,b[e]=a[19==e?d&3|8:d]);return b.join("")}; function openpgp_crypto_symmetricEncrypt(a,b,c,d,e){switch(b){case 0:return d;case 2:return openpgp_cfb_encrypt(a,desede,d,8,c,e).substring(0,d.length+10);case 3:return openpgp_cfb_encrypt(a,cast5_encrypt,d,8,c,e).substring(0,d.length+10);case 4:return openpgp_cfb_encrypt(a,BFencrypt,d,8,c,e).substring(0,d.length+10);case 7:case 8:case 9:return openpgp_cfb_encrypt(a,AESencrypt,d,16,keyExpansion(c),e).substring(0,d.length+18);case 10:return openpgp_cfb_encrypt(a,TFencrypt,d,16,c,e).substring(0,d.length+ 18);case 1:return util.print_error("IDEA Algorithm not implemented"),null;default:return null}} function openpgp_crypto_symmetricDecrypt(a,b,c,d){util.print_debug_hexstr_dump("openpgp_crypto_symmetricDecrypt:\nalgo:"+a+"\nencrypteddata:",c);var e=0;d||(e=2);switch(a){case 0:return c;case 2:return openpgp_cfb_decrypt(desede,8,b,c,d).substring(e,c.length+e-10);case 3:return openpgp_cfb_decrypt(cast5_encrypt,8,b,c,d).substring(e,c.length+e-10);case 4:return openpgp_cfb_decrypt(BFencrypt,8,b,c,d).substring(e,c.length+e-10);case 7:case 8:case 9:return openpgp_cfb_decrypt(AESencrypt,16,keyExpansion(b), @@ -216,43 +171,43 @@ function openpgp_crypto_getPrefixRandom(a){switch(a){case 2:case 3:case 4:return function openpgp_crypto_MDCSystemBytes(a,b,c){util.print_debug_hexstr_dump("openpgp_crypto_symmetricDecrypt:\nencrypteddata:",c);switch(a){case 0:return c;case 2:return openpgp_cfb_mdc(desede,8,b,c,openpgp_cfb);case 3:return openpgp_cfb_mdc(cast5_encrypt,8,b,c);case 4:return openpgp_cfb_mdc(BFencrypt,8,b,c);case 7:case 8:case 9:return openpgp_cfb_mdc(AESencrypt,16,keyExpansion(b),c);case 10:return openpgp_cfb_mdc(TFencrypt,16,b,c);case 1:util.print_error(""+(1==a?"IDEA Algorithm not implemented": "Twofish Algorithm not implemented"))}return null}function openpgp_crypto_generateSessionKey(a){switch(a){case 2:case 8:return openpgp_crypto_getRandomBytes(24);case 3:case 4:case 7:return util.print_debug("length = 16:\n"+util.hexstrdump(openpgp_crypto_getRandomBytes(16))),openpgp_crypto_getRandomBytes(16);case 9:case 10:return openpgp_crypto_getRandomBytes(32)}return null} function openpgp_crypto_verifySignature(a,b,c,d,e){var f=openpgp_crypto_hashData(b,e);switch(a){case 1:case 2:case 3:e=new RSA;a=d[0].toBigInteger();d=d[1].toBigInteger();c=c[0].toBigInteger();d=e.verify(c,d,a);b=openpgp_encoding_emsa_pkcs1_decode(b,d.toMPI().substring(2));return-1==b?(util.print_error("PKCS1 padding in message or key incorrect. Aborting..."),!1):b==f;case 16:return util.print_error("signing with Elgamal is not defined in the OpenPGP standard."),null;case 17:var a=new DSA,f=c[0].toBigInteger(), -c=c[1].toBigInteger(),g=d[0].toBigInteger(),h=d[1].toBigInteger(),k=d[2].toBigInteger(),d=d[3].toBigInteger(),d=a.verify(b,f,c,e,g,h,k,d);return 0==d.compareTo(f);default:return null}} -function openpgp_crypto_signData(a,b,c,d,e){switch(b){case 1:case 2:case 3:var b=new RSA,d=d[0].toBigInteger(),f=c[0].toBigInteger(),a=openpgp_encoding_emsa_pkcs1_encode(a,e,c[0].mpiByteLength);util.print_debug("signing using RSA");return b.sign(a,d,f).toMPI();case 17:b=new DSA;util.print_debug("DSA Sign: q size in Bytes:"+c[1].getByteLength());var f=c[0].toBigInteger(),g=c[1].toBigInteger(),h=c[2].toBigInteger();c[3].toBigInteger();c=d[0].toBigInteger();a=b.sign(a,e,h,f,g,c);util.print_debug("signing using DSA\n result:"+ +c=c[1].toBigInteger(),h=d[0].toBigInteger(),g=d[1].toBigInteger(),k=d[2].toBigInteger(),d=d[3].toBigInteger(),d=a.verify(b,f,c,e,h,g,k,d);return 0==d.compareTo(f);default:return null}} +function openpgp_crypto_signData(a,b,c,d,e){switch(b){case 1:case 2:case 3:var b=new RSA,d=d[0].toBigInteger(),f=c[0].toBigInteger(),a=openpgp_encoding_emsa_pkcs1_encode(a,e,c[0].mpiByteLength);util.print_debug("signing using RSA");return b.sign(a,d,f).toMPI();case 17:b=new DSA;util.print_debug("DSA Sign: q size in Bytes:"+c[1].getByteLength());var f=c[0].toBigInteger(),h=c[1].toBigInteger(),g=c[2].toBigInteger();c[3].toBigInteger();c=d[0].toBigInteger();a=b.sign(a,e,g,f,h,c);util.print_debug("signing using DSA\n result:"+ util.hexstrdump(a[0])+"|"+util.hexstrdump(a[1]));return a[0]+a[1];case 16:return util.print_debug("signing with Elgamal is not defined in the OpenPGP standard."),null;default:return null}}function openpgp_crypto_hashData(a,b){var c=null;switch(a){case 1:c=MD5(b);break;case 2:c=str_sha1(b);break;case 3:c=RMDstring(b);break;case 8:c=str_sha256(b);break;case 9:c=str_sha384(b);break;case 10:c=str_sha512(b);break;case 11:c=str_sha224(b)}return c} function openpgp_crypto_getHashByteLength(a){switch(a){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}return null}function openpgp_crypto_getRandomBytes(a){for(var b="",c=0;cb-a;)window.crypto.getRandomValues(c);return a+Math.abs(c[0]&Math.pow(2,d)-1)}function openpgp_crypto_getSecureRandomOctet(){var a=new Uint32Array(1);window.crypto.getRandomValues(a);return a[0]&255} function openpgp_crypto_getRandomBigInteger(a){if(0>a)return null;var b=openpgp_crypto_getRandomBytes(Math.floor((a+7)/8));0=b.compareTo(a))){for(var c=b.subtract(a),d=openpgp_crypto_getRandomBigInteger(c.bitLength());d>c;)d=openpgp_crypto_getRandomBigInteger(c.bitLength());return a.add(d)}} function openpgp_crypto_testRSA(a){debugger;var b=new RSA,c=new openpgp_type_mpi;c.create(openpgp_encoding_eme_pkcs1_encode("ABABABAB",128));c=b.encrypt(c.toBigInteger(),a.ee,a.n);b.decrypt(c,a.d,a.p,a.q,a.u)} -function openpgp_crypto_generateKeyPair(a,b,c,d,e){var f,g,h=new Date,h=h.getTime()/1E3,h=String.fromCharCode(Math.floor(h/16777216%256))+String.fromCharCode(Math.floor(h/65536%256))+String.fromCharCode(Math.floor(h/256%256))+String.fromCharCode(Math.floor(h%256));switch(a){case 1:b=(new RSA).generate(b,"10001");f=(new openpgp_packet_keymaterial).write_private_key(a,b,c,d,e,h);g=(new openpgp_packet_keymaterial).write_public_key(a,b,h);break;default:util.print_error("Unknown keytype "+a)}return{privateKey:f, -publicKey:g}}var dbits,canary=244837814094590,j_lm=15715070==(canary&16777215);function BigInteger(a,b,c){null!=a&&("number"==typeof a?this.fromNumber(a,b,c):null==b&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))}function nbi(){return new BigInteger(null)}function am1(a,b,c,d,e,f){for(;0<=--f;){var g=b*this[a++]+c[d]+e,e=Math.floor(g/67108864);c[d++]=g&67108863}return e} -function am2(a,b,c,d,e,f){for(var g=b&32767,b=b>>15;0<=--f;){var h=this[a]&32767,k=this[a++]>>15,j=b*h+k*g,h=g*h+((j&32767)<<15)+c[d]+(e&1073741823),e=(h>>>30)+(j>>>15)+b*k+(e>>>30);c[d++]=h&1073741823}return e}function am3(a,b,c,d,e,f){for(var g=b&16383,b=b>>14;0<=--f;){var h=this[a]&16383,k=this[a++]>>14,j=b*h+k*g,h=g*h+((j&16383)<<14)+c[d]+e,e=(h>>28)+(j>>14)+b*k;c[d++]=h&268435455}return e} +function openpgp_crypto_generateKeyPair(a,b,c,d,e){var f,h,g=new Date,g=g.getTime()/1E3,g=String.fromCharCode(Math.floor(g/16777216%256))+String.fromCharCode(Math.floor(g/65536%256))+String.fromCharCode(Math.floor(g/256%256))+String.fromCharCode(Math.floor(g%256));switch(a){case 1:b=(new RSA).generate(b,"10001");f=(new openpgp_packet_keymaterial).write_private_key(a,b,c,d,e,g);h=(new openpgp_packet_keymaterial).write_public_key(a,b,g);break;default:util.print_error("Unknown keytype "+a)}return{privateKey:f, +publicKey:h}}var dbits,canary=244837814094590,j_lm=15715070==(canary&16777215);function BigInteger(a,b,c){null!=a&&("number"==typeof a?this.fromNumber(a,b,c):null==b&&"string"!=typeof a?this.fromString(a,256):this.fromString(a,b))}function nbi(){return new BigInteger(null)}function am1(a,b,c,d,e,f){for(;0<=--f;){var h=b*this[a++]+c[d]+e,e=Math.floor(h/67108864);c[d++]=h&67108863}return e} +function am2(a,b,c,d,e,f){for(var h=b&32767,b=b>>15;0<=--f;){var g=this[a]&32767,k=this[a++]>>15,j=b*g+k*h,g=h*g+((j&32767)<<15)+c[d]+(e&1073741823),e=(g>>>30)+(j>>>15)+b*k+(e>>>30);c[d++]=g&1073741823}return e}function am3(a,b,c,d,e,f){for(var h=b&16383,b=b>>14;0<=--f;){var g=this[a]&16383,k=this[a++]>>14,j=b*g+k*h,g=h*g+((j&16383)<<14)+c[d]+e,e=(g>>28)+(j>>14)+b*k;c[d++]=g&268435455}return e} j_lm&&"Microsoft Internet Explorer"==navigator.appName?(BigInteger.prototype.am=am2,dbits=30):j_lm&&"Netscape"!=navigator.appName?(BigInteger.prototype.am=am1,dbits=26):(BigInteger.prototype.am=am3,dbits=28);BigInteger.prototype.DB=dbits;BigInteger.prototype.DM=(1< =vv;++vv)BI_RC[rr++]=vv;rr=97;for(vv=10;36>vv;++vv)BI_RC[rr++]=vv;rr=65;for(vv=10;36>vv;++vv)BI_RC[rr++]=vv;function int2char(a){return BI_RM.charAt(a)}function intAt(a,b){var c=BI_RC[a.charCodeAt(b)];return null==c?-1:c}function bnpCopyTo(a){for(var b=this.t-1;0<=b;--b)a[b]=this[b];a.t=this.t;a.s=this.s}function bnpFromInt(a){this.t=1;this.s=0>a?-1:0;0a?this[0]=a+DV:this.t=0}function nbv(a){var b=nbi();b.fromInt(a);return b} -function bnpFromString(a,b){var c;if(16==b)c=4;else if(8==b)c=3;else if(256==b)c=8;else if(2==b)c=1;else if(32==b)c=5;else if(4==b)c=2;else{this.fromRadix(a,b);return}this.s=this.t=0;for(var d=a.length,e=!1,f=0;0<=--d;){var g=8==c?a[d]&255:intAt(a,d);0>g?"-"==a.charAt(d)&&(e=!0):(e=!1,0==f?this[this.t++]=g:f+c>this.DB?(this[this.t-1]|=(g&(1< >this.DB-f):this[this.t-1]|=g< =this.DB&&(f-=this.DB))}if(8==c&&0!=(a[0]&128))this.s=-1,0 h?"-"==a.charAt(d)&&(e=!0):(e=!1,0==f?this[this.t++]=h:f+c>this.DB?(this[this.t-1]|=(h&(1< >this.DB-f):this[this.t-1]|=h< =this.DB&&(f-=this.DB))}if(8==c&&0!=(a[0]&128))this.s=-1,0 this.s)return"-"+this.negate().toString(a);if(16==a)a=4;else if(8==a)a=3;else if(2==a)a=1;else if(32==a)a=5;else if(4==a)a=2;else return this.toRadix(a);var b=(1<>g))d=!0,e=int2char(c);for(;0<=f;)g>(g+=this.DB-a)):(c=this[f]>>(g-=a)&b,0>=g&&(g+=this.DB,--f)),0 this.s)return"-"+this.negate().toString(a);if(16==a)a=4;else if(8==a)a=3;else if(2==a)a=1;else if(32==a)a=5;else if(4==a)a=2;else return this.toRadix(a);var b=(1<>h))d=!0,e=int2char(c);for(;0<=f;)h>(h+=this.DB-a)):(c=this[f]>>(h-=a)&b,0>=h&&(h+=this.DB,--f)),0 this.s?this.negate():this}function bnCompareTo(a){var b=this.s-a.s;if(0!=b)return b;var c=this.t,b=c-a.t;if(0!=b)return b;for(;0<=--c;)if(0!=(b=this[c]-a[c]))return b;return 0}function nbits(a){var b=1,c;if(0!=(c=a>>>16))a=c,b+=16;if(0!=(c=a>>8))a=c,b+=8;if(0!=(c=a>>4))a=c,b+=4;if(0!=(c=a>>2))a=c,b+=2;0!=a>>1&&(b+=1);return b} function bnBitLength(){return 0>=this.t?0:this.DB*(this.t-1)+nbits(this[this.t-1]^this.s&this.DM)}function bnpDLShiftTo(a,b){var c;for(c=this.t-1;0<=c;--c)b[c+a]=this[c];for(c=a-1;0<=c;--c)b[c]=0;b.t=this.t+a;b.s=this.s}function bnpDRShiftTo(a,b){for(var c=a;c >d|g,g=(this[h]&e)< =this.t)b.t=0;else{var d=a%this.DB,e=this.DB-d,f=(1< >d;for(var g=c+1;g >d;0 >d|h,h=(this[g]&e)< =this.t)b.t=0;else{var d=a%this.DB,e=this.DB-d,f=(1< >d;for(var h=c+1;h >d;0 >=this.DB;if(a.t >=this.DB;d+=this.s}else{for(d+=this.s;c >=this.DB;d-=a.s}b.s=0>d?-1:0;-1>d?b[c++]=this.DV+d:0 =b.DV)a[c+b.t]-=b.DV,a[c+b.t+1]=1}0 =d.t)){var e=this.abs();if(e.t >this.F2:0),j=this.FV/k,k=(1< g&&BigInteger.ZERO.subTo(c,c)}}}}function bnMod(a){var b=nbi();this.abs().divRemTo(a,null,b);0>this.s&&0 =d.t)){var e=this.abs();if(e.t >this.F2:0),j=this.FV/k,k=(1< h&&BigInteger.ZERO.subTo(c,c)}}}}function bnMod(a){var b=nbi();this.abs().divRemTo(a,null,b);0>this.s&&0 a.s||0<=a.compareTo(this.m)?a.mod(this.m):a}function cRevert(a){return a}function cReduce(a){a.divRemTo(this.m,null,a)}function cMulTo(a,b,c){a.multiplyTo(b,c);this.reduce(c)}function cSqrTo(a,b){a.squareTo(b);this.reduce(b)}Classic.prototype.convert=cConvert;Classic.prototype.revert=cRevert;Classic.prototype.reduce=cReduce;Classic.prototype.mulTo=cMulTo;Classic.prototype.sqrTo=cSqrTo; function bnpInvDigit(){if(1>this.t)return 0;var a=this[0];if(0==(a&1))return 0;var b=a&3,b=b*(2-(a&15)*b)&15,b=b*(2-(a&255)*b)&255,b=b*(2-((a&65535)*b&65535))&65535,b=b*(2-a*b%this.DV)%this.DV;return 0>15;this.um=(1< a.s&&0 >15)*this.mpl&this.um)<<15)&a.DM,c=b+this.m.t;for(a[c]+=this.m.am(0,d,a,b,0,this.m.t);a[c]>=a.DV;)a[c]-=a.DV,a[++c]++}a.clamp();a.drShiftTo(this.m.t,a);0<=a.compareTo(this.m)&&a.subTo(this.m,a)}function montSqrTo(a,b){a.squareTo(b);this.reduce(b)}function montMulTo(a,b,c){a.multiplyTo(b,c);this.reduce(c)}Montgomery.prototype.convert=montConvert; -Montgomery.prototype.revert=montRevert;Montgomery.prototype.reduce=montReduce;Montgomery.prototype.mulTo=montMulTo;Montgomery.prototype.sqrTo=montSqrTo;function bnpIsEven(){return 0==(0 a)return BigInteger.ONE;var c=nbi(),d=nbi(),e=b.convert(this),f=nbits(a)-1;for(e.copyTo(c);0<=--f;)if(b.sqrTo(c,d),0<(a&1< a)return BigInteger.ONE;var c=nbi(),d=nbi(),e=b.convert(this),f=nbits(a)-1;for(e.copyTo(c);0<=--f;)if(b.sqrTo(c,d),0<(a&1< a||b.isEven()?new Classic(b):new Montgomery(b);return this.exp(a,c)}BigInteger.prototype.copyTo=bnpCopyTo;BigInteger.prototype.fromInt=bnpFromInt;BigInteger.prototype.fromString=bnpFromString;BigInteger.prototype.clamp=bnpClamp;BigInteger.prototype.dlShiftTo=bnpDLShiftTo;BigInteger.prototype.drShiftTo=bnpDRShiftTo;BigInteger.prototype.lShiftTo=bnpLShiftTo;BigInteger.prototype.rShiftTo=bnpRShiftTo;BigInteger.prototype.subTo=bnpSubTo; BigInteger.prototype.multiplyTo=bnpMultiplyTo;BigInteger.prototype.squareTo=bnpSquareTo;BigInteger.prototype.divRemTo=bnpDivRemTo;BigInteger.prototype.invDigit=bnpInvDigit;BigInteger.prototype.isEven=bnpIsEven;BigInteger.prototype.exp=bnpExp;BigInteger.prototype.toString=bnToString;BigInteger.prototype.negate=bnNegate;BigInteger.prototype.abs=bnAbs;BigInteger.prototype.compareTo=bnCompareTo;BigInteger.prototype.bitLength=bnBitLength;BigInteger.prototype.mod=bnMod;BigInteger.prototype.modPowInt=bnModPowInt; BigInteger.ZERO=nbv(0);BigInteger.ONE=nbv(1);function SecureRandom(){this.nextBytes=function(a){for(var b=0;b >1;d.e=parseInt(c,16);for(d.ee=new BigInteger(c,16);;){for(;!(d.p=new BigInteger(b-f,1,e),0==d.p.subtract(BigInteger.ONE).gcd(d.ee).compareTo(BigInteger.ONE)&&d.p.isProbablePrime(10)););for(;!(d.q=new BigInteger(f,1,e),0==d.q.subtract(BigInteger.ONE).gcd(d.ee).compareTo(BigInteger.ONE)&&d.q.isProbablePrime(10));); -if(0>=d.p.compareTo(d.q)){var g=d.p;d.p=d.q;d.q=g}var g=d.p.subtract(BigInteger.ONE),h=d.q.subtract(BigInteger.ONE),k=g.multiply(h);if(0==k.gcd(d.ee).compareTo(BigInteger.ONE)){d.n=d.p.multiply(d.q);d.d=d.ee.modInverse(k);d.dmp1=d.d.mod(g);d.dmq1=d.d.mod(h);d.u=d.p.modInverse(d.q);break}}return d};this.keyObject=a}function bnClone(){var a=nbi();this.copyTo(a);return a} +function RSA(){function a(){this.n=null;this.e=0;this.u=this.dmq1=this.dmp1=this.q=this.p=this.d=this.ee=null}this.encrypt=function(a,c,d){return a.modPowInt(c,d)};this.decrypt=function(a,c,d,e,f){var h=a.mod(d).modPow(c.mod(d.subtract(BigInteger.ONE)),d),a=a.mod(e).modPow(c.mod(e.subtract(BigInteger.ONE)),e);util.print_debug("rsa.js decrypt\nxpn:"+util.hexstrdump(h.toMPI())+"\nxqn:"+util.hexstrdump(a.toMPI()));c=a.subtract(h);0==c[0]?(c=h.subtract(a),c=c.multiply(f).mod(e),c=e.subtract(c)):c=c.multiply(f).mod(e); +return c.multiply(d).add(h)};this.verify=function(a,c,d){return a.modPowInt(c,d)};this.sign=function(a,c,d){return a.modPow(c,d)};this.generate=function(b,c){var d=new a,e=new SecureRandom,f=b>>1;d.e=parseInt(c,16);for(d.ee=new BigInteger(c,16);;){for(;!(d.p=new BigInteger(b-f,1,e),0==d.p.subtract(BigInteger.ONE).gcd(d.ee).compareTo(BigInteger.ONE)&&d.p.isProbablePrime(10)););for(;!(d.q=new BigInteger(f,1,e),0==d.q.subtract(BigInteger.ONE).gcd(d.ee).compareTo(BigInteger.ONE)&&d.q.isProbablePrime(10));); +if(0>=d.p.compareTo(d.q)){var h=d.p;d.p=d.q;d.q=h}var h=d.p.subtract(BigInteger.ONE),g=d.q.subtract(BigInteger.ONE),k=h.multiply(g);if(0==k.gcd(d.ee).compareTo(BigInteger.ONE)){d.n=d.p.multiply(d.q);d.d=d.ee.modInverse(k);d.dmp1=d.d.mod(h);d.dmq1=d.d.mod(g);d.u=d.p.modInverse(d.q);break}}return d};this.keyObject=a}function bnClone(){var a=nbi();this.copyTo(a);return a} function bnIntValue(){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)< >24}function bnShortValue(){return 0==this.t?this.s:this[0]<<16>>16}function bnpChunkSize(a){return Math.floor(Math.LN2*this.DB/Math.log(a))}function bnSigNum(){return 0>this.s?-1:0>=this.t||1==this.t&&0>=this[0]?0:1} function bnpToRadix(a){null==a&&(a=10);if(0==this.signum()||2>a||36k?"-"==a.charAt(h)&&0==this.signum()&&(e=!0):(g=b*g+k,++f>=c&&(this.dMultiply(d),this.dAddOffset(g,0),g=f=0))}0 k?"-"==a.charAt(g)&&0==this.signum()&&(e=!0):(h=b*h+k,++f>=c&&(this.dMultiply(d),this.dAddOffset(h,0),h=f=0))}0 a)this.fromInt(1);else{this.fromNumber(a,c);this.testBit(a-1)||this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);for(this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(b);)this.dAddOffset(2,0),this.bitLength()>a&&this.subTo(BigInteger.ONE.shiftLeft(a-1),this)}else{var c=[],d=a&7;c.length=(a>>3)+1;b.nextBytes(c);c[0]=0 >c)!=(this.s&this.DM)>>c)b[e++]=d|this.s< c?(d=(this[a]&(1< >(c+=this.DB-8)):(d=this[a]>>(c-=8)&255,0>=c&&(c+=this.DB,--a)),0 this.compareTo(a)?this:a}function bnMax(a){return 0 a.s||a.t>2*this.m.t)return a.mod(this.m);if(0>a.compareTo(this.m))return a;var b=nbi();a.copyTo(b);this.reduce(b);return b}function barrettRevert(a){return a} function barrettReduce(a){a.drShiftTo(this.m.t-1,this.r2);if(a.t>this.m.t+1)a.t=this.m.t+1,a.clamp();this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);for(this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);0>a.compareTo(this.r2);)a.dAddOffset(1,this.m.t+1);for(a.subTo(this.r2,a);0<=a.compareTo(this.m);)a.subTo(this.m,a)}function barrettSqrTo(a,b){a.squareTo(b);this.reduce(b)}function barrettMulTo(a,b,c){a.multiplyTo(b,c);this.reduce(c)}Barrett.prototype.convert=barrettConvert; Barrett.prototype.revert=barrettRevert;Barrett.prototype.reduce=barrettReduce;Barrett.prototype.mulTo=barrettMulTo;Barrett.prototype.sqrTo=barrettSqrTo; -function bnModPow(a,b){var c=a.bitLength(),d,e=nbv(1),f;if(0>=c)return e;d=18>c?1:48>c?3:144>c?4:768>c?5:6;f=8>c?new Classic(b):b.isEven()?new Barrett(b):new Montgomery(b);var g=[],h=3,k=d-1,j=(1< =k?u=a[m]>>c-k&j:(u=(a[m]&(1< >this.DB+c-k));for(h=d;0==(u&1);)u>>=1,--h;if(0>(c-=h))c+=this.DB,--m;if(D)g[u].copyTo(e), -D=!1;else{for(;1 --c&&(c=this.DB-1,--m)}return f.revert(e)} +function bnModPow(a,b){var c=a.bitLength(),d,e=nbv(1),f;if(0>=c)return e;d=18>c?1:48>c?3:144>c?4:768>c?5:6;f=8>c?new Classic(b):b.isEven()?new Barrett(b):new Montgomery(b);var h=[],g=3,k=d-1,j=(1< =k?o=a[l]>>c-k&j:(o=(a[l]&(1< >this.DB+c-k));for(g=d;0==(o&1);)o>>=1,--g;if(0>(c-=g))c+=this.DB,--l;if(s)h[o].copyTo(e), +s=!1;else{for(;1 --c&&(c=this.DB-1,--l)}return f.revert(e)} function bnGCD(a){var b=0>this.s?this.negate():this.clone(),a=0>a.s?a.negate():a.clone();if(0>b.compareTo(a))var c=b,b=a,a=c;var c=b.getLowestSetBit(),d=a.getLowestSetBit();if(0>d)return b;c =a)return 0;var b=this.DV%a,c=0>this.s?a-1:0;if(0 h.signum())h.addTo(a,h);else return h;return 0>h.signum()?h.add(a):h} +function bnModInverse(a){var b=a.isEven();if(this.isEven()&&b||0==a.signum())return BigInteger.ZERO;for(var c=a.clone(),d=this.clone(),e=nbv(1),f=nbv(0),h=nbv(0),g=nbv(1);0!=c.signum();){for(;c.isEven();){c.rShiftTo(1,c);if(b){if(!e.isEven()||!f.isEven())e.addTo(this,e),f.subTo(a,f);e.rShiftTo(1,e)}else f.isEven()||f.subTo(a,f);f.rShiftTo(1,f)}for(;d.isEven();){d.rShiftTo(1,d);if(b){if(!h.isEven()||!g.isEven())h.addTo(this,h),g.subTo(a,g);h.rShiftTo(1,h)}else g.isEven()||g.subTo(a,g);g.rShiftTo(1, +g)}0<=c.compareTo(d)?(c.subTo(d,c),b&&e.subTo(h,e),f.subTo(g,f)):(d.subTo(c,d),b&&h.subTo(e,h),g.subTo(f,g))}if(0!=d.compareTo(BigInteger.ONE))return BigInteger.ZERO;if(0<=g.compareTo(a))return g.subtract(a);if(0>g.signum())g.addTo(a,g);else return g;return 0>g.signum()?g.add(a):g} var lowprimes=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727, 733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],lplim=67108864/lowprimes[lowprimes.length-1]; function bnIsProbablePrime(a){var b,c=this.abs();if(1==c.t&&c[0]<=lowprimes[lowprimes.length-1]){for(b=0;b >>16))a=c,b+=16;if(0!=(c=a>>8))a=c,b+=8;if(0!=(c=a>>4))a=c,b+=4;if(0!=(c=a>>2))a=c,b+=2;0!=a>>1&&(b+=1);return b}function bnToMPI(){var a=this.toByteArray(),b=8*(a.length-1)+nbits(a[0]),c;c=""+String.fromCharCode((b&65280)>>8);c+=String.fromCharCode(b&255);return c+=util.bin2str(a)} -function bnpMillerRabin(a){var b=this.subtract(BigInteger.ONE),c=b.getLowestSetBit();if(0>=c)return!1;var d=b.shiftRight(c),a=a+1>>1;if(a>lowprimes.length)a=lowprimes.length;for(var e=nbi(),f=0;f=c)return!1;var d=b.shiftRight(c),a=a+1>>1;if(a>lowprimes.length)a=lowprimes.length;for(var e=nbi(),f=0;fb?2:b;case 28:return 11b?11:b;case 32:return 10b?8:b;default:return util.print_debug("DSA select hash algorithm: returning null for an unknown length of q"),null}};this.sign=function(a,b,c,d,e,f){a=util.getLeftNBits(openpgp_crypto_hashData(a,b),e.bitLength());a=new BigInteger(util.hexstrdump(a),16);b=openpgp_crypto_getRandomBigIntegerInRange(BigInteger.ONE.add(BigInteger.ONE), -e.subtract(BigInteger.ONE));c=c.modPow(b,d).mod(e);e=b.modInverse(e).multiply(a.add(f.multiply(c))).mod(e);f=[];f[0]=c.toMPI();f[1]=e.toMPI();return f};this.verify=function(a,b,c,d,e,f,g,h){a=util.getLeftNBits(openpgp_crypto_hashData(a,d),f.bitLength());a=new BigInteger(util.hexstrdump(a),16);if(0 >>4^A)&252645135;A^=f;o^=f<<4;f=(o>>>16^A)&65535;A^=f;o^=f<<16;f=(A>>>2^o)&858993459;o^=f;A^=f<<2;f=(A>>>8^o)&16711935;o^=f;A^=f<<8;f=(o>>>1^A)&1431655765;A^=f;o^=f<<1;o=o<<1|o>>>31;A=A<<1|A>>>31;for(W=0;W >>4|A<<28)^a[e+1],f=o,o=A,A=f^(h[L>>>24&63]|j[L>>>16&63]|u[L>>>8&63]|l[L& -63]|g[z>>>24&63]|k[z>>>16&63]|m[z>>>8&63]|D[z&63]);f=o;o=A;A=f}o=o>>>1|o<<31;A=A>>>1|A<<31;f=(o>>>1^A)&1431655765;A^=f;o^=f<<1;f=(A>>>8^o)&16711935;o^=f;A^=f<<8;f=(A>>>2^o)&858993459;o^=f;A^=f<<2;f=(o>>>16^A)&65535;A^=f;o^=f<<16;f=(o>>>4^A)&252645135;A^=f;o^=f<<4;1==d&&(c?(na=o,la=A):(o^=fa,A^=O));tempresult+=String.fromCharCode(o>>>24,o>>>16&255,o>>>8&255,o&255,A>>>24,A>>>16&255,A>>>8&255,A&255);ea+=8;512==ea&&(result+=tempresult,tempresult="",ea=0)}result+=tempresult;return result=result.replace(/\0*$/g, -"")} -function des_createKeys(a){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 b=8 >>4^right)&252645135;right^= -k;left^=k<<4;k=(right>>>-16^left)&65535;left^=k;right^=k<<-16;k=(left>>>2^right)&858993459;right^=k;left^=k<<2;k=(right>>>-16^left)&65535;left^=k;right^=k<<-16;k=(left>>>1^right)&1431655765;right^=k;left^=k<<1;k=(right>>>8^left)&16711935;left^=k;right^=k<<8;k=(left>>>1^right)&1431655765;right^=k;left^=k<<1;k=left<<8|right>>>20&240;left=right<<24|right<<8&16711680|right>>>8&65280|right>>>24&240;right=k;for(i=0;i >>26,right=right<<2|right>>>26):(left=left<<1|left>>> -27,right=right<<1|right>>>27),left&=-15,right&=-15,e=pc2bytes0[left>>>28]|pc2bytes1[left>>>24&15]|pc2bytes2[left>>>20&15]|pc2bytes3[left>>>16&15]|pc2bytes4[left>>>12&15]|pc2bytes5[left>>>8&15]|pc2bytes6[left>>>4&15],f=pc2bytes7[right>>>28]|pc2bytes8[right>>>24&15]|pc2bytes9[right>>>20&15]|pc2bytes10[right>>>16&15]|pc2bytes11[right>>>12&15]|pc2bytes12[right>>>8&15]|pc2bytes13[right>>>4&15],k=(f>>>16^e)&65535,c[h++]=e^k,c[h++]=f^k<<16}return c} +131592,8,134348808,131584],j=[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],l=[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],o=[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],s=[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],q=[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],m=0,z,x,v,t,r,N,T,K,P,M,w,B,W=b.length,E=0,C=32==a.length? +3:9;N=3==C?c?[0,32,2]:[30,-2,-2]:c?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2];2==f?b+=" ":1==f?(f=8-W%8,b+=String.fromCharCode(f,f,f,f,f,f,f,f),8==f&&(W+=8)):f||(b+="\x00\x00\x00\x00\x00\x00\x00\x00");tempresult=result="";1==d&&(T=e.charCodeAt(m++)<<24|e.charCodeAt(m++)<<16|e.charCodeAt(m++)<<8|e.charCodeAt(m++),P=e.charCodeAt(m++)<<24|e.charCodeAt(m++)<<16|e.charCodeAt(m++)<<8|e.charCodeAt(m++),m=0);for(;m >>4^r)&252645135;r^=f;t^=f<<4;f=(t>>>16^r)&65535;r^=f;t^=f<<16;f=(r>>>2^t)&858993459;t^=f;r^=f<<2;f=(r>>>8^t)&16711935;t^=f;r^=f<<8;f=(t>>>1^r)&1431655765;r^=f;t^=f<<1;t=t<<1|t>>>31;r=r<<1|r>>>31;for(z=0;z >>4|r<<28)^a[e+1],f=t,t=r,r=f^(g[x>>>24&63]|j[x>>>16&63]|o[x>>>8&63]|q[x&63]|h[v>>>24&63]|k[v>>>16&63]|l[v>>> +8&63]|s[v&63]);f=t;t=r;r=f}t=t>>>1|t<<31;r=r>>>1|r<<31;f=(t>>>1^r)&1431655765;r^=f;t^=f<<1;f=(r>>>8^t)&16711935;t^=f;r^=f<<8;f=(r>>>2^t)&858993459;t^=f;r^=f<<2;f=(t>>>16^r)&65535;r^=f;t^=f<<16;f=(t>>>4^r)&252645135;r^=f;t^=f<<4;1==d&&(c?(T=t,P=r):(t^=K,r^=M));tempresult+=String.fromCharCode(t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255);E+=8;512==E&&(result+=tempresult,tempresult="",E=0)}result+=tempresult;return result=result.replace(/\0*$/g,"")} +function des_createKeys(a){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 b=8 >>4^right)&252645135; +right^=k;left^=k<<4;k=(right>>>-16^left)&65535;left^=k;right^=k<<-16;k=(left>>>2^right)&858993459;right^=k;left^=k<<2;k=(right>>>-16^left)&65535;left^=k;right^=k<<-16;k=(left>>>1^right)&1431655765;right^=k;left^=k<<1;k=(right>>>8^left)&16711935;left^=k;right^=k<<8;k=(left>>>1^right)&1431655765;right^=k;left^=k<<1;k=left<<8|right>>>20&240;left=right<<24|right<<8&16711680|right>>>8&65280|right>>>24&240;right=k;for(i=0;i >>26,right=right<<2|right>>>26):(left=left<< +1|left>>>27,right=right<<1|right>>>27),left&=-15,right&=-15,e=pc2bytes0[left>>>28]|pc2bytes1[left>>>24&15]|pc2bytes2[left>>>20&15]|pc2bytes3[left>>>16&15]|pc2bytes4[left>>>12&15]|pc2bytes5[left>>>8&15]|pc2bytes6[left>>>4&15],f=pc2bytes7[right>>>28]|pc2bytes8[right>>>24&15]|pc2bytes9[right>>>20&15]|pc2bytes10[right>>>16&15]|pc2bytes11[right>>>12&15]|pc2bytes12[right>>>8&15]|pc2bytes13[right>>>4&15],k=(f>>>16^e)&65535,c[g++]=e^k,c[g++]=f^k<<16}return c} function cast5_encrypt(a,b){var c=new openpgp_symenc_cast5;c.setKey(util.str2bin(b));return c.encrypt(a)} function openpgp_symenc_cast5(){function a(a,b,c){a=b+a;c=a< >>32-c;return(f[0][c>>>24]^f[1][c>>>16&255])-f[2][c>>>8&255]+f[3][c&255]}function b(a,b,c){a^=b;c=a< >>32-c;return f[0][c>>>24]-f[1][c>>>16&255]+f[2][c>>>8&255]^f[3][c&255]}function c(a,b,c){a=b-a;c=a< >>32-c;return(f[0][c>>>24]+f[1][c>>>16&255]^f[2][c>>>8&255])-f[3][c&255]}this.BlockSize=8;this.KeySize=16;this.setKey=function(a){this.masking=Array(16);this.rotate=Array(16);this.reset();if(a.length==this.KeySize)this.keySchedule(a); -else return util.print_error("cast5.js: CAST-128: keys must be 16 bytes"),!1;return!0};this.reset=function(){for(var a=0;16>a;a++)this.masking[a]=0,this.rotate[a]=0};this.getBlockSize=function(){return BlockSize};this.encrypt=function(d){var e=Array(d.length);for(i=0;i >>24&255;e[i+1]=j>>>16&255;e[i+2]=j>>>8&255;e[i+3]=j&255;e[i+4]=f>>>24&255;e[i+5]=f>>>16&255;e[i+6]=f>>>8&255;e[i+7]=f&255}return e};this.decrypt=function(d){var e=Array(d.length);for(i=0;i >>24&255;e[i+1]=j>>>16&255;e[i+2]=j>>>8&255;e[i+3]=j&255;e[i+4]=f>>>24&255;e[i+5]=f>>16&255;e[i+6]=f>>8&255;e[i+7]=f&255}return e};var d=Array(4);d[0]=Array(4);d[0][0]=[4,0,13,15,12,14,8];d[0][1]=[5,2,16,18,17,19,10];d[0][2]=[6,3,23,22,21,20,9];d[0][3]=[7,1,26,25,27,24,11];d[1]=Array(4);d[1][0]=[0, +else return util.print_error("cast5.js: CAST-128: keys must be 16 bytes"),!1;return!0};this.reset=function(){for(var a=0;16>a;a++)this.masking[a]=0,this.rotate[a]=0};this.getBlockSize=function(){return BlockSize};this.encrypt=function(d){var e=Array(d.length);for(i=0;i >>24&255;e[i+1]=j>>>16&255;e[i+2]=j>>>8&255;e[i+3]=j&255;e[i+4]=f>>>24&255;e[i+5]=f>>>16&255;e[i+6]=f>>>8&255;e[i+7]=f&255}return e};this.decrypt=function(d){var e=Array(d.length);for(i=0;i >>24&255;e[i+1]=j>>>16&255;e[i+2]=j>>>8&255;e[i+3]=j&255;e[i+4]=f>>>24&255;e[i+5]=f>>16&255;e[i+6]=f>>8&255;e[i+7]=f&255}return e};var d=Array(4);d[0]=Array(4);d[0][0]=[4,0,13,15,12,14,8];d[0][1]=[5,2,16,18,17,19,10];d[0][2]=[6,3,23,22,21,20,9];d[0][3]=[7,1,26,25,27,24,11];d[1]=Array(4);d[1][0]=[0, 6,21,23,20,22,16];d[1][1]=[1,4,0,2,1,3,18];d[1][2]=[2,5,7,6,5,4,17];d[1][3]=[3,7,10,9,11,8,19];d[2]=Array(4);d[2][0]=[4,0,13,15,12,14,8];d[2][1]=[5,2,16,18,17,19,10];d[2][2]=[6,3,23,22,21,20,9];d[2][3]=[7,1,26,25,27,24,11];d[3]=Array(4);d[3][0]=[0,6,21,23,20,22,16];d[3][1]=[1,4,0,2,1,3,18];d[3][2]=[2,5,7,6,5,4,17];d[3][3]=[3,7,10,9,11,8,19];var e=Array(4);e[0]=Array(4);e[0][0]=[24,25,23,22,18];e[0][1]=[26,27,21,20,22];e[0][2]=[28,29,19,18,25];e[0][3]=[30,31,17,16,28];e[1]=Array(4);e[1][0]=[3,2,12, -13,8];e[1][1]=[1,0,14,15,13];e[1][2]=[7,6,8,9,3];e[1][3]=[5,4,10,11,7];e[2]=Array(4);e[2][0]=[19,18,28,29,25];e[2][1]=[17,16,30,31,28];e[2][2]=[23,22,24,25,18];e[2][3]=[21,20,26,27,22];e[3]=Array(4);e[3][0]=[8,9,7,6,3];e[3][1]=[10,11,5,4,7];e[3][2]=[12,13,3,2,8];e[3][3]=[14,15,1,0,13];this.keySchedule=function(a){for(var b=Array(8),c=Array(32),j=0;4>j;j++){var m=4*j;b[j]=a[m]<<24|a[m+1]<<16|a[m+2]<<8|a[m+3]}for(var a=[6,7,4,5],u=j=0;2>u;u++)for(var D=0;4>D;D++){for(m=0;4>m;m++){var l=d[D][m],p=b[l[1]], -p=p^f[4][b[l[2]>>>2]>>>24-8*(l[2]&3)&255],p=p^f[5][b[l[3]>>>2]>>>24-8*(l[3]&3)&255],p=p^f[6][b[l[4]>>>2]>>>24-8*(l[4]&3)&255],p=p^f[7][b[l[5]>>>2]>>>24-8*(l[5]&3)&255],p=p^f[a[m]][b[l[6]>>>2]>>>24-8*(l[6]&3)&255];b[l[0]]=p}for(m=0;4>m;m++)l=e[D][m],p=f[4][b[l[0]>>>2]>>>24-8*(l[0]&3)&255],p^=f[5][b[l[1]>>>2]>>>24-8*(l[1]&3)&255],p^=f[6][b[l[2]>>>2]>>>24-8*(l[2]&3)&255],p^=f[7][b[l[3]>>>2]>>>24-8*(l[3]&3)&255],p^=f[4+m][b[l[4]>>>2]>>>24-8*(l[4]&3)&255],c[j]=p,j++}for(j=0;16>j;j++)this.masking[j]=c[j], +13,8];e[1][1]=[1,0,14,15,13];e[1][2]=[7,6,8,9,3];e[1][3]=[5,4,10,11,7];e[2]=Array(4);e[2][0]=[19,18,28,29,25];e[2][1]=[17,16,30,31,28];e[2][2]=[23,22,24,25,18];e[2][3]=[21,20,26,27,22];e[3]=Array(4);e[3][0]=[8,9,7,6,3];e[3][1]=[10,11,5,4,7];e[3][2]=[12,13,3,2,8];e[3][3]=[14,15,1,0,13];this.keySchedule=function(a){for(var b=Array(8),c=Array(32),j=0;4>j;j++){var l=4*j;b[j]=a[l]<<24|a[l+1]<<16|a[l+2]<<8|a[l+3]}for(var a=[6,7,4,5],o=j=0;2>o;o++)for(var s=0;4>s;s++){for(l=0;4>l;l++){var q=d[s][l],m=b[q[1]], +m=m^f[4][b[q[2]>>>2]>>>24-8*(q[2]&3)&255],m=m^f[5][b[q[3]>>>2]>>>24-8*(q[3]&3)&255],m=m^f[6][b[q[4]>>>2]>>>24-8*(q[4]&3)&255],m=m^f[7][b[q[5]>>>2]>>>24-8*(q[5]&3)&255],m=m^f[a[l]][b[q[6]>>>2]>>>24-8*(q[6]&3)&255];b[q[0]]=m}for(l=0;4>l;l++)q=e[s][l],m=f[4][b[q[0]>>>2]>>>24-8*(q[0]&3)&255],m^=f[5][b[q[1]>>>2]>>>24-8*(q[1]&3)&255],m^=f[6][b[q[2]>>>2]>>>24-8*(q[2]&3)&255],m^=f[7][b[q[3]>>>2]>>>24-8*(q[3]&3)&255],m^=f[4+l][b[q[4]>>>2]>>>24-8*(q[4]&3)&255],c[j]=m,j++}for(j=0;16>j;j++)this.masking[j]=c[j], this.rotate[j]=c[16+j]&31};var f=Array(8);f[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, @@ -359,13 +313,13 @@ f[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612 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 TFencrypt(a,b){var c=[].concat(a),d=createTwofish();d.open(util.str2bin(b),0);c=d.encrypt(c,0);d.close();return c}var MAXINT=4294967295; function rotb(a,b){return(a<>>8-b)&255}function rotw(a,b){return(a<>>32-b)&MAXINT}function getW(a,b){return a[b]|a[b+1]<<8|a[b+2]<<16|a[b+3]<<24}function setW(a,b,c){a.splice(b,4,c&255,c>>>8&255,c>>>16&255,c>>>24&255)}function setWInv(a,b,c){a.splice(b,4,c>>>24&255,c>>>16&255,c>>>8&255,c&255)}function getB(a,b){return a>>>8*b&255}function getNrBits(a){for(var b=0;0>>=1;return b}function getMask(a){return(1<d;d++)e=c>>>24,c=c<<8&MAXINT|a>>>24,a=a<<8&MAXINT,f=e<<1,e&128&&(f^=333),c^=e^f<<16,f^=e>>>1,e&1&&(f^=166),c^=f<<24|f<<8;return c}function d(a,b){var c,e,f;c=b>>4;e=b&15;f=A[a][c^ -e];c=ka[a][la[e]^O[c]];return fa[a][la[c]^O[f]]<<4|na[a][f^c]}function e(a,b){var c=getB(a,0),d=getB(a,1),f=getB(a,2),g=getB(a,3);switch(L){case 4:c=M[1][c]^getB(b[3],0),d=M[0][d]^getB(b[3],1),f=M[0][f]^getB(b[3],2),g=M[1][g]^getB(b[3],3);case 3:c=M[1][c]^getB(b[2],0),d=M[1][d]^getB(b[2],1),f=M[0][f]^getB(b[2],2),g=M[0][g]^getB(b[2],3);case 2:c=M[0][M[0][c]^getB(b[1],0)]^getB(b[0],0),d=M[0][M[1][d]^getB(b[1],1)]^getB(b[0],1),f=M[1][M[0][f]^getB(b[1],2)]^getB(b[0],2),g=M[1][M[1][g]^getB(b[1],3)]^getB(b[0], -3)}return Z[0][c]^Z[1][d]^Z[2][f]^Z[3][g]}c=a;var u,D,l,p;l=[];p=[];var W=[],L,z=[],o,A=[[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]],ka=[[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]],na=[[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]],fa=[[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]],la=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],O=[0,9,2,11,4,13,6,15,8,1,10,3,12, -5,14,7],M=[[],[]],Z=[[],[],[],[]];c=c.slice(0,32);for(a=c.length;16!=a&&24!=a&&32!=a;)c[a++]=0;for(a=0;a >2]=getW(c,a);for(a=0;256>a;a++)M[0][a]=d(0,a),M[1][a]=d(1,a);for(a=0;256>a;a++)u=M[1][a],D=u^u>>2^[0,90,180,238][u&3],o=u^u>>1^u>>2^[0,238,180,90][u&3],Z[0][a]=u+(D<<8)+(o<<16)+(o<<24),Z[2][a]=D+(o<<8)+(u<<16)+(o<<24),u=M[0][a],D=u^u>>2^[0,90,180,238][u&3],o=u^u>>1^u>>2^[0,238,180,90][u&3],Z[1][a]=o+(o<<8)+(D<<16)+(u<<24),Z[3][a]=D+(u<<8)+(o<<16)+(D<<24);L=W.length/2;for(a=0;a< -L;a++)u=W[a+a],l[a]=u,D=W[a+a+1],p[a]=D,z[L-a-1]=b(u,D);for(a=0;40>a;a+=2)u=16843009*a,D=u+16843009,u=e(u,l),D=rotw(e(D,p),8),f[a]=u+D&MAXINT,f[a+1]=rotw(u+2*D,9);for(a=0;256>a;a++)switch(u=D=l=p=a,L){case 4:u=M[1][u]^getB(z[3],0),D=M[0][D]^getB(z[3],1),l=M[0][l]^getB(z[3],2),p=M[1][p]^getB(z[3],3);case 3:u=M[1][u]^getB(z[2],0),D=M[1][D]^getB(z[2],1),l=M[0][l]^getB(z[2],2),p=M[0][p]^getB(z[2],3);case 2:g[0][a]=Z[0][M[0][M[0][u]^getB(z[1],0)]^getB(z[0],0)],g[1][a]=Z[1][M[0][M[1][D]^getB(z[1],1)]^getB(z[0], -1)],g[2][a]=Z[2][M[1][M[0][l]^getB(z[1],2)]^getB(z[0],2)],g[3][a]=Z[3][M[1][M[1][p]^getB(z[1],3)]^getB(z[0],3)]}},close:function(){f=[];g=[[],[],[],[]]},encrypt:function(c,g){d=c;e=g;for(var j=[getW(d,e)^f[0],getW(d,e+4)^f[1],getW(d,e+8)^f[2],getW(d,e+12)^f[3]],m=0;8>m;m++){var u=m,D=j,l=a(D[0]),p=b(D[1]);D[2]=rotw(D[2]^l+p+f[4*u+8]&MAXINT,31);D[3]=rotw(D[3],1)^l+2*p+f[4*u+9]&MAXINT;l=a(D[2]);p=b(D[3]);D[0]=rotw(D[0]^l+p+f[4*u+10]&MAXINT,31);D[1]=rotw(D[1],1)^l+2*p+f[4*u+11]&MAXINT}setW(d,e,j[2]^ -f[4]);setW(d,e+4,j[3]^f[5]);setW(d,e+8,j[0]^f[6]);setW(d,e+12,j[1]^f[7]);e+=16;return d},decrypt:function(c,g){d=c;e=g;for(var j=[getW(d,e)^f[4],getW(d,e+4)^f[5],getW(d,e+8)^f[6],getW(d,e+12)^f[7]],m=7;0<=m;m--){var u=m,D=j,l=a(D[0]),p=b(D[1]);D[2]=rotw(D[2],1)^l+p+f[4*u+10]&MAXINT;D[3]=rotw(D[3]^l+2*p+f[4*u+11]&MAXINT,31);l=a(D[2]);p=b(D[3]);D[0]=rotw(D[0],1)^l+p+f[4*u+8]&MAXINT;D[1]=rotw(D[1]^l+2*p+f[4*u+9]&MAXINT,31)}setW(d,e,j[2]^f[0]);setW(d,e+4,j[3]^f[1]);setW(d,e+8,j[0]^f[2]);setW(d,e+12,j[1]^ +function createTwofish(){function a(a){return h[0][getB(a,0)]^h[1][getB(a,1)]^h[2][getB(a,2)]^h[3][getB(a,3)]}function b(a){return h[0][getB(a,3)]^h[1][getB(a,0)]^h[2][getB(a,1)]^h[3][getB(a,2)]}var c=null,d=null,e=-1,f=[],h=[[],[],[],[]];return{name:"twofish",blocksize:16,open:function(a){function b(a,c){var d,e,f;for(d=0;8>d;d++)e=c>>>24,c=c<<8&MAXINT|a>>>24,a=a<<8&MAXINT,f=e<<1,e&128&&(f^=333),c^=e^f<<16,f^=e>>>1,e&1&&(f^=166),c^=f<<24|f<<8;return c}function d(a,b){var c,e,f;c=b>>4;e=b&15;f=r[a][c^ +e];c=N[a][P[e]^M[c]];return K[a][P[c]^M[f]]<<4|T[a][f^c]}function e(a,b){var c=getB(a,0),d=getB(a,1),f=getB(a,2),g=getB(a,3);switch(x){case 4:c=w[1][c]^getB(b[3],0),d=w[0][d]^getB(b[3],1),f=w[0][f]^getB(b[3],2),g=w[1][g]^getB(b[3],3);case 3:c=w[1][c]^getB(b[2],0),d=w[1][d]^getB(b[2],1),f=w[0][f]^getB(b[2],2),g=w[0][g]^getB(b[2],3);case 2:c=w[0][w[0][c]^getB(b[1],0)]^getB(b[0],0),d=w[0][w[1][d]^getB(b[1],1)]^getB(b[0],1),f=w[1][w[0][f]^getB(b[1],2)]^getB(b[0],2),g=w[1][w[1][g]^getB(b[1],3)]^getB(b[0], +3)}return B[0][c]^B[1][d]^B[2][f]^B[3][g]}c=a;var o,s,q,m;q=[];m=[];var z=[],x,v=[],t,r=[[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]],N=[[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]],T=[[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]],K=[[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]],P=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],M=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14, +7],w=[[],[]],B=[[],[],[],[]];c=c.slice(0,32);for(a=c.length;16!=a&&24!=a&&32!=a;)c[a++]=0;for(a=0;a >2]=getW(c,a);for(a=0;256>a;a++)w[0][a]=d(0,a),w[1][a]=d(1,a);for(a=0;256>a;a++)o=w[1][a],s=o^o>>2^[0,90,180,238][o&3],t=o^o>>1^o>>2^[0,238,180,90][o&3],B[0][a]=o+(s<<8)+(t<<16)+(t<<24),B[2][a]=s+(t<<8)+(o<<16)+(t<<24),o=w[0][a],s=o^o>>2^[0,90,180,238][o&3],t=o^o>>1^o>>2^[0,238,180,90][o&3],B[1][a]=t+(t<<8)+(s<<16)+(o<<24),B[3][a]=s+(o<<8)+(t<<16)+(s<<24);x=z.length/2;for(a=0;a a;a+=2)o=16843009*a,s=o+16843009,o=e(o,q),s=rotw(e(s,m),8),f[a]=o+s&MAXINT,f[a+1]=rotw(o+2*s,9);for(a=0;256>a;a++)switch(o=s=q=m=a,x){case 4:o=w[1][o]^getB(v[3],0),s=w[0][s]^getB(v[3],1),q=w[0][q]^getB(v[3],2),m=w[1][m]^getB(v[3],3);case 3:o=w[1][o]^getB(v[2],0),s=w[1][s]^getB(v[2],1),q=w[0][q]^getB(v[2],2),m=w[0][m]^getB(v[2],3);case 2:h[0][a]=B[0][w[0][w[0][o]^getB(v[1],0)]^getB(v[0],0)],h[1][a]=B[1][w[0][w[1][s]^getB(v[1],1)]^getB(v[0], +1)],h[2][a]=B[2][w[1][w[0][q]^getB(v[1],2)]^getB(v[0],2)],h[3][a]=B[3][w[1][w[1][m]^getB(v[1],3)]^getB(v[0],3)]}},close:function(){f=[];h=[[],[],[],[]]},encrypt:function(c,h){d=c;e=h;for(var j=[getW(d,e)^f[0],getW(d,e+4)^f[1],getW(d,e+8)^f[2],getW(d,e+12)^f[3]],l=0;8>l;l++){var o=l,s=j,q=a(s[0]),m=b(s[1]);s[2]=rotw(s[2]^q+m+f[4*o+8]&MAXINT,31);s[3]=rotw(s[3],1)^q+2*m+f[4*o+9]&MAXINT;q=a(s[2]);m=b(s[3]);s[0]=rotw(s[0]^q+m+f[4*o+10]&MAXINT,31);s[1]=rotw(s[1],1)^q+2*m+f[4*o+11]&MAXINT}setW(d,e,j[2]^ +f[4]);setW(d,e+4,j[3]^f[5]);setW(d,e+8,j[0]^f[6]);setW(d,e+12,j[1]^f[7]);e+=16;return d},decrypt:function(c,h){d=c;e=h;for(var j=[getW(d,e)^f[4],getW(d,e+4)^f[5],getW(d,e+8)^f[6],getW(d,e+12)^f[7]],l=7;0<=l;l--){var o=l,s=j,q=a(s[0]),m=b(s[1]);s[2]=rotw(s[2],1)^q+m+f[4*o+10]&MAXINT;s[3]=rotw(s[3]^q+2*m+f[4*o+11]&MAXINT,31);q=a(s[2]);m=b(s[3]);s[0]=rotw(s[0],1)^q+m+f[4*o+8]&MAXINT;s[1]=rotw(s[1]^q+2*m+f[4*o+9]&MAXINT,31)}setW(d,e,j[2]^f[0]);setW(d,e+4,j[3]^f[1]);setW(d,e+8,j[0]^f[2]);setW(d,e+12,j[1]^ f[3]);e+=16},finalize:function(){return d}}}function Blowfish(){}Blowfish.prototype.BLOCKSIZE=8; Blowfish.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, @@ -419,58 +373,58 @@ var Rcon=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53, 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];function B0(a){return a&255}function B1(a){return a>>8&255}function B2(a){return a>>16&255} function B3(a){return a>>24&255}function F1(a,b,c,d){return B1(T1[a&255])|B1(T1[b>>8&255])<<8|B1(T1[c>>16&255])<<16|B1(T1[d>>>24])<<24}function packBytes(a){var b,c,d=a.length,e=Array(d/4);if(a&&!(d%4)){for(b=0,c=0;c c;d++,c++)f[a][c]=k[d];4==c&&(a++,c=0)}for(;a c;d++,c++)f[a][c]=k[d];4==c&&(a++,c=0)}for(;a c;d++,c++)f[a][c]=k[d];4==c&&(a++,c=0)}}this.rounds=e;this.rk=f;return this} -function AESencrypt(a,b){var c,d,e,f,g,h=packBytes(a),k=b.rounds,j=h[0],m=h[1],u=h[2];g=h[3];for(c=0;c >8&255]^T3[f>>16&255]^T4[g>>>24],m=T1[e&255]^T2[f>>8&255]^T3[g>>16&255]^T4[d>>>24],u=T1[f&255]^T2[g>>8&255]^T3[d>>16&255]^T4[e>>>24],g=T1[g&255]^T2[d>>8&255]^T3[e>>16&255]^T4[f>>>24];c=k-1;d=j^b.rk[c][0];e=m^b.rk[c][1];f=u^b.rk[c][2];g^=b.rk[c][3];h[0]=F1(d,e,f,g)^b.rk[k][0];h[1]=F1(e,f,g,d)^b.rk[k][1];h[2]=F1(f, -g,d,e)^b.rk[k][2];h[3]=F1(g,d,e,f)^b.rk[k][3];return unpackBytes(h)} -function openpgp_cfb_encrypt(a,b,c,d,e,f){var g=Array(d),h=Array(d),a=a+a.charAt(d-2)+a.charAt(d-1);util.print_debug("prefixrandom:"+util.hexstrdump(a));for(var k="",j=0;j b*g;){for(var e=a(f,c),f=d.substring(g*b,g*b+b),j=0;j b*g;){for(var k=a(f,c),f=d.substring(g*b+0,g*b+b+0),e=0;e >8&255]^T3[f>>16&255]^T4[h>>>24],l=T1[e&255]^T2[f>>8&255]^T3[h>>16&255]^T4[d>>>24],o=T1[f&255]^T2[h>>8&255]^T3[d>>16&255]^T4[e>>>24],h=T1[h&255]^T2[d>>8&255]^T3[e>>16&255]^T4[f>>>24];c=k-1;d=j^b.rk[c][0];e=l^b.rk[c][1];f=o^b.rk[c][2];h^=b.rk[c][3];g[0]=F1(d,e,f,h)^b.rk[k][0];g[1]=F1(e,f,h,d)^b.rk[k][1];g[2]=F1(f, +h,d,e)^b.rk[k][2];g[3]=F1(h,d,e,f)^b.rk[k][3];return unpackBytes(g)} +function openpgp_cfb_encrypt(a,b,c,d,e,f){var h=Array(d),g=Array(d),a=a+a.charAt(d-2)+a.charAt(d-1);util.print_debug("prefixrandom:"+util.hexstrdump(a));for(var k="",j=0;j b*h;){for(var e=a(f,c),f=d.substring(h*b,h*b+b),j=0;j b*h;){for(var k=a(f,c),f=d.substring(h*b+0,h*b+b+0),e=0;e >5]|=(a.charCodeAt(d/8)&255)<<24-d%32;return b},c=function(a){var b=[],c=a.length,d,e;for(d=0;d >3]|=e<<24-4*(d%8)}return b},d=function(a){var b="",c=4*a.length,d,e;for(d=0;d >2]>>8*(3-d%4),b+="0123456789abcdef".charAt(e>>4&15)+"0123456789abcdef".charAt(e&15);return b},e=function(a){var b= -"",c=4*a.length,d,e,f;for(d=0;d >2]>>8*(3-d%4)&255)<<16|(a[d+1>>2]>>8*(3-(d+1)%4)&255)<<8|a[d+2>>2]>>8*(3-(d+2)%4)&255;for(e=0;4>e;e+=1)b=8*d+6*e<=32*a.length?b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>6*(3-e)&63):b+""}return b},f=function(a){for(var b="",c=0;c<32*a.length;c+=8)b+=String.fromCharCode(a[c>>5]>>>24-c%32&255);return b},g=function(a,b){return a<>>32-b},h=function(a,b){return a>>>b|a<<32-b},k=function(b,c){return 32>=c?new a(b.highOrder>>> -c|b.lowOrder<<32-c,b.lowOrder>>>c|b.highOrder<<32-c):new a(b.lowOrder>>>c|b.highOrder<<32-c,b.highOrder>>>c|b.lowOrder<<32-c)},j=function(b,c){return 32>=c?new a(b.highOrder>>>c,b.lowOrder>>>c|b.highOrder<<32-c):new a(0,b.highOrder<<32-c)},m=function(a,b,c){return a&b^~a&c},u=function(b,c,d){return new a(b.highOrder&c.highOrder^~b.highOrder&d.highOrder,b.lowOrder&c.lowOrder^~b.lowOrder&d.lowOrder)},D=function(a,b,c){return a&b^a&c^b&c},l=function(b,c,d){return new a(b.highOrder&c.highOrder^b.highOrder& -d.highOrder^c.highOrder&d.highOrder,b.lowOrder&c.lowOrder^b.lowOrder&d.lowOrder^c.lowOrder&d.lowOrder)},p=function(a){return h(a,2)^h(a,13)^h(a,22)},W=function(b){var c=k(b,28),d=k(b,34),b=k(b,39);return new a(c.highOrder^d.highOrder^b.highOrder,c.lowOrder^d.lowOrder^b.lowOrder)},L=function(a){return h(a,6)^h(a,11)^h(a,25)},z=function(b){var c=k(b,14),d=k(b,18),b=k(b,41);return new a(c.highOrder^d.highOrder^b.highOrder,c.lowOrder^d.lowOrder^b.lowOrder)},o=function(a){return h(a,7)^h(a,18)^a>>>3}, -A=function(b){var c=k(b,1),d=k(b,8),b=j(b,7);return new a(c.highOrder^d.highOrder^b.highOrder,c.lowOrder^d.lowOrder^b.lowOrder)},ka=function(a){return h(a,17)^h(a,19)^a>>>10},na=function(b){var c=k(b,19),d=k(b,61),b=j(b,6);return new a(c.highOrder^d.highOrder^b.highOrder,c.lowOrder^d.lowOrder^b.lowOrder)},fa=function(a,b){var c=(a&65535)+(b&65535);return((a>>>16)+(b>>>16)+(c>>>16)&65535)<<16|c&65535},la=function(a,b,c,d){var e=(a&65535)+(b&65535)+(c&65535)+(d&65535);return((a>>>16)+(b>>>16)+(c>>> -16)+(d>>>16)+(e>>>16)&65535)<<16|e&65535},O=function(a,b,c,d,e){var f=(a&65535)+(b&65535)+(c&65535)+(d&65535)+(e&65535);return((a>>>16)+(b>>>16)+(c>>>16)+(d>>>16)+(e>>>16)+(f>>>16)&65535)<<16|f&65535},M=function(b,c){var d,e,f;d=(b.lowOrder&65535)+(c.lowOrder&65535);e=(b.lowOrder>>>16)+(c.lowOrder>>>16)+(d>>>16);f=(e&65535)<<16|d&65535;d=(b.highOrder&65535)+(c.highOrder&65535)+(e>>>16);e=(b.highOrder>>>16)+(c.highOrder>>>16)+(d>>>16);return new a((e&65535)<<16|d&65535,f)},Z=function(b,c,d,e){var f, -g,h;f=(b.lowOrder&65535)+(c.lowOrder&65535)+(d.lowOrder&65535)+(e.lowOrder&65535);g=(b.lowOrder>>>16)+(c.lowOrder>>>16)+(d.lowOrder>>>16)+(e.lowOrder>>>16)+(f>>>16);h=(g&65535)<<16|f&65535;f=(b.highOrder&65535)+(c.highOrder&65535)+(d.highOrder&65535)+(e.highOrder&65535)+(g>>>16);g=(b.highOrder>>>16)+(c.highOrder>>>16)+(d.highOrder>>>16)+(e.highOrder>>>16)+(f>>>16);return new a((g&65535)<<16|f&65535,h)},qa=function(b,c,d,e,f){var g,h,j;g=(b.lowOrder&65535)+(c.lowOrder&65535)+(d.lowOrder&65535)+(e.lowOrder& -65535)+(f.lowOrder&65535);h=(b.lowOrder>>>16)+(c.lowOrder>>>16)+(d.lowOrder>>>16)+(e.lowOrder>>>16)+(f.lowOrder>>>16)+(g>>>16);j=(h&65535)<<16|g&65535;g=(b.highOrder&65535)+(c.highOrder&65535)+(d.highOrder&65535)+(e.highOrder&65535)+(f.highOrder&65535)+(h>>>16);h=(b.highOrder>>>16)+(c.highOrder>>>16)+(d.highOrder>>>16)+(e.highOrder>>>16)+(f.highOrder>>>16)+(g>>>16);return new a((h&65535)<<16|g&65535,j)},ea=function(a,b){var c=[],d,e,f,h,j,k,m,l,p,o=[1732584193,4023233417,2562383102,271733878,3285377520], -u=[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];a[b>>5]|=128<<24-b%32;a[(b+65>>9<<4)+15]=b;p=a.length;for(m=0;m l;l+=1)c[l]= -16>l?a[l+m]:g(c[l-3]^c[l-8]^c[l-14]^c[l-16],1),k=20>l?O(g(d,5),e&f^~e&h,j,u[l],c[l]):40>l?O(g(d,5),e^f^h,j,u[l],c[l]):60>l?O(g(d,5),D(e,f,h),j,u[l],c[l]):O(g(d,5),e^f^h,j,u[l],c[l]),j=h,h=f,f=g(e,30),e=d,d=k;o[0]=fa(d,o[0]);o[1]=fa(e,o[1]);o[2]=fa(f,o[2]);o[3]=fa(h,o[3]);o[4]=fa(j,o[4])}return o},ca=function(b,c,d){var e,f,g,h,j,k,ga,ca,ea,B,da,ma,ia,Ba,va,ja,wa,xa,ya,za,ta,ra,Aa,pa,t,ua,ba=[],Ea;if("SHA-224"===d||"SHA-256"===d)da=64,e=(c+65>>9<<4)+15,Ba=16,va=1,t=Number,ja=fa,wa=la,xa=O,ya=o,za= -ka,ta=p,ra=L,pa=D,Aa=m,ua=[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],B="SHA-224"===d?[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]:[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];else if("SHA-384"===d||"SHA-512"===d)da=80,e=(c+128>>10<<5)+31,Ba=32,va=2,t=a,ja=M,wa=Z,xa=qa, -ya=A,za=na,ta=W,ra=z,pa=l,Aa=u,ua=[new t(1116352408,3609767458),new t(1899447441,602891725),new t(3049323471,3964484399),new t(3921009573,2173295548),new t(961987163,4081628472),new t(1508970993,3053834265),new t(2453635748,2937671579),new t(2870763221,3664609560),new t(3624381080,2734883394),new t(310598401,1164996542),new t(607225278,1323610764),new t(1426881987,3590304994),new t(1925078388,4068182383),new t(2162078206,991336113),new t(2614888103,633803317),new t(3248222580,3479774868),new t(3835390401, -2666613458),new t(4022224774,944711139),new t(264347078,2341262773),new t(604807628,2007800933),new t(770255983,1495990901),new t(1249150122,1856431235),new t(1555081692,3175218132),new t(1996064986,2198950837),new t(2554220882,3999719339),new t(2821834349,766784016),new t(2952996808,2566594879),new t(3210313671,3203337956),new t(3336571891,1034457026),new t(3584528711,2466948901),new t(113926993,3758326383),new t(338241895,168717936),new t(666307205,1188179964),new t(773529912,1546045734),new t(1294757372, -1522805485),new t(1396182291,2643833823),new t(1695183700,2343527390),new t(1986661051,1014477480),new t(2177026350,1206759142),new t(2456956037,344077627),new t(2730485921,1290863460),new t(2820302411,3158454273),new t(3259730800,3505952657),new t(3345764771,106217008),new t(3516065817,3606008344),new t(3600352804,1432725776),new t(4094571909,1467031594),new t(275423344,851169720),new t(430227734,3100823752),new t(506948616,1363258195),new t(659060556,3750685593),new t(883997877,3785050280),new t(958139571, -3318307427),new t(1322822218,3812723403),new t(1537002063,2003034995),new t(1747873779,3602036899),new t(1955562222,1575990012),new t(2024104815,1125592928),new t(2227730452,2716904306),new t(2361852424,442776044),new t(2428436474,593698344),new t(2756734187,3733110249),new t(3204031479,2999351573),new t(3329325298,3815920427),new t(3391569614,3928383900),new t(3515267271,566280711),new t(3940187606,3454069534),new t(4118630271,4000239992),new t(116418474,1914138554),new t(174292421,2731055270),new t(289380356, -3203993006),new t(460393269,320620315),new t(685471733,587496836),new t(852142971,1086792851),new t(1017036298,365543100),new t(1126000580,2618297676),new t(1288033470,3409855158),new t(1501505948,4234509866),new t(1607167915,987167468),new t(1816402316,1246189591)],B="SHA-384"===d?[new t(3418070365,3238371032),new t(1654270250,914150663),new t(2438529370,812702999),new t(355462360,4144912697),new t(1731405415,4290775857),new t(41048885895,1750603025),new t(3675008525,1694076839),new t(1203062813, -3204075428)]:[new t(1779033703,4089235720),new t(3144134277,2227873595),new t(1013904242,4271175723),new t(2773480762,1595750129),new t(1359893119,2917565137),new t(2600822924,725511199),new t(528734635,4215389547),new t(1541459225,327033209)];b[c>>5]|=128<<24-c%32;b[e]=c;Ea=b.length;for(ma=0;ma
ia?new t(b[ia*va+ma],b[ia*va+ma+1]):wa(za(ba[ia-2]),ba[ia-7],ya(ba[ia-15]),ba[ia-16]),ca=xa(ga,ra(h),Aa(h, -j,k),ua[ia],ba[ia]),ea=ja(ta(c),pa(c,e,f)),ga=k,k=j,j=h,h=ja(g,ca),g=f,f=e,e=c,c=ja(ca,ea);B[0]=ja(c,B[0]);B[1]=ja(e,B[1]);B[2]=ja(f,B[2]);B[3]=ja(g,B[3]);B[4]=ja(h,B[4]);B[5]=ja(j,B[5]);B[6]=ja(k,B[6]);B[7]=ja(ga,B[7])}switch(d){case "SHA-224":return[B[0],B[1],B[2],B[3],B[4],B[5],B[6]];case "SHA-256":return B;case "SHA-384":return[B[0].highOrder,B[0].lowOrder,B[1].highOrder,B[1].lowOrder,B[2].highOrder,B[2].lowOrder,B[3].highOrder,B[3].lowOrder,B[4].highOrder,B[4].lowOrder,B[5].highOrder,B[5].lowOrder]; -case "SHA-512":return[B[0].highOrder,B[0].lowOrder,B[1].highOrder,B[1].lowOrder,B[2].highOrder,B[2].lowOrder,B[3].highOrder,B[3].lowOrder,B[4].highOrder,B[4].lowOrder,B[5].highOrder,B[5].lowOrder,B[6].highOrder,B[6].lowOrder,B[7].highOrder,B[7].lowOrder];default:return[]}},da=function(a,d){this.strToHash=this.strBinLen=this.sha512=this.sha384=this.sha256=this.sha224=this.sha1=null;if("HEX"===d){if(0!==a.length%2)return"TEXT MUST BE IN BYTE INCREMENTS";this.strBinLen=4*a.length;this.strToHash=c(a)}else if("ASCII"=== -d||"undefined"===typeof d)this.strBinLen=8*a.length,this.strToHash=b(a);else return"UNKNOWN TEXT INPUT TYPE"};da.prototype={getHash:function(a,b){var c=null,g=this.strToHash.slice();switch(b){case "HEX":c=d;break;case "B64":c=e;break;case "ASCII":c=f;break;default:return"FORMAT NOT RECOGNIZED"}switch(a){case "SHA-1":if(null===this.sha1)this.sha1=ea(g,this.strBinLen);return c(this.sha1);case "SHA-224":if(null===this.sha224)this.sha224=ca(g,this.strBinLen,a);return c(this.sha224);case "SHA-256":if(null=== -this.sha256)this.sha256=ca(g,this.strBinLen,a);return c(this.sha256);case "SHA-384":if(null===this.sha384)this.sha384=ca(g,this.strBinLen,a);return c(this.sha384);case "SHA-512":if(null===this.sha512)this.sha512=ca(g,this.strBinLen,a);return c(this.sha512);default:return"HASH NOT RECOGNIZED"}},getHMAC:function(a,g,h,j){var k,l,m,o,p;l=[];var u=[];switch(j){case "HEX":j=d;break;case "B64":j=e;break;case "ASCII":j=f;break;default:return"FORMAT NOT RECOGNIZED"}switch(h){case "SHA-1":k=64;p=160;break; -case "SHA-224":k=64;p=224;break;case "SHA-256":k=64;p=256;break;case "SHA-384":k=128;p=384;break;case "SHA-512":k=128;p=512;break;default:return"HASH NOT RECOGNIZED"}if("HEX"===g){if(0!==a.length%2)return"KEY MUST BE IN BYTE INCREMENTS";g=c(a);o=4*a.length}else if("ASCII"===g)g=b(a),o=8*a.length;else return"UNKNOWN KEY INPUT TYPE";a=8*k;m=k/4-1;k o/8&&(g[m]&=4294967040);for(k=0;k<=m;k+=1)l[k]=g[k]^909522486,u[k]=g[k]^1549556828;"SHA-1"===h? -(l=ea(l.concat(this.strToHash),a+this.strBinLen),l=ea(u.concat(l),a+p)):(l=ca(l.concat(this.strToHash),a+this.strBinLen,h),l=ca(u.concat(l),a+p,h));return j(l)}};return da}();function str_sha1(a){return(new jsSHA(a,"ASCII")).getHash("SHA-1","ASCII")}function str_sha224(a){return(new jsSHA(a,"ASCII")).getHash("SHA-224","ASCII")}function str_sha256(a){return(new jsSHA(a,"ASCII")).getHash("SHA-256","ASCII")}function str_sha384(a){return(new jsSHA(a,"ASCII")).getHash("SHA-384","ASCII")} -function str_sha512(a){return(new jsSHA(a,"ASCII")).getHash("SHA-512","ASCII")}var RMDsize=160,X=[];function ROL(a,b){return new Number(a<>>32-b)}function F(a,b,c){return new Number(a^b^c)}function G(a,b,c){return new Number(a&b|~a&c)}function H(a,b,c){return new Number((a|~b)^c)}function I(a,b,c){return new Number(a&c|b&~c)}function J(a,b,c){return new Number(a^(b|~c))} -function mixOneRound(a,b,c,d,e,f,g,h){switch(h){case 0:a+=F(b,c,d)+f+0;break;case 1:a+=G(b,c,d)+f+1518500249;break;case 2:a+=H(b,c,d)+f+1859775393;break;case 3:a+=I(b,c,d)+f+2400959708;break;case 4:a+=J(b,c,d)+f+2840853838;break;case 5:a+=J(b,c,d)+f+1352829926;break;case 6:a+=I(b,c,d)+f+1548603684;break;case 7:a+=H(b,c,d)+f+1836072691;break;case 8:a+=G(b,c,d)+f+2053994217;break;case 9:a+=F(b,c,d)+f+0;break;default:document.write("Bogus round number")}a=ROL(a,g)+e;c=ROL(c,10);h=[];h[0]=a&4294967295; -h[1]=b&4294967295;h[2]=c&4294967295;h[3]=d&4294967295;h[4]=e&4294967295;h[5]=f;h[6]=g;return h}function MDinit(a){a[0]=1732584193;a[1]=4023233417;a[2]=2562383102;a[3]=271733878;a[4]=3285377520} +"",c=4*a.length,d,e,f;for(d=0;d >2]>>8*(3-d%4)&255)<<16|(a[d+1>>2]>>8*(3-(d+1)%4)&255)<<8|a[d+2>>2]>>8*(3-(d+2)%4)&255;for(e=0;4>e;e+=1)b=8*d+6*e<=32*a.length?b+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(f>>6*(3-e)&63):b+""}return b},f=function(a){for(var b="",c=0;c<32*a.length;c+=8)b+=String.fromCharCode(a[c>>5]>>>24-c%32&255);return b},h=function(a,b){return a<>>32-b},g=function(a,b){return a>>>b|a<<32-b},k=function(b,c){return 32>=c?new a(b.highOrder>>> +c|b.lowOrder<<32-c,b.lowOrder>>>c|b.highOrder<<32-c):new a(b.lowOrder>>>c|b.highOrder<<32-c,b.highOrder>>>c|b.lowOrder<<32-c)},j=function(b,c){return 32>=c?new a(b.highOrder>>>c,b.lowOrder>>>c|b.highOrder<<32-c):new a(0,b.highOrder<<32-c)},l=function(a,b,c){return a&b^~a&c},o=function(b,c,d){return new a(b.highOrder&c.highOrder^~b.highOrder&d.highOrder,b.lowOrder&c.lowOrder^~b.lowOrder&d.lowOrder)},s=function(a,b,c){return a&b^a&c^b&c},q=function(b,c,d){return new a(b.highOrder&c.highOrder^b.highOrder& +d.highOrder^c.highOrder&d.highOrder,b.lowOrder&c.lowOrder^b.lowOrder&d.lowOrder^c.lowOrder&d.lowOrder)},m=function(a){return g(a,2)^g(a,13)^g(a,22)},z=function(b){var c=k(b,28),d=k(b,34),b=k(b,39);return new a(c.highOrder^d.highOrder^b.highOrder,c.lowOrder^d.lowOrder^b.lowOrder)},x=function(a){return g(a,6)^g(a,11)^g(a,25)},v=function(b){var c=k(b,14),d=k(b,18),b=k(b,41);return new a(c.highOrder^d.highOrder^b.highOrder,c.lowOrder^d.lowOrder^b.lowOrder)},t=function(a){return g(a,7)^g(a,18)^a>>>3}, +r=function(b){var c=k(b,1),d=k(b,8),b=j(b,7);return new a(c.highOrder^d.highOrder^b.highOrder,c.lowOrder^d.lowOrder^b.lowOrder)},N=function(a){return g(a,17)^g(a,19)^a>>>10},T=function(b){var c=k(b,19),d=k(b,61),b=j(b,6);return new a(c.highOrder^d.highOrder^b.highOrder,c.lowOrder^d.lowOrder^b.lowOrder)},K=function(a,b){var c=(a&65535)+(b&65535);return((a>>>16)+(b>>>16)+(c>>>16)&65535)<<16|c&65535},P=function(a,b,c,d){var e=(a&65535)+(b&65535)+(c&65535)+(d&65535);return((a>>>16)+(b>>>16)+(c>>>16)+ +(d>>>16)+(e>>>16)&65535)<<16|e&65535},M=function(a,b,c,d,e){var f=(a&65535)+(b&65535)+(c&65535)+(d&65535)+(e&65535);return((a>>>16)+(b>>>16)+(c>>>16)+(d>>>16)+(e>>>16)+(f>>>16)&65535)<<16|f&65535},w=function(b,c){var d,e,f;d=(b.lowOrder&65535)+(c.lowOrder&65535);e=(b.lowOrder>>>16)+(c.lowOrder>>>16)+(d>>>16);f=(e&65535)<<16|d&65535;d=(b.highOrder&65535)+(c.highOrder&65535)+(e>>>16);e=(b.highOrder>>>16)+(c.highOrder>>>16)+(d>>>16);return new a((e&65535)<<16|d&65535,f)},B=function(b,c,d,e){var f,g, +h;f=(b.lowOrder&65535)+(c.lowOrder&65535)+(d.lowOrder&65535)+(e.lowOrder&65535);g=(b.lowOrder>>>16)+(c.lowOrder>>>16)+(d.lowOrder>>>16)+(e.lowOrder>>>16)+(f>>>16);h=(g&65535)<<16|f&65535;f=(b.highOrder&65535)+(c.highOrder&65535)+(d.highOrder&65535)+(e.highOrder&65535)+(g>>>16);g=(b.highOrder>>>16)+(c.highOrder>>>16)+(d.highOrder>>>16)+(e.highOrder>>>16)+(f>>>16);return new a((g&65535)<<16|f&65535,h)},W=function(b,c,d,e,f){var g,h,j;g=(b.lowOrder&65535)+(c.lowOrder&65535)+(d.lowOrder&65535)+(e.lowOrder& +65535)+(f.lowOrder&65535);h=(b.lowOrder>>>16)+(c.lowOrder>>>16)+(d.lowOrder>>>16)+(e.lowOrder>>>16)+(f.lowOrder>>>16)+(g>>>16);j=(h&65535)<<16|g&65535;g=(b.highOrder&65535)+(c.highOrder&65535)+(d.highOrder&65535)+(e.highOrder&65535)+(f.highOrder&65535)+(h>>>16);h=(b.highOrder>>>16)+(c.highOrder>>>16)+(d.highOrder>>>16)+(e.highOrder>>>16)+(f.highOrder>>>16)+(g>>>16);return new a((h&65535)<<16|g&65535,j)},E=function(a,b){var c=[],d,e,f,g,j,k,l,m,q,o=[1732584193,4023233417,2562383102,271733878,3285377520], +r=[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];a[b>>5]|=128<<24-b%32;a[(b+65>>9<<4)+15]=b;q=a.length;for(l=0;l m;m+=1)c[m]= +16>m?a[m+l]:h(c[m-3]^c[m-8]^c[m-14]^c[m-16],1),k=20>m?M(h(d,5),e&f^~e&g,j,r[m],c[m]):40>m?M(h(d,5),e^f^g,j,r[m],c[m]):60>m?M(h(d,5),s(e,f,g),j,r[m],c[m]):M(h(d,5),e^f^g,j,r[m],c[m]),j=g,g=f,f=h(e,30),e=d,d=k;o[0]=K(d,o[0]);o[1]=K(e,o[1]);o[2]=K(f,o[2]);o[3]=K(g,o[3]);o[4]=K(j,o[4])}return o},C=function(b,c,d){var e,f,g,h,j,k,V,C,E,u,D,Y,L,fa,ea,Q,ga,ha,ia,ja,ka,la,ma,na,p,oa,ba=[],ra;if("SHA-224"===d||"SHA-256"===d)D=64,e=(c+65>>9<<4)+15,fa=16,ea=1,p=Number,Q=K,ga=P,ha=M,ia=t,ja=N,ka=m,la=x,na=s, +ma=l,oa=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804, +4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],u="SHA-224"===d?[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]:[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];else if("SHA-384"===d||"SHA-512"===d)D=80,e=(c+128>>10<<5)+31,fa=32,ea=2,p=a,Q=w,ga=B,ha=W,ia=r,ja=T,ka=z,la=v,na=q, +ma=o,oa=[new p(1116352408,3609767458),new p(1899447441,602891725),new p(3049323471,3964484399),new p(3921009573,2173295548),new p(961987163,4081628472),new p(1508970993,3053834265),new p(2453635748,2937671579),new p(2870763221,3664609560),new p(3624381080,2734883394),new p(310598401,1164996542),new p(607225278,1323610764),new p(1426881987,3590304994),new p(1925078388,4068182383),new p(2162078206,991336113),new p(2614888103,633803317),new p(3248222580,3479774868),new p(3835390401,2666613458),new p(4022224774, +944711139),new p(264347078,2341262773),new p(604807628,2007800933),new p(770255983,1495990901),new p(1249150122,1856431235),new p(1555081692,3175218132),new p(1996064986,2198950837),new p(2554220882,3999719339),new p(2821834349,766784016),new p(2952996808,2566594879),new p(3210313671,3203337956),new p(3336571891,1034457026),new p(3584528711,2466948901),new p(113926993,3758326383),new p(338241895,168717936),new p(666307205,1188179964),new p(773529912,1546045734),new p(1294757372,1522805485),new p(1396182291, +2643833823),new p(1695183700,2343527390),new p(1986661051,1014477480),new p(2177026350,1206759142),new p(2456956037,344077627),new p(2730485921,1290863460),new p(2820302411,3158454273),new p(3259730800,3505952657),new p(3345764771,106217008),new p(3516065817,3606008344),new p(3600352804,1432725776),new p(4094571909,1467031594),new p(275423344,851169720),new p(430227734,3100823752),new p(506948616,1363258195),new p(659060556,3750685593),new p(883997877,3785050280),new p(958139571,3318307427),new p(1322822218, +3812723403),new p(1537002063,2003034995),new p(1747873779,3602036899),new p(1955562222,1575990012),new p(2024104815,1125592928),new p(2227730452,2716904306),new p(2361852424,442776044),new p(2428436474,593698344),new p(2756734187,3733110249),new p(3204031479,2999351573),new p(3329325298,3815920427),new p(3391569614,3928383900),new p(3515267271,566280711),new p(3940187606,3454069534),new p(4118630271,4000239992),new p(116418474,1914138554),new p(174292421,2731055270),new p(289380356,3203993006),new p(460393269, +320620315),new p(685471733,587496836),new p(852142971,1086792851),new p(1017036298,365543100),new p(1126000580,2618297676),new p(1288033470,3409855158),new p(1501505948,4234509866),new p(1607167915,987167468),new p(1816402316,1246189591)],u="SHA-384"===d?[new p(3418070365,3238371032),new p(1654270250,914150663),new p(2438529370,812702999),new p(355462360,4144912697),new p(1731405415,4290775857),new p(41048885895,1750603025),new p(3675008525,1694076839),new p(1203062813,3204075428)]:[new p(1779033703, +4089235720),new p(3144134277,2227873595),new p(1013904242,4271175723),new p(2773480762,1595750129),new p(1359893119,2917565137),new p(2600822924,725511199),new p(528734635,4215389547),new p(1541459225,327033209)];b[c>>5]|=128<<24-c%32;b[e]=c;ra=b.length;for(Y=0;YL?new p(b[L*ea+Y],b[L*ea+Y+1]):ga(ja(ba[L-2]),ba[L-7],ia(ba[L-15]),ba[L-16]),C=ha(V,la(h),ma(h,j,k),oa[L],ba[L]),E=Q(ka(c),na(c,e,f)),V=k,k=j,j=h, +h=Q(g,C),g=f,f=e,e=c,c=Q(C,E);u[0]=Q(c,u[0]);u[1]=Q(e,u[1]);u[2]=Q(f,u[2]);u[3]=Q(g,u[3]);u[4]=Q(h,u[4]);u[5]=Q(j,u[5]);u[6]=Q(k,u[6]);u[7]=Q(V,u[7])}switch(d){case "SHA-224":return[u[0],u[1],u[2],u[3],u[4],u[5],u[6]];case "SHA-256":return u;case "SHA-384":return[u[0].highOrder,u[0].lowOrder,u[1].highOrder,u[1].lowOrder,u[2].highOrder,u[2].lowOrder,u[3].highOrder,u[3].lowOrder,u[4].highOrder,u[4].lowOrder,u[5].highOrder,u[5].lowOrder];case "SHA-512":return[u[0].highOrder,u[0].lowOrder,u[1].highOrder, +u[1].lowOrder,u[2].highOrder,u[2].lowOrder,u[3].highOrder,u[3].lowOrder,u[4].highOrder,u[4].lowOrder,u[5].highOrder,u[5].lowOrder,u[6].highOrder,u[6].lowOrder,u[7].highOrder,u[7].lowOrder];default:return[]}},D=function(a,d){this.strToHash=this.strBinLen=this.sha512=this.sha384=this.sha256=this.sha224=this.sha1=null;if("HEX"===d){if(0!==a.length%2)return"TEXT MUST BE IN BYTE INCREMENTS";this.strBinLen=4*a.length;this.strToHash=c(a)}else if("ASCII"===d||"undefined"===typeof d)this.strBinLen=8*a.length, +this.strToHash=b(a);else return"UNKNOWN TEXT INPUT TYPE"};D.prototype={getHash:function(a,b){var c=null,g=this.strToHash.slice();switch(b){case "HEX":c=d;break;case "B64":c=e;break;case "ASCII":c=f;break;default:return"FORMAT NOT RECOGNIZED"}switch(a){case "SHA-1":if(null===this.sha1)this.sha1=E(g,this.strBinLen);return c(this.sha1);case "SHA-224":if(null===this.sha224)this.sha224=C(g,this.strBinLen,a);return c(this.sha224);case "SHA-256":if(null===this.sha256)this.sha256=C(g,this.strBinLen,a);return c(this.sha256); +case "SHA-384":if(null===this.sha384)this.sha384=C(g,this.strBinLen,a);return c(this.sha384);case "SHA-512":if(null===this.sha512)this.sha512=C(g,this.strBinLen,a);return c(this.sha512);default:return"HASH NOT RECOGNIZED"}},getHMAC:function(a,g,h,j){var k,l,m,o,q;l=[];var r=[];switch(j){case "HEX":j=d;break;case "B64":j=e;break;case "ASCII":j=f;break;default:return"FORMAT NOT RECOGNIZED"}switch(h){case "SHA-1":k=64;q=160;break;case "SHA-224":k=64;q=224;break;case "SHA-256":k=64;q=256;break;case "SHA-384":k= +128;q=384;break;case "SHA-512":k=128;q=512;break;default:return"HASH NOT RECOGNIZED"}if("HEX"===g){if(0!==a.length%2)return"KEY MUST BE IN BYTE INCREMENTS";g=c(a);o=4*a.length}else if("ASCII"===g)g=b(a),o=8*a.length;else return"UNKNOWN KEY INPUT TYPE";a=8*k;m=k/4-1;k o/8&&(g[m]&=4294967040);for(k=0;k<=m;k+=1)l[k]=g[k]^909522486,r[k]=g[k]^1549556828;"SHA-1"===h?(l=E(l.concat(this.strToHash),a+this.strBinLen),l=E(r.concat(l),a+q)):(l=C(l.concat(this.strToHash), +a+this.strBinLen,h),l=C(r.concat(l),a+q,h));return j(l)}};return D}();function str_sha1(a){return(new jsSHA(a,"ASCII")).getHash("SHA-1","ASCII")}function str_sha224(a){return(new jsSHA(a,"ASCII")).getHash("SHA-224","ASCII")}function str_sha256(a){return(new jsSHA(a,"ASCII")).getHash("SHA-256","ASCII")}function str_sha384(a){return(new jsSHA(a,"ASCII")).getHash("SHA-384","ASCII")}function str_sha512(a){return(new jsSHA(a,"ASCII")).getHash("SHA-512","ASCII")}var RMDsize=160,X=[]; +function ROL(a,b){return new Number(a<>>32-b)}function F(a,b,c){return new Number(a^b^c)}function G(a,b,c){return new Number(a&b|~a&c)}function H(a,b,c){return new Number((a|~b)^c)}function I(a,b,c){return new Number(a&c|b&~c)}function J(a,b,c){return new Number(a^(b|~c))} +function mixOneRound(a,b,c,d,e,f,h,g){switch(g){case 0:a+=F(b,c,d)+f+0;break;case 1:a+=G(b,c,d)+f+1518500249;break;case 2:a+=H(b,c,d)+f+1859775393;break;case 3:a+=I(b,c,d)+f+2400959708;break;case 4:a+=J(b,c,d)+f+2840853838;break;case 5:a+=J(b,c,d)+f+1352829926;break;case 6:a+=I(b,c,d)+f+1548603684;break;case 7:a+=H(b,c,d)+f+1836072691;break;case 8:a+=G(b,c,d)+f+2053994217;break;case 9:a+=F(b,c,d)+f+0;break;default:document.write("Bogus round number")}a=ROL(a,h)+e;c=ROL(c,10);g=[];g[0]=a&4294967295; +g[1]=b&4294967295;g[2]=c&4294967295;g[3]=d&4294967295;g[4]=e&4294967295;g[5]=f;g[6]=h;return g}function MDinit(a){a[0]=1732584193;a[1]=4023233417;a[2]=2562383102;a[3]=271733878;a[4]=3285377520} var ROLs=[[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]],indexes=[[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]]; function compress(a,b){blockA=[];blockB=[];for(var c,d=0;5>d;d++)blockA[d]=new Number(a[d]),blockB[d]=new Number(a[d]);for(var e=0,f=0;5>f;f++)for(d=0;16>d;d++)c=mixOneRound(blockA[(e+0)%5],blockA[(e+1)%5],blockA[(e+2)%5],blockA[(e+3)%5],blockA[(e+4)%5],b[indexes[f][d]],ROLs[f][d],f),blockA[(e+0)%5]=c[0],blockA[(e+1)%5]=c[1],blockA[(e+2)%5]=c[2],blockA[(e+3)%5]=c[3],blockA[(e+4)%5]=c[4],e+=4;e=0;for(f=5;10>f;f++)for(d=0;16>d;d++)c=mixOneRound(blockB[(e+0)%5],blockB[(e+1)%5],blockB[(e+2)%5],blockB[(e+ 3)%5],blockB[(e+4)%5],b[indexes[f][d]],ROLs[f][d],f),blockB[(e+0)%5]=c[0],blockB[(e+1)%5]=c[1],blockB[(e+2)%5]=c[2],blockB[(e+3)%5]=c[3],blockB[(e+4)%5]=c[4],e+=4;blockB[3]+=blockA[2]+a[1];a[1]=a[2]+blockA[3]+blockB[4];a[2]=a[3]+blockA[4]+blockB[0];a[3]=a[4]+blockA[0]+blockB[1];a[4]=a[0]+blockA[1]+blockB[2];a[0]=blockB[3]}function zeroX(a){for(var b=0;16>b;b++)a[b]=0} -function MDfinish(a,b,c,d){var e=Array(16);zeroX(e);for(var f=0,g=0;g<(c&63);g++)e[g>>>2]^=(b.charCodeAt(f++)&255)<<8*(g&3);e[c>>>2&15]^=1<<8*(c&3)+7;55<(c&63)&&(compress(a,e),e=Array(16),zeroX(e));e[14]=c<<3;e[15]=c>>>29|d<<3;compress(a,e)}function BYTES_TO_DWORD(a){var b=(a.charCodeAt(3)&255)<<24,b=b|(a.charCodeAt(2)&255)<<16,b=b|(a.charCodeAt(1)&255)<<8;return b|=a.charCodeAt(0)&255} -function RMD(a){var b=Array(RMDsize/32),c=Array(RMDsize/8),d,e;MDinit(b);d=a.length;var f=Array(16);zeroX(f);var g=0;for(e=d;63 h;h++)f[h]=BYTES_TO_DWORD(a.substr(g,4)),g+=4;compress(b,f)}MDfinish(b,a.substr(g),d,0);for(h=0;h >>2]&255,c[h+1]=b[h>>>2]>>>8&255,c[h+2]=b[h>>>2]>>>16&255,c[h+3]=b[h>>>2]>>>24&255;return c}function RMDstring(a){for(var a=RMD(a),b="",c=0;c >>2]^=(b.charCodeAt(f++)&255)<<8*(h&3);e[c>>>2&15]^=1<<8*(c&3)+7;55<(c&63)&&(compress(a,e),e=Array(16),zeroX(e));e[14]=c<<3;e[15]=c>>>29|d<<3;compress(a,e)}function BYTES_TO_DWORD(a){var b=(a.charCodeAt(3)&255)<<24,b=b|(a.charCodeAt(2)&255)<<16,b=b|(a.charCodeAt(1)&255)<<8;return b|=a.charCodeAt(0)&255} +function RMD(a){var b=Array(RMDsize/32),c=Array(RMDsize/8),d,e;MDinit(b);d=a.length;var f=Array(16);zeroX(f);var h=0;for(e=d;63 g;g++)f[g]=BYTES_TO_DWORD(a.substr(h,4)),h+=4;compress(b,f)}MDfinish(b,a.substr(h),d,0);for(g=0;g >>2]&255,c[g+1]=b[g>>>2]>>>8&255,c[g+2]=b[g>>>2]>>>16&255,c[g+3]=b[g>>>2]>>>24&255;return c}function RMDstring(a){for(var a=RMD(a),b="",c=0;c >>32-e,c)}function ff(a,b,c,d,e,f,g){return cmn(b&c|~b&d,a,b,e,f,g)}function gg(a,b,c,d,e,f,g){return cmn(b&d|c&~d,a,b,e,f,g)}function hh(a,b,c,d,e,f,g){return cmn(b^c^d,a,b,e,f,g)} -function ii(a,b,c,d,e,f,g){return cmn(c^(b|~d),a,b,e,f,g)}function md51(a){txt="";var b=a.length,c=[1732584193,-271733879,-1732584194,271733878],d;for(d=64;d<=a.length;d+=64)md5cycle(c,md5blk(a.substring(d-64,d)));var a=a.substring(d-64),e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(d=0;d >2]|=a.charCodeAt(d)<<(d%4<<3);e[d>>2]|=128<<(d%4<<3);if(55 d;d++)e[d]=0}e[14]=8*b;md5cycle(c,e);return c} +21,1309151649),c=ii(c,d,e,f,b[4],6,-145523070),f=ii(f,c,d,e,b[11],10,-1120210379),e=ii(e,f,c,d,b[2],15,718787259),d=ii(d,e,f,c,b[9],21,-343485551);a[0]=add32(c,a[0]);a[1]=add32(d,a[1]);a[2]=add32(e,a[2]);a[3]=add32(f,a[3])}function cmn(a,b,c,d,e,f){b=add32(add32(b,a),add32(d,f));return add32(b< >>32-e,c)}function ff(a,b,c,d,e,f,h){return cmn(b&c|~b&d,a,b,e,f,h)}function gg(a,b,c,d,e,f,h){return cmn(b&d|c&~d,a,b,e,f,h)}function hh(a,b,c,d,e,f,h){return cmn(b^c^d,a,b,e,f,h)} +function ii(a,b,c,d,e,f,h){return cmn(c^(b|~d),a,b,e,f,h)}function md51(a){txt="";var b=a.length,c=[1732584193,-271733879,-1732584194,271733878],d;for(d=64;d<=a.length;d+=64)md5cycle(c,md5blk(a.substring(d-64,d)));var a=a.substring(d-64),e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(d=0;d >2]|=a.charCodeAt(d)<<(d%4<<3);e[d>>2]|=128<<(d%4<<3);if(55 d;d++)e[d]=0}e[14]=8*b;md5cycle(c,e);return c} function md5blk(a){var b=[],c;for(c=0;64>c;c+=4)b[c>>2]=a.charCodeAt(c)+(a.charCodeAt(c+1)<<8)+(a.charCodeAt(c+2)<<16)+(a.charCodeAt(c+3)<<24);return b}var hex_chr="0123456789abcdef".split("");function rhex(a){for(var b="",c=0;4>c;c++)b+=hex_chr[a>>8*c+4&15]+hex_chr[a>>8*c&15];return b}function hex(a){for(var b=0;b >16)+(b>>16)+(c>>16)<<16|c&65535}); function openpgp_keyring(){this.init=function(){var a=JSON.parse(window.localStorage.getItem("privatekeys")),b=JSON.parse(window.localStorage.getItem("publickeys"));if(null==a||0==a.length)a=[];if(null==b||0==b.length)b=[];this.publicKeys=[];this.privateKeys=[];for(var c=0,d=0;d a;){var e=openpgp_packet.read_packet(b,a,b.length-a);if(null==e){util.print_error("openpgp.msg.messge decrypt:\n[pub/priv_key]parsing ends here @:"+a+" l:"+d);break}else switch(e.tagType){case 2:if(32==e.signatureType)this.revocationSignatures[this.revocationSignatures.length]=e;else if(15 e.signatureType){if(null==this.certificationsignatures)this.certificationSignatures= -[];this.certificationSignatures[this.certificationSignatures.length]=e}else util.print_error("openpgp.msg.messge decrypt:\nunknown signature type directly on key "+e.signatureType+" @"+a);a+=e.packetLength+e.headerLength;break;case 7:this.subKeys[this.subKeys.length]=e;a+=e.packetLength+e.headerLength;a+=e.read_nodes(this.privateKeyPacket,b,a,b.length-a);break;case 17:this.userAttributes[this.userAttributes.length]=e;a+=e.packetLength+e.headerLength;a+=e.read_nodes(this.privateKeyPacket,b,a,b.length- -a);break;case 13:this.userIds[this.userIds.length]=e;a+=e.packetLength+e.headerLength;a+=e.read_nodes(this.privateKeyPacket,b,a,b.length-a);break;default:return this.position=c-this.privateKeyPacket.packetLength-this.privateKeyPacket.headerLength,this.len=a-c}}this.position=c-this.privateKeyPacket.packetLength-this.privateKeyPacket.headerLength;return this.len=a-c};this.decryptSecretMPIs=function(a){return this.privateKeyPacket.decryptSecretMPIs(a)};this.getSubKeyIds=function(){if(4==this.privateKeyPacket.publicKey.version)var a= -[];for(var b=0;b +a;){var e=openpgp_packet.read_packet(b,a,b.length-a);if(null==e){util.print_error("openpgp.msg.messge decrypt:\n[pub/priv_key]parsing ends here @:"+a+" l:"+d);break}else switch(e.tagType){case 2:if(32==e.signatureType)this.revocationSignatures[this.revocationSignatures.length]=e;else if(15 e.signatureType){if(null==this.certificationsignatures)this.certificationSignatures=[];this.certificationSignatures[this.certificationSignatures.length]=e}else util.print_error("openpgp.msg.messge decrypt:\nunknown signature type directly on key "+ +e.signatureType+" @"+a);a+=e.packetLength+e.headerLength;break;case 7:this.subKeys[this.subKeys.length]=e;a+=e.packetLength+e.headerLength;a+=e.read_nodes(this.privateKeyPacket,b,a,b.length-a);break;case 17:this.userAttributes[this.userAttributes.length]=e;a+=e.packetLength+e.headerLength;a+=e.read_nodes(this.privateKeyPacket,b,a,b.length-a);break;case 13:this.userIds[this.userIds.length]=e;a+=e.packetLength+e.headerLength;a+=e.read_nodes(this.privateKeyPacket,b,a,b.length-a);break;default:return this.position= +c-this.privateKeyPacket.packetLength-this.privateKeyPacket.headerLength,this.len=a-c}}this.position=c-this.privateKeyPacket.packetLength-this.privateKeyPacket.headerLength;return this.len=a-c};this.decryptSecretMPIs=function(a){return this.privateKeyPacket.decryptSecretMPIs(a)};this.getSubKeyIds=function(){if(4==this.privateKeyPacket.publicKey.version)var a=[];for(var b=0;b b-11)return-1;var c; hash_headers=[,[48,32,48,12,6,8,42,134,72,134,247,13,2,5,5,0,4,16],[48,33,48,9,6,5,43,14,3,2,26,5,0,4,20],[48,33,48,9,6,5,43,36,3,2,1,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]; function openpgp_encoding_emsa_pkcs1_encode(a,b,c){var d;d=""+String.fromCharCode(0);d+=String.fromCharCode(1);for(var e=0;e >2&63),b=(c&3)<<4):1==g?(e+=b64s.charAt(b|c>>4&15),b=(c&15)<<2):2==g&&(e+=b64s.charAt(b|c>>6&3),f+=1,0==f%60&&(e+="\n"),e+=b64s.charAt(c&63)),f+=1,0==f%60&&(e+="\n"),g+=1,3==g&&(g=0);0 >6-e&255)),e=e+2&7,f=b< >2&63),b=(c&3)<<4):1==h?(e+=b64s.charAt(b|c>>4&15),b=(c&15)<<2):2==h&&(e+=b64s.charAt(b|c>>6&3),f+=1,0==f%60&&(e+="\n"),e+=b64s.charAt(c&63)),f+=1,0==f%60&&(e+="\n"),h+=1,3==h&&(h=0);0 >6-e&255)),e=e+2&7,f=b<