shogun-button-react 6.3.7 → 6.4.1
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/README.md +17 -0
- package/dist/components/ShogunButton.js +174 -88
- package/dist/index.js +1 -1
- package/dist/index.js.LICENSE.txt +0 -2
- package/package.json +2 -2
- package/dist/118.index.js +0 -2
- package/dist/118.index.js.LICENSE.txt +0 -3
- package/dist/18.index.js +0 -1
- package/dist/195.index.js +0 -2
- package/dist/195.index.js.LICENSE.txt +0 -1
- package/dist/452.index.js +0 -2
- package/dist/452.index.js.LICENSE.txt +0 -1
- package/dist/508.index.js +0 -2
- package/dist/508.index.js.LICENSE.txt +0 -1
- package/dist/604.index.js +0 -2
- package/dist/604.index.js.LICENSE.txt +0 -7
- package/dist/619.index.js +0 -2
- package/dist/619.index.js.LICENSE.txt +0 -1
- package/dist/639.index.js +0 -2
- package/dist/639.index.js.LICENSE.txt +0 -1
- package/dist/695.index.js +0 -1
- package/dist/725.index.js +0 -2
- package/dist/725.index.js.LICENSE.txt +0 -1
- package/dist/732.index.js +0 -1
- package/dist/766.index.js +0 -2
- package/dist/766.index.js.LICENSE.txt +0 -1
- package/dist/841.index.js +0 -2
- package/dist/841.index.js.LICENSE.txt +0 -1
|
@@ -18,8 +18,6 @@
|
|
|
18
18
|
|
|
19
19
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
20
20
|
|
|
21
|
-
/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
|
|
22
|
-
|
|
23
21
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
24
22
|
|
|
25
23
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shogun-button-react",
|
|
3
3
|
"description": "Shogun connector button",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.4.1",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
7
|
"src/styles/index.css"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"prettier": "^3.5.3",
|
|
46
46
|
"process": "^0.11.10",
|
|
47
47
|
"rxjs": "^7.8.2",
|
|
48
|
-
"shogun-core": "^6.
|
|
48
|
+
"shogun-core": "^6.4.0",
|
|
49
49
|
"stream-browserify": "^3.0.0",
|
|
50
50
|
"util": "^0.12.5"
|
|
51
51
|
},
|
package/dist/118.index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 118.index.js.LICENSE.txt */
|
|
2
|
-
export const __webpack_esm_id__=118;export const __webpack_esm_ids__=[118];export const __webpack_esm_modules__={3118:(t,e,n)=>{n.d(e,{ml_dsa87:()=>mt});const r=BigInt(2**32-1),o=BigInt(32);function s(t,e=!1){return e?{h:Number(t&r),l:Number(t>>o&r)}:{h:0|Number(t>>o&r),l:0|Number(t&r)}}function i(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function c(t,e=""){if(!Number.isSafeInteger(t)||t<0)throw new Error(`${e&&`"${e}" `}expected integer >= 0, got ${t}`)}function u(t,e,n=""){const r=i(t),o=t?.length,s=void 0!==e;if(!r||s&&o!==e)throw new Error((n&&`"${n}" `)+"expected Uint8Array"+(s?` of length ${e}`:"")+", got "+(r?`length=${o}`:"type="+typeof t));return t}function l(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function f(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function d(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}const a=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])()?t=>t:function(t){for(let e=0;e<t.length;e++)t[e]=d(t[e]);return t};function h(...t){let e=0;for(let n=0;n<t.length;n++){const r=t[n];u(r),e+=r.length}const n=new Uint8Array(e);for(let e=0,r=0;e<t.length;e++){const o=t[e];n.set(o,r),r+=o.length}return n}const g=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])}),p=BigInt(0),y=BigInt(1),w=BigInt(2),b=BigInt(7),L=BigInt(256),A=BigInt(113),m=[],E=[],k=[];for(let t=0,e=y,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],m.push(2*(5*r+n)),E.push((t+1)*(t+2)/2%64);let o=p;for(let t=0;t<7;t++)e=(e<<y^(e>>b)*A)%L,e&w&&(o^=y<<(y<<BigInt(t))-y);k.push(o)}const x=function(t,e=!1){const n=t.length;let r=new Uint32Array(n),o=new Uint32Array(n);for(let i=0;i<n;i++){const{h:n,l:c}=s(t[i],e);[r[i],o[i]]=[n,c]}return[r,o]}(k,!0),I=x[0],U=x[1],_=(t,e,n)=>n>32?((t,e,n)=>e<<n-32|t>>>64-n)(t,e,n):((t,e,n)=>t<<n|e>>>32-n)(t,e,n),T=(t,e,n)=>n>32?((t,e,n)=>t<<n-32|e>>>64-n)(t,e,n):((t,e,n)=>e<<n|t>>>32-n)(t,e,n);class v{state;pos=0;posOut=0;finished=!1;state32;destroyed=!1;blockLen;suffix;outputLen;enableXOF=!1;rounds;constructor(t,e,n,r=!1,o=24){if(this.blockLen=t,this.suffix=e,this.outputLen=n,this.enableXOF=r,this.rounds=o,c(n,"outputLen"),!(0<t&&t<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(){a(this.state32),function(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let e=0;e<10;e++)n[e]=t[e]^t[e+10]^t[e+20]^t[e+30]^t[e+40];for(let e=0;e<10;e+=2){const r=(e+8)%10,o=(e+2)%10,s=n[o],i=n[o+1],c=_(s,i,1)^n[r],u=T(s,i,1)^n[r+1];for(let n=0;n<50;n+=10)t[e+n]^=c,t[e+n+1]^=u}let e=t[2],o=t[3];for(let n=0;n<24;n++){const r=E[n],s=_(e,o,r),i=T(e,o,r),c=m[n];e=t[c],o=t[c+1],t[c]=s,t[c+1]=i}for(let e=0;e<50;e+=10){for(let r=0;r<10;r++)n[r]=t[e+r];for(let r=0;r<10;r++)t[e+r]^=~n[(r+2)%10]&n[(r+4)%10]}t[0]^=I[r],t[1]^=U[r]}f(n)}(this.state32,this.rounds),a(this.state32),this.posOut=0,this.pos=0}update(t){l(this),u(t);const{blockLen:e,state:n}=this,r=t.length;for(let o=0;o<r;){const s=Math.min(e-this.pos,r-o);for(let e=0;e<s;e++)n[this.pos++]^=t[o++];this.pos===e&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:e,pos:n,blockLen:r}=this;t[n]^=e,128&e&&n===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){l(this,!1),u(t),this.finish();const e=this.state,{blockLen:n}=this;for(let r=0,o=t.length;r<o;){this.posOut>=n&&this.keccak();const s=Math.min(n-this.posOut,o-r);t.set(e.subarray(this.posOut,this.posOut+s),r),this.posOut+=s,r+=s}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return c(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(function(t,e){u(t,void 0,"digestInto() output");const n=e.outputLen;if(t.length<n)throw new Error('"digestInto() output" expected to be of length >='+n)}(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,f(this.state)}_cloneInto(t){const{blockLen:e,suffix:n,outputLen:r,rounds:o,enableXOF:s}=this;return t||=new v(e,n,r,s,o),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=o,t.suffix=n,t.outputLen=r,t.enableXOF=s,t.destroyed=this.destroyed,t}}const O=(t,e,n,r={})=>function(t,e={}){const n=(e,n)=>t(n).update(e).digest(),r=t(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.create=e=>t(e),Object.assign(n,e),Object.freeze(n)}((r={})=>new v(e,t,void 0===r.dkLen?n:r.dkLen,!0),r),M=O(31,168,16,g(11)),B=O(31,136,32,g(12));function F(t){if(!Number.isSafeInteger(t)||t<0||t>4294967295)throw new Error("wrong u32 integer:"+t);return t}function N(t){return F(t),!(t&t-1)&&0!==t}function K(t,e){F(t);let n=0;for(let r=0;r<e;r++,t>>>=1)n=n<<1|1&t;return n}function $(t){return F(t),31-Math.clz32(t)}function P(t){const e=t.length;if(e<2||!N(e))throw new Error("n must be a power of 2 and greater than 1. Got "+e);const n=$(e);for(let r=0;r<e;r++){const e=K(r,n);if(r<e){const n=t[r];t[r]=t[e],t[e]=n}}return t}const R=(t,e)=>{const{N:n,roots:r,dit:o,invertButterflies:s=!1,skipStages:i=0,brp:c=!0}=e,u=$(n);if(!N(n))throw new Error("FFT: Polynomial size should be power of two");const l=o!==s;return e=>{if(e.length!==n)throw new Error("FFT: wrong Polynomial length");o&&c&&P(e);for(let c=0,f=1;c<u-i;c++){const d=o?c+1+i:u-c,a=1<<d,h=a>>1,g=n>>d;for(let i=0;i<n;i+=a)for(let c=0,u=f++;c<h;c++){const f=i+c,d=i+c+h,a=r[s?o?n-u:u:c*g],p=e[d],y=e[f];if(l){const n=t.mul(p,a);e[f]=t.add(y,n),e[d]=t.sub(y,n)}else s?(e[f]=t.add(p,y),e[d]=t.mul(t.sub(p,y),a)):(e[f]=t.add(y,p),e[d]=t.mul(t.sub(y,p),a))}}return!o&&c&&P(e),e}},S=function(t=32){const e="object"==typeof globalThis?globalThis.crypto:null;if("function"!=typeof e?.getRandomValues)throw new Error("crypto.getRandomValues must be defined");return e.getRandomValues(new Uint8Array(t))};function X(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return 0===n}function G(t){if("object"!=typeof t||null===t||i(t))throw new Error("expected opts to be an object")}function Y(t){G(t),void 0!==t.context&&u(t.context,void 0,"opts.context")}function C(t){Y(t),!1!==t.extraEntropy&&void 0!==t.extraEntropy&&u(t.extraEntropy,void 0,"opts.extraEntropy")}function j(t,...e){const n=t=>"number"==typeof t?t:t.bytesLen,r=e.reduce((t,e)=>t+n(e),0);return{bytesLen:r,encode:o=>{const s=new Uint8Array(r);for(let r=0,i=0;r<e.length;r++){const c=e[r],l=n(c),f="number"==typeof c?o[r]:c.encode(o[r]);u(f,l,t),s.set(f,i),"number"!=typeof c&&f.fill(0),i+=l}return s},decode:o=>{u(o,r,t);const s=[];for(const t of e){const e=n(t),r=o.subarray(0,e);s.push("number"==typeof t?r:t.decode(r)),o=o.subarray(e)}return s}}}function H(t,e){const n=e*t.bytesLen;return{bytesLen:n,encode:r=>{if(r.length!==e)throw new Error(`vecCoder.encode: wrong length=${r.length}. Expected: ${e}`);const o=new Uint8Array(n);for(let e=0,n=0;e<r.length;e++){const s=t.encode(r[e]);o.set(s,n),s.fill(0),n+=s.length}return o},decode:e=>{u(e,n);const r=[];for(let n=0;n<e.length;n+=t.bytesLen)r.push(t.decode(e.subarray(n,n+t.bytesLen)));return r}}}function V(...t){for(const e of t)if(Array.isArray(e))for(const t of e)t.fill(0);else e.fill(0)}function z(t){return(1<<t)-1}const D=Uint8Array.of();function W(t,e=D){if(u(t),u(e),e.length>255)throw new Error("context should be less than 255 bytes");return h(new Uint8Array([0,e.length]),e,t)}const Q=Uint8Array.from([6,9,96,134,72,1,101,3,4,2]);function q(t,e,n=D){if(u(e),u(n),n.length>255)throw new Error("context should be less than 255 bytes");const r=t(e);return h(new Uint8Array([1,n.length]),n,t.oid,r)}const Z=t=>(e,n)=>{n||(n=t.blockLen);const r=new Uint8Array(e.length+2);r.set(e);const o=e.length,s=new Uint8Array(n);let i=t.create({}),c=0,u=0;return{stats:()=>({calls:c,xofs:u}),get:(e,n)=>(r[o+0]=e,r[o+1]=n,i.destroy(),i=t.create({}).update(r),c++,()=>(u++,i.xofInto(s))),clean:()=>{i.destroy(),V(s,r)}}},J=Z(M),tt=Z(B);function et(t){G(t),void 0!==t.externalMu&&function(t,e=""){if("boolean"!=typeof t)throw new Error((e&&`"${e}" `)+"expected boolean, got type="+typeof t)}(t.externalMu,"opts.externalMu")}const nt=256,rt=8380417,ot=0|Math.floor(95232),st=0|Math.floor(261888),it={K:8,L:7,D:13,GAMMA1:2**19,GAMMA2:st,TAU:60,ETA:2,OMEGA:75},ct=t=>new Int32Array(t),{mod:ut,smod:lt,NTT:ft,bitsCoder:dt}=(t=>{const{newPoly:e,N:n,Q:r,F:o,ROOT_OF_UNITY:s,brvBits:i,isKyber:c}=t,u=(t,e=r)=>{const n=t%e|0;return 0|(n>=0?n:e+n)},l=function(){const t=e(n);for(let e=0;e<n;e++){const n=K(e,i),o=BigInt(s)**BigInt(n)%BigInt(r);t[e]=0|Number(o)}return t}(),f={add:(t,e)=>0|u((0|t)+(0|e)),sub:(t,e)=>0|u((0|t)-(0|e)),mul:(t,e)=>0|u((0|t)*(0|e)),inv:t=>{throw new Error("not implemented")}},d={N:n,roots:l,invertButterflies:!0,skipStages:c?1:0,brp:!1},a=R(f,{dit:!1,...d}),h=R(f,{dit:!0,...d}),g={encode:t=>a(t),decode:t=>{h(t);for(let e=0;e<t.length;e++)t[e]=u(o*t[e]);return t}};return{mod:u,smod:(t,e=r)=>{const n=0|u(t,e);return 0|(n>e>>1?n-e:n)},nttZetas:l,NTT:g,bitsCoder:(t,r)=>{const o=z(t),s=t*(n/8);return{bytesLen:s,encode:e=>{const n=new Uint8Array(s);for(let s=0,i=0,c=0,u=0;s<e.length;s++)for(i|=(r.encode(e[s])&o)<<c,c+=t;c>=8;c-=8,i>>=8)n[u++]=i&z(c);return n},decode:s=>{const i=e(n);for(let e=0,n=0,c=0,u=0;e<s.length;e++)for(n|=s[e]<<c,c+=8;c>=t;c-=t,n>>=t)i[u++]=r.decode(n&o);return i}}}}})({N:nt,Q:rt,F:8347681,ROOT_OF_UNITY:1753,newPoly:ct,isKyber:!1,brvBits:8}),at=t=>t,ht=(t,e=at,n=at)=>dt(t,{encode:t=>e(n(t)),decode:t=>n(e(t))}),gt=(t,e)=>{for(let n=0;n<t.length;n++)t[n]=ut(t[n]+e[n]);return t},pt=(t,e)=>{for(let n=0;n<t.length;n++)t[n]=ut(t[n]-e[n]);return t},yt=t=>{for(let e=0;e<nt;e++)t[e]<<=13;return t},wt=(t,e)=>{for(let n=0;n<nt;n++)if(Math.abs(lt(t[n]))>=e)return!0;return!1},bt=(t,e)=>{const n=ct(nt);for(let r=0;r<t.length;r++)n[r]=ut(t[r]*e[r]);return n};function Lt(t){const e=ct(nt);for(let n=0;n<nt;){const r=t();if(r.length%3)throw new Error("RejNTTPoly: unaligned block");for(let t=0;n<nt&&t<=r.length-3;t+=3){const o=8388607&(r[t+0]|r[t+1]<<8|r[t+2]<<16);o<rt&&(e[n++]=o)}}return e}function At(t){const{K:e,L:n,GAMMA1:r,GAMMA2:o,TAU:s,ETA:i,OMEGA:c}=t,{CRH_BYTES:l,TR_BYTES:f,C_TILDE_BYTES:d,XOF128:a,XOF256:h,securityLevel:g}=t;if(![2,4].includes(i))throw new Error("Wrong ETA");if(![1<<17,1<<19].includes(r))throw new Error("Wrong GAMMA1");if(![ot,st].includes(o))throw new Error("Wrong GAMMA2");const p=s*i,y=t=>{const e=ut(t),n=0|lt(e,2*o);return e-n===rt-1?{r1:0,r0:n-1|0}:{r1:0|Math.floor((e-n)/(2*o)),r0:n}},w=t=>y(t).r1,b=t=>y(t).r0,L=(t,e)=>t<=o||t>rt-o||t===rt-o&&0===e?0:1,A=(t,e)=>{const n=Math.floor((rt-1)/(2*o)),{r1:r,r0:s}=y(e);return 1===t?s>0?0|ut(r+1,n):0|ut(r-1,n):0|r},m=t=>{const e=ut(t),n=0|lt(e,8192);return{r1:0|Math.floor((e-n)/8192),r0:n}},E={bytesLen:c+e,encode:t=>{if(!1===t)throw new Error("hint.encode: hint is false");const n=new Uint8Array(c+e);for(let r=0,o=0;r<e;r++){for(let e=0;e<nt;e++)0!==t[r][e]&&(n[o++]=e);n[c+r]=o}return n},decode:t=>{const n=[];let r=0;for(let o=0;o<e;o++){const e=ct(nt);if(t[c+o]<r||t[c+o]>c)return!1;for(let n=r;n<t[c+o];n++){if(n>r&&t[n]<=t[n-1])return!1;e[t[n]]=1}r=t[c+o],n.push(e)}for(let e=r;e<c;e++)if(0!==t[e])return!1;return n}},k=ht(2===i?3:4,t=>i-t,t=>{if(!(-i<=t&&t<=i))throw new Error(`malformed key s1/s3 ${t} outside of ETA range [${-i}, ${i}]`);return t}),x=ht(13,t=>4096-t),I=ht(10),U=ht(r===1<<17?18:20,t=>lt(r-t)),_=H(ht(o===ot?6:4),e),T=j("publicKey",32,H(I,e)),v=j("secretKey",32,32,f,H(k,n),H(k,e),H(x,e)),O=j("signature",d,H(U,n),E),M=2===i?t=>t<15&&2-t%5:t=>t<9&&4-t;function F(t){const e=ct(nt);for(let n=0;n<nt;){const r=t();for(let t=0;n<nt&&t<r.length;t+=1){const o=M(15&r[t]),s=M(r[t]>>4&15);!1!==o&&(e[n++]=o),n<nt&&!1!==s&&(e[n++]=s)}}return e}const N=t=>{const e=ct(nt),n=B.create({}).update(t),r=new Uint8Array(B.blockLen);n.xofInto(r);const o=r.slice(0,8);for(let t=nt-s,i=8,c=0,u=0;t<nt;t++){let s=t+1;for(;s>t;)s=r[i++],i<B.blockLen||(n.xofInto(r),i=0);e[t]=e[s],e[s]=1-((o[c]>>u++&1)<<1),u>=8&&(c++,u=0)}return e},K=t=>{const e=ct(nt),n=ct(nt);for(let r=0;r<t.length;r++){const{r0:o,r1:s}=m(t[r]);e[r]=o,n[r]=s}return{r0:e,r1:n}},$=(t,e)=>{for(let n=0;n<nt;n++)t[n]=A(e[n],t[n]);return t},P=(t,e)=>{const n=ct(nt);let r=0;for(let o=0;o<nt;o++){const s=L(t[o],e[o]);n[o]=s,r+=s}return{v:n,cnt:r}},R=j("seed",32,64,32),G={info:{type:"internal-ml-dsa"},lengths:{secretKey:v.bytesLen,publicKey:T.bytesLen,seed:32,signature:O.bytesLen,signRand:32},keygen:t=>{const r=new Uint8Array(34),o=void 0===t;o&&(t=S(32)),u(t,32,"seed"),r.set(t),o&&V(t),r[32]=e,r[33]=n;const[s,i,c]=R.decode(B(r,{dkLen:R.bytesLen})),l=h(i),d=[];for(let t=0;t<n;t++)d.push(F(l.get(255&t,t>>8&255)));const g=[];for(let t=n;t<n+e;t++)g.push(F(l.get(255&t,t>>8&255)));const p=d.map(t=>ft.encode(t.slice())),y=[],w=[],b=a(s),L=ct(nt);for(let t=0;t<e;t++){V(L);for(let e=0;e<n;e++){const n=Lt(b.get(e,t));gt(L,bt(n,p[e]))}ft.decode(L);const{r0:e,r1:r}=K(gt(L,g[t]));y.push(e),w.push(r)}const A=T.encode([s,w]),m=B(A,{dkLen:f}),E=v.encode([s,c,m,d,g,y]);return b.clean(),l.clean(),V(s,i,c,d,g,p,L,y,w,m,r),{publicKey:A,secretKey:E}},getPublicKey:t=>{const[r,o,s,i,c,u]=v.decode(t),l=a(r),f=i.map(t=>ft.encode(t.slice())),d=[],h=ct(nt);for(let t=0;t<e;t++){h.fill(0);for(let e=0;e<n;e++){const n=Lt(l.get(e,t));gt(h,bt(n,f[e]))}ft.decode(h),gt(h,c[t]);const{r1:e}=K(h);d.push(e)}return l.clean(),V(h,f,u,i,c),T.encode([r,d])},sign:(t,s,i={})=>{C(i),et(i);let{extraEntropy:f,externalMu:g=!1}=i;const[y,L,A,m,E,k]=v.decode(s),x=[],I=a(y);for(let t=0;t<e;t++){const e=[];for(let r=0;r<n;r++)e.push(Lt(I.get(r,t)));x.push(e)}I.clean();for(let t=0;t<n;t++)ft.encode(m[t]);for(let t=0;t<e;t++)ft.encode(E[t]),ft.encode(k[t]);const T=g?t:B.create({dkLen:l}).update(A).update(t).digest(),M=!1===f?new Uint8Array(32):void 0===f?S(32):f;u(M,32,"extraEntropy");const F=B.create({dkLen:l}).update(L).update(M).update(T).digest();u(F,l);const K=h(F,U.bytesLen);t:for(let t=0;;){const s=[];for(let e=0;e<n;e++,t++)s.push(U.decode(K.get(255&t,t>>8)()));const i=s.map(t=>ft.encode(t.slice())),u=[];for(let t=0;t<e;t++){const e=ct(nt);for(let r=0;r<n;r++)gt(e,bt(x[t][r],i[r]));ft.decode(e),u.push(e)}const l=u.map(t=>t.map(w)),f=B.create({dkLen:d}).update(T).update(_.encode(l)).digest(),a=ft.encode(N(f)),h=m.map(t=>bt(t,a));for(let t=0;t<n;t++)if(gt(ft.decode(h[t]),s[t]),wt(h[t],r-p))continue t;let g=0;const y=[];for(let t=0;t<e;t++){const e=ft.decode(bt(E[t],a)),n=pt(u[t],e).map(b);if(wt(n,o-p))continue t;const r=ft.decode(bt(k[t],a));if(wt(r,o))continue t;gt(n,r);const s=P(n,l[t]);y.push(s.v),g+=s.cnt}if(g>c)continue;K.clean();const L=O.encode([f,h,y]);return V(f,h,y,a,l,u,i,s,F,T,m,E,k,...x),L}throw new Error("Unreachable code path reached, report this error")},verify:(t,o,s,i={})=>{et(i);const{externalMu:u=!1}=i,[h,g]=T.decode(s),y=B(s,{dkLen:f});if(t.length!==O.bytesLen)return!1;const[w,b,L]=O.decode(t);if(!1===L)return!1;for(let t=0;t<n;t++)if(wt(b[t],r-p))return!1;const A=u?o:B.create({dkLen:l}).update(y).update(o).digest(),m=ft.encode(N(w)),E=b.map(t=>t.slice());for(let t=0;t<n;t++)ft.encode(E[t]);const k=[],x=a(h);for(let t=0;t<e;t++){const e=bt(ft.encode(yt(g[t])),m),r=ct(nt);for(let e=0;e<n;e++){const n=Lt(x.get(e,t));gt(r,bt(n,E[e]))}const o=ft.decode(pt(r,e));k.push($(o,L[t]))}x.clean();const I=B.create({dkLen:d}).update(A).update(_.encode(k)).digest();for(const t of L)if(!(t.reduce((t,e)=>t+e,0)<=c))return!1;for(const t of b)if(wt(t,r-p))return!1;return X(w,I)}};return{info:{type:"ml-dsa"},internal:G,securityLevel:g,keygen:G.keygen,lengths:G.lengths,getPublicKey:G.getPublicKey,sign:(t,e,n={})=>{C(n);const r=W(t,n.context),o=G.sign(r,e,n);return V(r),o},verify:(t,e,n,r={})=>(Y(r),G.verify(t,W(e,r.context),n)),prehash:t=>(function(t,e=0){if(!t.oid||!X(t.oid.subarray(0,10),Q))throw new Error("hash.oid is invalid: expected NIST hash");const n=8*t.outputLen/2;if(e>n)throw new Error("Pre-hash security strength too low: "+n+", required: "+e)}(t,g),{info:{type:"hashml-dsa"},securityLevel:g,lengths:G.lengths,keygen:G.keygen,getPublicKey:G.getPublicKey,sign:(e,n,r={})=>{C(r);const o=q(t,e,r.context),s=G.sign(o,n,r);return V(o),s},verify:(e,n,r,o={})=>(Y(o),G.verify(e,q(t,n,o.context),r))})}}const mt=At({...it,CRH_BYTES:64,TR_BYTES:64,C_TILDE_BYTES:64,XOF128:J,XOF256:tt,securityLevel:256})}};
|
package/dist/18.index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const __webpack_esm_id__=18;export const __webpack_esm_ids__=[18];export const __webpack_esm_modules__={8018:(e,r,i)=>{i.d(r,{MlKem1024:()=>o,MlKem512:()=>l,MlKem768:()=>b});var t=i(8619),a=i(4220);class n{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"auth",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_prim",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}async serializePublicKey(e){try{return await this._serializePublicKey(e)}catch(e){throw new a.LV(e)}}async deserializePublicKey(e){try{return await this._deserializePublicKey(e)}catch(e){throw new a.Ug(e)}}async serializePrivateKey(e){try{return await this._serializePrivateKey(e)}catch(e){throw new a.LV(e)}}async deserializePrivateKey(e){try{return await this._deserializePrivateKey(e)}catch(e){throw new a.Ug(e)}}async generateKeyPair(){await this._setup();const e=new Uint8Array(32),r=new Uint8Array(32);try{this._api.getRandomValues(e),this._api.getRandomValues(r)}catch(e){throw new a.EM(e)}try{const i=(0,a.xW)(e,r),[t,n]=await this._prim.deriveKeyPair(i);return{privateKey:await this.deserializePrivateKey(i.buffer),publicKey:await this.deserializePublicKey(t.buffer)}}catch(e){throw new a.$7(e)}}async deriveKeyPair(e){try{const[r,i]=await this._prim.deriveKeyPair(new Uint8Array(e));return{privateKey:await this.deserializePrivateKey(e),publicKey:await this.deserializePublicKey(r.buffer)}}catch(e){throw new a.$7(e)}}async importKey(e,r,i=!0){await this._setup();try{let t;if("jwk"===e){if(r instanceof ArrayBuffer||r instanceof Uint8Array)throw new Error("Invalid jwk key format");t=await this._importJWK(r,i)}else if(r instanceof ArrayBuffer)t=new Uint8Array(r);else{if(!(r instanceof Uint8Array))throw new Error("Invalid key format");t=r}if(i&&t.byteLength!==this.publicKeySize)throw new Error("Invalid length of the key");if(!i&&t.byteLength!==this.privateKeySize)throw new Error("Invalid length of the key");return new a.Bk(this.name,t,i?"public":"private",i?[]:a.xE)}catch(e){throw new a.Ug(e)}}async encap(e){let r;if(void 0!==e.ekm)if(e.ekm instanceof ArrayBuffer)r=new Uint8Array(e.ekm);else{if(!(e.ekm instanceof Uint8Array))throw new a.NS("ekm must be 32 bytes in length");r=e.ekm}const i=new Uint8Array(await this.serializePublicKey(e.recipientPublicKey));if(i.byteLength!==this.publicKeySize)throw new a.NS("Invalid length of recipientKey");try{const[e,t]=await this._prim.encap(i,r);return{sharedSecret:t.buffer,enc:e.buffer}}catch(e){throw new a.Wg(e)}}async decap(e){const r=(0,a.Di)(e.recipientKey)?e.recipientKey.privateKey:e.recipientKey;if(e.enc.byteLength!==this.encSize)throw new a.NS("Invalid length of enc");const i=new Uint8Array(e.enc),t=new Uint8Array(await this.serializePrivateKey(r));if(t.byteLength!==this.privateKeySize)throw new a.NS("Invalid length of recipientKey");try{const[e,r]=await this._prim.deriveKeyPair(t);return(await this._prim.decap(i,r)).buffer}catch(e){throw new a.uu(e)}}async _setup(){void 0===this._api&&(this._api=await(0,a.QZ)())}_serializePublicKey(e){return new Promise((r,i)=>{"public"!==e.type&&i(new Error("Not public key")),e.algorithm.name!==this.name&&i(new Error(`Invalid algorithm name: ${e.algorithm.name}`)),e.key.byteLength!==this.publicKeySize&&i(new Error(`Invalid key length: ${e.key.byteLength}`)),r(e.key.buffer)})}_deserializePublicKey(e){return new Promise((r,i)=>{e.byteLength!==this.publicKeySize&&i(new Error(`Invalid key length: ${e.byteLength}`)),r(new a.Bk(this.name,new Uint8Array(e),"public"))})}_serializePrivateKey(e){return new Promise((r,i)=>{"private"!==e.type&&i(new Error("Not private key")),e.algorithm.name!==this.name&&i(new Error(`Invalid algorithm name: ${e.algorithm.name}`)),e.key.byteLength!==this.privateKeySize&&i(new Error(`Invalid key length: ${e.key.byteLength}`)),r(e.key.buffer)})}_deserializePrivateKey(e){return new Promise((r,i)=>{e.byteLength!==this.privateKeySize&&i(new Error(`Invalid key length: ${e.byteLength}`)),r(new a.Bk(this.name,new Uint8Array(e),"private",["deriveBits"]))})}_importJWK(e,r){return new Promise((i,t)=>{void 0!==e.kty&&"AKP"===e.kty||t(new Error(`Invalid kty: ${e.kty}`)),void 0!==e.alg&&e.alg===this.name||t(new Error(`Invalid alg: ${e.alg}`)),r||(void 0===e.priv&&t(new Error("Invalid key: `priv` not found")),void 0===e.key_ops||1===e.key_ops.length&&"deriveBits"===e.key_ops[0]||t(new Error("Invalid key: `key_ops` should be ['deriveBits']")),i((0,a.rf)(e.priv))),void 0!==e.priv&&t(new Error("Invalid key: `priv` should not be set")),void 0===e.pub&&t(new Error("Invalid key: `pub` not found")),void 0!==e.key_ops&&e.key_ops.length>0&&t(new Error("Invalid key: `key_ops` should not be set")),i((0,a.rf)(e.pub))})}}class l extends n{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:a.h.MlKem512}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ML-KEM-512"}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:768}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:800}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:64}),Object.defineProperty(this,"auth",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_prim",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._prim=new t.Zc}}class b extends n{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:a.h.MlKem768}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ML-KEM-768"}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:1088}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:1184}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:64}),Object.defineProperty(this,"auth",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_prim",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._prim=new t.wo}}class o extends n{constructor(){super(),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:a.h.MlKem1024}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ML-KEM-1024"}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:1568}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:1568}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:64}),Object.defineProperty(this,"auth",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_prim",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._prim=new t.AL}}}};
|
package/dist/195.index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 195.index.js.LICENSE.txt */
|
|
2
|
-
export const __webpack_esm_id__=195;export const __webpack_esm_ids__=[195];export const __webpack_esm_modules__={5385:(t,e,r)=>{r.d(e,{Tq:()=>f,qX:()=>p,qj:()=>y,zc:()=>d});var n=r(8906),i=r(2531),s=r(5916);const o=n.Ph;function a(t,e){if(c(t),c(e),t<0||t>=1<<8*e)throw new Error("invalid I2OSP input: "+t);const r=Array.from({length:e}).fill(0);for(let n=e-1;n>=0;n--)r[n]=255&t,t>>>=8;return new Uint8Array(r)}function u(t,e){const r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t[n]^e[n];return r}function c(t){if(!Number.isSafeInteger(t))throw new Error("number expected")}function h(t){if(!(0,i.aY)(t)&&"string"!=typeof t)throw new Error("DST must be Uint8Array or string");return"string"==typeof t?(0,i.AI)(t):t}function f(t,e,r,n){(0,i.DO)(t),c(r),(e=h(e)).length>255&&(e=n((0,i.Id)((0,i.AI)("H2C-OVERSIZE-DST-"),e)));const{outputLen:s,blockLen:o}=n,f=Math.ceil(r/s);if(r>65535||f>255)throw new Error("expand_message_xmd: invalid lenInBytes");const d=(0,i.Id)(e,a(e.length,1)),l=a(0,o),p=a(r,2),y=new Array(f),m=n((0,i.Id)(l,t,p,a(0,1),d));y[0]=n((0,i.Id)(m,a(1,1),d));for(let t=1;t<=f;t++){const e=[u(m,y[t-1]),a(t+1,1),d];y[t]=n((0,i.Id)(...e))}return(0,i.Id)(...y).slice(0,r)}function d(t,e,r,n,s){if((0,i.DO)(t),c(r),(e=h(e)).length>255){const t=Math.ceil(2*n/8);e=s.create({dkLen:t}).update((0,i.AI)("H2C-OVERSIZE-DST-")).update(e).digest()}if(r>65535||e.length>255)throw new Error("expand_message_xof: invalid lenInBytes");return s.create({dkLen:r}).update(t).update(a(r,2)).update(e).update(a(e.length,1)).digest()}function l(t,e,r){(0,n.DS)(r,{p:"bigint",m:"number",k:"number",hash:"function"});const{p:a,k:u,m:h,hash:l,expand:p,DST:y}=r;if(!(0,n.jN)(r.hash))throw new Error("expected valid hash");(0,i.DO)(t),c(e);const m=a.toString(2).length,w=Math.ceil((m+u)/8),g=e*h*w;let x;if("xmd"===p)x=f(t,y,g,l);else if("xof"===p)x=d(t,y,g,u,l);else{if("_internal_pass"!==p)throw new Error('expand must be "xmd" or "xof"');x=t}const E=new Array(e);for(let t=0;t<e;t++){const e=new Array(h);for(let r=0;r<h;r++){const n=w*(r+t*h),i=x.subarray(n,n+w);e[r]=(0,s.zi)(o(i),a)}E[t]=e}return E}const p=(0,i.AI)("HashToScalar-");function y(t,e,r){if("function"!=typeof e)throw new Error("mapToCurve() must be defined");function n(r){return t.fromAffine(e(r))}function i(e){const r=e.clearCofactor();return r.equals(t.ZERO)?t.ZERO:(r.assertValidity(),r)}return{defaults:r,hashToCurve(t,e){const s=l(t,2,Object.assign({},r,e)),o=n(s[0]),a=n(s[1]);return i(o.add(a))},encodeToCurve(t,e){const s=r.encodeDST?{DST:r.encodeDST}:{};return i(n(l(t,1,Object.assign({},r,s,e))[0]))},mapToCurve(t){if(!Array.isArray(t))throw new Error("expected array of bigints");for(const e of t)if("bigint"!=typeof e)throw new Error("expected array of bigints");return i(n(t))},hashToScalar(e,n){const i=t.Fn.ORDER;return l(e,1,Object.assign({},r,{p:i,m:1,DST:p},n))[0][0]}}}},6618:(t,e,r)=>{r.d(e,{TO:()=>f,i5:()=>d,n6:()=>l});var n=r(8906),i=r(2531),s=r(649),o=r(5916);const a=BigInt(0),u=BigInt(1),c=BigInt(2),h=BigInt(8);function f(t,e={}){const r=(0,s.UT)("edwards",t,e,e.FpFnLE),{Fp:o,Fn:f}=r;let d=r.CURVE;const{h:l}=d;(0,n.DS)(e,{},{uvRatio:"function"});const p=c<<BigInt(8*f.BYTES)-u,y=t=>o.create(t),m=e.uvRatio||((t,e)=>{try{return{isValid:!0,value:o.sqrt(o.div(t,e))}}catch(t){return{isValid:!1,value:a}}});if(!function(t,e,r,n){const i=t.sqr(r),s=t.sqr(n),o=t.add(t.mul(e.a,i),s),a=t.add(t.ONE,t.mul(e.d,t.mul(i,s)));return t.eql(o,a)}(o,d,d.Gx,d.Gy))throw new Error("bad curve params: generator point");function w(t,e,r=!1){const i=r?u:a;return(0,n.aK)("coordinate "+t,e,i,p),e}function g(t){if(!(t instanceof B))throw new Error("ExtendedPoint expected")}const x=(0,n.x)((t,e)=>{const{X:r,Y:n,Z:i}=t,s=t.is0();null==e&&(e=s?h:o.inv(i));const c=y(r*e),f=y(n*e),d=o.mul(i,e);if(s)return{x:a,y:u};if(d!==u)throw new Error("invZ was invalid");return{x:c,y:f}}),E=(0,n.x)(t=>{const{a:e,d:r}=d;if(t.is0())throw new Error("bad point: ZERO");const{X:n,Y:i,Z:s,T:o}=t,a=y(n*n),u=y(i*i),c=y(s*s),h=y(c*c),f=y(a*e);if(y(c*y(f+u))!==y(h+y(r*y(a*u))))throw new Error("bad point: equation left != right (1)");if(y(n*i)!==y(s*o))throw new Error("bad point: equation left != right (2)");return!0});class B{constructor(t,e,r,n){this.X=w("x",t),this.Y=w("y",e),this.Z=w("z",r,!0),this.T=w("t",n),Object.freeze(this)}static CURVE(){return d}static fromAffine(t){if(t instanceof B)throw new Error("extended point not allowed");const{x:e,y:r}=t||{};return w("x",e),w("y",r),new B(e,r,u,y(e*r))}static fromBytes(t,e=!1){const r=o.BYTES,{a:i,d:s}=d;t=(0,n.nC)((0,n.eV)(t,r,"point")),(0,n.d6)(e,"zip215");const c=(0,n.nC)(t),h=t[r-1];c[r-1]=-129&h;const f=(0,n.lX)(c),l=e?p:o.ORDER;(0,n.aK)("point.y",f,a,l);const w=y(f*f),g=y(w-u),x=y(s*w-i);let{isValid:E,value:b}=m(g,x);if(!E)throw new Error("bad point: invalid y coordinate");const S=(b&u)===u,v=!!(128&h);if(!e&&b===a&&v)throw new Error("bad point: x=0 and x_0=1");return v!==S&&(b=y(-b)),B.fromAffine({x:b,y:f})}static fromHex(t,e=!1){return B.fromBytes((0,n.qj)("point",t),e)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(t=8,e=!0){return b.createCache(this,t),e||this.multiply(c),this}assertValidity(){E(this)}equals(t){g(t);const{X:e,Y:r,Z:n}=this,{X:i,Y:s,Z:o}=t,a=y(e*o),u=y(i*n),c=y(r*o),h=y(s*n);return a===u&&c===h}is0(){return this.equals(B.ZERO)}negate(){return new B(y(-this.X),this.Y,this.Z,y(-this.T))}double(){const{a:t}=d,{X:e,Y:r,Z:n}=this,i=y(e*e),s=y(r*r),o=y(c*y(n*n)),a=y(t*i),u=e+r,h=y(y(u*u)-i-s),f=a+s,l=f-o,p=a-s,m=y(h*l),w=y(f*p),g=y(h*p),x=y(l*f);return new B(m,w,x,g)}add(t){g(t);const{a:e,d:r}=d,{X:n,Y:i,Z:s,T:o}=this,{X:a,Y:u,Z:c,T:h}=t,f=y(n*a),l=y(i*u),p=y(o*r*h),m=y(s*c),w=y((n+i)*(a+u)-f-l),x=m-p,E=m+p,b=y(l-e*f),S=y(w*x),v=y(E*b),T=y(w*b),A=y(x*E);return new B(S,v,A,T)}subtract(t){return this.add(t.negate())}multiply(t){if(!f.isValidNot0(t))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:e,f:r}=b.cached(this,t,t=>(0,s.Ak)(B,t));return(0,s.Ak)(B,[e,r])[0]}multiplyUnsafe(t,e=B.ZERO){if(!f.isValid(t))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return t===a?B.ZERO:this.is0()||t===u?this:b.unsafe(this,t,t=>(0,s.Ak)(B,t),e)}isSmallOrder(){return this.multiplyUnsafe(l).is0()}isTorsionFree(){return b.unsafe(this,d.n).is0()}toAffine(t){return x(this,t)}clearCofactor(){return l===u?this:this.multiplyUnsafe(l)}toBytes(){const{x:t,y:e}=this.toAffine(),r=o.toBytes(e);return r[r.length-1]|=t&u?128:0,r}toHex(){return(0,i.My)(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(t){return(0,s.Ak)(B,t)}static msm(t,e){return(0,s.Xf)(B,f,t,e)}_setWindowSize(t){this.precompute(t)}toRawBytes(){return this.toBytes()}}B.BASE=new B(d.Gx,d.Gy,u,y(d.Gx*d.Gy)),B.ZERO=new B(a,u,u,a),B.Fp=o,B.Fn=f;const b=new s.hT(B,f.BITS);return B.BASE.precompute(8),B}class d{constructor(t){this.ep=t}static fromBytes(t){(0,n.SJ)()}static fromHex(t){(0,n.SJ)()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(t){return this.ep.toAffine(t)}toHex(){return(0,i.My)(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(t){return this.assertSame(t),this.init(this.ep.add(t.ep))}subtract(t){return this.assertSame(t),this.init(this.ep.subtract(t.ep))}multiply(t){return this.init(this.ep.multiply(t))}multiplyUnsafe(t){return this.init(this.ep.multiplyUnsafe(t))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(t,e){return this.init(this.ep.precompute(t,e))}toRawBytes(){return this.toBytes()}}function l(t){const{CURVE:e,curveOpts:r,hash:s,eddsaOpts:a}=function(t){const e={a:t.a,d:t.d,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},r={Fp:t.Fp,Fn:(0,o.D0)(e.n,t.nBitLength,!0),uvRatio:t.uvRatio},n={randomBytes:t.randomBytes,adjustScalarBytes:t.adjustScalarBytes,domain:t.domain,prehash:t.prehash,mapToCurve:t.mapToCurve};return{CURVE:e,curveOpts:r,hash:t.hash,eddsaOpts:n}}(t);return function(t,e){const r=e.Point;return Object.assign({},e,{ExtendedPoint:r,CURVE:t,nBitLength:r.Fn.BITS,nByteLength:r.Fn.BYTES})}(t,function(t,e,r={}){if("function"!=typeof e)throw new Error('"hash" function param is required');(0,n.DS)(r,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:s}=r,{BASE:o,Fp:a,Fn:c}=t,h=r.randomBytes||i.po,f=r.adjustScalarBytes||(t=>t),d=r.domain||((t,e,r)=>{if((0,n.d6)(r,"phflag"),e.length||r)throw new Error("Contexts/pre-hash are not supported");return t});function l(t){return c.create((0,n.lX)(t))}function p(t){const{head:r,prefix:i,scalar:s}=function(t){const r=x.secretKey;t=(0,n.qj)("private key",t,r);const i=(0,n.qj)("hashed private key",e(t),2*r),s=f(i.slice(0,r));return{head:s,prefix:i.slice(r,2*r),scalar:l(s)}}(t),a=o.multiply(s),u=a.toBytes();return{head:r,prefix:i,scalar:s,point:a,pointBytes:u}}function y(t){return p(t).pointBytes}function m(t=Uint8Array.of(),...r){const o=(0,i.Id)(...r);return l(e(d(o,(0,n.qj)("context",t),!!s)))}const w={zip215:!0},g=a.BYTES,x={secretKey:g,publicKey:g,signature:2*g,seed:g};function E(t=h(x.seed)){return(0,n.eV)(t,x.seed,"seed")}const B={getExtendedPublicKey:p,randomSecretKey:E,isValidSecretKey:function(t){return(0,i.aY)(t)&&t.length===c.BYTES},isValidPublicKey:function(e,r){try{return!!t.fromBytes(e,r)}catch(t){return!1}},toMontgomery(e){const{y:r}=t.fromBytes(e),n=x.publicKey,i=32===n;if(!i&&57!==n)throw new Error("only defined for 25519 and 448");const s=i?a.div(u+r,u-r):a.div(r-u,r+u);return a.toBytes(s)},toMontgomerySecret(t){const r=x.secretKey;(0,n.eV)(t,r);const i=e(t.subarray(0,r));return f(i).subarray(0,r)},randomPrivateKey:E,precompute:(e=8,r=t.BASE)=>r.precompute(e,!1)};return Object.freeze({keygen:function(t){const e=B.randomSecretKey(t);return{secretKey:e,publicKey:y(e)}},getPublicKey:y,sign:function(t,e,r={}){t=(0,n.qj)("message",t),s&&(t=s(t));const{prefix:a,scalar:u,pointBytes:h}=p(e),f=m(r.context,a,t),d=o.multiply(f).toBytes(),l=m(r.context,d,h,t),y=c.create(f+l*u);if(!c.isValid(y))throw new Error("sign failed: invalid s");const w=(0,i.Id)(d,c.toBytes(y));return(0,n.eV)(w,x.signature,"result")},verify:function(e,r,i,a=w){const{context:u,zip215:c}=a,h=x.signature;e=(0,n.qj)("signature",e,h),r=(0,n.qj)("message",r),i=(0,n.qj)("publicKey",i,x.publicKey),void 0!==c&&(0,n.d6)(c,"zip215"),s&&(r=s(r));const f=h/2,d=e.subarray(0,f),l=(0,n.lX)(e.subarray(f,h));let p,y,g;try{p=t.fromBytes(i,c),y=t.fromBytes(d,c),g=o.multiplyUnsafe(l)}catch(t){return!1}if(!c&&p.isSmallOrder())return!1;const E=m(u,y.toBytes(),p.toBytes(),r);return y.add(p.multiplyUnsafe(E)).subtract(g).clearCofactor().is0()},utils:B,Point:t,lengths:x})}(f(e,r),s,a))}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
package/dist/452.index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 452.index.js.LICENSE.txt */
|
|
2
|
-
export const __webpack_esm_id__=452;export const __webpack_esm_ids__=[452];export const __webpack_esm_modules__={3452:(f,e,t)=>{t.d(e,{ed448:()=>O});var n=t(7238),c=t(2531),a=t(649),i=t(6618),r=(t(5385),t(5916)),s=t(8906);const o={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),n:BigInt("0x3fffffffffffffffffffffffffffffffffffffffffffffffffffffff7cca23e9c44edb49aed63690216cc2728dc58f552378c292ab5844f3"),h:BigInt(4),a:BigInt(1),d:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffffffffffffffffffffffffffffffffffffffffffffffff6756"),Gx:BigInt("0x4f1970c66bed0ded221d15a622bf36da9e146570470f1767ea6de324a3d3a46412ae1af72ab66511433b80e18b00938e2626a82bc70cc05e"),Gy:BigInt("0x693f46716eb6bc248876203756c9c7624bea73736ca3984087789c1e05a0c2d73ad3ff1ce67c39c4fdbd132c4ed7c8ad9808795bf230fa14")},d=Object.assign({},o,{d:BigInt("0xd78b4bdc7f0daf19f24f38c29373a2ccad46157242a50f37809b1da3412a12e79ccc9c81264cfe9ad080997058fb61c4243cc32dbaa156b9"),Gx:BigInt("0x79a70b2b70400553ae7c9df416c792c61128751ac92969240c25a07d728bdc93e21f7787ed6972249de732f38496cd11698713093e9c04fc"),Gy:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffff80000000000000000000000000000000000000000000000000000001")}),B=(0,c.qj)(()=>n.mh.create({dkLen:114})),u=BigInt(1),g=BigInt(2),b=BigInt(3),I=BigInt(4),l=BigInt(11),h=BigInt(22),m=BigInt(44),w=BigInt(88),p=BigInt(223);function x(f){return f[0]&=252,f[55]|=128,f[56]=0,f}function _(f,e){const t=o.p,n=(0,r.zi)(f*f*e,t),c=(0,r.zi)(n*f,t),a=function(f){const e=o.p,t=f*f*f%e,n=t*t*f%e,c=(0,r.zH)(n,b,e)*n%e,a=(0,r.zH)(c,b,e)*n%e,i=(0,r.zH)(a,g,e)*t%e,s=(0,r.zH)(i,l,e)*i%e,d=(0,r.zH)(s,h,e)*s%e,B=(0,r.zH)(d,m,e)*d%e,I=(0,r.zH)(B,w,e)*B%e,x=(0,r.zH)(I,m,e)*d%e,_=(0,r.zH)(x,g,e)*t%e,z=(0,r.zH)(_,u,e)*f%e;return(0,r.zH)(z,p,e)*_%e}((0,r.zi)(c*n*e,t)),i=(0,r.zi)(c*a,t),s=(0,r.zi)(i*i,t);return{isValid:(0,r.zi)(s*e,t)===f,value:i}}const z=(()=>(0,r.D0)(o.p,{BITS:456,isLE:!0}))(),E=(()=>(0,r.D0)(o.n,{BITS:456,isLE:!0}))(),y=(()=>(0,r.D0)(o.p,{BITS:448,isLE:!0}))(),H=(()=>(0,r.D0)(o.n,{BITS:448,isLE:!0}))();function S(f,e,t){if(e.length>255)throw new Error("context must be smaller than 255, got: "+e.length);return(0,c.Id)((0,s.Mh)("SigEd448"),new Uint8Array([t?1:0,e.length]),e,f)}const D=(()=>({...o,Fp:z,Fn:E,nBitLength:E.BITS,hash:B,adjustScalarBytes:x,domain:S,uvRatio:_}))(),O=(0,i.n6)(D);(0,i.TO)(d);const R=BigInt("39082"),v=BigInt("78163"),T=BigInt("98944233647732219769177004876929019128417576295529901074099889598043702116001257856802131563896515373927712232092845883226922417596214"),L=BigInt("315019913931389607337177038330951043522456072897266928557328499619017160722351061360252776265186336876723201881398623946864393857820716"),P=f=>_(u,f);function j(f){const{d:e}=o,t=z.ORDER,n=f=>z.create(f),c=n(-f*f),a=n(e*(c-u)),i=n((a+u)*(a-c)),{isValid:s,value:d}=_(v,n((c+u)*i));let B=d;s||(B=n(f*d));let b=u;s||(b=n(-u));const I=n(B*(c+u));let l=I;(0,r.dQ)(I,t)&&(l=n(-I));const h=I*I,m=n(l*g),w=n(h+u),p=n(h-u),x=n(B*I*(c-u)*v+b);return new O.Point(n(m*x),n(p*w),n(w*x),n(m*p))}class q extends i.i5{constructor(f){super(f)}static fromAffine(f){return new q(O.Point.fromAffine(f))}assertSame(f){if(!(f instanceof q))throw new Error("DecafPoint expected")}init(f){return new q(f)}static hashToCurve(f){return function(f){(0,c.DO)(f,112);const e=!0,t=j(y.create(y.fromBytes(f.subarray(0,56),e))),n=j(y.create(y.fromBytes(f.subarray(56,112),e)));return new q(t.add(n))}((0,s.qj)("decafHash",f,112))}static fromBytes(f){(0,c.DO)(f,56);const{d:e}=o,t=z.ORDER,n=f=>y.create(f),a=y.fromBytes(f);if(!(0,s.ex)(H.toBytes(a),f)||(0,r.dQ)(a,t))throw new Error("invalid decaf448 encoding 1");const i=n(a*a),d=n(u+i),B=n(d*d),g=n(B-I*e*i),{isValid:b,value:l}=P(n(g*B));let h=n((a+a)*l*d*T);(0,r.dQ)(h,t)&&(h=n(-h));const m=n(h*l*g*L),w=n((u-i)*l*d),p=n(m*w);if(!b)throw new Error("invalid decaf448 encoding 2");return new q(new O.Point(m,w,u,p))}static fromHex(f){return q.fromBytes((0,s.qj)("decafHex",f,56))}static msm(f,e){return(0,a.Xf)(q,E,f,e)}toBytes(){const{X:f,Z:e,T:t}=this.ep,n=z.ORDER,c=f=>z.create(f),a=c(c(f+t)*c(f-t)),i=c(f*f),{value:s}=P(c(a*R*i));let o=c(s*a*T);(0,r.dQ)(o,n)&&(o=c(-o));const d=c(L*o*e-t);let B=c(R*s*f*d);return(0,r.dQ)(B,n)&&(B=c(-B)),H.toBytes(B)}equals(f){this.assertSame(f);const{X:e,Y:t}=this.ep,{X:n,Y:c}=f.ep;return z.create(e*c)===z.create(t*n)}is0(){return this.equals(q.ZERO)}}q.BASE=(()=>new q(O.Point.BASE).multiplyUnsafe(g))(),q.ZERO=(()=>new q(O.Point.ZERO))(),q.Fp=(()=>y)(),q.Fn=(()=>H)()}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
package/dist/508.index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/*! For license information please see 508.index.js.LICENSE.txt */
|
|
2
|
-
export const __webpack_esm_id__=508;export const __webpack_esm_ids__=[508];export const __webpack_esm_modules__={3508:(e,t,r)=>{r.d(t,{XWing:()=>g});var i=r(8619),a=r(4220);const n=BigInt(1),s=BigInt(2),y=BigInt(3),h=BigInt(5),o=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed");function c(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}const w=(()=>{const e=o;return(0,a.EC)({P:e,type:"x25519",powPminus2:t=>{const{pow_p_5_8:r,b2:i}=function(e){const t=BigInt(10),r=BigInt(20),i=BigInt(40),y=BigInt(80),c=o,w=e*e%c*e%c,l=(0,a.zH)(w,s,c)*w%c,u=(0,a.zH)(l,n,c)*e%c,f=(0,a.zH)(u,h,c)*u%c,b=(0,a.zH)(f,t,c)*f%c,d=(0,a.zH)(b,r,c)*b%c,p=(0,a.zH)(d,i,c)*d%c,v=(0,a.zH)(p,y,c)*p%c,g=(0,a.zH)(v,y,c)*p%c,_=(0,a.zH)(g,t,c)*f%c;return{pow_p_5_8:(0,a.zH)(_,s,c)*e%c,b2:w}}(t);return(0,a.zi)((0,a.zH)(r,y,e)*i,e)},adjustScalarBytes:c})})();class l extends a.o0{async extract(e,t){if(await this._setup(),0===e.byteLength&&(e=new ArrayBuffer(this.hashSize)),e.byteLength!==this.hashSize)return(0,a.w8)(a.sc,new Uint8Array(e),new Uint8Array(t)).buffer;const r=await this._api.importKey("raw",e,this.algHash,!1,["sign"]);return await this._api.sign("HMAC",r,t)}}const u="X25519";class f{constructor(e){Object.defineProperty(this,"_hkdf",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nPk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_nSk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._hkdf=e,this._nPk=32,this._nSk=32}async serializePublicKey(e){try{return await this._serializePublicKey(e)}catch(e){throw new a.LV(e)}}async deserializePublicKey(e){try{return await this._importRawKey(e,!0)}catch(e){throw new a.Ug(e)}}async serializePrivateKey(e){try{return await this._serializePrivateKey(e)}catch(e){throw new a.LV(e)}}async deserializePrivateKey(e){try{return await this._importRawKey(e,!1)}catch(e){throw new a.Ug(e)}}async importKey(e,t,r){try{if("raw"===e)return await this._importRawKey(t,r);if(t instanceof ArrayBuffer)throw new Error("Invalid jwk key format");return await this._importJWK(t,r)}catch(e){throw new a.Ug(e)}}async generateKeyPair(){try{const e=await w.utils.randomSecretKey(),t=new a.Bk(u,e,"private",a.xE);return{publicKey:await this.derivePublicKey(t),privateKey:t}}catch(e){throw new a.EM(e)}}async deriveKeyPair(e){try{const t=await this._hkdf.labeledExtract(a.wg.buffer,a.CY,new Uint8Array(e)),r=await this._hkdf.labeledExpand(t,a.Hz,a.wg,this._nSk),i=new a.Bk(u,new Uint8Array(r),"private",a.xE);return{privateKey:i,publicKey:await this.derivePublicKey(i)}}catch(e){throw new a.$7(e)}}async derivePublicKey(e){try{return await this._derivePublicKey(e)}catch(e){throw new a.Ug(e)}}async dh(e,t){try{return await this._dh(e,t)}catch(e){throw new a.LV(e)}}async derive(e,t){try{return await this._derive(e,t)}catch(e){throw new a.LV(e)}}_serializePublicKey(e){return new Promise(t=>{t(e.key.buffer)})}_serializePrivateKey(e){return new Promise(t=>{t(e.key.buffer)})}_importRawKey(e,t){return new Promise((r,i)=>{t&&e.byteLength!==this._nPk&&i(new Error("Invalid length of the key")),t||e.byteLength===this._nSk||i(new Error("Invalid length of the key")),r(new a.Bk(u,new Uint8Array(e),t?"public":"private",t?[]:a.xE))})}_importJWK(e,t){return new Promise((r,i)=>{void 0!==e.kty&&"OKP"===e.kty||i(new Error(`Invalid kty: ${e.kty}`)),void 0!==e.crv&&"X25519"===e.crv||i(new Error(`Invalid crv: ${e.crv}`)),t?(void 0!==e.d&&i(new Error("Invalid key: `d` should not be set")),void 0===e.x&&i(new Error("Invalid key: `x` not found")),r(new a.Bk(u,(0,a.rf)(e.x),"public"))):("string"!=typeof e.d&&i(new Error("Invalid key: `d` not found")),r(new a.Bk(u,(0,a.rf)(e.d),"private",a.xE)))})}_derivePublicKey(e){return new Promise((t,r)=>{try{const r=w.getPublicKey(e.key);t(new a.Bk(u,r,"public"))}catch(e){r(e)}})}_dh(e,t){return new Promise((r,i)=>{try{r(w.getSharedSecret(e.key,t.key).buffer)}catch(e){i(e)}})}_derive(e,t){return new Promise((r,i)=>{try{r(w.getSharedSecret(e,t))}catch(e){i(e)}})}}a.gX;const b="X-Wing",d=new Uint8Array([9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),p=new Uint8Array([92,46,47,47,94,92]);function v(e,t,r,a){const n=new Uint8Array(e.length+t.length+r.length+a.length+p.length);return n.set(e,0),n.set(t,e.length),n.set(r,e.length+t.length),n.set(a,e.length+t.length+r.length),n.set(p,e.length+t.length+r.length+a.length),i.C2.create().update(n).digest()}class g{constructor(){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:a.h.XWing}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:b}),Object.defineProperty(this,"secretSize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"encSize",{enumerable:!0,configurable:!0,writable:!0,value:1120}),Object.defineProperty(this,"publicKeySize",{enumerable:!0,configurable:!0,writable:!0,value:1216}),Object.defineProperty(this,"privateKeySize",{enumerable:!0,configurable:!0,writable:!0,value:32}),Object.defineProperty(this,"auth",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_m",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_x25519",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_api",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._m=new i.wo,this._x25519=new f(new l)}async serializePublicKey(e){await this._setup();try{return await this._serializePublicKey(e)}catch(e){throw new a.LV(e)}}async deserializePublicKey(e){await this._setup();try{return await this._deserializePublicKey(e)}catch(e){throw new a.Ug(e)}}async serializePrivateKey(e){await this._setup();try{return await this._serializePrivateKey(e)}catch(e){throw new a.LV(e)}}async deserializePrivateKey(e){await this._setup();try{return await this._deserializePrivateKey(e)}catch(e){throw new a.Ug(e)}}async generateKeyPair(){await this._setup();const e=new Uint8Array(32);try{this._api.getRandomValues(e)}catch(e){throw new a.EM(e)}try{const[t,r]=await this._generateKeyPairDerand(e);return{privateKey:await this.deserializePrivateKey(e.buffer),publicKey:await this.deserializePublicKey(r.buffer)}}catch(e){throw new a.$7(e)}}async generateKeyPairDerand(e){if(32!==e.byteLength)throw new a.NS("Invalid length of sk");try{const[t,r]=await this._generateKeyPairDerand(e);return{privateKey:await this.deserializePrivateKey(e.buffer),publicKey:await this.deserializePublicKey(r.buffer)}}catch(e){throw new a.$7(e)}}async deriveKeyPair(e){await this._setup();try{const t=i.mh.create({dkLen:32}).update(new Uint8Array(e)).digest(),[r,a]=await this._generateKeyPairDerand(t);return{privateKey:await this.deserializePrivateKey(t.buffer),publicKey:await this.deserializePublicKey(a.buffer)}}catch(e){throw new a.$7(e)}}async importKey(e,t,r=!0){await this._setup();try{let i;if("jwk"===e){if(t instanceof ArrayBuffer||t instanceof Uint8Array)throw new Error("Invalid jwk key format");i=await this._importJWK(t,r)}else if(t instanceof ArrayBuffer)i=new Uint8Array(t);else{if(!(t instanceof Uint8Array))throw new Error("Invalid key format");i=t}if(r&&i.byteLength!==this.publicKeySize)throw new Error("Invalid length of the key");if(!r&&i.byteLength!==this.privateKeySize)throw new Error("Invalid length of the key");return new a.Bk(b,i,r?"public":"private",r?[]:a.xE)}catch(e){throw new a.Ug(e)}}async encap(e){let t,r,i;if(void 0!==e.ekm&&!(0,a.Di)(e.ekm)){if(64!==e.ekm.byteLength)throw new a.NS("ekm must be 64 bytes in length");t=e.ekm}if(void 0!==t){const e=new Uint8Array(t);r=e.subarray(0,32),i=e.subarray(32,64)}else{i=new Uint8Array(32);try{this._api.getRandomValues(i)}catch(e){throw new a.EM(e)}}const n=new Uint8Array(await this.serializePublicKey(e.recipientPublicKey));if(1216!==n.byteLength)throw new a.NS("Invalid length of recipientPublicKey");await this._setup();try{const e=n.subarray(0,1184),t=n.subarray(1184,1216),s=await this._x25519.derive(i,d),y=await this._x25519.derive(i,t),[h,o]=await this._m.encap(e,r);return{sharedSecret:v(o,y,s,t).buffer,enc:(0,a.xW)(h,s).buffer}}catch(e){throw new a.Wg(e)}}async decap(e){const t=(0,a.Di)(e.recipientKey)?e.recipientKey.privateKey:e.recipientKey;if(1120!==e.enc.byteLength)throw new a.NS("Invalid length of enc");const r=new Uint8Array(await this.serializePrivateKey(t));if(32!==r.byteLength)throw new a.NS("Invalid length of recipientKey");await this._setup();try{const[t,i,a,n]=await this._expandDecapsulationKey(r),s=new Uint8Array(e.enc),y=s.subarray(0,1088),h=s.subarray(1088);return v(await this._m.decap(y,t),await this._x25519.derive(i,h),h,n).buffer}catch(e){throw new a.uu(e)}}async _setup(){void 0===this._api&&(this._api=await(0,a.QZ)())}async _generateKeyPairDerand(e){const[t,r,i,n]=await this._expandDecapsulationKey(e);return[e,(0,a.xW)(i,n)]}async _expandDecapsulationKey(e){const t=i.mh.create({dkLen:96}).update(e).digest(),[r,a]=await this._m.deriveKeyPair(t.subarray(0,64)),n=t.subarray(64,96);return[a,n,r,await this._x25519.derive(n,d)]}_serializePublicKey(e){return new Promise((t,r)=>{"public"!==e.type&&r(new Error("Not public key")),e.algorithm.name!==this.name&&r(new Error(`Invalid algorithm name: ${e.algorithm.name}`)),e.key.byteLength!==this.publicKeySize&&r(new Error(`Invalid key length: ${e.key.byteLength}`)),t(e.key.buffer)})}_deserializePublicKey(e){return new Promise((t,r)=>{e.byteLength!==this.publicKeySize&&r(new Error(`Invalid key length: ${e.byteLength}`)),t(new a.Bk(this.name,new Uint8Array(e),"public"))})}_serializePrivateKey(e){return new Promise((t,r)=>{"private"!==e.type&&r(new Error("Not private key")),e.algorithm.name!==this.name&&r(new Error(`Invalid algorithm name: ${e.algorithm.name}`)),e.key.byteLength!==this.privateKeySize&&r(new Error(`Invalid key length: ${e.key.byteLength}`)),t(e.key.buffer)})}_deserializePrivateKey(e){return new Promise((t,r)=>{e.byteLength!==this.privateKeySize&&r(new Error(`Invalid key length: ${e.byteLength}`)),t(new a.Bk(this.name,new Uint8Array(e),"private",["deriveBits"]))})}_importJWK(e,t){return new Promise((r,i)=>{void 0!==e.kty&&"AKP"===e.kty||i(new Error(`Invalid kty: ${e.kty}`)),void 0!==e.alg&&e.alg===b||i(new Error(`Invalid alg: ${e.alg}`)),t||(void 0===e.priv&&i(new Error("Invalid key: `priv` not found")),void 0===e.key_ops||1===e.key_ops.length&&"deriveBits"===e.key_ops[0]||i(new Error("Invalid key: `key_ops` should be ['deriveBits']")),r((0,a.rf)(e.priv))),void 0!==e.priv&&i(new Error("Invalid key: `priv` should not be set")),void 0===e.pub&&i(new Error("Invalid key: `pub` not found")),void 0!==e.key_ops&&e.key_ops.length>0&&i(new Error("Invalid key: `key_ops` should not be set")),r((0,a.rf)(e.pub))})}}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|