tweb/public/1.053f9f6685b1fd67d1cf.worker.js
Eduard Kuzmenko a9f8400d2a stage
2021-04-08 18:39:04 +04:00

1 line
2.6 KiB
JavaScript

this.webpackChunk([1],{13:function(t,e,n){"use strict";n.r(e),n.d(e,"makePasswordHash",(function(){return s})),n.d(e,"computeSRP",(function(){return j}));var c=n(3),r=n(1),a=n(4),i=n(0),b=function(t,e,n,c){return new(n||(n=Promise))((function(r,a){function i(t){try{s(c.next(t))}catch(t){a(t)}}function b(t){try{s(c.throw(t))}catch(t){a(t)}}function s(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(i,b)}s((c=c.apply(t,e||[])).next())}))};Object(a.b)("SRP",a.a.error);function s(t,e,n){return b(this,void 0,void 0,(function*(){let r="";for(let t=0;t<e.length;t++)r+=String.fromCharCode(e[t]);let a=yield c.a.sha256Hash(r+t+r);a=Object(i.b)(n,a,n),a=yield c.a.sha256Hash(a);let b=yield c.a.pbkdf2(new Uint8Array(a),e,1e5);return b=Object(i.b)(n,b,n),a=yield c.a.sha256Hash(b),a}))}function j(t,e,n){return b(this,void 0,void 0,(function*(){const a=n?e.new_algo:e.current_algo,j=Object(r.y)(Object(i.g)(a.p),16),O=Object(r.y)(Object(i.g)(e.srp_B),16),o=Object(r.o)(a.g,32,256),h=yield s(t,new Uint8Array(a.salt1),new Uint8Array(a.salt2)),l=Object(r.y)(Object(i.g)(new Uint8Array(h)),16),u=function(t,e,n=0){return Array(e).fill(n).concat(t).slice(-e)},y=u(Object(i.e)(Object(r.d)(j,16)),256),d=u(Object(i.e)(Object(r.d)(o,16)),256),f=u(Object(i.e)(Object(r.d)(O,16)),256),w=Object(r.w)(o,l,j),A=t=>{const e=new Uint8Array(t.length);for(let n=0;n<t.length;n+=4)e[n]=t[n+3],e[n+1]=t[n+2],e[n+2]=t[n+1],e[n+3]=t[n];return e};if(n){return u(Object(i.e)(Object(r.d)(w,16)),256)}let g=yield c.a.sha256Hash(Object(i.a)(y,d));g=Object(r.y)(Object(i.g)(new Uint8Array(g)),16);const U=Object(r.r)(Object(r.s)(g,w),j),H=(t,e)=>{const n=Object(r.z)(e,t);return!(Object(r.t)(n)||Object(r.e)(n)<1984||Object(r.e)(t)<1984||Math.floor((Object(r.e)(t)+7)/8)>256)};let p,{a:_,a_for_hash:v,u:P}=yield(()=>b(this,void 0,void 0,(function*(){for(;;){const t=Object(r.y)(Object(i.g)(A(e.secure_random)),16),n=Object(r.w)(o,t,j);if(H(n,j)){const e=Object(i.e)(Object(r.d)(n,16)),a=yield c.a.sha256Hash(Object(i.a)(new Uint8Array(e),new Uint8Array(f))),b=Object(r.y)(Object(i.g)(new Uint8Array(a)),16);if(!Object(r.p)(b)&&!Object(r.t)(b))return{a:t,a_for_hash:e,u:b}}}})))();p=Object(r.n)(O,U)?O:Object(r.a)(O,j),p=Object(r.r)(Object(r.z)(p,U),j);let k=Object(r.s)(P,l),m=Object(r.a)(_,k),C=Object(r.w)(p,m,j),S=yield c.a.sha256Hash(u(Object(i.e)(Object(r.d)(C,16)),256)),R=yield c.a.sha256Hash(y),x=yield c.a.sha256Hash(d);R=Object(i.i)(new Uint8Array(R),new Uint8Array(x));let z=Object(i.b)(R,yield c.a.sha256Hash(a.salt1),yield c.a.sha256Hash(a.salt2),v,f,S),M=yield c.a.sha256Hash(z);return{_:"inputCheckPasswordSRP",srp_id:e.srp_id,A:new Uint8Array(v),M1:new Uint8Array(M)}}))}}});