hfs 3.3.0-rc5 → 3.3.0-rc6b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/frontend/assets/{dist-legacy-BwOLCt69.js → dist-legacy-C6QgEp6D.js} +1 -1
- package/frontend/assets/{index-legacy-BrUKT6jx.js → index-legacy-BmqEJ8j7.js} +1 -1
- package/frontend/assets/{lib-legacy-Dtus09cI.js → lib-legacy-CsRW6Dqy.js} +1 -1
- package/frontend/assets/{sha512-legacy-CBENfTz7.js → sha512-legacy-CBsqn3LH.js} +1 -1
- package/frontend/index.html +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/src/serveGuiFiles.js +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){function e(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var r,n,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.toStringTag||"@@toStringTag";function a(e,i,o,u){var a=i&&i.prototype instanceof c?i:c,f=Object.create(a.prototype);return t(f,"_invoke",function(e,t,i){var o,u,a,c=0,f=i||[],h=!1,l={p:0,n:0,v:r,a:v,f:v.bind(r,4),d:function(e,t){return o=e,u=0,a=r,l.n=t,s}};function v(e,t){for(u=e,a=t,n=0;!h&&c&&!i&&n<f.length;n++){var i,o=f[n],v=l.p,p=o[2];e>3?(i=p===t)&&(a=o[(u=o[4])?5:(u=3,3)],o[4]=o[5]=r):o[0]<=v&&((i=e<2&&v<o[1])?(u=0,l.v=t,l.n=o[1]):v<p&&(i=e<3||o[0]>t||t>p)&&(o[4]=e,o[5]=t,l.n=p,u=0))}if(i||e>1)return s;throw h=!0,t}return function(i,f,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===f&&v(f,p),u=f,a=p;(n=u<2?r:a)||!h;){o||(u?u<3?(u>1&&(l.n=-1),v(u,a)):l.n=a:l.v=a);try{if(c=2,o){if(u||(i="next"),n=o[i]){if(!(n=n.call(o,a)))throw TypeError("iterator result is not an object");if(!n.done)return n;a=n.value,u<2&&(u=0)}else 1===u&&(n=o.return)&&n.call(o),u<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),u=1);o=r}else if((n=(h=l.n<0)?a:e.call(t,l))!==s)break}catch(n){o=r,u=1,a=n}finally{c=1}}return{value:n,done:h}}}(e,o,u),!0),f}var s={};function c(){}function f(){}function h(){}n=Object.getPrototypeOf;var l=[][o]?n(n([][o]())):(t(n={},o,(function(){return this})),n),v=h.prototype=c.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,t(e,u,"GeneratorFunction")),e.prototype=Object.create(v),e}return f.prototype=h,t(v,"constructor",h),t(h,"constructor",f),f.displayName="GeneratorFunction",t(h,u,"GeneratorFunction"),t(v),t(v,u,"Generator"),t(v,o,(function(){return this})),t(v,"toString",(function(){return"[object Generator]"})),(e=function(){return{w:a,m:p}})()}function t(e,r,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}t=function(e,r,n,i){function u(r,n){t(e,r,(function(e){return this._invoke(r,n,e)}))}r?o?o(e,r,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[r]=n:(u("next",0),u("throw",1),u("return",2))},t(e,r,n,i)}function r(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}System.register(["./index-legacy-BrUKT6jx.js"],(function(t,n){var i,u,s,c,f,h,l,v;return{setters:[function(e){i=e.t}],execute:function(){u=i((function(e,t){t.exports={}})),s=i((function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.crossEnvCrypto=void 0;try{var t="undefined"!=typeof window&&window.crypto||u().webcrypto;if(t){if(!t.subtle)throw new Error("Crypto.Subtle is undefined. Make sure you are using HTTPS in a compatible browser.");var r=function(e){return function(r){return t.subtle.digest(e,r)}};e.crossEnvCrypto={randomBytes:t.getRandomValues.bind(t),hashFunctions:{SHA1:r("SHA-1"),SHA256:r("SHA-256"),SHA384:r("SHA-384"),SHA512:r("SHA-512")}}}else{var n=u(),i=function(e){return function(t){return n.createHash(e).update(t).digest().buffer}};e.crossEnvCrypto={randomBytes:n.randomFillSync,hashFunctions:{SHA1:i("sha1"),SHA256:i("sha256"),SHA384:i("sha384"),SHA512:i("sha512")}}}}catch(o){throw console.error(o),new Error("No suitable crypto library was found. You may need a polyfill.")}})),c=i((function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SRPParameters=void 0;var t=s(),r=o((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.PrimeGroup[2048],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.H.SHA512;if(a(this,e),this.primeGroup=t,this.H=r,this.NBits=this.primeGroup.N.toString(2).length,!r)throw new Error("Hash function required")}));e.SRPParameters=r,r.PrimeGroup={256:{N:BigInt("125617018995153554710546479714086468244499594888726646874671447258204721048803"),g:BigInt(2)},512:{N:BigInt("11144252439149533417835749556168991736939157778924947037200268358613863350040339017097790259154750906072491181606044774215413467851989724116331597513345603"),g:BigInt(2)},768:{N:BigInt("1087179135105457859072065649059069760280540086975817629066444682366896187793570736574549981488868217843627094867924800342887096064844227836735667168319981288765377499806385489913341488724152562880918438701129530606139552645689583147"),g:BigInt(2)},1024:{N:BigInt("167609434410335061345139523764350090260135525329813904557420930309800865859473551531551523800013916573891864789934747039010546328480848979516637673776605610374669426214776197828492691384519453218253702788022233205683635831626913357154941914129985489522629902540768368409482248290641036967659389658897350067939"),g:BigInt(2)},1536:{N:BigInt("1486998185923128292816507353619409521152457662596380074614818966810244974827752411420380336514078832314731499938313197533147998565301020797040787428051479639316928015998415709101293902971072960487527411068082311763171549170528008620813391411445907584912865222076100726050255271567749213905330659264908657221124284665444825474741087704974475795505492821585749417639344967192301749033325359286273431675492866492416941152646940908101472416714421046022696100064262587"),g:BigInt(2)},2048:{N:BigInt("21766174458617435773191008891802753781907668374255538511144643224689886235383840957210909013086056401571399717235807266581649606472148410291413364152197364477180887395655483738115072677402235101762521901569820740293149529620419333266262073471054548368736039519702486226506248861060256971802984953561121442680157668000761429988222457090413873973970171927093992114751765168063614761119615476233422096442783117971236371647333871414335895773474667308967050807005509320424799678417036867928316761272274230314067548291133582479583061439577559347101961771406173684378522703483495337037655006751328447510550299250924469288819"),g:BigInt(2)}},r.H={SHA1:t.crossEnvCrypto.hashFunctions.SHA1,SHA256:t.crossEnvCrypto.hashFunctions.SHA256,SHA384:t.crossEnvCrypto.hashFunctions.SHA384,SHA512:t.crossEnvCrypto.hashFunctions.SHA512}})),f=i((function(t){var n=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.modPow=t.hashBitCount=t.createVerifierAndSalt=t.createVerifier=t.generateRandomBigInt=t.generateRandomString=t.hashPadded=t.hash=t.padStartArrayBuffer=t.stringToArrayBuffer=t.arrayBufferToBigInt=t.bigIntToArrayBuffer=void 0;var i=s(),o=BigInt(0),u=BigInt(1),a=BigInt(2);t.bigIntToArrayBuffer=function(e){var t=e.toString(16),r=new ArrayBuffer(Math.ceil(t.length/2)),n=new Uint8Array(r),i=0;t.length%2!=0&&(n[0]=parseInt(t[0],16),i=1);for(var o=0;o<r.byteLength;o++)n[o+i]=parseInt(t.slice(2*o+i,2*o+2+i),16);return r};t.arrayBufferToBigInt=function(e){var t=[];return new Uint8Array(e).forEach((function(e){t.push(("0"+e.toString(16)).slice(-2))})),BigInt(`0x${t.join("")}`)},t.stringToArrayBuffer=function(e){return(new TextEncoder).encode(e).buffer};function c(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=r.reduce((function(e,t){return e+t.byteLength}),0),o=new Uint8Array(i),u=0,a=0;a<r.length;a++)o.set(new Uint8Array(r[a]),u),u+=r[a].byteLength;return e.H(o)}function f(t,r,i,o){return n(this,void 0,void 0,e().m((function n(){var u;return e().w((function(e){for(;;)switch(e.n){case 0:if(r&&r.trim()){e.n=1;break}throw new Error("Identity (I) must not be null or empty.");case 1:if(i){e.n=2;break}throw new Error("Salt (s) must not be null.");case 2:if(o){e.n=3;break}throw new Error("Password (P) must not be null");case 3:return e.n=4,t.computeX(r,i,o);case 4:return u=e.v,e.a(2,t.computeVerifier(u))}}),n)})))}t.padStartArrayBuffer=function(e,t){var r=new Uint8Array(e);if(r.length<t){var n=new Uint8Array(t);return n.fill(0,0,t-r.length),n.set(r,t-r.length),n}return r},t.hash=c,t.hashPadded=function(e,n){for(var i=arguments.length,o=new Array(i>2?i-2:0),u=2;u<i;u++)o[u-2]=arguments[u];return c.apply(void 0,[e].concat(r(o.map((function(e){return t.padStartArrayBuffer(e,n)})))))},t.generateRandomString=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=new Uint8Array(Math.ceil(Math.ceil(e/2)));return i.crossEnvCrypto.randomBytes(t),t.reduce((function(e,t){var r=t.toString(16).toString();return 1===r.length?e+"0"+r:e+r}),"").slice(0,e)},t.generateRandomBigInt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return t.arrayBufferToBigInt(h(e))},t.createVerifier=f,t.createVerifierAndSalt=function(t,r,i,o){return n(this,void 0,void 0,e().m((function n(){var u,a,s;return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,t.generateRandomSalt(o);case 1:return u=e.v,a=u,e.n=2,f(t,r,u,i);case 2:return s=e.v,e.a(2,{s:a,v:s})}}),n)})))};t.hashBitCount=function(r){return n(void 0,void 0,void 0,e().m((function n(){var i;return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,c(r,t.bigIntToArrayBuffer(BigInt(1)));case 1:return i=e.v.byteLength,e.a(2,8*i)}}),n)})))},t.modPow=function(e,t,r){for(var n=u;t>o;)t%a==u?(n=e*n%r,t-=u):(e=e*e%r,t/=a);return n};var h=function(e){var t=new Uint8Array(e);return i.crossEnvCrypto.randomBytes(t),t.buffer}})),h=i((function(t){var r=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPRoutines=void 0;var n=f(),i=function(){return o((function e(t){a(this,e),this.parameters=t}),[{key:"hash",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.hash.apply(n,[this.parameters].concat(t))}},{key:"hashPadded",value:function(){for(var e=Math.trunc((this.parameters.NBits+7)/8),t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return n.hashPadded.apply(n,[this.parameters,e].concat(r))}},{key:"computeK",value:function(){return r(this,void 0,void 0,e().m((function t(){var r;return e().w((function(e){for(;;)switch(e.n){case 0:return r=n,e.n=1,this.hashPadded(n.bigIntToArrayBuffer(this.parameters.primeGroup.N),n.bigIntToArrayBuffer(this.parameters.primeGroup.g));case 1:return e.a(2,r.arrayBufferToBigInt.call(r,e.v))}}),t,this)})))}},{key:"generateRandomSalt",value:function(t){return r(this,void 0,void 0,e().m((function r(){var i,o;return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,n.hashBitCount(this.parameters);case 1:return i=e.v,o=t||2*i/8,e.a(2,n.generateRandomBigInt(o))}}),r,this)})))}},{key:"computeX",value:function(t,i,o){return r(this,void 0,void 0,e().m((function r(){var u,a,s;return e().w((function(e){for(;;)switch(e.n){case 0:return u=n,a=this,s=n.bigIntToArrayBuffer(i),e.n=1,this.computeIdentityHash(t,o);case 1:return e.n=2,a.hash.call(a,s,e.v);case 2:return e.a(2,u.arrayBufferToBigInt.call(u,e.v))}}),r,this)})))}},{key:"computeXStep2",value:function(t,i){return r(this,void 0,void 0,e().m((function r(){var o;return e().w((function(e){for(;;)switch(e.n){case 0:return o=n,e.n=1,this.hash(n.bigIntToArrayBuffer(t),i);case 1:return e.a(2,o.arrayBufferToBigInt.call(o,e.v))}}),r,this)})))}},{key:"computeIdentityHash",value:function(t,i){return r(this,void 0,void 0,e().m((function t(){return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,this.hash(n.stringToArrayBuffer(i));case 1:return e.a(2,e.v)}}),t,this)})))}},{key:"computeVerifier",value:function(e){return n.modPow(this.parameters.primeGroup.g,e,this.parameters.primeGroup.N)}},{key:"generatePrivateValue",value:function(){var e,t=Math.max(256,this.parameters.NBits);do{e=n.generateRandomBigInt(t/8)%this.parameters.primeGroup.N}while(e===BigInt(0));return e}},{key:"computeClientPublicValue",value:function(e){return n.modPow(this.parameters.primeGroup.g,e,this.parameters.primeGroup.N)}},{key:"isValidPublicValue",value:function(e){return e%this.parameters.primeGroup.N!==BigInt(0)}},{key:"computeU",value:function(t,i){return r(this,void 0,void 0,e().m((function r(){var o;return e().w((function(e){for(;;)switch(e.n){case 0:return o=n,e.n=1,this.hashPadded(n.bigIntToArrayBuffer(t),n.bigIntToArrayBuffer(i));case 1:return e.a(2,o.arrayBufferToBigInt.call(o,e.v))}}),r,this)})))}},{key:"computeClientEvidence",value:function(t,i,o,u,a){return r(this,void 0,void 0,e().m((function t(){var r;return e().w((function(e){for(;;)switch(e.n){case 0:return r=n,e.n=1,this.hash(n.bigIntToArrayBuffer(o),n.bigIntToArrayBuffer(u),n.bigIntToArrayBuffer(a));case 1:return e.a(2,r.arrayBufferToBigInt.call(r,e.v))}}),t,this)})))}},{key:"computeServerEvidence",value:function(t,i,o){return r(this,void 0,void 0,e().m((function r(){var u;return e().w((function(e){for(;;)switch(e.n){case 0:return u=n,e.n=1,this.hash(n.bigIntToArrayBuffer(t),n.bigIntToArrayBuffer(i),n.bigIntToArrayBuffer(o));case 1:return e.a(2,u.arrayBufferToBigInt.call(u,e.v))}}),r,this)})))}},{key:"computeClientSessionKey",value:function(e,t,r,i,o){var u=this.parameters.primeGroup.N,a=r*t+i,s=n.modPow(this.parameters.primeGroup.g,t,u)*e%u;return n.modPow(o+u-s,a,u)}}])}();t.SRPRoutines=i})),l=i((function(t){var r=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPClientSessionStep2=t.SRPClientSessionStep1=t.SRPClientSession=void 0;var n=function(){return o((function e(t){a(this,e),this.routines=t}),[{key:"step1",value:function(t,n){return r(this,void 0,void 0,e().m((function r(){var o;return e().w((function(e){for(;;)switch(e.n){case 0:if(t&&t.trim()){e.n=1;break}throw new Error("User identity must not be null nor empty");case 1:if(n){e.n=2;break}throw new Error("User password must not be null");case 2:return e.n=3,this.routines.computeIdentityHash(t,n);case 3:return o=e.v,e.a(2,new i(this.routines,t,o))}}),r,this)})))}}])}();t.SRPClientSession=n;var i=function(){function t(e,r,n){a(this,t),this.routines=e,this.I=r,this.IH=n}return o(t,[{key:"step2",value:function(t,n){return r(this,void 0,void 0,e().m((function r(){var i,o,a,s,c,f,h;return e().w((function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}throw new Error("Salt (s) must not be null");case 1:if(n){e.n=2;break}throw new Error("Public server value (B) must not be null");case 2:return e.n=3,this.routines.computeXStep2(t,this.IH);case 3:return i=e.v,o=this.routines.generatePrivateValue(),a=this.routines.computeClientPublicValue(o),e.n=4,this.routines.computeK();case 4:return s=e.v,e.n=5,this.routines.computeU(a,n);case 5:return c=e.v,f=this.routines.computeClientSessionKey(s,i,c,o,n),e.n=6,this.routines.computeClientEvidence(this.I,t,a,n,f);case 6:return h=e.v,e.a(2,new u(this.routines,a,h,f))}}),r,this)})))}},{key:"toJSON",value:function(){return{I:this.I,IH:Array.from(new Uint8Array(this.IH))}}}],[{key:"fromState",value:function(e,r){return new t(e,r.I,new Uint8Array(r.IH).buffer)}}])}();t.SRPClientSessionStep1=i;var u=function(){function t(e,r,n,i){a(this,t),this.routines=e,this.A=r,this.M1=n,this.S=i}return o(t,[{key:"step3",value:function(t){return r(this,void 0,void 0,e().m((function r(){return e().w((function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}throw new Error("Server evidence (M2) must not be null");case 1:return e.n=2,this.routines.computeServerEvidence(this.A,this.M1,this.S);case 2:if(e.v===t){e.n=3;break}throw new Error("Bad server credentials");case 3:return e.a(2)}}),r,this)})))}},{key:"toJSON",value:function(){return{A:this.A.toString(16),M1:this.M1.toString(16),S:this.S.toString(16)}}}],[{key:"fromState",value:function(e,r){return new t(e,BigInt("0x"+r.A),BigInt("0x"+r.M1),BigInt("0x"+r.S))}}])}();t.SRPClientSessionStep2=u})),v=i((function(t){var r=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPServerSessionStep1=t.SRPServerSession=void 0;var n=f(),i=function(){return o((function e(t){a(this,e),this.routines=t}),[{key:"step1",value:function(t,n,i){return r(this,void 0,void 0,e().m((function r(){var o,a,c;return e().w((function(e){for(;;)switch(e.n){case 0:return o=this.routines.generatePrivateValue(),e.n=1,this.routines.computeK();case 1:return a=e.v,c=s(this.routines.parameters,a,i,o),e.a(2,new u(this.routines,t,n,i,o,c))}}),r,this)})))}}])}();t.SRPServerSession=i;var u=function(){function t(e,r,n,i,o,u){a(this,t),this.routines=e,this.identifier=r,this.salt=n,this.verifier=i,this.b=o,this.B=u}return o(t,[{key:"sessionKey",value:function(t){return r(this,void 0,void 0,e().m((function r(){var n;return e().w((function(e){for(;;)switch(e.n){case 0:if(null!==t){e.n=1;break}throw new Error("Client public value (A) must not be null");case 1:if(this.routines.isValidPublicValue(t)){e.n=2;break}throw new Error(`Invalid Client public value (A): ${t.toString(16)}`);case 2:return e.n=3,this.routines.computeU(t,this.B);case 3:return n=e.v,e.a(2,c(this.routines.parameters.primeGroup.N,this.verifier,n,t,this.b))}}),r,this)})))}},{key:"step2",value:function(t,n){return r(this,void 0,void 0,e().m((function r(){var i;return e().w((function(e){for(;;)switch(e.n){case 0:if(n){e.n=1;break}throw new Error("Client evidence (M1) must not be null");case 1:return e.n=2,this.sessionKey(t);case 2:return i=e.v,e.n=3,this.routines.computeClientEvidence(this.identifier,this.salt,t,this.B,i);case 3:if(e.v===n){e.n=4;break}throw new Error("Bad client credentials");case 4:return e.a(2,this.routines.computeServerEvidence(t,n,i))}}),r,this)})))}},{key:"toJSON",value:function(){return{identifier:this.identifier,salt:this.salt.toString(16),verifier:this.verifier.toString(16),b:this.b.toString(16),B:this.B.toString(16)}}}],[{key:"fromState",value:function(e,r){return new t(e,r.identifier,BigInt("0x"+r.salt),BigInt("0x"+r.verifier),BigInt("0x"+r.b),BigInt("0x"+r.B))}}])}();t.SRPServerSessionStep1=u;var s=function(e,t,r,i){return(n.modPow(e.primeGroup.g,i,e.primeGroup.N)+r*t)%e.primeGroup.N},c=function(e,t,r,i,o){return n.modPow(n.modPow(t,r,e)*i,o,e)}})),t("default",i((function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.generateRandomBigInt=e.arrayBufferToBigInt=e.bigIntToArrayBuffer=e.createVerifierAndSalt=e.SRPServerSessionStep1=e.SRPServerSession=e.SRPClientSessionStep2=e.SRPClientSessionStep1=e.SRPClientSession=e.SRPRoutines=e.SRPParameters=void 0;var t=c();Object.defineProperty(e,"SRPParameters",{enumerable:!0,get:function(){return t.SRPParameters}});var r=h();Object.defineProperty(e,"SRPRoutines",{enumerable:!0,get:function(){return r.SRPRoutines}});var n=l();Object.defineProperty(e,"SRPClientSession",{enumerable:!0,get:function(){return n.SRPClientSession}}),Object.defineProperty(e,"SRPClientSessionStep1",{enumerable:!0,get:function(){return n.SRPClientSessionStep1}}),Object.defineProperty(e,"SRPClientSessionStep2",{enumerable:!0,get:function(){return n.SRPClientSessionStep2}});var i=v();Object.defineProperty(e,"SRPServerSession",{enumerable:!0,get:function(){return i.SRPServerSession}}),Object.defineProperty(e,"SRPServerSessionStep1",{enumerable:!0,get:function(){return i.SRPServerSessionStep1}});var o=f();Object.defineProperty(e,"createVerifierAndSalt",{enumerable:!0,get:function(){return o.createVerifierAndSalt}}),Object.defineProperty(e,"bigIntToArrayBuffer",{enumerable:!0,get:function(){return o.bigIntToArrayBuffer}}),Object.defineProperty(e,"arrayBufferToBigInt",{enumerable:!0,get:function(){return o.arrayBufferToBigInt}}),Object.defineProperty(e,"generateRandomBigInt",{enumerable:!0,get:function(){return o.generateRandomBigInt}})}))())}}}))}();
|
|
1
|
+
!function(){function e(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var r,n,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",u=i.toStringTag||"@@toStringTag";function a(e,i,o,u){var a=i&&i.prototype instanceof c?i:c,f=Object.create(a.prototype);return t(f,"_invoke",function(e,t,i){var o,u,a,c=0,f=i||[],h=!1,l={p:0,n:0,v:r,a:v,f:v.bind(r,4),d:function(e,t){return o=e,u=0,a=r,l.n=t,s}};function v(e,t){for(u=e,a=t,n=0;!h&&c&&!i&&n<f.length;n++){var i,o=f[n],v=l.p,p=o[2];e>3?(i=p===t)&&(a=o[(u=o[4])?5:(u=3,3)],o[4]=o[5]=r):o[0]<=v&&((i=e<2&&v<o[1])?(u=0,l.v=t,l.n=o[1]):v<p&&(i=e<3||o[0]>t||t>p)&&(o[4]=e,o[5]=t,l.n=p,u=0))}if(i||e>1)return s;throw h=!0,t}return function(i,f,p){if(c>1)throw TypeError("Generator is already running");for(h&&1===f&&v(f,p),u=f,a=p;(n=u<2?r:a)||!h;){o||(u?u<3?(u>1&&(l.n=-1),v(u,a)):l.n=a:l.v=a);try{if(c=2,o){if(u||(i="next"),n=o[i]){if(!(n=n.call(o,a)))throw TypeError("iterator result is not an object");if(!n.done)return n;a=n.value,u<2&&(u=0)}else 1===u&&(n=o.return)&&n.call(o),u<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),u=1);o=r}else if((n=(h=l.n<0)?a:e.call(t,l))!==s)break}catch(n){o=r,u=1,a=n}finally{c=1}}return{value:n,done:h}}}(e,o,u),!0),f}var s={};function c(){}function f(){}function h(){}n=Object.getPrototypeOf;var l=[][o]?n(n([][o]())):(t(n={},o,(function(){return this})),n),v=h.prototype=c.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,t(e,u,"GeneratorFunction")),e.prototype=Object.create(v),e}return f.prototype=h,t(v,"constructor",h),t(h,"constructor",f),f.displayName="GeneratorFunction",t(h,u,"GeneratorFunction"),t(v),t(v,u,"Generator"),t(v,o,(function(){return this})),t(v,"toString",(function(){return"[object Generator]"})),(e=function(){return{w:a,m:p}})()}function t(e,r,n,i){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}t=function(e,r,n,i){function u(r,n){t(e,r,(function(e){return this._invoke(r,n,e)}))}r?o?o(e,r,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[r]=n:(u("next",0),u("throw",1),u("return",2))},t(e,r,n,i)}function r(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,u(n.key),n)}}function o(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}System.register(["./index-legacy-BmqEJ8j7.js"],(function(t,n){var i,u,s,c,f,h,l,v;return{setters:[function(e){i=e.t}],execute:function(){u=i((function(e,t){t.exports={}})),s=i((function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.crossEnvCrypto=void 0;try{var t="undefined"!=typeof window&&window.crypto||u().webcrypto;if(t){if(!t.subtle)throw new Error("Crypto.Subtle is undefined. Make sure you are using HTTPS in a compatible browser.");var r=function(e){return function(r){return t.subtle.digest(e,r)}};e.crossEnvCrypto={randomBytes:t.getRandomValues.bind(t),hashFunctions:{SHA1:r("SHA-1"),SHA256:r("SHA-256"),SHA384:r("SHA-384"),SHA512:r("SHA-512")}}}else{var n=u(),i=function(e){return function(t){return n.createHash(e).update(t).digest().buffer}};e.crossEnvCrypto={randomBytes:n.randomFillSync,hashFunctions:{SHA1:i("sha1"),SHA256:i("sha256"),SHA384:i("sha384"),SHA512:i("sha512")}}}}catch(o){throw console.error(o),new Error("No suitable crypto library was found. You may need a polyfill.")}})),c=i((function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SRPParameters=void 0;var t=s(),r=o((function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.PrimeGroup[2048],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.H.SHA512;if(a(this,e),this.primeGroup=t,this.H=r,this.NBits=this.primeGroup.N.toString(2).length,!r)throw new Error("Hash function required")}));e.SRPParameters=r,r.PrimeGroup={256:{N:BigInt("125617018995153554710546479714086468244499594888726646874671447258204721048803"),g:BigInt(2)},512:{N:BigInt("11144252439149533417835749556168991736939157778924947037200268358613863350040339017097790259154750906072491181606044774215413467851989724116331597513345603"),g:BigInt(2)},768:{N:BigInt("1087179135105457859072065649059069760280540086975817629066444682366896187793570736574549981488868217843627094867924800342887096064844227836735667168319981288765377499806385489913341488724152562880918438701129530606139552645689583147"),g:BigInt(2)},1024:{N:BigInt("167609434410335061345139523764350090260135525329813904557420930309800865859473551531551523800013916573891864789934747039010546328480848979516637673776605610374669426214776197828492691384519453218253702788022233205683635831626913357154941914129985489522629902540768368409482248290641036967659389658897350067939"),g:BigInt(2)},1536:{N:BigInt("1486998185923128292816507353619409521152457662596380074614818966810244974827752411420380336514078832314731499938313197533147998565301020797040787428051479639316928015998415709101293902971072960487527411068082311763171549170528008620813391411445907584912865222076100726050255271567749213905330659264908657221124284665444825474741087704974475795505492821585749417639344967192301749033325359286273431675492866492416941152646940908101472416714421046022696100064262587"),g:BigInt(2)},2048:{N:BigInt("21766174458617435773191008891802753781907668374255538511144643224689886235383840957210909013086056401571399717235807266581649606472148410291413364152197364477180887395655483738115072677402235101762521901569820740293149529620419333266262073471054548368736039519702486226506248861060256971802984953561121442680157668000761429988222457090413873973970171927093992114751765168063614761119615476233422096442783117971236371647333871414335895773474667308967050807005509320424799678417036867928316761272274230314067548291133582479583061439577559347101961771406173684378522703483495337037655006751328447510550299250924469288819"),g:BigInt(2)}},r.H={SHA1:t.crossEnvCrypto.hashFunctions.SHA1,SHA256:t.crossEnvCrypto.hashFunctions.SHA256,SHA384:t.crossEnvCrypto.hashFunctions.SHA384,SHA512:t.crossEnvCrypto.hashFunctions.SHA512}})),f=i((function(t){var n=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.modPow=t.hashBitCount=t.createVerifierAndSalt=t.createVerifier=t.generateRandomBigInt=t.generateRandomString=t.hashPadded=t.hash=t.padStartArrayBuffer=t.stringToArrayBuffer=t.arrayBufferToBigInt=t.bigIntToArrayBuffer=void 0;var i=s(),o=BigInt(0),u=BigInt(1),a=BigInt(2);t.bigIntToArrayBuffer=function(e){var t=e.toString(16),r=new ArrayBuffer(Math.ceil(t.length/2)),n=new Uint8Array(r),i=0;t.length%2!=0&&(n[0]=parseInt(t[0],16),i=1);for(var o=0;o<r.byteLength;o++)n[o+i]=parseInt(t.slice(2*o+i,2*o+2+i),16);return r};t.arrayBufferToBigInt=function(e){var t=[];return new Uint8Array(e).forEach((function(e){t.push(("0"+e.toString(16)).slice(-2))})),BigInt(`0x${t.join("")}`)},t.stringToArrayBuffer=function(e){return(new TextEncoder).encode(e).buffer};function c(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i=r.reduce((function(e,t){return e+t.byteLength}),0),o=new Uint8Array(i),u=0,a=0;a<r.length;a++)o.set(new Uint8Array(r[a]),u),u+=r[a].byteLength;return e.H(o)}function f(t,r,i,o){return n(this,void 0,void 0,e().m((function n(){var u;return e().w((function(e){for(;;)switch(e.n){case 0:if(r&&r.trim()){e.n=1;break}throw new Error("Identity (I) must not be null or empty.");case 1:if(i){e.n=2;break}throw new Error("Salt (s) must not be null.");case 2:if(o){e.n=3;break}throw new Error("Password (P) must not be null");case 3:return e.n=4,t.computeX(r,i,o);case 4:return u=e.v,e.a(2,t.computeVerifier(u))}}),n)})))}t.padStartArrayBuffer=function(e,t){var r=new Uint8Array(e);if(r.length<t){var n=new Uint8Array(t);return n.fill(0,0,t-r.length),n.set(r,t-r.length),n}return r},t.hash=c,t.hashPadded=function(e,n){for(var i=arguments.length,o=new Array(i>2?i-2:0),u=2;u<i;u++)o[u-2]=arguments[u];return c.apply(void 0,[e].concat(r(o.map((function(e){return t.padStartArrayBuffer(e,n)})))))},t.generateRandomString=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=new Uint8Array(Math.ceil(Math.ceil(e/2)));return i.crossEnvCrypto.randomBytes(t),t.reduce((function(e,t){var r=t.toString(16).toString();return 1===r.length?e+"0"+r:e+r}),"").slice(0,e)},t.generateRandomBigInt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return t.arrayBufferToBigInt(h(e))},t.createVerifier=f,t.createVerifierAndSalt=function(t,r,i,o){return n(this,void 0,void 0,e().m((function n(){var u,a,s;return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,t.generateRandomSalt(o);case 1:return u=e.v,a=u,e.n=2,f(t,r,u,i);case 2:return s=e.v,e.a(2,{s:a,v:s})}}),n)})))};t.hashBitCount=function(r){return n(void 0,void 0,void 0,e().m((function n(){var i;return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,c(r,t.bigIntToArrayBuffer(BigInt(1)));case 1:return i=e.v.byteLength,e.a(2,8*i)}}),n)})))},t.modPow=function(e,t,r){for(var n=u;t>o;)t%a==u?(n=e*n%r,t-=u):(e=e*e%r,t/=a);return n};var h=function(e){var t=new Uint8Array(e);return i.crossEnvCrypto.randomBytes(t),t.buffer}})),h=i((function(t){var r=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPRoutines=void 0;var n=f(),i=function(){return o((function e(t){a(this,e),this.parameters=t}),[{key:"hash",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.hash.apply(n,[this.parameters].concat(t))}},{key:"hashPadded",value:function(){for(var e=Math.trunc((this.parameters.NBits+7)/8),t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return n.hashPadded.apply(n,[this.parameters,e].concat(r))}},{key:"computeK",value:function(){return r(this,void 0,void 0,e().m((function t(){var r;return e().w((function(e){for(;;)switch(e.n){case 0:return r=n,e.n=1,this.hashPadded(n.bigIntToArrayBuffer(this.parameters.primeGroup.N),n.bigIntToArrayBuffer(this.parameters.primeGroup.g));case 1:return e.a(2,r.arrayBufferToBigInt.call(r,e.v))}}),t,this)})))}},{key:"generateRandomSalt",value:function(t){return r(this,void 0,void 0,e().m((function r(){var i,o;return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,n.hashBitCount(this.parameters);case 1:return i=e.v,o=t||2*i/8,e.a(2,n.generateRandomBigInt(o))}}),r,this)})))}},{key:"computeX",value:function(t,i,o){return r(this,void 0,void 0,e().m((function r(){var u,a,s;return e().w((function(e){for(;;)switch(e.n){case 0:return u=n,a=this,s=n.bigIntToArrayBuffer(i),e.n=1,this.computeIdentityHash(t,o);case 1:return e.n=2,a.hash.call(a,s,e.v);case 2:return e.a(2,u.arrayBufferToBigInt.call(u,e.v))}}),r,this)})))}},{key:"computeXStep2",value:function(t,i){return r(this,void 0,void 0,e().m((function r(){var o;return e().w((function(e){for(;;)switch(e.n){case 0:return o=n,e.n=1,this.hash(n.bigIntToArrayBuffer(t),i);case 1:return e.a(2,o.arrayBufferToBigInt.call(o,e.v))}}),r,this)})))}},{key:"computeIdentityHash",value:function(t,i){return r(this,void 0,void 0,e().m((function t(){return e().w((function(e){for(;;)switch(e.n){case 0:return e.n=1,this.hash(n.stringToArrayBuffer(i));case 1:return e.a(2,e.v)}}),t,this)})))}},{key:"computeVerifier",value:function(e){return n.modPow(this.parameters.primeGroup.g,e,this.parameters.primeGroup.N)}},{key:"generatePrivateValue",value:function(){var e,t=Math.max(256,this.parameters.NBits);do{e=n.generateRandomBigInt(t/8)%this.parameters.primeGroup.N}while(e===BigInt(0));return e}},{key:"computeClientPublicValue",value:function(e){return n.modPow(this.parameters.primeGroup.g,e,this.parameters.primeGroup.N)}},{key:"isValidPublicValue",value:function(e){return e%this.parameters.primeGroup.N!==BigInt(0)}},{key:"computeU",value:function(t,i){return r(this,void 0,void 0,e().m((function r(){var o;return e().w((function(e){for(;;)switch(e.n){case 0:return o=n,e.n=1,this.hashPadded(n.bigIntToArrayBuffer(t),n.bigIntToArrayBuffer(i));case 1:return e.a(2,o.arrayBufferToBigInt.call(o,e.v))}}),r,this)})))}},{key:"computeClientEvidence",value:function(t,i,o,u,a){return r(this,void 0,void 0,e().m((function t(){var r;return e().w((function(e){for(;;)switch(e.n){case 0:return r=n,e.n=1,this.hash(n.bigIntToArrayBuffer(o),n.bigIntToArrayBuffer(u),n.bigIntToArrayBuffer(a));case 1:return e.a(2,r.arrayBufferToBigInt.call(r,e.v))}}),t,this)})))}},{key:"computeServerEvidence",value:function(t,i,o){return r(this,void 0,void 0,e().m((function r(){var u;return e().w((function(e){for(;;)switch(e.n){case 0:return u=n,e.n=1,this.hash(n.bigIntToArrayBuffer(t),n.bigIntToArrayBuffer(i),n.bigIntToArrayBuffer(o));case 1:return e.a(2,u.arrayBufferToBigInt.call(u,e.v))}}),r,this)})))}},{key:"computeClientSessionKey",value:function(e,t,r,i,o){var u=this.parameters.primeGroup.N,a=r*t+i,s=n.modPow(this.parameters.primeGroup.g,t,u)*e%u;return n.modPow(o+u-s,a,u)}}])}();t.SRPRoutines=i})),l=i((function(t){var r=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPClientSessionStep2=t.SRPClientSessionStep1=t.SRPClientSession=void 0;var n=function(){return o((function e(t){a(this,e),this.routines=t}),[{key:"step1",value:function(t,n){return r(this,void 0,void 0,e().m((function r(){var o;return e().w((function(e){for(;;)switch(e.n){case 0:if(t&&t.trim()){e.n=1;break}throw new Error("User identity must not be null nor empty");case 1:if(n){e.n=2;break}throw new Error("User password must not be null");case 2:return e.n=3,this.routines.computeIdentityHash(t,n);case 3:return o=e.v,e.a(2,new i(this.routines,t,o))}}),r,this)})))}}])}();t.SRPClientSession=n;var i=function(){function t(e,r,n){a(this,t),this.routines=e,this.I=r,this.IH=n}return o(t,[{key:"step2",value:function(t,n){return r(this,void 0,void 0,e().m((function r(){var i,o,a,s,c,f,h;return e().w((function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}throw new Error("Salt (s) must not be null");case 1:if(n){e.n=2;break}throw new Error("Public server value (B) must not be null");case 2:return e.n=3,this.routines.computeXStep2(t,this.IH);case 3:return i=e.v,o=this.routines.generatePrivateValue(),a=this.routines.computeClientPublicValue(o),e.n=4,this.routines.computeK();case 4:return s=e.v,e.n=5,this.routines.computeU(a,n);case 5:return c=e.v,f=this.routines.computeClientSessionKey(s,i,c,o,n),e.n=6,this.routines.computeClientEvidence(this.I,t,a,n,f);case 6:return h=e.v,e.a(2,new u(this.routines,a,h,f))}}),r,this)})))}},{key:"toJSON",value:function(){return{I:this.I,IH:Array.from(new Uint8Array(this.IH))}}}],[{key:"fromState",value:function(e,r){return new t(e,r.I,new Uint8Array(r.IH).buffer)}}])}();t.SRPClientSessionStep1=i;var u=function(){function t(e,r,n,i){a(this,t),this.routines=e,this.A=r,this.M1=n,this.S=i}return o(t,[{key:"step3",value:function(t){return r(this,void 0,void 0,e().m((function r(){return e().w((function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}throw new Error("Server evidence (M2) must not be null");case 1:return e.n=2,this.routines.computeServerEvidence(this.A,this.M1,this.S);case 2:if(e.v===t){e.n=3;break}throw new Error("Bad server credentials");case 3:return e.a(2)}}),r,this)})))}},{key:"toJSON",value:function(){return{A:this.A.toString(16),M1:this.M1.toString(16),S:this.S.toString(16)}}}],[{key:"fromState",value:function(e,r){return new t(e,BigInt("0x"+r.A),BigInt("0x"+r.M1),BigInt("0x"+r.S))}}])}();t.SRPClientSessionStep2=u})),v=i((function(t){var r=t&&t.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function u(e){try{s(n.next(e))}catch(t){o(t)}}function a(e){try{s(n.throw(e))}catch(t){o(t)}}function s(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(u,a)}s((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.SRPServerSessionStep1=t.SRPServerSession=void 0;var n=f(),i=function(){return o((function e(t){a(this,e),this.routines=t}),[{key:"step1",value:function(t,n,i){return r(this,void 0,void 0,e().m((function r(){var o,a,c;return e().w((function(e){for(;;)switch(e.n){case 0:return o=this.routines.generatePrivateValue(),e.n=1,this.routines.computeK();case 1:return a=e.v,c=s(this.routines.parameters,a,i,o),e.a(2,new u(this.routines,t,n,i,o,c))}}),r,this)})))}}])}();t.SRPServerSession=i;var u=function(){function t(e,r,n,i,o,u){a(this,t),this.routines=e,this.identifier=r,this.salt=n,this.verifier=i,this.b=o,this.B=u}return o(t,[{key:"sessionKey",value:function(t){return r(this,void 0,void 0,e().m((function r(){var n;return e().w((function(e){for(;;)switch(e.n){case 0:if(null!==t){e.n=1;break}throw new Error("Client public value (A) must not be null");case 1:if(this.routines.isValidPublicValue(t)){e.n=2;break}throw new Error(`Invalid Client public value (A): ${t.toString(16)}`);case 2:return e.n=3,this.routines.computeU(t,this.B);case 3:return n=e.v,e.a(2,c(this.routines.parameters.primeGroup.N,this.verifier,n,t,this.b))}}),r,this)})))}},{key:"step2",value:function(t,n){return r(this,void 0,void 0,e().m((function r(){var i;return e().w((function(e){for(;;)switch(e.n){case 0:if(n){e.n=1;break}throw new Error("Client evidence (M1) must not be null");case 1:return e.n=2,this.sessionKey(t);case 2:return i=e.v,e.n=3,this.routines.computeClientEvidence(this.identifier,this.salt,t,this.B,i);case 3:if(e.v===n){e.n=4;break}throw new Error("Bad client credentials");case 4:return e.a(2,this.routines.computeServerEvidence(t,n,i))}}),r,this)})))}},{key:"toJSON",value:function(){return{identifier:this.identifier,salt:this.salt.toString(16),verifier:this.verifier.toString(16),b:this.b.toString(16),B:this.B.toString(16)}}}],[{key:"fromState",value:function(e,r){return new t(e,r.identifier,BigInt("0x"+r.salt),BigInt("0x"+r.verifier),BigInt("0x"+r.b),BigInt("0x"+r.B))}}])}();t.SRPServerSessionStep1=u;var s=function(e,t,r,i){return(n.modPow(e.primeGroup.g,i,e.primeGroup.N)+r*t)%e.primeGroup.N},c=function(e,t,r,i,o){return n.modPow(n.modPow(t,r,e)*i,o,e)}})),t("default",i((function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.generateRandomBigInt=e.arrayBufferToBigInt=e.bigIntToArrayBuffer=e.createVerifierAndSalt=e.SRPServerSessionStep1=e.SRPServerSession=e.SRPClientSessionStep2=e.SRPClientSessionStep1=e.SRPClientSession=e.SRPRoutines=e.SRPParameters=void 0;var t=c();Object.defineProperty(e,"SRPParameters",{enumerable:!0,get:function(){return t.SRPParameters}});var r=h();Object.defineProperty(e,"SRPRoutines",{enumerable:!0,get:function(){return r.SRPRoutines}});var n=l();Object.defineProperty(e,"SRPClientSession",{enumerable:!0,get:function(){return n.SRPClientSession}}),Object.defineProperty(e,"SRPClientSessionStep1",{enumerable:!0,get:function(){return n.SRPClientSessionStep1}}),Object.defineProperty(e,"SRPClientSessionStep2",{enumerable:!0,get:function(){return n.SRPClientSessionStep2}});var i=v();Object.defineProperty(e,"SRPServerSession",{enumerable:!0,get:function(){return i.SRPServerSession}}),Object.defineProperty(e,"SRPServerSessionStep1",{enumerable:!0,get:function(){return i.SRPServerSessionStep1}});var o=f();Object.defineProperty(e,"createVerifierAndSalt",{enumerable:!0,get:function(){return o.createVerifierAndSalt}}),Object.defineProperty(e,"bigIntToArrayBuffer",{enumerable:!0,get:function(){return o.bigIntToArrayBuffer}}),Object.defineProperty(e,"arrayBufferToBigInt",{enumerable:!0,get:function(){return o.arrayBufferToBigInt}}),Object.defineProperty(e,"generateRandomBigInt",{enumerable:!0,get:function(){return o.generateRandomBigInt}})}))())}}}))}();
|