shogun-button-react 6.2.4 → 6.3.3
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/dist/118.index.js +1 -1
- package/dist/18.index.js +1 -1
- package/dist/195.index.js +1 -1
- package/dist/452.index.js +2 -0
- package/dist/508.index.js +1 -1
- package/dist/604.index.js +1 -1
- package/dist/619.index.js +1 -1
- package/dist/695.index.js +1 -1
- package/dist/732.index.js +1 -1
- package/dist/841.index.js +2 -0
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +0 -2
- package/package.json +2 -2
- package/dist/122.index.js +0 -2
- package/dist/47.index.js +0 -2
- package/dist/649.index.js +0 -2
- package/dist/649.index.js.LICENSE.txt +0 -1
- package/dist/794.index.js +0 -2
- package/dist/794.index.js.LICENSE.txt +0 -1
- /package/dist/{122.index.js.LICENSE.txt → 452.index.js.LICENSE.txt} +0 -0
- /package/dist/{47.index.js.LICENSE.txt → 841.index.js.LICENSE.txt} +0 -0
package/dist/619.index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see 619.index.js.LICENSE.txt */
|
|
2
|
-
export const __webpack_esm_id__=619;export const __webpack_esm_ids__=[619];export const __webpack_esm_modules__={38619:(e,t,r)=>{r.d(t,{AL:()=>ge,Zc:()=>ye,wo:()=>ke,C2:()=>N,mh:()=>R});class n extends Error{constructor(e){let t;t=e instanceof Error?e.message:"string"==typeof e?e:"",super(t),this.name=this.constructor.name}}const i=256,s=3329,o=[2285,2571,2970,1812,1493,1422,287,202,3158,622,1577,182,962,2127,1855,1468,573,2004,264,383,2500,1458,1727,3199,2648,1017,732,608,1787,411,3124,1758,1223,652,2777,1015,2036,1491,3047,1785,516,3321,3009,2663,1711,2167,126,1469,2476,3239,3058,830,107,1908,3082,2378,2931,961,1821,2604,448,2264,677,2054,2226,430,555,843,2078,871,1550,105,422,587,177,3094,3038,2869,1574,1653,3083,778,1159,3182,2552,1483,2727,1119,1739,644,2457,349,418,329,3173,3254,817,1097,603,610,1322,2044,1864,384,2114,3193,1218,1994,2455,220,2142,1670,2144,1799,2051,794,1819,2475,2459,478,3221,3021,996,991,958,1869,1522,1628],a=[1701,1807,1460,2371,2338,2333,308,108,2851,870,854,1510,2535,1278,1530,1185,1659,1187,3109,874,1335,2111,136,1215,2945,1465,1285,2007,2719,2726,2232,2512,75,156,3e3,2911,2980,872,2685,1590,2210,602,1846,777,147,2170,2551,246,1676,1755,460,291,235,3152,2742,2907,3224,1779,2458,1251,2486,2774,2899,1103,1275,2652,1065,2881,725,1508,2368,398,951,247,1421,3222,2499,271,90,853,1860,3203,1162,1618,666,320,8,2813,1544,282,1838,1293,2314,552,2677,2106,1571,205,2918,1542,2721,2597,2312,681,130,1602,1871,829,2946,3065,1325,2756,1861,1474,1202,2367,3147,1752,2707,171,3127,3042,1907,1836,1517,359,758,1441],l=BigInt(2**32-1),u=BigInt(32);function c(e,t=!1){return t?{h:Number(e&l),l:Number(e>>u&l)}:{h:0|Number(e>>u&l),l:0|Number(e&l)}}function h(e,t=""){if(!Number.isSafeInteger(e)||e<0)throw new Error(`${t&&`"${t}" `}expected integer >0, got ${e}`)}function f(e,t,r=""){const n=(i=e)instanceof Uint8Array||ArrayBuffer.isView(i)&&"Uint8Array"===i.constructor.name;var i;const s=e?.length,o=void 0!==t;if(!n||o&&s!==t)throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(o?` of length ${t}`:"")+", got "+(n?`length=${s}`:"type="+typeof e));return e}function b(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function _(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function d(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const p=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])()?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=d(e[t]);return e};function y(e,t={}){const r=(t,r)=>e(r).update(t).digest(),n=e(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.create=t=>e(t),Object.assign(r,t),Object.freeze(r)}const w=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])}),k=BigInt(0),g=BigInt(1),m=BigInt(2),v=BigInt(7),A=BigInt(256),O=BigInt(113),S=[],z=[],P=[];for(let e=0,t=g,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],S.push(2*(5*n+r)),z.push((e+1)*(e+2)/2%64);let i=k;for(let e=0;e<7;e++)t=(t<<g^(t>>v)*O)%A,t&m&&(i^=g<<(g<<BigInt(e))-g);P.push(i)}const U=function(e,t=!1){const r=e.length,n=new Uint32Array(r),i=new Uint32Array(r);for(let s=0;s<r;s++){const{h:r,l:o}=c(e[s],t);[n[s],i[s]]=[r,o]}return[n,i]}(P,!0),j=U[0],L=U[1],I=(e,t,r)=>r>32?((e,t,r)=>t<<r-32|e>>>64-r)(e,t,r):((e,t,r)=>e<<r|t>>>32-r)(e,t,r),x=(e,t,r)=>r>32?((e,t,r)=>e<<r-32|t>>>64-r)(e,t,r):((e,t,r)=>t<<r|e>>>32-r)(e,t,r);class E{constructor(e,t,r,n=!1,i=24){if(Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pos",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"posOut",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"finished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"state32",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"destroyed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"blockLen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"suffix",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputLen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"enableXOF",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"rounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,h(r,"outputLen"),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");var s;this.state=new Uint8Array(200),this.state32=(s=this.state,new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)))}clone(){return this._cloneInto()}keccak(){p(this.state32),function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,s=r[i],o=r[i+1],a=I(s,o,1)^r[n],l=x(s,o,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=l}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=z[r],s=I(t,i,n),o=x(t,i,n),a=S[r];t=e[a],i=e[a+1],e[a]=s,e[a+1]=o}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=j[n],e[1]^=L[n]}_(r)}(this.state32,this.rounds),p(this.state32),this.posOut=0,this.pos=0}update(e){b(this),f(e);const{blockLen:t,state:r}=this,n=e.length;for(let i=0;i<n;){const s=Math.min(t-this.pos,n-i);for(let t=0;t<s;t++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){b(this,!1),f(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return h(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(function(e,t){f(e,void 0,"digestInto() output");const r=t.outputLen;if(e.length<r)throw new Error('"digestInto() output" expected to be of length >='+r)}(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,_(this.state)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:s}=this;return e||=new E(t,r,n,s,i),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}const V=(e,t,r,n={})=>y(()=>new E(t,e,r),n),N=V(6,136,32,w(8)),B=V(6,72,64,w(10)),K=(e,t,r,n={})=>y((n={})=>new E(t,e,void 0===n.dkLen?r:n.dkLen,!0),n),F=K(31,168,16,w(11)),R=K(31,136,32,w(12)),M=(X=globalThis,$={},new Proxy(X,{get:(e,t,r)=>t in $?$[t]:X[t],set:(e,t,r)=>(t in $&&delete $[t],X[t]=r,!0),deleteProperty(e,t){let r=!1;return t in $&&(delete $[t],r=!0),t in X&&(delete X[t],r=!0),r},ownKeys(e){const t=Reflect.ownKeys(X),r=Reflect.ownKeys($),n=new Set(r);return[...t.filter(e=>!n.has(e)),...r]},defineProperty:(e,t,r)=>(t in $&&delete $[t],Reflect.defineProperty(X,t,r),!0),getOwnPropertyDescriptor:(e,t)=>t in $?Reflect.getOwnPropertyDescriptor($,t):Reflect.getOwnPropertyDescriptor(X,t),has:(e,t)=>t in $||t in X}));var X,$;function C(e){return e%256}function D(e){const t=-32768;return e>=t&&e<=32767?e:e<t?(e+=32769,32767+(e%=65536)):(e-=32768,t+(e%=65536))}function T(e){return e%65536}function H(e){const t=-2147483648,r=2147483647;return e>=t&&e<=r?e:e<t?(e+=2147483649,r+(e%=4294967296)):(e-=2147483648,t+(e%=4294967296))}function Z(e){return e%4294967296}function q(e,t,r){return R.create({dkLen:e}).update(t).update(new Uint8Array([r])).digest()}function G(e){let t=Z(e[0]);return t|=Z(e[1])<<8,t|=Z(e[2])<<16,t}function J(e){let t=Z(e[0]);return t|=Z(e[1])<<8,t|=Z(e[2])<<16,t|=Z(e[3])<<24,Z(t)}class Q{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_k",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_du",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_dv",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_eta1",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_eta2",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_skSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_pkSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_compressedUSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_compressedVSize",{enumerable:!0,configurable:!0,writable:!0,value:0})}async generateKeyPair(){await this._setup();try{const e=new Uint8Array(64);return this._api.getRandomValues(e),this._deriveKeyPair(e)}catch(e){throw new n(e)}}async deriveKeyPair(e){await this._setup();try{if(64!==e.byteLength)throw new Error("seed must be 64 bytes in length");return this._deriveKeyPair(e)}catch(e){throw new n(e)}}async encap(e,t){await this._setup();try{if(e.length!==384*this._k+32)throw new Error("invalid encapsulation key");const r=this._getSeed(t),[n,i]=W(r,Y(e));return[this._encap(e,r,i),n]}catch(e){throw new n(e)}}async decap(e,t){await this._setup();try{if(e.byteLength!==this._compressedUSize+this._compressedVSize)throw new Error("Invalid ct size");if(t.length!==768*this._k+96)throw new Error("Invalid decapsulation key");const r=t.subarray(0,this._skSize),n=t.subarray(this._skSize,this._skSize+this._pkSize),i=t.subarray(this._skSize+this._pkSize,this._skSize+this._pkSize+32),s=t.subarray(this._skSize+this._pkSize+32,this._skSize+this._pkSize+64),o=this._decap(e,r),[a,l]=W(o,i),u=function(e,t){const r=R.create({dkLen:32}).update(e);return void 0!==t&&r.update(t),r.digest()}(s,e);return 1===function(e,t){if(e.length!=t.length)return 0;const r=new Uint8Array([0]);for(let n=0;n<e.length;n++)r[0]|=e[n]^t[n];const n=new Uint8Array([0]);return n[0]=r[0]^~n[0],n[0]&=n[0]>>4,n[0]&=n[0]>>2,n[0]&=n[0]>>1,n[0]}(e,this._encap(n,o,l))?a:u}catch(e){throw new n(e)}}async _setup(){void 0===this._api&&(this._api=await async function(){if(void 0!==M&&void 0!==globalThis.crypto)return globalThis.crypto;try{const{webcrypto:e}=await Promise.resolve().then(r.t.bind(r,91565,19));return e}catch(e){throw new Error("failed to load Crypto")}}())}_getSeed(e){if(null==e){const e=new Uint8Array(32);return this._api.getRandomValues(e),e}if(32!==e.byteLength)throw new Error("seed must be 32 bytes in length");return e}_deriveKeyPair(e){const t=e.subarray(0,32),r=e.subarray(32,64),[n,i]=this._deriveCpaKeyPair(t),s=Y(n),o=new Uint8Array(this._skSize+this._pkSize+64);return o.set(i,0),o.set(n,this._skSize),o.set(s,this._skSize+this._pkSize),o.set(r,this._skSize+this._pkSize+32),[n,o]}_deriveCpaKeyPair(e){const[t,r]=W(e,new Uint8Array([this._k])),n=this._sampleMatrix(t,!1),i=this._sampleNoise1(r,0,this._k),s=this._sampleNoise1(r,this._k,this._k);for(let e=0;e<this._k;e++)i[e]=se(i[e]),i[e]=ae(i[e]),s[e]=se(s[e]);const o=new Array(this._k);for(let e=0;e<this._k;e++)o[e]=ce(he(n[e],i)),o[e]=_e(o[e],s[e]),o[e]=ae(o[e]);const a=new Uint8Array(this._pkSize);for(let e=0;e<this._k;e++)a.set(te(o[e]),384*e);a.set(t,this._skSize);const l=new Uint8Array(this._skSize);for(let e=0;e<this._k;e++)l.set(te(i[e]),384*e);return[a,l]}_encap(e,t,r){const n=new Array(this._k),i=new Uint8Array(384*this._k);for(let t=0;t<this._k;t++)n[t]=re(e.subarray(384*t,384*(t+1))),i.set(te(n[t]),384*t);if(!function(e,t){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(e.subarray(0,i.length),i))throw new Error("invalid encapsulation key");const s=e.subarray(this._skSize),o=this._sampleMatrix(s,!0),a=this._sampleNoise1(r,0,this._k),l=this._sampleNoise2(r,this._k,this._k),u=this._sampleNoise2(r,2*this._k,1)[0];for(let e=0;e<this._k;e++)a[e]=se(a[e]),a[e]=ae(a[e]);const c=new Array(this._k);for(let e=0;e<this._k;e++)c[e]=he(o[e],a),c[e]=de(c[e]),c[e]=_e(c[e],l[e]),c[e]=ae(c[e]);const h=function(e){const t=new Array(384).fill(0);let r;for(let n=0;n<32;n++)for(let i=0;i<8;i++)r=-1*D(e[n]>>i&1),t[8*n+i]=r&D(1665);return t}(t);let f=he(n,a);f=de(f),f=_e(f,u),f=_e(f,h),f=ae(f);const b=new Uint8Array(this._compressedUSize+this._compressedVSize);return this._compressU(b.subarray(0,this._compressedUSize),c),this._compressV(b.subarray(this._compressedUSize),f),b}_decap(e,t){const r=this._decompressU(e.subarray(0,this._compressedUSize)),n=this._decompressV(e.subarray(this._compressedUSize)),o=this._polyvecFromBytes(t);for(let e=0;e<this._k;e++)r[e]=se(r[e]);let a=he(o,r);return a=de(a),a=function(e,t){for(let r=0;r<i;r++)e[r]-=t[r];return e}(n,a),a=ae(a),function(e){const t=new Uint8Array(32);let r;const n=pe(e);for(let e=0;e<32;e++){t[e]=0;for(let i=0;i<8;i++)r=((T(n[8*e+i])<<1)+T(s/2))/T(s)&1,t[e]|=C(r<<i)}return t}(a)}_sampleMatrix(e,t){const r=new Array(this._k),n=new Uint8Array(2);for(let s=0,o=0;o<this._k;o++){r[o]=new Array(this._k);for(let a=0;a<this._k;a++){t?(n[0]=o,n[1]=a):(n[0]=a,n[1]=o);const l=ee(e,n),u=ne(l.subarray(0,504),504,i);for(r[o][a]=u[0],s=u[1];s<i;){const e=ne(l.subarray(504,672),168,i-s),t=e[0],n=e[1];for(let e=s;e<i;e++)r[o][a][e]=t[e-s];s+=n}}}return r}_sampleNoise1(e,t,r){const n=new Array(r);for(let s=0;s<r;s++)n[s]=ie(q(this._eta1*i/4,e,t),this._eta1),t++;return n}_sampleNoise2(e,t,r){const n=new Array(r);for(let s=0;s<r;s++)n[s]=ie(q(this._eta2*i/4,e,t),this._eta2),t++;return n}_polyvecFromBytes(e){const t=new Array(this._k);for(let r=0;r<this._k;r++)t[r]=re(e.subarray(384*r,384*(r+1)));return t}_compressU(e,t){const r=new Array(4);for(let n=0,i=0;i<this._k;i++)for(let o=0;o<64;o++){for(let e=0;e<4;e++)r[e]=((t[i][4*o+e]<<10)+s/2)/s&1023;e[n++]=C(0|r[0]),e[n++]=C(r[0]>>8|r[1]<<2),e[n++]=C(r[1]>>6|r[2]<<4),e[n++]=C(r[2]>>4|r[3]<<6),e[n++]=C(r[3]>>2)}return e}_compressV(e,t){const r=new Uint8Array(8);for(let n=0,i=0;i<32;i++){for(let e=0;e<8;e++)r[e]=15&C(((t[8*i+e]<<4)+s/2)/s);e[n++]=r[0]|r[1]<<4,e[n++]=r[2]|r[3]<<4,e[n++]=r[4]|r[5]<<4,e[n++]=r[6]|r[7]<<4}return e}_decompressU(e){const t=new Array(this._k);for(let e=0;e<this._k;e++)t[e]=new Array(384);const r=new Array(4);for(let n=0,i=0;i<this._k;i++)for(let o=0;o<64;o++){r[0]=T(e[n+0])|T(e[n+1])<<8,r[1]=T(e[n+1])>>2|T(e[n+2])<<6,r[2]=T(e[n+2])>>4|T(e[n+3])<<4,r[3]=T(e[n+3])>>6|T(e[n+4])<<2,n+=5;for(let e=0;e<4;e++)t[i][4*o+e]=D(Z(1023&r[e])*Z(s)+512>>10)}return t}_decompressV(e){const t=new Array(384);for(let r=0,n=0;n<128;n++,r++)t[2*n+0]=D(T(15&e[r])*T(s)+8>>4),t[2*n+1]=D(T(e[r]>>4)*T(s)+8>>4);return t}}function W(e,t){const r=B.create().update(e);void 0!==t&&r.update(t);const n=r.digest();return[n.subarray(0,32),n.subarray(32,64)]}function Y(e){return N.create().update(e).digest()}function ee(e,t){return F.create({dkLen:672}).update(e).update(t).digest()}function te(e){let t=0,r=0;const n=new Uint8Array(384),i=pe(e);for(let e=0;e<128;e++)t=T(i[2*e]),r=T(i[2*e+1]),n[3*e+0]=C(0|t),n[3*e+1]=C(t>>8)|C(r<<4),n[3*e+2]=C(r>>4);return n}function re(e){const t=new Array(384).fill(0);for(let r=0;r<128;r++)t[2*r]=D(4095&(T(e[3*r+0])|T(e[3*r+1])<<8)),t[2*r+1]=D(4095&(T(e[3*r+1])>>4|T(e[3*r+2])<<4));return t}function ne(e,t,r){const n=new Array(384).fill(0);let i,o,a=0;for(let l=0;a<r&&l+3<=t;)i=4095&(T(0|e[l])|T(e[l+1])<<8),o=4095&(T(e[l+1]>>4)|T(e[l+2])<<4),l+=3,i<s&&(n[a]=i,a+=1),a<r&&o<s&&(n[a]=o,a+=1);return[n,a]}function ie(e,t){let r,n,i,s;const o=new Array(384).fill(0);for(let a=0;a<32;a++){r=J(e.subarray(4*a,e.length)),n=1431655765&r,n+=r>>1&1431655765;for(let e=0;e<8;e++)i=D(n>>4*e+0&3),s=D(n>>4*e+t&3),o[8*a+e]=i-s}return o}function se(e){for(let t=0,r=1,n=128;n>=2;n>>=1)for(let i=0;i<256;i=t+n){const s=o[r];for(r+=1,t=i;t<i+n;t++){const r=oe(s,e[t+n]);e[t+n]=e[t]-r,e[t]=e[t]+r}}return e}function oe(e,t){return ue(e*t)}function ae(e){for(let t=0;t<i;t++)e[t]=le(e[t]);return e}function le(e){let t=16778880.5/s*e>>24;return t*=s,e-t}function ue(e){let t=D(62209*H(e))*s;return t=e-t,t>>=16,D(t)}function ce(e){for(let t=0;t<i;t++)e[t]=ue(H(e[t])*H(1353));return e}function he(e,t){let r,n=fe(e[0],t[0]);for(let i=1;i<e.length;i++)r=fe(e[i],t[i]),n=_e(n,r);return ae(n)}function fe(e,t){let r,n;for(let i=0;i<64;i++)r=be(e[4*i+0],e[4*i+1],t[4*i+0],t[4*i+1],o[64+i]),n=be(e[4*i+2],e[4*i+3],t[4*i+2],t[4*i+3],-o[64+i]),e[4*i+0]=r[0],e[4*i+1]=r[1],e[4*i+2]=n[0],e[4*i+3]=n[1];return e}function be(e,t,r,n,i){const s=new Array(2);return s[0]=oe(t,n),s[0]=oe(s[0],i),s[0]+=oe(e,r),s[1]=oe(e,n),s[1]+=oe(t,r),s}function _e(e,t){const r=new Array(384);for(let n=0;n<i;n++)r[n]=e[n]+t[n];return r}function de(e){let t=0;for(let r=0,n=2;n<=128;n<<=1)for(let i=0;i<256;i=t+n){const s=a[r];for(r+=1,t=i;t<i+n;t++){const r=e[t];e[t]=le(r+e[t+n]),e[t+n]=r-e[t+n],e[t+n]=oe(s,e[t+n])}}for(t=0;t<256;t++)e[t]=oe(e[t],a[127]);return e}function pe(e){for(let t=0;t<i;t++)e[t]-=s,e[t]+=e[t]>>31&s;return e}class ye extends Q{constructor(){super(),Object.defineProperty(this,"_k",{enumerable:!0,configurable:!0,writable:!0,value:2}),Object.defineProperty(this,"_du",{enumerable:!0,configurable:!0,writable:!0,value:10}),Object.defineProperty(this,"_dv",{enumerable:!0,configurable:!0,writable:!0,value:4}),Object.defineProperty(this,"_eta1",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"_eta2",{enumerable:!0,configurable:!0,writable:!0,value:2}),this._skSize=12*this._k*i/8,this._pkSize=this._skSize+32,this._compressedUSize=this._k*this._du*i/8,this._compressedVSize=this._dv*i/8}_sampleNoise1(e,t,r){const n=new Array(r);for(let s=0;s<r;s++)n[s]=we(q(this._eta1*i/4,e,t),this._eta1),t++;return n}}function we(e,t){let r,n,i,s;const o=new Array(384).fill(0);for(let a=0;a<64;a++){r=G(e.subarray(3*a,e.length)),n=2396745&r,n+=r>>1&2396745,n+=r>>2&2396745;for(let e=0;e<4;e++)i=D(n>>6*e+0&7),s=D(n>>6*e+t&7),o[4*a+e]=i-s}return o}class ke extends Q{constructor(){super(),Object.defineProperty(this,"_k",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"_du",{enumerable:!0,configurable:!0,writable:!0,value:10}),Object.defineProperty(this,"_dv",{enumerable:!0,configurable:!0,writable:!0,value:4}),Object.defineProperty(this,"_eta1",{enumerable:!0,configurable:!0,writable:!0,value:2}),Object.defineProperty(this,"_eta2",{enumerable:!0,configurable:!0,writable:!0,value:2}),this._skSize=12*this._k*i/8,this._pkSize=this._skSize+32,this._compressedUSize=this._k*this._du*i/8,this._compressedVSize=this._dv*i/8}}class ge extends Q{constructor(){super(),Object.defineProperty(this,"_k",{enumerable:!0,configurable:!0,writable:!0,value:4}),Object.defineProperty(this,"_du",{enumerable:!0,configurable:!0,writable:!0,value:11}),Object.defineProperty(this,"_dv",{enumerable:!0,configurable:!0,writable:!0,value:5}),Object.defineProperty(this,"_eta1",{enumerable:!0,configurable:!0,writable:!0,value:2}),Object.defineProperty(this,"_eta2",{enumerable:!0,configurable:!0,writable:!0,value:2}),this._skSize=12*this._k*i/8,this._pkSize=this._skSize+32,this._compressedUSize=this._k*this._du*i/8,this._compressedVSize=this._dv*i/8}_compressU(e,t){const r=new Array(8);for(let n=0,i=0;i<this._k;i++)for(let o=0;o<32;o++){for(let e=0;e<8;e++)r[e]=T(((Z(t[i][8*o+e])<<11)+Z(s/2))/Z(s)&2047);e[n++]=C(0|r[0]),e[n++]=C(r[0]>>8|r[1]<<3),e[n++]=C(r[1]>>5|r[2]<<6),e[n++]=C(r[2]>>2),e[n++]=C(r[2]>>10|r[3]<<1),e[n++]=C(r[3]>>7|r[4]<<4),e[n++]=C(r[4]>>4|r[5]<<7),e[n++]=C(r[5]>>1),e[n++]=C(r[5]>>9|r[6]<<2),e[n++]=C(r[6]>>6|r[7]<<5),e[n++]=C(r[7]>>3)}return e}_compressV(e,t){const r=new Uint8Array(8);for(let n=0,i=0;i<32;i++){for(let e=0;e<8;e++)r[e]=31&C(((Z(t[8*i+e])<<5)+Z(s/2))/Z(s));e[n++]=C(r[0]|r[1]<<5),e[n++]=C(r[1]>>3|r[2]<<2|r[3]<<7),e[n++]=C(r[3]>>1|r[4]<<4),e[n++]=C(r[4]>>4|r[5]<<1|r[6]<<6),e[n++]=C(r[6]>>2|r[7]<<3)}return e}_decompressU(e){const t=new Array(this._k);for(let e=0;e<this._k;e++)t[e]=new Array(384);const r=new Array(8);for(let n=0,i=0;i<this._k;i++)for(let o=0;o<32;o++){r[0]=T(e[n+0])|T(e[n+1])<<8,r[1]=T(e[n+1])>>3|T(e[n+2])<<5,r[2]=T(e[n+2])>>6|T(e[n+3])<<2|T(e[n+4])<<10,r[3]=T(e[n+4])>>1|T(e[n+5])<<7,r[4]=T(e[n+5])>>4|T(e[n+6])<<4,r[5]=T(e[n+6])>>7|T(e[n+7])<<1|T(e[n+8])<<9,r[6]=T(e[n+8])>>2|T(e[n+9])<<6,r[7]=T(e[n+9])>>5|T(e[n+10])<<3,n+=11;for(let e=0;e<8;e++)t[i][8*o+e]=Z(2047&r[e])*s+1024>>11}return t}_decompressV(e){const t=new Array(384),r=new Array(8);for(let n=0,i=0;i<32;i++){r[0]=0|e[n+0],r[1]=e[n+0]>>5|e[n+1]<<3,r[2]=e[n+1]>>2,r[3]=e[n+1]>>7|e[n+2]<<1,r[4]=e[n+2]>>4|e[n+3]<<4,r[5]=e[n+3]>>1,r[6]=e[n+3]>>6|e[n+4]<<2,r[7]=e[n+4]>>3,n+=5;for(let e=0;e<8;e++)t[8*i+e]=D(Z(31&r[e])*Z(s)+16>>5)}return t}}}};
|
|
2
|
+
export const __webpack_esm_id__=619;export const __webpack_esm_ids__=[619];export const __webpack_esm_modules__={8619:(e,t,r)=>{r.d(t,{AL:()=>ge,Zc:()=>ye,wo:()=>ke,C2:()=>N,mh:()=>R});class n extends Error{constructor(e){let t;t=e instanceof Error?e.message:"string"==typeof e?e:"",super(t),this.name=this.constructor.name}}const i=256,s=3329,o=[2285,2571,2970,1812,1493,1422,287,202,3158,622,1577,182,962,2127,1855,1468,573,2004,264,383,2500,1458,1727,3199,2648,1017,732,608,1787,411,3124,1758,1223,652,2777,1015,2036,1491,3047,1785,516,3321,3009,2663,1711,2167,126,1469,2476,3239,3058,830,107,1908,3082,2378,2931,961,1821,2604,448,2264,677,2054,2226,430,555,843,2078,871,1550,105,422,587,177,3094,3038,2869,1574,1653,3083,778,1159,3182,2552,1483,2727,1119,1739,644,2457,349,418,329,3173,3254,817,1097,603,610,1322,2044,1864,384,2114,3193,1218,1994,2455,220,2142,1670,2144,1799,2051,794,1819,2475,2459,478,3221,3021,996,991,958,1869,1522,1628],a=[1701,1807,1460,2371,2338,2333,308,108,2851,870,854,1510,2535,1278,1530,1185,1659,1187,3109,874,1335,2111,136,1215,2945,1465,1285,2007,2719,2726,2232,2512,75,156,3e3,2911,2980,872,2685,1590,2210,602,1846,777,147,2170,2551,246,1676,1755,460,291,235,3152,2742,2907,3224,1779,2458,1251,2486,2774,2899,1103,1275,2652,1065,2881,725,1508,2368,398,951,247,1421,3222,2499,271,90,853,1860,3203,1162,1618,666,320,8,2813,1544,282,1838,1293,2314,552,2677,2106,1571,205,2918,1542,2721,2597,2312,681,130,1602,1871,829,2946,3065,1325,2756,1861,1474,1202,2367,3147,1752,2707,171,3127,3042,1907,1836,1517,359,758,1441],l=BigInt(2**32-1),u=BigInt(32);function c(e,t=!1){return t?{h:Number(e&l),l:Number(e>>u&l)}:{h:0|Number(e>>u&l),l:0|Number(e&l)}}function h(e,t=""){if(!Number.isSafeInteger(e)||e<0)throw new Error(`${t&&`"${t}" `}expected integer >0, got ${e}`)}function f(e,t,r=""){const n=(i=e)instanceof Uint8Array||ArrayBuffer.isView(i)&&"Uint8Array"===i.constructor.name;var i;const s=e?.length,o=void 0!==t;if(!n||o&&s!==t)throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(o?` of length ${t}`:"")+", got "+(n?`length=${s}`:"type="+typeof e));return e}function b(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function _(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function d(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const p=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])()?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=d(e[t]);return e};function y(e,t={}){const r=(t,r)=>e(r).update(t).digest(),n=e(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.create=t=>e(t),Object.assign(r,t),Object.freeze(r)}const w=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])}),k=BigInt(0),g=BigInt(1),m=BigInt(2),v=BigInt(7),A=BigInt(256),O=BigInt(113),S=[],z=[],P=[];for(let e=0,t=g,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],S.push(2*(5*n+r)),z.push((e+1)*(e+2)/2%64);let i=k;for(let e=0;e<7;e++)t=(t<<g^(t>>v)*O)%A,t&m&&(i^=g<<(g<<BigInt(e))-g);P.push(i)}const U=function(e,t=!1){const r=e.length,n=new Uint32Array(r),i=new Uint32Array(r);for(let s=0;s<r;s++){const{h:r,l:o}=c(e[s],t);[n[s],i[s]]=[r,o]}return[n,i]}(P,!0),j=U[0],L=U[1],I=(e,t,r)=>r>32?((e,t,r)=>t<<r-32|e>>>64-r)(e,t,r):((e,t,r)=>e<<r|t>>>32-r)(e,t,r),x=(e,t,r)=>r>32?((e,t,r)=>e<<r-32|t>>>64-r)(e,t,r):((e,t,r)=>t<<r|e>>>32-r)(e,t,r);class E{constructor(e,t,r,n=!1,i=24){if(Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pos",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"posOut",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"finished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"state32",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"destroyed",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"blockLen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"suffix",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputLen",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"enableXOF",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"rounds",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,h(r,"outputLen"),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");var s;this.state=new Uint8Array(200),this.state32=(s=this.state,new Uint32Array(s.buffer,s.byteOffset,Math.floor(s.byteLength/4)))}clone(){return this._cloneInto()}keccak(){p(this.state32),function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const n=(t+8)%10,i=(t+2)%10,s=r[i],o=r[i+1],a=I(s,o,1)^r[n],l=x(s,o,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=l}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=z[r],s=I(t,i,n),o=x(t,i,n),a=S[r];t=e[a],i=e[a+1],e[a]=s,e[a+1]=o}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=j[n],e[1]^=L[n]}_(r)}(this.state32,this.rounds),p(this.state32),this.posOut=0,this.pos=0}update(e){b(this),f(e);const{blockLen:t,state:r}=this,n=e.length;for(let i=0;i<n;){const s=Math.min(t-this.pos,n-i);for(let t=0;t<s;t++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,128&t&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){b(this,!1),f(e),this.finish();const t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return h(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(function(e,t){f(e,void 0,"digestInto() output");const r=t.outputLen;if(e.length<r)throw new Error('"digestInto() output" expected to be of length >='+r)}(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,_(this.state)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:s}=this;return e||=new E(t,r,n,s,i),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}const V=(e,t,r,n={})=>y(()=>new E(t,e,r),n),N=V(6,136,32,w(8)),B=V(6,72,64,w(10)),K=(e,t,r,n={})=>y((n={})=>new E(t,e,void 0===n.dkLen?r:n.dkLen,!0),n),F=K(31,168,16,w(11)),R=K(31,136,32,w(12)),M=(X=globalThis,$={},new Proxy(X,{get:(e,t,r)=>t in $?$[t]:X[t],set:(e,t,r)=>(t in $&&delete $[t],X[t]=r,!0),deleteProperty(e,t){let r=!1;return t in $&&(delete $[t],r=!0),t in X&&(delete X[t],r=!0),r},ownKeys(e){const t=Reflect.ownKeys(X),r=Reflect.ownKeys($),n=new Set(r);return[...t.filter(e=>!n.has(e)),...r]},defineProperty:(e,t,r)=>(t in $&&delete $[t],Reflect.defineProperty(X,t,r),!0),getOwnPropertyDescriptor:(e,t)=>t in $?Reflect.getOwnPropertyDescriptor($,t):Reflect.getOwnPropertyDescriptor(X,t),has:(e,t)=>t in $||t in X}));var X,$;function C(e){return e%256}function D(e){const t=-32768;return e>=t&&e<=32767?e:e<t?(e+=32769,32767+(e%=65536)):(e-=32768,t+(e%=65536))}function T(e){return e%65536}function H(e){const t=-2147483648,r=2147483647;return e>=t&&e<=r?e:e<t?(e+=2147483649,r+(e%=4294967296)):(e-=2147483648,t+(e%=4294967296))}function Z(e){return e%4294967296}function q(e,t,r){return R.create({dkLen:e}).update(t).update(new Uint8Array([r])).digest()}function G(e){let t=Z(e[0]);return t|=Z(e[1])<<8,t|=Z(e[2])<<16,t}function J(e){let t=Z(e[0]);return t|=Z(e[1])<<8,t|=Z(e[2])<<16,t|=Z(e[3])<<24,Z(t)}class Q{constructor(){Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_k",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_du",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_dv",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_eta1",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_eta2",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_skSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_pkSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_compressedUSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_compressedVSize",{enumerable:!0,configurable:!0,writable:!0,value:0})}async generateKeyPair(){await this._setup();try{const e=new Uint8Array(64);return this._api.getRandomValues(e),this._deriveKeyPair(e)}catch(e){throw new n(e)}}async deriveKeyPair(e){await this._setup();try{if(64!==e.byteLength)throw new Error("seed must be 64 bytes in length");return this._deriveKeyPair(e)}catch(e){throw new n(e)}}async encap(e,t){await this._setup();try{if(e.length!==384*this._k+32)throw new Error("invalid encapsulation key");const r=this._getSeed(t),[n,i]=W(r,Y(e));return[this._encap(e,r,i),n]}catch(e){throw new n(e)}}async decap(e,t){await this._setup();try{if(e.byteLength!==this._compressedUSize+this._compressedVSize)throw new Error("Invalid ct size");if(t.length!==768*this._k+96)throw new Error("Invalid decapsulation key");const r=t.subarray(0,this._skSize),n=t.subarray(this._skSize,this._skSize+this._pkSize),i=t.subarray(this._skSize+this._pkSize,this._skSize+this._pkSize+32),s=t.subarray(this._skSize+this._pkSize+32,this._skSize+this._pkSize+64),o=this._decap(e,r),[a,l]=W(o,i),u=function(e,t){const r=R.create({dkLen:32}).update(e);return void 0!==t&&r.update(t),r.digest()}(s,e);return 1===function(e,t){if(e.length!=t.length)return 0;const r=new Uint8Array([0]);for(let n=0;n<e.length;n++)r[0]|=e[n]^t[n];const n=new Uint8Array([0]);return n[0]=r[0]^~n[0],n[0]&=n[0]>>4,n[0]&=n[0]>>2,n[0]&=n[0]>>1,n[0]}(e,this._encap(n,o,l))?a:u}catch(e){throw new n(e)}}async _setup(){void 0===this._api&&(this._api=await async function(){if(void 0!==M&&void 0!==globalThis.crypto)return globalThis.crypto;try{const{webcrypto:e}=await Promise.resolve().then(r.t.bind(r,1565,19));return e}catch(e){throw new Error("failed to load Crypto")}}())}_getSeed(e){if(null==e){const e=new Uint8Array(32);return this._api.getRandomValues(e),e}if(32!==e.byteLength)throw new Error("seed must be 32 bytes in length");return e}_deriveKeyPair(e){const t=e.subarray(0,32),r=e.subarray(32,64),[n,i]=this._deriveCpaKeyPair(t),s=Y(n),o=new Uint8Array(this._skSize+this._pkSize+64);return o.set(i,0),o.set(n,this._skSize),o.set(s,this._skSize+this._pkSize),o.set(r,this._skSize+this._pkSize+32),[n,o]}_deriveCpaKeyPair(e){const[t,r]=W(e,new Uint8Array([this._k])),n=this._sampleMatrix(t,!1),i=this._sampleNoise1(r,0,this._k),s=this._sampleNoise1(r,this._k,this._k);for(let e=0;e<this._k;e++)i[e]=se(i[e]),i[e]=ae(i[e]),s[e]=se(s[e]);const o=new Array(this._k);for(let e=0;e<this._k;e++)o[e]=ce(he(n[e],i)),o[e]=_e(o[e],s[e]),o[e]=ae(o[e]);const a=new Uint8Array(this._pkSize);for(let e=0;e<this._k;e++)a.set(te(o[e]),384*e);a.set(t,this._skSize);const l=new Uint8Array(this._skSize);for(let e=0;e<this._k;e++)l.set(te(i[e]),384*e);return[a,l]}_encap(e,t,r){const n=new Array(this._k),i=new Uint8Array(384*this._k);for(let t=0;t<this._k;t++)n[t]=re(e.subarray(384*t,384*(t+1))),i.set(te(n[t]),384*t);if(!function(e,t){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(e.subarray(0,i.length),i))throw new Error("invalid encapsulation key");const s=e.subarray(this._skSize),o=this._sampleMatrix(s,!0),a=this._sampleNoise1(r,0,this._k),l=this._sampleNoise2(r,this._k,this._k),u=this._sampleNoise2(r,2*this._k,1)[0];for(let e=0;e<this._k;e++)a[e]=se(a[e]),a[e]=ae(a[e]);const c=new Array(this._k);for(let e=0;e<this._k;e++)c[e]=he(o[e],a),c[e]=de(c[e]),c[e]=_e(c[e],l[e]),c[e]=ae(c[e]);const h=function(e){const t=new Array(384).fill(0);let r;for(let n=0;n<32;n++)for(let i=0;i<8;i++)r=-1*D(e[n]>>i&1),t[8*n+i]=r&D(1665);return t}(t);let f=he(n,a);f=de(f),f=_e(f,u),f=_e(f,h),f=ae(f);const b=new Uint8Array(this._compressedUSize+this._compressedVSize);return this._compressU(b.subarray(0,this._compressedUSize),c),this._compressV(b.subarray(this._compressedUSize),f),b}_decap(e,t){const r=this._decompressU(e.subarray(0,this._compressedUSize)),n=this._decompressV(e.subarray(this._compressedUSize)),o=this._polyvecFromBytes(t);for(let e=0;e<this._k;e++)r[e]=se(r[e]);let a=he(o,r);return a=de(a),a=function(e,t){for(let r=0;r<i;r++)e[r]-=t[r];return e}(n,a),a=ae(a),function(e){const t=new Uint8Array(32);let r;const n=pe(e);for(let e=0;e<32;e++){t[e]=0;for(let i=0;i<8;i++)r=((T(n[8*e+i])<<1)+T(s/2))/T(s)&1,t[e]|=C(r<<i)}return t}(a)}_sampleMatrix(e,t){const r=new Array(this._k),n=new Uint8Array(2);for(let s=0,o=0;o<this._k;o++){r[o]=new Array(this._k);for(let a=0;a<this._k;a++){t?(n[0]=o,n[1]=a):(n[0]=a,n[1]=o);const l=ee(e,n),u=ne(l.subarray(0,504),504,i);for(r[o][a]=u[0],s=u[1];s<i;){const e=ne(l.subarray(504,672),168,i-s),t=e[0],n=e[1];for(let e=s;e<i;e++)r[o][a][e]=t[e-s];s+=n}}}return r}_sampleNoise1(e,t,r){const n=new Array(r);for(let s=0;s<r;s++)n[s]=ie(q(this._eta1*i/4,e,t),this._eta1),t++;return n}_sampleNoise2(e,t,r){const n=new Array(r);for(let s=0;s<r;s++)n[s]=ie(q(this._eta2*i/4,e,t),this._eta2),t++;return n}_polyvecFromBytes(e){const t=new Array(this._k);for(let r=0;r<this._k;r++)t[r]=re(e.subarray(384*r,384*(r+1)));return t}_compressU(e,t){const r=new Array(4);for(let n=0,i=0;i<this._k;i++)for(let o=0;o<64;o++){for(let e=0;e<4;e++)r[e]=((t[i][4*o+e]<<10)+s/2)/s&1023;e[n++]=C(0|r[0]),e[n++]=C(r[0]>>8|r[1]<<2),e[n++]=C(r[1]>>6|r[2]<<4),e[n++]=C(r[2]>>4|r[3]<<6),e[n++]=C(r[3]>>2)}return e}_compressV(e,t){const r=new Uint8Array(8);for(let n=0,i=0;i<32;i++){for(let e=0;e<8;e++)r[e]=15&C(((t[8*i+e]<<4)+s/2)/s);e[n++]=r[0]|r[1]<<4,e[n++]=r[2]|r[3]<<4,e[n++]=r[4]|r[5]<<4,e[n++]=r[6]|r[7]<<4}return e}_decompressU(e){const t=new Array(this._k);for(let e=0;e<this._k;e++)t[e]=new Array(384);const r=new Array(4);for(let n=0,i=0;i<this._k;i++)for(let o=0;o<64;o++){r[0]=T(e[n+0])|T(e[n+1])<<8,r[1]=T(e[n+1])>>2|T(e[n+2])<<6,r[2]=T(e[n+2])>>4|T(e[n+3])<<4,r[3]=T(e[n+3])>>6|T(e[n+4])<<2,n+=5;for(let e=0;e<4;e++)t[i][4*o+e]=D(Z(1023&r[e])*Z(s)+512>>10)}return t}_decompressV(e){const t=new Array(384);for(let r=0,n=0;n<128;n++,r++)t[2*n+0]=D(T(15&e[r])*T(s)+8>>4),t[2*n+1]=D(T(e[r]>>4)*T(s)+8>>4);return t}}function W(e,t){const r=B.create().update(e);void 0!==t&&r.update(t);const n=r.digest();return[n.subarray(0,32),n.subarray(32,64)]}function Y(e){return N.create().update(e).digest()}function ee(e,t){return F.create({dkLen:672}).update(e).update(t).digest()}function te(e){let t=0,r=0;const n=new Uint8Array(384),i=pe(e);for(let e=0;e<128;e++)t=T(i[2*e]),r=T(i[2*e+1]),n[3*e+0]=C(0|t),n[3*e+1]=C(t>>8)|C(r<<4),n[3*e+2]=C(r>>4);return n}function re(e){const t=new Array(384).fill(0);for(let r=0;r<128;r++)t[2*r]=D(4095&(T(e[3*r+0])|T(e[3*r+1])<<8)),t[2*r+1]=D(4095&(T(e[3*r+1])>>4|T(e[3*r+2])<<4));return t}function ne(e,t,r){const n=new Array(384).fill(0);let i,o,a=0;for(let l=0;a<r&&l+3<=t;)i=4095&(T(0|e[l])|T(e[l+1])<<8),o=4095&(T(e[l+1]>>4)|T(e[l+2])<<4),l+=3,i<s&&(n[a]=i,a+=1),a<r&&o<s&&(n[a]=o,a+=1);return[n,a]}function ie(e,t){let r,n,i,s;const o=new Array(384).fill(0);for(let a=0;a<32;a++){r=J(e.subarray(4*a,e.length)),n=1431655765&r,n+=r>>1&1431655765;for(let e=0;e<8;e++)i=D(n>>4*e+0&3),s=D(n>>4*e+t&3),o[8*a+e]=i-s}return o}function se(e){for(let t=0,r=1,n=128;n>=2;n>>=1)for(let i=0;i<256;i=t+n){const s=o[r];for(r+=1,t=i;t<i+n;t++){const r=oe(s,e[t+n]);e[t+n]=e[t]-r,e[t]=e[t]+r}}return e}function oe(e,t){return ue(e*t)}function ae(e){for(let t=0;t<i;t++)e[t]=le(e[t]);return e}function le(e){let t=16778880.5/s*e>>24;return t*=s,e-t}function ue(e){let t=D(62209*H(e))*s;return t=e-t,t>>=16,D(t)}function ce(e){for(let t=0;t<i;t++)e[t]=ue(H(e[t])*H(1353));return e}function he(e,t){let r,n=fe(e[0],t[0]);for(let i=1;i<e.length;i++)r=fe(e[i],t[i]),n=_e(n,r);return ae(n)}function fe(e,t){let r,n;for(let i=0;i<64;i++)r=be(e[4*i+0],e[4*i+1],t[4*i+0],t[4*i+1],o[64+i]),n=be(e[4*i+2],e[4*i+3],t[4*i+2],t[4*i+3],-o[64+i]),e[4*i+0]=r[0],e[4*i+1]=r[1],e[4*i+2]=n[0],e[4*i+3]=n[1];return e}function be(e,t,r,n,i){const s=new Array(2);return s[0]=oe(t,n),s[0]=oe(s[0],i),s[0]+=oe(e,r),s[1]=oe(e,n),s[1]+=oe(t,r),s}function _e(e,t){const r=new Array(384);for(let n=0;n<i;n++)r[n]=e[n]+t[n];return r}function de(e){let t=0;for(let r=0,n=2;n<=128;n<<=1)for(let i=0;i<256;i=t+n){const s=a[r];for(r+=1,t=i;t<i+n;t++){const r=e[t];e[t]=le(r+e[t+n]),e[t+n]=r-e[t+n],e[t+n]=oe(s,e[t+n])}}for(t=0;t<256;t++)e[t]=oe(e[t],a[127]);return e}function pe(e){for(let t=0;t<i;t++)e[t]-=s,e[t]+=e[t]>>31&s;return e}class ye extends Q{constructor(){super(),Object.defineProperty(this,"_k",{enumerable:!0,configurable:!0,writable:!0,value:2}),Object.defineProperty(this,"_du",{enumerable:!0,configurable:!0,writable:!0,value:10}),Object.defineProperty(this,"_dv",{enumerable:!0,configurable:!0,writable:!0,value:4}),Object.defineProperty(this,"_eta1",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"_eta2",{enumerable:!0,configurable:!0,writable:!0,value:2}),this._skSize=12*this._k*i/8,this._pkSize=this._skSize+32,this._compressedUSize=this._k*this._du*i/8,this._compressedVSize=this._dv*i/8}_sampleNoise1(e,t,r){const n=new Array(r);for(let s=0;s<r;s++)n[s]=we(q(this._eta1*i/4,e,t),this._eta1),t++;return n}}function we(e,t){let r,n,i,s;const o=new Array(384).fill(0);for(let a=0;a<64;a++){r=G(e.subarray(3*a,e.length)),n=2396745&r,n+=r>>1&2396745,n+=r>>2&2396745;for(let e=0;e<4;e++)i=D(n>>6*e+0&7),s=D(n>>6*e+t&7),o[4*a+e]=i-s}return o}class ke extends Q{constructor(){super(),Object.defineProperty(this,"_k",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"_du",{enumerable:!0,configurable:!0,writable:!0,value:10}),Object.defineProperty(this,"_dv",{enumerable:!0,configurable:!0,writable:!0,value:4}),Object.defineProperty(this,"_eta1",{enumerable:!0,configurable:!0,writable:!0,value:2}),Object.defineProperty(this,"_eta2",{enumerable:!0,configurable:!0,writable:!0,value:2}),this._skSize=12*this._k*i/8,this._pkSize=this._skSize+32,this._compressedUSize=this._k*this._du*i/8,this._compressedVSize=this._dv*i/8}}class ge extends Q{constructor(){super(),Object.defineProperty(this,"_k",{enumerable:!0,configurable:!0,writable:!0,value:4}),Object.defineProperty(this,"_du",{enumerable:!0,configurable:!0,writable:!0,value:11}),Object.defineProperty(this,"_dv",{enumerable:!0,configurable:!0,writable:!0,value:5}),Object.defineProperty(this,"_eta1",{enumerable:!0,configurable:!0,writable:!0,value:2}),Object.defineProperty(this,"_eta2",{enumerable:!0,configurable:!0,writable:!0,value:2}),this._skSize=12*this._k*i/8,this._pkSize=this._skSize+32,this._compressedUSize=this._k*this._du*i/8,this._compressedVSize=this._dv*i/8}_compressU(e,t){const r=new Array(8);for(let n=0,i=0;i<this._k;i++)for(let o=0;o<32;o++){for(let e=0;e<8;e++)r[e]=T(((Z(t[i][8*o+e])<<11)+Z(s/2))/Z(s)&2047);e[n++]=C(0|r[0]),e[n++]=C(r[0]>>8|r[1]<<3),e[n++]=C(r[1]>>5|r[2]<<6),e[n++]=C(r[2]>>2),e[n++]=C(r[2]>>10|r[3]<<1),e[n++]=C(r[3]>>7|r[4]<<4),e[n++]=C(r[4]>>4|r[5]<<7),e[n++]=C(r[5]>>1),e[n++]=C(r[5]>>9|r[6]<<2),e[n++]=C(r[6]>>6|r[7]<<5),e[n++]=C(r[7]>>3)}return e}_compressV(e,t){const r=new Uint8Array(8);for(let n=0,i=0;i<32;i++){for(let e=0;e<8;e++)r[e]=31&C(((Z(t[8*i+e])<<5)+Z(s/2))/Z(s));e[n++]=C(r[0]|r[1]<<5),e[n++]=C(r[1]>>3|r[2]<<2|r[3]<<7),e[n++]=C(r[3]>>1|r[4]<<4),e[n++]=C(r[4]>>4|r[5]<<1|r[6]<<6),e[n++]=C(r[6]>>2|r[7]<<3)}return e}_decompressU(e){const t=new Array(this._k);for(let e=0;e<this._k;e++)t[e]=new Array(384);const r=new Array(8);for(let n=0,i=0;i<this._k;i++)for(let o=0;o<32;o++){r[0]=T(e[n+0])|T(e[n+1])<<8,r[1]=T(e[n+1])>>3|T(e[n+2])<<5,r[2]=T(e[n+2])>>6|T(e[n+3])<<2|T(e[n+4])<<10,r[3]=T(e[n+4])>>1|T(e[n+5])<<7,r[4]=T(e[n+5])>>4|T(e[n+6])<<4,r[5]=T(e[n+6])>>7|T(e[n+7])<<1|T(e[n+8])<<9,r[6]=T(e[n+8])>>2|T(e[n+9])<<6,r[7]=T(e[n+9])>>5|T(e[n+10])<<3,n+=11;for(let e=0;e<8;e++)t[i][8*o+e]=Z(2047&r[e])*s+1024>>11}return t}_decompressV(e){const t=new Array(384),r=new Array(8);for(let n=0,i=0;i<32;i++){r[0]=0|e[n+0],r[1]=e[n+0]>>5|e[n+1]<<3,r[2]=e[n+1]>>2,r[3]=e[n+1]>>7|e[n+2]<<1,r[4]=e[n+2]>>4|e[n+3]<<4,r[5]=e[n+3]>>1,r[6]=e[n+3]>>6|e[n+4]<<2,r[7]=e[n+4]>>3,n+=5;for(let e=0;e<8;e++)t[8*i+e]=D(Z(31&r[e])*Z(s)+16>>5)}return t}}}};
|
package/dist/695.index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const __webpack_esm_id__=695;export const __webpack_esm_ids__=[695];export const __webpack_esm_modules__={18695:(e,t,r)=>{function n(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function o(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function i(e,t,r=""){const n=(o=e)instanceof Uint8Array||ArrayBuffer.isView(o)&&"Uint8Array"===o.constructor.name;var o;const i=e?.length,s=void 0!==t;if(!n||s&&i!==t)throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(s?` of length ${t}`:"")+", got "+(n?`length=${i}`:"type="+typeof e));return e}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function a(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function c(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}r.d(t,{Chacha20Poly1305:()=>C});const u=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])(),l=(e,t)=>{function r(r,...n){if(i(r,void 0,"key"),!u)throw new Error("Non little-endian hardware is not yet supported");void 0!==e.nonceLength&&i(n[0],e.varSizeNonce?void 0:e.nonceLength,"nonce");const o=e.tagLength;o&&void 0!==n[1]&&i(n[1],void 0,"AAD");const s=t(r,...n),a=(e,t)=>{if(void 0!==t){if(2!==e)throw new Error("cipher output not supported");i(t,void 0,"output")}};let c=!1;return{encrypt(e,t){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,i(e),a(s.encrypt.length,t),s.encrypt(e,t)},decrypt(e,t){if(i(e),o&&e.length<o)throw new Error('"ciphertext" expected length bigger than tagLength='+o);return a(s.decrypt.length,t),s.decrypt(e,t)}}}return Object.assign(r,e),r};function h(e,t,r=!0){if(void 0===t)return new Uint8Array(e);if(t.length!==e)throw new Error('"output" expected Uint8Array of length '+e+", got: "+t.length);if(r&&t.byteOffset%4!=0)throw new Error("invalid output, must be aligned");return t}function f(e){return Uint8Array.from(e)}const b=e=>Uint8Array.from(e.split("").map(e=>e.charCodeAt(0))),y=b("expand 16-byte k"),w=b("expand 32-byte k"),p=a(y),d=a(w);function g(e,t){return e<<t|e>>>32-t}function v(e){return e.byteOffset%4==0}const A=2**32-1,U=Uint32Array.of();function m(e,t){const{allowShortKeys:r,extendNonceFn:s,counterLength:u,counterRight:l,rounds:h}=function(e,t){if(null==t||"object"!=typeof t)throw new Error("options must be defined");return Object.assign({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t)}(0,t);if("function"!=typeof e)throw new Error("core must be a function");return o(u),o(h),n(l),n(r),(t,n,b,y,w=0)=>{i(t,void 0,"key"),i(n,void 0,"nonce"),i(b,void 0,"data");const g=b.length;if(void 0===y&&(y=new Uint8Array(g)),i(y,void 0,"output"),o(w),w<0||w>=A)throw new Error("arx: counter overflow");if(y.length<g)throw new Error(`arx: output (${y.length}) is shorter than data (${g})`);const m=[],_=t.length;let E,k;if(32===_)m.push(E=f(t)),k=d;else{if(16!==_||!r)throw i(t,32,"arx key"),new Error("invalid key size");E=new Uint8Array(32),E.set(t),E.set(t,16),k=p,m.push(E)}v(n)||m.push(n=f(n));const x=a(E);if(s){if(24!==n.length)throw new Error("arx: extended nonce must be 24 bytes");s(k,x,a(n.subarray(0,16)),x),n=n.subarray(16)}const L=16-u;if(L!==n.length)throw new Error(`arx: nonce must be ${L} or 16 bytes`);if(12!==L){const e=new Uint8Array(12);e.set(n,l?0:12-n.length),n=e,m.push(n)}const O=a(n);return function(e,t,r,n,o,i,s,c){const u=o.length,l=new Uint8Array(64),h=a(l),f=v(o)&&v(i),b=f?a(o):U,y=f?a(i):U;for(let a=0;a<u;s++){if(e(t,r,n,h,s,c),s>=A)throw new Error("arx: counter overflow");const w=Math.min(64,u-a);if(f&&64===w){const e=a/4;if(a%4!=0)throw new Error("arx: invalid block position");for(let t,r=0;r<16;r++)t=e+r,y[t]=b[t]^h[r];a+=64;continue}for(let e,t=0;t<w;t++)e=a+t,i[e]=o[e]^l[t];a+=w}}(e,k,x,O,b,y,w,h),c(...m),y}}function _(e,t){return 255&e[t++]|(255&e[t++])<<8}class E{constructor(e){Object.defineProperty(this,"blockLen",{enumerable:!0,configurable:!0,writable:!0,value:16}),Object.defineProperty(this,"outputLen",{enumerable:!0,configurable:!0,writable:!0,value:16}),Object.defineProperty(this,"buffer",{enumerable:!0,configurable:!0,writable:!0,value:new Uint8Array(16)}),Object.defineProperty(this,"r",{enumerable:!0,configurable:!0,writable:!0,value:new Uint16Array(10)}),Object.defineProperty(this,"h",{enumerable:!0,configurable:!0,writable:!0,value:new Uint16Array(10)}),Object.defineProperty(this,"pad",{enumerable:!0,configurable:!0,writable:!0,value:new Uint16Array(8)}),Object.defineProperty(this,"pos",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"finished",{enumerable:!0,configurable:!0,writable:!0,value:!1});const t=_(e=f(i(e,32,"key")),0),r=_(e,2),n=_(e,4),o=_(e,6),s=_(e,8),a=_(e,10),c=_(e,12),u=_(e,14);this.r[0]=8191&t,this.r[1]=8191&(t>>>13|r<<3),this.r[2]=7939&(r>>>10|n<<6),this.r[3]=8191&(n>>>7|o<<9),this.r[4]=255&(o>>>4|s<<12),this.r[5]=s>>>1&8190,this.r[6]=8191&(s>>>14|a<<2),this.r[7]=8065&(a>>>11|c<<5),this.r[8]=8191&(c>>>8|u<<8),this.r[9]=u>>>5&127;for(let t=0;t<8;t++)this.pad[t]=_(e,16+2*t)}process(e,t,r=!1){const n=r?0:2048,{h:o,r:i}=this,s=i[0],a=i[1],c=i[2],u=i[3],l=i[4],h=i[5],f=i[6],b=i[7],y=i[8],w=i[9],p=_(e,t+0),d=_(e,t+2),g=_(e,t+4),v=_(e,t+6),A=_(e,t+8),U=_(e,t+10),m=_(e,t+12),E=_(e,t+14),k=o[0]+(8191&p),x=o[1]+(8191&(p>>>13|d<<3)),L=o[2]+(8191&(d>>>10|g<<6)),O=o[3]+(8191&(g>>>7|v<<9)),P=o[4]+(8191&(v>>>4|A<<12)),j=o[5]+(A>>>1&8191),S=o[6]+(8191&(A>>>14|U<<2)),z=o[7]+(8191&(U>>>11|m<<5)),$=o[8]+(8191&(m>>>8|E<<8)),I=o[9]+(E>>>5|n);let B=0,C=B+k*s+x*(5*w)+L*(5*y)+O*(5*b)+P*(5*f);B=C>>>13,C&=8191,C+=j*(5*h)+S*(5*l)+z*(5*u)+$*(5*c)+I*(5*a),B+=C>>>13,C&=8191;let N=B+k*a+x*s+L*(5*w)+O*(5*y)+P*(5*b);B=N>>>13,N&=8191,N+=j*(5*f)+S*(5*h)+z*(5*l)+$*(5*u)+I*(5*c),B+=N>>>13,N&=8191;let D=B+k*c+x*a+L*s+O*(5*w)+P*(5*y);B=D>>>13,D&=8191,D+=j*(5*b)+S*(5*f)+z*(5*h)+$*(5*l)+I*(5*u),B+=D>>>13,D&=8191;let K=B+k*u+x*c+L*a+O*s+P*(5*w);B=K>>>13,K&=8191,K+=j*(5*y)+S*(5*b)+z*(5*f)+$*(5*h)+I*(5*l),B+=K>>>13,K&=8191;let M=B+k*l+x*u+L*c+O*a+P*s;B=M>>>13,M&=8191,M+=j*(5*w)+S*(5*y)+z*(5*b)+$*(5*f)+I*(5*h),B+=M>>>13,M&=8191;let R=B+k*h+x*l+L*u+O*c+P*a;B=R>>>13,R&=8191,R+=j*s+S*(5*w)+z*(5*y)+$*(5*b)+I*(5*f),B+=R>>>13,R&=8191;let H=B+k*f+x*h+L*l+O*u+P*c;B=H>>>13,H&=8191,H+=j*a+S*s+z*(5*w)+$*(5*y)+I*(5*b),B+=H>>>13,H&=8191;let V=B+k*b+x*f+L*h+O*l+P*u;B=V>>>13,V&=8191,V+=j*c+S*a+z*s+$*(5*w)+I*(5*y),B+=V>>>13,V&=8191;let F=B+k*y+x*b+L*f+O*h+P*l;B=F>>>13,F&=8191,F+=j*u+S*c+z*a+$*s+I*(5*w),B+=F>>>13,F&=8191;let q=B+k*w+x*y+L*b+O*f+P*h;B=q>>>13,q&=8191,q+=j*l+S*u+z*c+$*a+I*s,B+=q>>>13,q&=8191,B=(B<<2)+B|0,B=B+C|0,C=8191&B,B>>>=13,N+=B,o[0]=C,o[1]=N,o[2]=D,o[3]=K,o[4]=M,o[5]=R,o[6]=H,o[7]=V,o[8]=F,o[9]=q}finalize(){const{h:e,pad:t}=this,r=new Uint16Array(10);let n=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=n,n=e[t]>>>13,e[t]&=8191;e[0]+=5*n,n=e[0]>>>13,e[0]&=8191,e[1]+=n,n=e[1]>>>13,e[1]&=8191,e[2]+=n,r[0]=e[0]+5,n=r[0]>>>13,r[0]&=8191;for(let t=1;t<10;t++)r[t]=e[t]+n,n=r[t]>>>13,r[t]&=8191;r[9]-=8192;let o=(1^n)-1;for(let e=0;e<10;e++)r[e]&=o;o=~o;for(let t=0;t<10;t++)e[t]=e[t]&o|r[t];e[0]=65535&(e[0]|e[1]<<13),e[1]=65535&(e[1]>>>3|e[2]<<10),e[2]=65535&(e[2]>>>6|e[3]<<7),e[3]=65535&(e[3]>>>9|e[4]<<4),e[4]=65535&(e[4]>>>12|e[5]<<1|e[6]<<14),e[5]=65535&(e[6]>>>2|e[7]<<11),e[6]=65535&(e[7]>>>5|e[8]<<8),e[7]=65535&(e[8]>>>8|e[9]<<5);let i=e[0]+t[0];e[0]=65535&i;for(let r=1;r<8;r++)i=(e[r]+t[r]|0)+(i>>>16)|0,e[r]=65535&i;c(r)}update(e){s(this),i(e),e=f(e);const{buffer:t,blockLen:r}=this,n=e.length;for(let o=0;o<n;){const i=Math.min(r-this.pos,n-o);if(i!==r)t.set(e.subarray(o,o+i),this.pos),this.pos+=i,o+=i,this.pos===r&&(this.process(t,0,!1),this.pos=0);else for(;r<=n-o;o+=r)this.process(e,o)}return this}destroy(){c(this.h,this.r,this.buffer,this.pad)}digestInto(e){s(this),function(e,t){i(e,void 0,"output");const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;const{buffer:t,h:r}=this;let{pos:n}=this;if(n){for(t[n++]=1;n<16;n++)t[n]=0;this.process(t,0,!0)}this.finalize();let o=0;for(let t=0;t<8;t++)e[o++]=r[t]>>>0,e[o++]=r[t]>>>8;return e}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}}const k=(()=>function(e){const t=(t,r)=>e(r).update(t).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(e=>new E(e)))();function x(e,t,r,n,o,i=20){const s=e[0],a=e[1],c=e[2],u=e[3],l=t[0],h=t[1],f=t[2],b=t[3],y=t[4],w=t[5],p=t[6],d=t[7],v=o,A=r[0],U=r[1],m=r[2];let _=s,E=a,k=c,x=u,L=l,O=h,P=f,j=b,S=y,z=w,$=p,I=d,B=v,C=A,N=U,D=m;for(let e=0;e<i;e+=2)_=_+L|0,B=g(B^_,16),S=S+B|0,L=g(L^S,12),_=_+L|0,B=g(B^_,8),S=S+B|0,L=g(L^S,7),E=E+O|0,C=g(C^E,16),z=z+C|0,O=g(O^z,12),E=E+O|0,C=g(C^E,8),z=z+C|0,O=g(O^z,7),k=k+P|0,N=g(N^k,16),$=$+N|0,P=g(P^$,12),k=k+P|0,N=g(N^k,8),$=$+N|0,P=g(P^$,7),x=x+j|0,D=g(D^x,16),I=I+D|0,j=g(j^I,12),x=x+j|0,D=g(D^x,8),I=I+D|0,j=g(j^I,7),_=_+O|0,D=g(D^_,16),$=$+D|0,O=g(O^$,12),_=_+O|0,D=g(D^_,8),$=$+D|0,O=g(O^$,7),E=E+P|0,B=g(B^E,16),I=I+B|0,P=g(P^I,12),E=E+P|0,B=g(B^E,8),I=I+B|0,P=g(P^I,7),k=k+j|0,C=g(C^k,16),S=S+C|0,j=g(j^S,12),k=k+j|0,C=g(C^k,8),S=S+C|0,j=g(j^S,7),x=x+L|0,N=g(N^x,16),z=z+N|0,L=g(L^z,12),x=x+L|0,N=g(N^x,8),z=z+N|0,L=g(L^z,7);let K=0;n[K++]=s+_|0,n[K++]=a+E|0,n[K++]=c+k|0,n[K++]=u+x|0,n[K++]=l+L|0,n[K++]=h+O|0,n[K++]=f+P|0,n[K++]=b+j|0,n[K++]=y+S|0,n[K++]=w+z|0,n[K++]=p+$|0,n[K++]=d+I|0,n[K++]=v+B|0,n[K++]=A+C|0,n[K++]=U+N|0,n[K++]=m+D|0}const L=m(x,{counterRight:!1,counterLength:4,allowShortKeys:!1}),O=new Uint8Array(16),P=(e,t)=>{e.update(t);const r=t.length%16;r&&e.update(O.subarray(r))},j=new Uint8Array(32);function S(e,t,r,o,s){void 0!==s&&i(s,void 0,"AAD");const a=e(t,r,j),u=function(e,t,r){n(r);const o=new Uint8Array(16),i=(s=o,new DataView(s.buffer,s.byteOffset,s.byteLength));var s;return i.setBigUint64(0,BigInt(t),r),i.setBigUint64(8,BigInt(e),r),o}(o.length,s?s.length:0,!0),l=k.create(a);s&&P(l,s),P(l,o),l.update(u);const h=l.digest();return c(a,u),h}const z=l({blockSize:64,nonceLength:12,tagLength:16},($=L,(e,t,r)=>({encrypt(n,o){const i=n.length;(o=h(i+16,o,!1)).set(n);const s=o.subarray(0,-16);$(e,t,s,s,1);const a=S($,e,t,s,r);return o.set(a,i),c(a),o},decrypt(n,o){o=h(n.length-16,o,!1);const i=n.subarray(0,-16),s=n.subarray(-16),a=S($,e,t,i,r);if(!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(s,a))throw new Error("invalid tag");return o.set(n.subarray(0,-16)),$(e,t,o,o,1),c(a),o}})));var $,I=r(24220);class B{constructor(e){Object.defineProperty(this,"_key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._key=new Uint8Array(e)}async seal(e,t,r){return await this._seal(e,t,r)}async open(e,t,r){return await this._open(e,t,r)}_seal(e,t,r){return new Promise(n=>{n(z(this._key,new Uint8Array(e),new Uint8Array(r)).encrypt(new Uint8Array(t)).buffer)})}_open(e,t,r){return new Promise(n=>{n(z(this._key,new Uint8Array(e),new Uint8Array(r)).decrypt(new Uint8Array(t)).buffer)})}}class C{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:I.vw.Chacha20Poly1305}),Object.defineProperty(this,"keySize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"nonceSize",{enumerable:!0,configurable:!0,writable:!0,value:12}),Object.defineProperty(this,"tagSize",{enumerable:!0,configurable:!0,writable:!0,value:16})}createEncryptionContext(e){return new B(e)}}}};
|
|
1
|
+
export const __webpack_esm_id__=695;export const __webpack_esm_ids__=[695];export const __webpack_esm_modules__={8695:(e,t,r)=>{function n(e){if("boolean"!=typeof e)throw new Error(`boolean expected, not ${e}`)}function o(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function i(e,t,r=""){const n=(o=e)instanceof Uint8Array||ArrayBuffer.isView(o)&&"Uint8Array"===o.constructor.name;var o;const i=e?.length,s=void 0!==t;if(!n||s&&i!==t)throw new Error((r&&`"${r}" `)+"expected Uint8Array"+(s?` of length ${t}`:"")+", got "+(n?`length=${i}`:"type="+typeof e));return e}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function a(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function c(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}r.d(t,{Chacha20Poly1305:()=>C});const u=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])(),l=(e,t)=>{function r(r,...n){if(i(r,void 0,"key"),!u)throw new Error("Non little-endian hardware is not yet supported");void 0!==e.nonceLength&&i(n[0],e.varSizeNonce?void 0:e.nonceLength,"nonce");const o=e.tagLength;o&&void 0!==n[1]&&i(n[1],void 0,"AAD");const s=t(r,...n),a=(e,t)=>{if(void 0!==t){if(2!==e)throw new Error("cipher output not supported");i(t,void 0,"output")}};let c=!1;return{encrypt(e,t){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,i(e),a(s.encrypt.length,t),s.encrypt(e,t)},decrypt(e,t){if(i(e),o&&e.length<o)throw new Error('"ciphertext" expected length bigger than tagLength='+o);return a(s.decrypt.length,t),s.decrypt(e,t)}}}return Object.assign(r,e),r};function h(e,t,r=!0){if(void 0===t)return new Uint8Array(e);if(t.length!==e)throw new Error('"output" expected Uint8Array of length '+e+", got: "+t.length);if(r&&t.byteOffset%4!=0)throw new Error("invalid output, must be aligned");return t}function f(e){return Uint8Array.from(e)}const b=e=>Uint8Array.from(e.split("").map(e=>e.charCodeAt(0))),y=b("expand 16-byte k"),w=b("expand 32-byte k"),p=a(y),d=a(w);function g(e,t){return e<<t|e>>>32-t}function v(e){return e.byteOffset%4==0}const A=2**32-1,U=Uint32Array.of();function m(e,t){const{allowShortKeys:r,extendNonceFn:s,counterLength:u,counterRight:l,rounds:h}=function(e,t){if(null==t||"object"!=typeof t)throw new Error("options must be defined");return Object.assign({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t)}(0,t);if("function"!=typeof e)throw new Error("core must be a function");return o(u),o(h),n(l),n(r),(t,n,b,y,w=0)=>{i(t,void 0,"key"),i(n,void 0,"nonce"),i(b,void 0,"data");const g=b.length;if(void 0===y&&(y=new Uint8Array(g)),i(y,void 0,"output"),o(w),w<0||w>=A)throw new Error("arx: counter overflow");if(y.length<g)throw new Error(`arx: output (${y.length}) is shorter than data (${g})`);const m=[],_=t.length;let E,k;if(32===_)m.push(E=f(t)),k=d;else{if(16!==_||!r)throw i(t,32,"arx key"),new Error("invalid key size");E=new Uint8Array(32),E.set(t),E.set(t,16),k=p,m.push(E)}v(n)||m.push(n=f(n));const x=a(E);if(s){if(24!==n.length)throw new Error("arx: extended nonce must be 24 bytes");s(k,x,a(n.subarray(0,16)),x),n=n.subarray(16)}const L=16-u;if(L!==n.length)throw new Error(`arx: nonce must be ${L} or 16 bytes`);if(12!==L){const e=new Uint8Array(12);e.set(n,l?0:12-n.length),n=e,m.push(n)}const O=a(n);return function(e,t,r,n,o,i,s,c){const u=o.length,l=new Uint8Array(64),h=a(l),f=v(o)&&v(i),b=f?a(o):U,y=f?a(i):U;for(let a=0;a<u;s++){if(e(t,r,n,h,s,c),s>=A)throw new Error("arx: counter overflow");const w=Math.min(64,u-a);if(f&&64===w){const e=a/4;if(a%4!=0)throw new Error("arx: invalid block position");for(let t,r=0;r<16;r++)t=e+r,y[t]=b[t]^h[r];a+=64;continue}for(let e,t=0;t<w;t++)e=a+t,i[e]=o[e]^l[t];a+=w}}(e,k,x,O,b,y,w,h),c(...m),y}}function _(e,t){return 255&e[t++]|(255&e[t++])<<8}class E{constructor(e){Object.defineProperty(this,"blockLen",{enumerable:!0,configurable:!0,writable:!0,value:16}),Object.defineProperty(this,"outputLen",{enumerable:!0,configurable:!0,writable:!0,value:16}),Object.defineProperty(this,"buffer",{enumerable:!0,configurable:!0,writable:!0,value:new Uint8Array(16)}),Object.defineProperty(this,"r",{enumerable:!0,configurable:!0,writable:!0,value:new Uint16Array(10)}),Object.defineProperty(this,"h",{enumerable:!0,configurable:!0,writable:!0,value:new Uint16Array(10)}),Object.defineProperty(this,"pad",{enumerable:!0,configurable:!0,writable:!0,value:new Uint16Array(8)}),Object.defineProperty(this,"pos",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"finished",{enumerable:!0,configurable:!0,writable:!0,value:!1});const t=_(e=f(i(e,32,"key")),0),r=_(e,2),n=_(e,4),o=_(e,6),s=_(e,8),a=_(e,10),c=_(e,12),u=_(e,14);this.r[0]=8191&t,this.r[1]=8191&(t>>>13|r<<3),this.r[2]=7939&(r>>>10|n<<6),this.r[3]=8191&(n>>>7|o<<9),this.r[4]=255&(o>>>4|s<<12),this.r[5]=s>>>1&8190,this.r[6]=8191&(s>>>14|a<<2),this.r[7]=8065&(a>>>11|c<<5),this.r[8]=8191&(c>>>8|u<<8),this.r[9]=u>>>5&127;for(let t=0;t<8;t++)this.pad[t]=_(e,16+2*t)}process(e,t,r=!1){const n=r?0:2048,{h:o,r:i}=this,s=i[0],a=i[1],c=i[2],u=i[3],l=i[4],h=i[5],f=i[6],b=i[7],y=i[8],w=i[9],p=_(e,t+0),d=_(e,t+2),g=_(e,t+4),v=_(e,t+6),A=_(e,t+8),U=_(e,t+10),m=_(e,t+12),E=_(e,t+14),k=o[0]+(8191&p),x=o[1]+(8191&(p>>>13|d<<3)),L=o[2]+(8191&(d>>>10|g<<6)),O=o[3]+(8191&(g>>>7|v<<9)),P=o[4]+(8191&(v>>>4|A<<12)),j=o[5]+(A>>>1&8191),S=o[6]+(8191&(A>>>14|U<<2)),z=o[7]+(8191&(U>>>11|m<<5)),$=o[8]+(8191&(m>>>8|E<<8)),I=o[9]+(E>>>5|n);let B=0,C=B+k*s+x*(5*w)+L*(5*y)+O*(5*b)+P*(5*f);B=C>>>13,C&=8191,C+=j*(5*h)+S*(5*l)+z*(5*u)+$*(5*c)+I*(5*a),B+=C>>>13,C&=8191;let N=B+k*a+x*s+L*(5*w)+O*(5*y)+P*(5*b);B=N>>>13,N&=8191,N+=j*(5*f)+S*(5*h)+z*(5*l)+$*(5*u)+I*(5*c),B+=N>>>13,N&=8191;let D=B+k*c+x*a+L*s+O*(5*w)+P*(5*y);B=D>>>13,D&=8191,D+=j*(5*b)+S*(5*f)+z*(5*h)+$*(5*l)+I*(5*u),B+=D>>>13,D&=8191;let K=B+k*u+x*c+L*a+O*s+P*(5*w);B=K>>>13,K&=8191,K+=j*(5*y)+S*(5*b)+z*(5*f)+$*(5*h)+I*(5*l),B+=K>>>13,K&=8191;let M=B+k*l+x*u+L*c+O*a+P*s;B=M>>>13,M&=8191,M+=j*(5*w)+S*(5*y)+z*(5*b)+$*(5*f)+I*(5*h),B+=M>>>13,M&=8191;let R=B+k*h+x*l+L*u+O*c+P*a;B=R>>>13,R&=8191,R+=j*s+S*(5*w)+z*(5*y)+$*(5*b)+I*(5*f),B+=R>>>13,R&=8191;let H=B+k*f+x*h+L*l+O*u+P*c;B=H>>>13,H&=8191,H+=j*a+S*s+z*(5*w)+$*(5*y)+I*(5*b),B+=H>>>13,H&=8191;let V=B+k*b+x*f+L*h+O*l+P*u;B=V>>>13,V&=8191,V+=j*c+S*a+z*s+$*(5*w)+I*(5*y),B+=V>>>13,V&=8191;let F=B+k*y+x*b+L*f+O*h+P*l;B=F>>>13,F&=8191,F+=j*u+S*c+z*a+$*s+I*(5*w),B+=F>>>13,F&=8191;let q=B+k*w+x*y+L*b+O*f+P*h;B=q>>>13,q&=8191,q+=j*l+S*u+z*c+$*a+I*s,B+=q>>>13,q&=8191,B=(B<<2)+B|0,B=B+C|0,C=8191&B,B>>>=13,N+=B,o[0]=C,o[1]=N,o[2]=D,o[3]=K,o[4]=M,o[5]=R,o[6]=H,o[7]=V,o[8]=F,o[9]=q}finalize(){const{h:e,pad:t}=this,r=new Uint16Array(10);let n=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=n,n=e[t]>>>13,e[t]&=8191;e[0]+=5*n,n=e[0]>>>13,e[0]&=8191,e[1]+=n,n=e[1]>>>13,e[1]&=8191,e[2]+=n,r[0]=e[0]+5,n=r[0]>>>13,r[0]&=8191;for(let t=1;t<10;t++)r[t]=e[t]+n,n=r[t]>>>13,r[t]&=8191;r[9]-=8192;let o=(1^n)-1;for(let e=0;e<10;e++)r[e]&=o;o=~o;for(let t=0;t<10;t++)e[t]=e[t]&o|r[t];e[0]=65535&(e[0]|e[1]<<13),e[1]=65535&(e[1]>>>3|e[2]<<10),e[2]=65535&(e[2]>>>6|e[3]<<7),e[3]=65535&(e[3]>>>9|e[4]<<4),e[4]=65535&(e[4]>>>12|e[5]<<1|e[6]<<14),e[5]=65535&(e[6]>>>2|e[7]<<11),e[6]=65535&(e[7]>>>5|e[8]<<8),e[7]=65535&(e[8]>>>8|e[9]<<5);let i=e[0]+t[0];e[0]=65535&i;for(let r=1;r<8;r++)i=(e[r]+t[r]|0)+(i>>>16)|0,e[r]=65535&i;c(r)}update(e){s(this),i(e),e=f(e);const{buffer:t,blockLen:r}=this,n=e.length;for(let o=0;o<n;){const i=Math.min(r-this.pos,n-o);if(i!==r)t.set(e.subarray(o,o+i),this.pos),this.pos+=i,o+=i,this.pos===r&&(this.process(t,0,!1),this.pos=0);else for(;r<=n-o;o+=r)this.process(e,o)}return this}destroy(){c(this.h,this.r,this.buffer,this.pad)}digestInto(e){s(this),function(e,t){i(e,void 0,"output");const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}(e,this),this.finished=!0;const{buffer:t,h:r}=this;let{pos:n}=this;if(n){for(t[n++]=1;n<16;n++)t[n]=0;this.process(t,0,!0)}this.finalize();let o=0;for(let t=0;t<8;t++)e[o++]=r[t]>>>0,e[o++]=r[t]>>>8;return e}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}}const k=(()=>function(e){const t=(t,r)=>e(r).update(t).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(e=>new E(e)))();function x(e,t,r,n,o,i=20){const s=e[0],a=e[1],c=e[2],u=e[3],l=t[0],h=t[1],f=t[2],b=t[3],y=t[4],w=t[5],p=t[6],d=t[7],v=o,A=r[0],U=r[1],m=r[2];let _=s,E=a,k=c,x=u,L=l,O=h,P=f,j=b,S=y,z=w,$=p,I=d,B=v,C=A,N=U,D=m;for(let e=0;e<i;e+=2)_=_+L|0,B=g(B^_,16),S=S+B|0,L=g(L^S,12),_=_+L|0,B=g(B^_,8),S=S+B|0,L=g(L^S,7),E=E+O|0,C=g(C^E,16),z=z+C|0,O=g(O^z,12),E=E+O|0,C=g(C^E,8),z=z+C|0,O=g(O^z,7),k=k+P|0,N=g(N^k,16),$=$+N|0,P=g(P^$,12),k=k+P|0,N=g(N^k,8),$=$+N|0,P=g(P^$,7),x=x+j|0,D=g(D^x,16),I=I+D|0,j=g(j^I,12),x=x+j|0,D=g(D^x,8),I=I+D|0,j=g(j^I,7),_=_+O|0,D=g(D^_,16),$=$+D|0,O=g(O^$,12),_=_+O|0,D=g(D^_,8),$=$+D|0,O=g(O^$,7),E=E+P|0,B=g(B^E,16),I=I+B|0,P=g(P^I,12),E=E+P|0,B=g(B^E,8),I=I+B|0,P=g(P^I,7),k=k+j|0,C=g(C^k,16),S=S+C|0,j=g(j^S,12),k=k+j|0,C=g(C^k,8),S=S+C|0,j=g(j^S,7),x=x+L|0,N=g(N^x,16),z=z+N|0,L=g(L^z,12),x=x+L|0,N=g(N^x,8),z=z+N|0,L=g(L^z,7);let K=0;n[K++]=s+_|0,n[K++]=a+E|0,n[K++]=c+k|0,n[K++]=u+x|0,n[K++]=l+L|0,n[K++]=h+O|0,n[K++]=f+P|0,n[K++]=b+j|0,n[K++]=y+S|0,n[K++]=w+z|0,n[K++]=p+$|0,n[K++]=d+I|0,n[K++]=v+B|0,n[K++]=A+C|0,n[K++]=U+N|0,n[K++]=m+D|0}const L=m(x,{counterRight:!1,counterLength:4,allowShortKeys:!1}),O=new Uint8Array(16),P=(e,t)=>{e.update(t);const r=t.length%16;r&&e.update(O.subarray(r))},j=new Uint8Array(32);function S(e,t,r,o,s){void 0!==s&&i(s,void 0,"AAD");const a=e(t,r,j),u=function(e,t,r){n(r);const o=new Uint8Array(16),i=(s=o,new DataView(s.buffer,s.byteOffset,s.byteLength));var s;return i.setBigUint64(0,BigInt(t),r),i.setBigUint64(8,BigInt(e),r),o}(o.length,s?s.length:0,!0),l=k.create(a);s&&P(l,s),P(l,o),l.update(u);const h=l.digest();return c(a,u),h}const z=l({blockSize:64,nonceLength:12,tagLength:16},($=L,(e,t,r)=>({encrypt(n,o){const i=n.length;(o=h(i+16,o,!1)).set(n);const s=o.subarray(0,-16);$(e,t,s,s,1);const a=S($,e,t,s,r);return o.set(a,i),c(a),o},decrypt(n,o){o=h(n.length-16,o,!1);const i=n.subarray(0,-16),s=n.subarray(-16),a=S($,e,t,i,r);if(!function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(s,a))throw new Error("invalid tag");return o.set(n.subarray(0,-16)),$(e,t,o,o,1),c(a),o}})));var $,I=r(4220);class B{constructor(e){Object.defineProperty(this,"_key",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._key=new Uint8Array(e)}async seal(e,t,r){return await this._seal(e,t,r)}async open(e,t,r){return await this._open(e,t,r)}_seal(e,t,r){return new Promise(n=>{n(z(this._key,new Uint8Array(e),new Uint8Array(r)).encrypt(new Uint8Array(t)).buffer)})}_open(e,t,r){return new Promise(n=>{n(z(this._key,new Uint8Array(e),new Uint8Array(r)).decrypt(new Uint8Array(t)).buffer)})}}class C{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:I.vw.Chacha20Poly1305}),Object.defineProperty(this,"keySize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"nonceSize",{enumerable:!0,configurable:!0,writable:!0,value:12}),Object.defineProperty(this,"tagSize",{enumerable:!0,configurable:!0,writable:!0,value:16})}createEncryptionContext(e){return new B(e)}}}};
|
package/dist/732.index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const __webpack_esm_id__=732;export const __webpack_esm_ids__=[732];export const __webpack_esm_modules__={
|
|
1
|
+
export const __webpack_esm_id__=732;export const __webpack_esm_ids__=[732];export const __webpack_esm_modules__={7732:(t,e,r)=>{r.d(e,{chacha20poly1305:()=>L});var n=r(8246);const o=t=>Uint8Array.from(t.split(""),t=>t.charCodeAt(0)),s=o("expand 16-byte k"),i=o("expand 32-byte k"),h=(0,n.DH)(s),c=(0,n.DH)(i);function u(t,e){return t<<e|t>>>32-e}function a(t){return t.byteOffset%4==0}const l=2**32-1,f=Uint32Array.of();function d(t,e){const{allowShortKeys:r,extendNonceFn:o,counterLength:s,counterRight:i,rounds:u}=(0,n.tY)({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},e);if("function"!=typeof t)throw new Error("core must be a function");return(0,n.Fe)(s),(0,n.Fe)(u),(0,n.e8)(i),(0,n.e8)(r),(e,d,p,y,w=0)=>{(0,n.DO)(e,void 0,"key"),(0,n.DO)(d,void 0,"nonce"),(0,n.DO)(p,void 0,"data");const g=p.length;if(void 0===y&&(y=new Uint8Array(g)),(0,n.DO)(y,void 0,"output"),(0,n.Fe)(w),w<0||w>=l)throw new Error("arx: counter overflow");if(y.length<g)throw new Error(`arx: output (${y.length}) is shorter than data (${g})`);const b=[];let _,A,D=e.length;if(32===D)b.push(_=(0,n.nC)(e)),A=c;else{if(16!==D||!r)throw(0,n.DO)(e,32,"arx key"),new Error("invalid key size");_=new Uint8Array(32),_.set(e),_.set(e,16),A=h,b.push(_)}a(d)||b.push(d=(0,n.nC)(d));const x=(0,n.DH)(_);if(o){if(24!==d.length)throw new Error("arx: extended nonce must be 24 bytes");o(A,x,(0,n.DH)(d.subarray(0,16)),x),d=d.subarray(16)}const k=16-s;if(k!==d.length)throw new Error(`arx: nonce must be ${k} or 16 bytes`);if(12!==k){const t=new Uint8Array(12);t.set(d,i?0:12-d.length),d=t,b.push(d)}const H=(0,n.DH)(d);return function(t,e,r,o,s,i,h,c){const u=s.length,d=new Uint8Array(64),p=(0,n.DH)(d),y=a(s)&&a(i),w=y?(0,n.DH)(s):f,g=y?(0,n.DH)(i):f;for(let n=0;n<u;h++){if(t(e,r,o,p,h,c),h>=l)throw new Error("arx: counter overflow");const a=Math.min(64,u-n);if(y&&64===a){const t=n/4;if(n%4!=0)throw new Error("arx: invalid block position");for(let e,r=0;r<16;r++)e=t+r,g[e]=w[e]^p[r];n+=64;continue}for(let t,e=0;e<a;e++)t=n+e,i[t]=s[t]^d[e];n+=a}}(t,A,x,H,p,y,w,u),(0,n.uH)(...b),y}}function p(t,e){return 255&t[e++]|(255&t[e++])<<8}class y{blockLen=16;outputLen=16;buffer=new Uint8Array(16);r=new Uint16Array(10);h=new Uint16Array(10);pad=new Uint16Array(8);pos=0;finished=!1;constructor(t){const e=p(t=(0,n.nC)((0,n.DO)(t,32,"key")),0),r=p(t,2),o=p(t,4),s=p(t,6),i=p(t,8),h=p(t,10),c=p(t,12),u=p(t,14);this.r[0]=8191&e,this.r[1]=8191&(e>>>13|r<<3),this.r[2]=7939&(r>>>10|o<<6),this.r[3]=8191&(o>>>7|s<<9),this.r[4]=255&(s>>>4|i<<12),this.r[5]=i>>>1&8190,this.r[6]=8191&(i>>>14|h<<2),this.r[7]=8065&(h>>>11|c<<5),this.r[8]=8191&(c>>>8|u<<8),this.r[9]=u>>>5&127;for(let e=0;e<8;e++)this.pad[e]=p(t,16+2*e)}process(t,e,r=!1){const n=r?0:2048,{h:o,r:s}=this,i=s[0],h=s[1],c=s[2],u=s[3],a=s[4],l=s[5],f=s[6],d=s[7],y=s[8],w=s[9],g=p(t,e+0),b=p(t,e+2),_=p(t,e+4),A=p(t,e+6),D=p(t,e+8),x=p(t,e+10),k=p(t,e+12),H=p(t,e+14);let L=o[0]+(8191&g),U=o[1]+(8191&(g>>>13|b<<3)),v=o[2]+(8191&(b>>>10|_<<6)),m=o[3]+(8191&(_>>>7|A<<9)),C=o[4]+(8191&(A>>>4|D<<12)),E=o[5]+(D>>>1&8191),O=o[6]+(8191&(D>>>14|x<<2)),F=o[7]+(8191&(x>>>11|k<<5)),S=o[8]+(8191&(k>>>8|H<<8)),$=o[9]+(H>>>5|n),z=0,K=z+L*i+U*(5*w)+v*(5*y)+m*(5*d)+C*(5*f);z=K>>>13,K&=8191,K+=E*(5*l)+O*(5*a)+F*(5*u)+S*(5*c)+$*(5*h),z+=K>>>13,K&=8191;let N=z+L*h+U*i+v*(5*w)+m*(5*y)+C*(5*d);z=N>>>13,N&=8191,N+=E*(5*f)+O*(5*l)+F*(5*a)+S*(5*u)+$*(5*c),z+=N>>>13,N&=8191;let R=z+L*c+U*h+v*i+m*(5*w)+C*(5*y);z=R>>>13,R&=8191,R+=E*(5*d)+O*(5*f)+F*(5*l)+S*(5*a)+$*(5*u),z+=R>>>13,R&=8191;let I=z+L*u+U*c+v*h+m*i+C*(5*w);z=I>>>13,I&=8191,I+=E*(5*y)+O*(5*d)+F*(5*f)+S*(5*l)+$*(5*a),z+=I>>>13,I&=8191;let M=z+L*a+U*u+v*c+m*h+C*i;z=M>>>13,M&=8191,M+=E*(5*w)+O*(5*y)+F*(5*d)+S*(5*f)+$*(5*l),z+=M>>>13,M&=8191;let q=z+L*l+U*a+v*u+m*c+C*h;z=q>>>13,q&=8191,q+=E*i+O*(5*w)+F*(5*y)+S*(5*d)+$*(5*f),z+=q>>>13,q&=8191;let P=z+L*f+U*l+v*a+m*u+C*c;z=P>>>13,P&=8191,P+=E*h+O*i+F*(5*w)+S*(5*y)+$*(5*d),z+=P>>>13,P&=8191;let Y=z+L*d+U*f+v*l+m*a+C*u;z=Y>>>13,Y&=8191,Y+=E*c+O*h+F*i+S*(5*w)+$*(5*y),z+=Y>>>13,Y&=8191;let j=z+L*y+U*d+v*f+m*l+C*a;z=j>>>13,j&=8191,j+=E*u+O*c+F*h+S*i+$*(5*w),z+=j>>>13,j&=8191;let B=z+L*w+U*y+v*d+m*f+C*l;z=B>>>13,B&=8191,B+=E*a+O*u+F*c+S*h+$*i,z+=B>>>13,B&=8191,z=(z<<2)+z|0,z=z+K|0,K=8191&z,z>>>=13,N+=z,o[0]=K,o[1]=N,o[2]=R,o[3]=I,o[4]=M,o[5]=q,o[6]=P,o[7]=Y,o[8]=j,o[9]=B}finalize(){const{h:t,pad:e}=this,r=new Uint16Array(10);let o=t[1]>>>13;t[1]&=8191;for(let e=2;e<10;e++)t[e]+=o,o=t[e]>>>13,t[e]&=8191;t[0]+=5*o,o=t[0]>>>13,t[0]&=8191,t[1]+=o,o=t[1]>>>13,t[1]&=8191,t[2]+=o,r[0]=t[0]+5,o=r[0]>>>13,r[0]&=8191;for(let e=1;e<10;e++)r[e]=t[e]+o,o=r[e]>>>13,r[e]&=8191;r[9]-=8192;let s=(1^o)-1;for(let t=0;t<10;t++)r[t]&=s;s=~s;for(let e=0;e<10;e++)t[e]=t[e]&s|r[e];t[0]=65535&(t[0]|t[1]<<13),t[1]=65535&(t[1]>>>3|t[2]<<10),t[2]=65535&(t[2]>>>6|t[3]<<7),t[3]=65535&(t[3]>>>9|t[4]<<4),t[4]=65535&(t[4]>>>12|t[5]<<1|t[6]<<14),t[5]=65535&(t[6]>>>2|t[7]<<11),t[6]=65535&(t[7]>>>5|t[8]<<8),t[7]=65535&(t[8]>>>8|t[9]<<5);let i=t[0]+e[0];t[0]=65535&i;for(let r=1;r<8;r++)i=(t[r]+e[r]|0)+(i>>>16)|0,t[r]=65535&i;(0,n.uH)(r)}update(t){(0,n.CC)(this),(0,n.DO)(t),t=(0,n.nC)(t);const{buffer:e,blockLen:r}=this,o=t.length;for(let n=0;n<o;){const s=Math.min(r-this.pos,o-n);if(s!==r)e.set(t.subarray(n,n+s),this.pos),this.pos+=s,n+=s,this.pos===r&&(this.process(e,0,!1),this.pos=0);else for(;r<=o-n;n+=r)this.process(t,n)}return this}destroy(){(0,n.uH)(this.h,this.r,this.buffer,this.pad)}digestInto(t){(0,n.CC)(this),(0,n.Ht)(t,this),this.finished=!0;const{buffer:e,h:r}=this;let{pos:o}=this;if(o){for(e[o++]=1;o<16;o++)e[o]=0;this.process(e,0,!0)}this.finalize();let s=0;for(let e=0;e<8;e++)t[s++]=r[e]>>>0,t[s++]=r[e]>>>8;return t}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const r=t.slice(0,e);return this.destroy(),r}}const w=(()=>function(t){const e=(e,r)=>t(r).update(e).digest(),r=t(new Uint8Array(32));return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=e=>t(e),e}(t=>new y(t)))();function g(t,e,r,n,o,s=20){let i=t[0],h=t[1],c=t[2],a=t[3],l=e[0],f=e[1],d=e[2],p=e[3],y=e[4],w=e[5],g=e[6],b=e[7],_=o,A=r[0],D=r[1],x=r[2],k=i,H=h,L=c,U=a,v=l,m=f,C=d,E=p,O=y,F=w,S=g,$=b,z=_,K=A,N=D,R=x;for(let t=0;t<s;t+=2)k=k+v|0,z=u(z^k,16),O=O+z|0,v=u(v^O,12),k=k+v|0,z=u(z^k,8),O=O+z|0,v=u(v^O,7),H=H+m|0,K=u(K^H,16),F=F+K|0,m=u(m^F,12),H=H+m|0,K=u(K^H,8),F=F+K|0,m=u(m^F,7),L=L+C|0,N=u(N^L,16),S=S+N|0,C=u(C^S,12),L=L+C|0,N=u(N^L,8),S=S+N|0,C=u(C^S,7),U=U+E|0,R=u(R^U,16),$=$+R|0,E=u(E^$,12),U=U+E|0,R=u(R^U,8),$=$+R|0,E=u(E^$,7),k=k+m|0,R=u(R^k,16),S=S+R|0,m=u(m^S,12),k=k+m|0,R=u(R^k,8),S=S+R|0,m=u(m^S,7),H=H+C|0,z=u(z^H,16),$=$+z|0,C=u(C^$,12),H=H+C|0,z=u(z^H,8),$=$+z|0,C=u(C^$,7),L=L+E|0,K=u(K^L,16),O=O+K|0,E=u(E^O,12),L=L+E|0,K=u(K^L,8),O=O+K|0,E=u(E^O,7),U=U+v|0,N=u(N^U,16),F=F+N|0,v=u(v^F,12),U=U+v|0,N=u(N^U,8),F=F+N|0,v=u(v^F,7);let I=0;n[I++]=i+k|0,n[I++]=h+H|0,n[I++]=c+L|0,n[I++]=a+U|0,n[I++]=l+v|0,n[I++]=f+m|0,n[I++]=d+C|0,n[I++]=p+E|0,n[I++]=y+O|0,n[I++]=w+F|0,n[I++]=g+S|0,n[I++]=b+$|0,n[I++]=_+z|0,n[I++]=A+K|0,n[I++]=D+N|0,n[I++]=x+R|0}const b=d(g,{counterRight:!1,counterLength:4,allowShortKeys:!1}),_=d(g,{counterRight:!1,counterLength:8,extendNonceFn:function(t,e,r,n){let o=t[0],s=t[1],i=t[2],h=t[3],c=e[0],a=e[1],l=e[2],f=e[3],d=e[4],p=e[5],y=e[6],w=e[7],g=r[0],b=r[1],_=r[2],A=r[3];for(let t=0;t<20;t+=2)o=o+c|0,g=u(g^o,16),d=d+g|0,c=u(c^d,12),o=o+c|0,g=u(g^o,8),d=d+g|0,c=u(c^d,7),s=s+a|0,b=u(b^s,16),p=p+b|0,a=u(a^p,12),s=s+a|0,b=u(b^s,8),p=p+b|0,a=u(a^p,7),i=i+l|0,_=u(_^i,16),y=y+_|0,l=u(l^y,12),i=i+l|0,_=u(_^i,8),y=y+_|0,l=u(l^y,7),h=h+f|0,A=u(A^h,16),w=w+A|0,f=u(f^w,12),h=h+f|0,A=u(A^h,8),w=w+A|0,f=u(f^w,7),o=o+a|0,A=u(A^o,16),y=y+A|0,a=u(a^y,12),o=o+a|0,A=u(A^o,8),y=y+A|0,a=u(a^y,7),s=s+l|0,g=u(g^s,16),w=w+g|0,l=u(l^w,12),s=s+l|0,g=u(g^s,8),w=w+g|0,l=u(l^w,7),i=i+f|0,b=u(b^i,16),d=d+b|0,f=u(f^d,12),i=i+f|0,b=u(b^i,8),d=d+b|0,f=u(f^d,7),h=h+c|0,_=u(_^h,16),p=p+_|0,c=u(c^p,12),h=h+c|0,_=u(_^h,8),p=p+_|0,c=u(c^p,7);let D=0;n[D++]=o,n[D++]=s,n[D++]=i,n[D++]=h,n[D++]=g,n[D++]=b,n[D++]=_,n[D++]=A},allowShortKeys:!1}),A=new Uint8Array(16),D=(t,e)=>{t.update(e);const r=e.length%16;r&&t.update(A.subarray(r))},x=new Uint8Array(32);function k(t,e,r,o,s){void 0!==s&&(0,n.DO)(s,void 0,"AAD");const i=t(e,r,x),h=(0,n.Pg)(o.length,s?s.length:0,!0),c=w.create(i);s&&D(c,s),D(c,o),c.update(h);const u=c.digest();return(0,n.uH)(i,h),u}const H=t=>(e,r,o)=>({encrypt(s,i){const h=s.length;(i=(0,n.N$)(h+16,i,!1)).set(s);const c=i.subarray(0,-16);t(e,r,c,c,1);const u=k(t,e,r,c,o);return i.set(u,h),(0,n.uH)(u),i},decrypt(s,i){i=(0,n.N$)(s.length-16,i,!1);const h=s.subarray(0,-16),c=s.subarray(-16),u=k(t,e,r,h,o);if(!(0,n.ex)(c,u))throw new Error("invalid tag");return i.set(s.subarray(0,-16)),t(e,r,i,i,1),(0,n.uH)(u),i}}),L=(0,n.qn)({blockSize:64,nonceLength:12,tagLength:16},H(b));H(_)}};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! For license information please see 841.index.js.LICENSE.txt */
|
|
2
|
+
export const __webpack_esm_id__=841;export const __webpack_esm_ids__=[841];export const __webpack_esm_modules__={1841:(f,t,e)=>{e.r(t),e.d(t,{ED25519_TORSION_SUBGROUP:()=>J,RistrettoPoint:()=>tf,ed25519:()=>z,ed25519_hasher:()=>X,ed25519ctx:()=>O,ed25519ph:()=>P,edwardsToMontgomery:()=>$,edwardsToMontgomeryPriv:()=>ff,edwardsToMontgomeryPub:()=>W,encodeToCurve:()=>nf,hashToCurve:()=>ef,hashToRistretto255:()=>rf,hash_to_ristretto255:()=>of,ristretto255:()=>V,ristretto255_hasher:()=>Y,x25519:()=>M});var n=e(5429),r=e(2531),o=e(649),c=e(6618),i=e(5385),s=e(5916),a=e(8906);const u=BigInt(0),d=BigInt(1),l=BigInt(2);const m=BigInt(0),g=BigInt(1),_=BigInt(2),B=BigInt(3),h=BigInt(5),p=BigInt(8),I=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),x=(()=>({p:I,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:p,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")}))();function w(f){const t=BigInt(10),e=BigInt(20),n=BigInt(40),r=BigInt(80),o=I,c=f*f%o*f%o,i=(0,s.zH)(c,_,o)*c%o,a=(0,s.zH)(i,g,o)*f%o,u=(0,s.zH)(a,h,o)*a%o,d=(0,s.zH)(u,t,o)*u%o,l=(0,s.zH)(d,e,o)*d%o,m=(0,s.zH)(l,n,o)*l%o,B=(0,s.zH)(m,r,o)*m%o,p=(0,s.zH)(B,r,o)*m%o,x=(0,s.zH)(p,t,o)*u%o;return{pow_p_5_8:(0,s.zH)(x,_,o)*f%o,b2:c}}function y(f){return f[0]&=248,f[31]&=127,f[31]|=64,f}const b=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function v(f,t){const e=I,n=(0,s.zi)(t*t*t,e),r=w(f*(0,s.zi)(n*n*t,e)).pow_p_5_8;let o=(0,s.zi)(f*n*r,e);const c=(0,s.zi)(t*o*o,e),i=o,a=(0,s.zi)(o*b,e),u=c===f,d=c===(0,s.zi)(-f,e),l=c===(0,s.zi)(-f*b,e);return u&&(o=i),(d||l)&&(o=a),(0,s.dQ)(o,e)&&(o=(0,s.zi)(-o,e)),{isValid:u||d,value:o}}const E=(()=>(0,s.D0)(x.p,{isLE:!0}))(),S=(()=>(0,s.D0)(x.n,{isLE:!0}))(),q=(()=>({...x,Fp:E,hash:n.Zf,adjustScalarBytes:y,uvRatio:v}))(),z=(()=>(0,c.n6)(q))();function T(f,t,e){if(t.length>255)throw new Error("Context is too big");return(0,r.Id)((0,r.AI)("SigEd25519 no Ed25519 collisions"),new Uint8Array([e?1:0,t.length]),t,f)}const O=(()=>(0,c.n6)({...q,domain:T}))(),P=(()=>(0,c.n6)(Object.assign({},q,{domain:T,prehash:n.Zf})))(),M=(()=>{const f=E.ORDER;return function(f){const t=function(f){return(0,a.DS)(f,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...f})}(f),{P:e,type:n,adjustScalarBytes:o,powPminus2:c,randomBytes:i}=t,m="x25519"===n;if(!m&&"x448"!==n)throw new Error("invalid type");const g=i||r.po,_=m?255:448,B=m?32:56,h=m?BigInt(9):BigInt(5),p=m?BigInt(121665):BigInt(39081),I=m?l**BigInt(254):l**BigInt(447),x=m?BigInt(8)*l**BigInt(251)-d:BigInt(4)*l**BigInt(445)-d,w=I+x+d,y=f=>(0,s.zi)(f,e),b=v(h);function v(f){return(0,a.z)(y(f),B)}function E(f,t){const n=function(f,t){(0,a.aK)("u",f,u,e),(0,a.aK)("scalar",t,I,w);const n=t,r=f;let o=d,i=u,s=f,l=d,m=u;for(let f=BigInt(_-1);f>=u;f--){const t=n>>f&d;m^=t,({x_2:o,x_3:s}=q(m,o,s)),({x_2:i,x_3:l}=q(m,i,l)),m=t;const e=o+i,c=y(e*e),a=o-i,u=y(a*a),g=c-u,_=s+l,B=y((s-l)*e),h=y(_*a),I=B+h,x=B-h;s=y(I*I),l=y(r*y(x*x)),o=y(c*u),i=y(g*(c+y(p*g)))}({x_2:o,x_3:s}=q(m,o,s)),({x_2:i,x_3:l}=q(m,i,l));const g=c(i);return y(o*g)}(function(f){const t=(0,a.qj)("u coordinate",f,B);return m&&(t[31]&=127),y((0,a.lX)(t))}(t),function(f){return(0,a.lX)(o((0,a.qj)("scalar",f,B)))}(f));if(n===u)throw new Error("invalid private or public key received");return v(n)}function S(f){return E(f,b)}function q(f,t,e){const n=y(f*(t-e));return{x_2:t=y(t-n),x_3:e=y(e+n)}}const z={secretKey:B,publicKey:B,seed:B},T=(f=g(B))=>((0,r.DO)(f,z.seed),f);return{keygen:function(f){const t=T(f);return{secretKey:t,publicKey:S(t)}},getSharedSecret:(f,t)=>E(f,t),getPublicKey:f=>S(f),scalarMult:E,scalarMultBase:S,utils:{randomSecretKey:T,randomPrivateKey:T},GuBytes:b.slice(),lengths:z}}({P:f,type:"x25519",powPminus2:t=>{const{pow_p_5_8:e,b2:n}=w(t);return(0,s.zi)((0,s.zH)(e,B,f)*n,f)},adjustScalarBytes:y})})(),H=(()=>(I+B)/p)(),D=(()=>E.pow(_,H))(),R=(()=>E.sqrt(E.neg(E.ONE)))(),j=(()=>(0,s.Tv)(E,E.neg(BigInt(486664))))();const X=(()=>(0,i.qj)(z.Point,f=>function(f){const{xMn:t,xMd:e,yMn:n,yMd:r}=function(f){const t=(I-h)/p,e=BigInt(486662);let n=E.sqr(f);n=E.mul(n,_);let r=E.add(n,E.ONE),o=E.neg(e),c=E.sqr(r),i=E.mul(c,r),s=E.mul(n,e);s=E.mul(s,o),s=E.add(s,c),s=E.mul(s,o);let a=E.sqr(i);c=E.sqr(a),a=E.mul(a,i),a=E.mul(a,s),c=E.mul(c,a);let u=E.pow(c,t);u=E.mul(u,a);let d=E.mul(u,R);c=E.sqr(u),c=E.mul(c,i);let l=E.eql(c,s),m=E.cmov(d,u,l),B=E.mul(o,n),x=E.mul(u,f);x=E.mul(x,D);let w=E.mul(x,R),y=E.mul(s,n);c=E.sqr(x),c=E.mul(c,i);let b=E.eql(c,y),v=E.cmov(w,x,b);c=E.sqr(m),c=E.mul(c,i);let S=E.eql(c,s),q=E.cmov(B,o,S),z=E.cmov(v,m,S),T=E.isOdd(z);return z=E.cmov(z,E.neg(z),S!==T),{xMn:q,xMd:r,yMn:z,yMd:g}}(f);let o=E.mul(t,r);o=E.mul(o,j);let c=E.mul(e,n),i=E.sub(t,e),a=E.add(t,e),u=E.mul(c,a),d=E.eql(u,E.ZERO);o=E.cmov(o,E.ZERO,d),c=E.cmov(c,E.ONE,d),i=E.cmov(i,E.ONE,d),a=E.cmov(a,E.ONE,d);const[l,m]=(0,s.pS)(E,[c,a],!0);return{x:E.mul(o,l),y:E.mul(i,m)}}(f[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:I,m:1,k:128,expand:"xmd",hash:n.Zf}))(),Z=b,A=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),C=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),K=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Q=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),N=f=>v(g,f),k=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),L=f=>z.Point.Fp.create((0,a.lX)(f)&k);function F(f){const{d:t}=x,e=I,n=f=>E.create(f),r=n(Z*f*f),o=n((r+g)*K);let c=BigInt(-1);const i=n((c-t*r)*n(r+t));let{isValid:a,value:u}=v(o,i),d=n(u*f);(0,s.dQ)(d,e)||(d=n(-d)),a||(u=d),a||(c=r);const l=n(c*(r-g)*Q-i),m=u*u,_=n((u+u)*i),B=n(l*A),h=n(g-m),p=n(g+m);return new z.Point(n(_*p),n(h*B),n(B*p),n(_*h))}function G(f){(0,r.DO)(f,64);const t=F(L(f.subarray(0,32))),e=F(L(f.subarray(32,64)));return new U(t.add(e))}class U extends c.i5{constructor(f){super(f)}static fromAffine(f){return new U(z.Point.fromAffine(f))}assertSame(f){if(!(f instanceof U))throw new Error("RistrettoPoint expected")}init(f){return new U(f)}static hashToCurve(f){return G((0,a.qj)("ristrettoHash",f,64))}static fromBytes(f){(0,r.DO)(f,32);const{a:t,d:e}=x,n=I,o=f=>E.create(f),c=L(f);if(!(0,a.ex)(E.toBytes(c),f)||(0,s.dQ)(c,n))throw new Error("invalid ristretto255 encoding 1");const i=o(c*c),u=o(g+t*i),d=o(g-t*i),l=o(u*u),_=o(d*d),B=o(t*e*l-_),{isValid:h,value:p}=N(o(B*_)),w=o(p*d),y=o(p*w*B);let b=o((c+c)*w);(0,s.dQ)(b,n)&&(b=o(-b));const v=o(u*y),S=o(b*v);if(!h||(0,s.dQ)(S,n)||v===m)throw new Error("invalid ristretto255 encoding 2");return new U(new z.Point(b,v,g,S))}static fromHex(f){return U.fromBytes((0,a.qj)("ristrettoHex",f,32))}static msm(f,t){return(0,o.Xf)(U,z.Point.Fn,f,t)}toBytes(){let{X:f,Y:t,Z:e,T:n}=this.ep;const r=I,o=f=>E.create(f),c=o(o(e+t)*o(e-t)),i=o(f*t),a=o(i*i),{value:u}=N(o(c*a)),d=o(u*c),l=o(u*i),m=o(d*l*n);let g;if((0,s.dQ)(n*m,r)){let e=o(t*Z),n=o(f*Z);f=e,t=n,g=o(d*C)}else g=l;(0,s.dQ)(f*m,r)&&(t=o(-t));let _=o((e-t)*g);return(0,s.dQ)(_,r)&&(_=o(-_)),E.toBytes(_)}equals(f){this.assertSame(f);const{X:t,Y:e}=this.ep,{X:n,Y:r}=f.ep,o=f=>E.create(f),c=o(t*r)===o(e*n),i=o(e*r)===o(t*n);return c||i}is0(){return this.equals(U.ZERO)}}U.BASE=(()=>new U(z.Point.BASE))(),U.ZERO=(()=>new U(z.Point.ZERO))(),U.Fp=(()=>E)(),U.Fn=(()=>S)();const V={Point:U},Y={hashToCurve(f,t){const e=t?.DST||"ristretto255_XMD:SHA-512_R255MAP_RO_";return G((0,i.Tq)(f,e,64,n.Zf))},hashToScalar(f,t={DST:i.qX}){const e=(0,i.Tq)(f,t.DST,64,n.Zf);return S.create((0,a.lX)(e))}},J=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];function W(f){return z.utils.toMontgomery((0,a.qj)("pub",f))}const $=W;function ff(f){return z.utils.toMontgomerySecret((0,a.qj)("pub",f))}const tf=U,ef=(()=>X.hashToCurve)(),nf=(()=>X.encodeToCurve)(),rf=(()=>Y.hashToCurve)(),of=(()=>Y.hashToCurve)()}};
|