1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1788],{31788:(t,e,r)=>{let n;r.d(e,{secp256k1:()=>tq});var i,o={};r.r(o),r.d(o,{aK:()=>P,e8:()=>x,DO:()=>E,dJ:()=>Z,OG:()=>F,My:()=>v,Ph:()=>q,lX:()=>N,Id:()=>C,fg:()=>T,qj:()=>U,aT:()=>S,r4:()=>z,aY:()=>b,x:()=>j,lq:()=>R,z:()=>H,zW:()=>A,Q5:()=>_});var s=r(44150),l=r(7791);class f extends l.Vw{constructor(t,e,r,n){super(),this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,l.O8)(this.buffer)}update(t){(0,s.CC)(this);let{view:e,buffer:r,blockLen:n}=this,i=(t=(0,l.ZJ)(t)).length;for(let o=0;o<i;){let s=Math.min(n-this.pos,i-o);if(s===n){let e=(0,l.O8)(t);for(;n<=i-o;o+=n)this.process(e,o);continue}r.set(t.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,s.CC)(this),(0,s.Ht)(t,this),this.finished=!0;let{buffer:e,view:r,blockLen:n,isLE:i}=this,{pos:o}=this;e[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(r,0),o=0);for(let t=o;t<n;t++)e[t]=0;!function(t,e,r,n){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,n);let i=BigInt(32),o=BigInt(0xffffffff),s=Number(r>>i&o),l=Number(r&o),f=4*!!n,a=4*!n;t.setUint32(e+f,s,n),t.setUint32(e+a,l,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);let f=(0,l.O8)(t),a=this.outputLen;if(a%4)throw Error("_sha2: outputLen should be aligned to 32bit");let u=a/4,h=this.get();if(u>h.length)throw Error("_sha2: outputLen bigger than state");for(let t=0;t<u;t++)f.setUint32(4*t,h[t],i)}digest(){let{buffer:t,outputLen:e}=this;this.digestInto(t);let r=t.slice(0,e);return this.destroy(),r}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());let{blockLen:e,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return t.length=n,t.pos=s,t.finished=i,t.destroyed=o,n%e&&t.buffer.set(r),t}}let a=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),u=new Uint32Array([0x6a09e66
vendor: 4,925 bytes, line 1
17,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),h=new Uint32Array(64);class d extends f{constructor(){super(64,32,8,!1),this.A=0|u[0],this.B=0|u[1],this.C=0|u[2],this.D=0|u[3],this.E=0|u[4],this.F=0|u[5],this.G=0|u[6],this.H=0|u[7]}get(){let{A:t,B:e,C:r,D:n,E:i,F:o,G:s,H:l}=this;return[t,e,r,n,i,o,s,l]}set(t,e,r,n,i,o,s,l){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|l}process(t,e){for(let r=0;r<16;r++,e+=4)h[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){let e=h[t-15],r=h[t-2],n=(0,l.Ow)(e,7)^(0,l.Ow)(e,18)^e>>>3,i=(0,l.Ow)(r,17)^(0,l.Ow)(r,19)^r>>>10;h[t]=i+h[t-7]+n+h[t-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:f,G:u,H:d}=this;for(let t=0;t<64;t++){var c,g,p,y;let e=d+((0,l.Ow)(s,6)^(0,l.Ow)(s,11)^(0,l.Ow)(s,25))+((c=s)&f^~c&u)+a[t]+h[t]|0,w=((0,l.Ow)(r,2)^(0,l.Ow)(r,13)^(0,l.Ow)(r,22))+((g=r)&(p=n)^g&(y=i)^p&y)|0;d=u,u=f,f=s,s=o+e|0,o=i,i=n,n=r,r=e+w|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,f=f+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,n,i,o,s,f,u,d)}roundClean(){h.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}let c=(0,l.ld)(()=>new d);class g extends l.Vw{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,(0,s.sd)(t);const r=(0,l.ZJ)(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?t.create().update(r).digest():r);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),i.fill(0)}update(t){return(0,s.CC)(this),this.iHash.update(t),this}digestInto(t){(0,s.CC)(this),(0,s.DO)(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));let{oHash:e,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return t.finished=n,t.destroyed=i,t.blockLen=o,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let p=(t,e,r)=>new g(t,e).update(r).digest();p.create=(t,e)=>new g(t,e);let y=BigInt(0),w=BigInt(1),m=BigInt(2);function b(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function E(t){if(!b(t))throw Error("Uint8Array expected")}function x(t,e){if("boolean"!=typeof e)throw Error(t+" boolean expected, got "+e)}let B=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function v(t){E(t);let e="";for(let r=0;r<t.length;r++)e+=B[t[r]];return e}function A(t){let e=t.toString(16);return 1&e.length?"0"+e:e}function O(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);return""===t?y:BigInt("0x"+t)}function I(t){return t>=48&&t<=57?t-48:t>=65&&t<=70?t-55:t>=97&&t<=102?t-87:void 0}function S(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);let e=t.length,r=e/2;if(e%2)throw Error("hex string expected, got unpadded hex of length "+e);let n=new Uint8Array(r);for(let e=0,i=0;e<r;e++,i+=2){let r=I(t.charCodeAt(i)),o=I(t.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(t[i]+t[i+1])+'" at index '+i);n[e]=16*r+o}return n}function q(t){return O(v(t))}function N(t){return E(t),O(v(Uint8Array.from(t).reverse()))}function R(t,e){return S(t.toString(16).padStart(2*e,"0"))}function H(t,e){return R(t,e).reverse()}function U(t,e,r){let n;if("string"==typeof e)try{n=S(e)}catch(e){throw Error(t+" must be hex string or Uint8Array, cause: "+e)}else if(b(e))n=Uint8Array.from(e);else throw Error(t+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(t+" of length "+r+" expected, got "+i);return n}function C(...t){let e=0;for(let r=0;r<t.length;r++){let n=t[r];E(n),e+=n.length}let r=new Uint8Array(e);for(let e=0,n=0;e<t.length;e++){let i=t[e];r.set(i,n),n+=i.length}return r}let L=t=>"bigint"==typeof t&&y<=t;function z(t,e,r){return L(t)&&L(e)&&L(r)&&e<=t&&t<r}function P(t,e,r,n){if(!z(e,r,n))throw Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}function Z(t){let e;for(e=0;t>y;t>>=w,e+=1);return e}let F=t=>(m<<BigInt(t-1))-w,k=t=>new Uint8Array(t);function T(t,e,r){if("number"!=typeof t||t<2)throw Error("hashLen must be a number");if("number"!=typeof e||e<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=k(t),i=k(t),o=0,s=()=>{n.fill(1),i.fill(0),o=0},l=(...t)=>r(i,n,...t),f=(t=k())=>{let e;if(i=l((e=[0],Uint8Array.from(e)),t),n=l(),0!==t.length){let e;i=l((e=[1],Uint8Array.from(e)),t),n=l()}},a=()=>
1{if(o++>=1e3)throw Error("drbg: tried 1000 values");let t=0,r=[];for(;t<e;){let e=(n=l()).slice();r.push(e),t+=n.length}return C(...r)};return(t,e)=>{let r;for(s(),f(t);!(r=e(a()));)f();return s(),r}}let V={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,stringOrUint8Array:t=>"string"==typeof t||b(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};function _(t,e,r={}){let n=(e,r,n)=>{let i=V[r];if("function"!=typeof i)throw Error("invalid validator function");let o=t[e];if((!n||void 0!==o)&&!i(o,t))throw Error("param "+String(e)+" is invalid. Expected "+r+", got "+o)};for(let[t,r]of Object.entries(e))n(t,r,!1);for(let[t,e]of Object.entries(r))n(t,e,!0);return t}function j(t){let e=new WeakMap;return(r,...n)=>{let i=e.get(r);if(void 0!==i)return i;let o=t(r,...n);return e.set(r,o),o}}let D=BigInt(0),K=BigInt(1),M=BigInt(2),W=BigInt(3),Y=BigInt(4),G=BigInt(5),J=BigInt(8);function Q(t,e){let r=t%e;return r>=D?r:e+r}function X(t,e,r){let n=t;for(;e-- >D;)n*=n,n%=r;return n}function $(t,e){if(t===D)throw Error("invert: expected non-zero number");if(e<=D)throw Error("invert: expected positive modulus, got "+e);let r=Q(t,e),n=e,i=D,o=K,s=K,l=D;for(;r!==D;){let t=n/r,e=n%r,f=i-s*t,a=o-l*t;n=r,r=e,i=s,o=l,s=f,l=a}if(n!==K)throw Error("invert: does not exist");return Q(i,e)}let tt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function te(t,e){let r=void 0!==e?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function tr(t,e,r=!1,n={}){let i;if(t<=D)throw Error("invalid field: expected ORDER > 0, got "+t);let{nBitLength:o,nByteLength:s}=te(t,e);if(s>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let l=Object.freeze({ORDER:t,isLE:r,BITS:o,BYTES:s,MASK:F(o),ZERO:D,ONE:K,create:e=>Q(e,t),isValid:e=>{if("bigint"!=typeof e)throw Error("invalid field element: expected bigint, got "+typeof e);return D<=e&&e<t},is0:t=>t===D,isOdd:t=>(t&K)===K,neg:e=>Q(-e,t),eql:(t,e)=>t===e,sqr:e=>Q(e*e,t),add:(e,r)=>Q(e+r,t),sub:(e,r)=>Q(e-r,t),mul:(e,r)=>Q(e*r,t),pow:(t,e)=>(function(t,e,r){if(r<D)throw Error("invalid exponent, negatives unsupported");if(r===D)return t.ONE;if(r===K)return e;let n=t.ONE,i=e;for(;r>D;)r&K&&(n=t.mul(n,i)),i=t.sqr(i),r>>=K;return n})(l,t,e),div:(e,r)=>Q(e*$(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>$(e,t),sqrt:n.sqrt||(e=>(i||(i=function(t){if(t%Y===W){let e=(t+K)/Y;return function(t,r){let n=t.pow(r,e);if(!t.eql(t.sqr(n),r))throw Error("Cannot find square root");return n}}if(t%J===G){let e=(t-G)/J;return function(t,r){let n=t.mul(r,M),i=t.pow(n,e),o=t.mul(r,i),s=t.mul(t.mul(o,M),i),l=t.mul(o,t.sub(s,t.ONE));if(!t.eql(t.sqr(l),r))throw Error("Cannot find square root");return l}}return function(t){let e,r,n,i=(t-K)/M;for(e=t-K,r=0;e%M===D;e/=M,r++);for(n=M;n<t&&function(t,e,r){if(e<D)throw Error("invalid exponent, negatives unsupported");if(r<=D)throw Error("invalid modulus");if(r===K)return D;let n=K;for(;e>D;)e&K&&(n=n*t%r),t=t*t%r,e>>=K;return n}(n,i,t)!==t-K;n++)if(n>1e3)throw Error("Cannot find square root: likely non-prime P");if(1===r){let e=(t+K)/Y;return function(t,r){let n=t.pow(r,e);if(!t.eql(t.sqr(n),r))throw Error("Cannot find square root");return n}}let o=(e+K)/M;return function(t,s){if(t.pow(s,i)===t.neg(t.ONE))throw Error("Cannot find square root");let l=r,f=t.pow(t.mul(t.ONE,n),e),a=t.pow(s,o),u=t.pow(s,e);for(;!t.eql(u,t.ONE);){if(t.eql(u,t.ZERO))return t.ZERO;let e=1;for(let r=t.sqr(u);e<l&&!t.eql(r,t.ONE);e++)r=t.sqr(r);let r=t.pow(f,K<<BigInt(l-e-1));f=t.sqr(r),a=t.mul(a,r),u=t.mul(u,f),l=e}return a}}(t)}(t)),i(l,e))),invertBatch:t=>{let e,r,n;return e=Array(t.length),r=t.reduce((t,r,n)=>l.is0(r)?t:(e[n]=t,l.mul(t,r)),l.ONE),n=l.inv(r),t.reduceRight((t,r,n)=>l.is0(r)?t:(e[n]=l.mul(t,e[n]),l.mul(t,r)),n),e},cmov:(t,e,r)=>r?e:t,toBytes:t=>r?H(t,s):R(t,s),fromBytes:t=>{if(t.length!==s)throw Error("Field.fromBytes: expected "+s+" bytes, got "+t.length);return r?N(t):q(t)}});return Object.freeze(l)}function tn(t){if("bigint"!=typeof t)throw Error("field order must be bigint");return Math.ceil(t.toString(2).length/8)}function ti(t){let e=tn(t);return e+Math.ceil(e/2)}let to=BigInt(0),ts=BigInt(1);function tl(t,e){let r=e.negate();return t?r:e}function tf(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw Error("invalid window size, expected [1.."+e+"], got W="+t)}function ta(t,e){return tf(t,e),{windows:Math.ceil(e/t)+1,windowSize:2**(t-1)}}let tu=new WeakMap,th=new WeakMap;function td(t){return th.get(t)||1}function tc(t){return _(t.Fp,tt.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),_(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...te(t.n,t.nBitLength),...t,...{p:t.Fp.ORDER}})}function tg(t){void 0!==t.lowS&&x("lowS",t.lowS),void 0!==t.prehash&&x("prehash",t.prehash)}let{Ph:tp,aT:ty}=o;
vendor: 5,438 bytes, line 1
1class tw extends Error{constructor(t=""){super(t)}}let tm={Err:tw,_tlv:{encode:(t,e)=>{let{Err:r}=tm;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(1&e.length)throw new r("tlv.encode: unpadded data");let n=e.length/2,i=A(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let o=n>127?A(i.length/2|128):"";return A(t)+o+i+e},decode(t,e){let{Err:r}=tm,n=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");let i=e[n++],o=0;if(128&i){let t=127&i;if(!t)throw new r("tlv.decode(long): indefinite length not supported");if(t>4)throw new r("tlv.decode(long): byte length is too big");let s=e.subarray(n,n+t);if(s.length!==t)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(let t of s)o=o<<8|t;if(n+=t,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=i;let s=e.subarray(n,n+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:e.subarray(n+o)}}},_int:{encode(t){let{Err:e}=tm;if(t<tb)throw new e("integer: negative integers are not allowed");let r=A(t);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){let{Err:e}=tm;if(128&t[0])throw new e("invalid signature integer: negative");if(0===t[0]&&!(128&t[1]))throw new e("invalid signature integer: unnecessary leading zero");return tp(t)}},toSig(t){let{Err:e,_int:r,_tlv:n}=tm,i="string"==typeof t?ty(t):t;E(i);let{v:o,l:s}=n.decode(48,i);if(s.length)throw new e("invalid signature: left bytes after parsing");let{v:l,l:f}=n.decode(2,o),{v:a,l:u}=n.decode(2,f);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(l),s:r.decode(a)}},hexFromSig(t){let{_tlv:e,_int:r}=tm,n=e.encode(2,r.encode(t.r)),i=e.encode(2,r.encode(t.s));return e.encode(48,n+i)}},tb=BigInt(0),tE=BigInt(1),tx=(BigInt(2),BigInt(3));BigInt(4);let tB=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),tv=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),tA=BigInt(1),tO=BigInt(2),tI=(t,e)=>(t+e/tO)/e,tS=tr(tB,void 0,void 0,{sqrt:function(t){let e=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),s=BigInt(44),l=BigInt(88),f=t*t*t%tB,a=f*f*t%tB,u=X(a,e,tB)*a%tB,h=X(u,e,tB)*a%tB,d=X(h,tO,tB)*f%tB,c=X(d,n,tB)*d%tB,g=X(c,i,tB)*c%tB,p=X(g,s,tB)*g%tB,y=X(p,l,tB)*p%tB,w=X(y,s,tB)*g%tB,m=X(w,e,tB)*a%tB,b=X(m,o,tB)*c%tB,E=X(b,r,tB)*f%tB,x=X(E,tO,tB);if(!tS.eql(tS.sqr(x),t))throw Error("Cannot find square root");return x}}),tq=(i={a:BigInt(0),b:BigInt(7),Fp:tS,n:tv,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-tA*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=BigInt("0x100000000000000000000000000000000"),o=tI(e*t,tv),s=tI(-r*t,tv),l=Q(t-o*e-s*n,tv),f=Q(-o*r-s*e,tv),a=l>i,u=f>i;if(a&&(l=tv-l),u&&(f=tv-f),l>i||f>i)throw Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:a,k1:l,k2neg:u,k2:f}}}},{...(n=t=>(function(t){let e,r=(_(e=tc(t),{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})),{Fp:n,n:i}=r,o=n.BYTES+1,s=2*n.BYTES+1;function l(t){return Q(t,i)}let{ProjectivePoint:f,normPrivateKeyToScalar:a,weierstrassEquation:u,isWithinCurveOrder:h}=function(t){var e;let r=function(t){let e=tc(t);_(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.ZERO))throw Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}(t),{Fp:n}=r,i=tr(r.n,r.nBitLength),o=r.toBytes||((t,e,r)=>{let i=e.toAffine();return C(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),s=r.fromBytes||(t=>{let e=t.subarray(1);return{x:n.fromBytes(e.subarray(0,n.BYTES)),y:n.fromBytes(e.subarray(n.BYTES,2*n.BYTES))}});function l(t){let{a:e,b:i}=r,o=n.sqr(t),s=n.mul(o,t);return n.add(n.add(s,n.mul(t,e)),i)}if(!n.eql(n.sqr(r.Gy),l(r.Gx)))throw Error("bad generator point: equation left != right");function f(t){let e,{allowedPrivateKeyLengths:n,nByteLength:i,wrapPrivateKey:o,n:s}=r;if(n&&"bigint"!=typeof t){if(b(t)&&(t=v(t)),"string"!=typeof t||!n.includes(t.length))throw Error("invalid private key");t=t.padStart(2*i,"0")}try{e="bigint"==typeof t?t:q(U("private key",t,i))}catch(e){throw Error("invalid private key, expected hex or "+i+" bytes, got "+typeof t)}return o&&(e=Q(e,s)),P("private key",e,tE,s),e}function a(t){if(!(t instanceof d))throw Error("ProjectivePoint expected")}let u=j((t,e)=>{let{px:r,py:i,pz:o}=t;if(n.eql(o,n.ONE))return{x:r,y:i};let s=t.is0();null==e&&(e=s?n.ONE:n.inv(o));let l=n.mul(r,e),f=n.mul(i,e),a=n.mul(o,e);if(s)return{x:n.ZERO,y:n.ZERO};
1if(!n.eql(a,n.ONE))throw Error("invZ was invalid");return{x:l,y:f}}),h=j(t=>{if(t.is0()){if(r.allowInfinityPoint&&!n.is0(t.py))return;throw Error("bad point: ZERO")}let{x:e,y:i}=t.toAffine();if(!n.isValid(e)||!n.isValid(i))throw Error("bad point: x or y not FE");let o=n.sqr(i),s=l(e);if(!n.eql(o,s))throw Error("bad point: equation left != right");if(!t.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class d{constructor(t,e,r){if(this.px=t,this.py=e,this.pz=r,null==t||!n.isValid(t))throw Error("x required");if(null==e||!n.isValid(e))throw Error("y required");if(null==r||!n.isValid(r))throw Error("z required");Object.freeze(this)}static fromAffine(t){let{x:e,y:r}=t||{};if(!t||!n.isValid(e)||!n.isValid(r))throw Error("invalid affine point");if(t instanceof d)throw Error("projective point not allowed");let i=t=>n.eql(t,n.ZERO);return i(e)&&i(r)?d.ZERO:new d(e,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){let e=n.invertBatch(t.map(t=>t.pz));return t.map((t,r)=>t.toAffine(e[r])).map(d.fromAffine)}static fromHex(t){let e=d.fromAffine(s(U("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return d.BASE.multiply(f(t))}static msm(t,e){return function(t,e,r,n){if(!Array.isArray(r))throw Error("array expected");r.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)});if(!Array.isArray(n))throw Error("array of scalars expected");if(n.forEach((t,r)=>{if(!e.isValid(t))throw Error("invalid scalar at index "+r)}),r.length!==n.length)throw Error("arrays of points and scalars must have equal length");let i=t.ZERO,o=Z(BigInt(r.length)),s=o>12?o-3:o>4?o-2:o?2:1,l=(1<<s)-1,f=Array(l+1).fill(i),a=Math.floor((e.BITS-1)/s)*s,u=i;for(let t=a;t>=0;t-=s){f.fill(i);for(let e=0;e<n.length;e++){let i=Number(n[e]>>BigInt(t)&BigInt(l));f[i]=f[i].add(r[e])}let e=i;for(let t=f.length-1,r=i;t>0;t--)r=r.add(f[t]),e=e.add(r);if(u=u.add(e),0!==t)for(let t=0;t<s;t++)u=u.double()}return u}(d,i,t,e)}_setWindowSize(t){g.setWindowSize(this,t)}assertValidity(){h(this)}hasEvenY(){let{y:t}=this.toAffine();if(n.isOdd)return!n.isOdd(t);throw Error("Field doesn't support isOdd")}equals(t){a(t);let{px:e,py:r,pz:i}=this,{px:o,py:s,pz:l}=t,f=n.eql(n.mul(e,l),n.mul(o,i)),u=n.eql(n.mul(r,l),n.mul(s,i));return f&&u}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){let{a:t,b:e}=r,i=n.mul(e,tx),{px:o,py:s,pz:l}=this,f=n.ZERO,a=n.ZERO,u=n.ZERO,h=n.mul(o,o),c=n.mul(s,s),g=n.mul(l,l),p=n.mul(o,s);return p=n.add(p,p),u=n.mul(o,l),u=n.add(u,u),f=n.mul(t,u),a=n.mul(i,g),a=n.add(f,a),f=n.sub(c,a),a=n.add(c,a),a=n.mul(f,a),f=n.mul(p,f),u=n.mul(i,u),g=n.mul(t,g),p=n.sub(h,g),p=n.mul(t,p),p=n.add(p,u),u=n.add(h,h),h=n.add(u,h),h=n.add(h,g),h=n.mul(h,p),a=n.add(a,h),g=n.mul(s,l),g=n.add(g,g),h=n.mul(g,p),f=n.sub(f,h),u=n.mul(g,c),u=n.add(u,u),new d(f,a,u=n.add(u,u))}add(t){a(t);let{px:e,py:i,pz:o}=this,{px:s,py:l,pz:f}=t,u=n.ZERO,h=n.ZERO,c=n.ZERO,g=r.a,p=n.mul(r.b,tx),y=n.mul(e,s),w=n.mul(i,l),m=n.mul(o,f),b=n.add(e,i),E=n.add(s,l);b=n.mul(b,E),E=n.add(y,w),b=n.sub(b,E),E=n.add(e,o);let x=n.add(s,f);return E=n.mul(E,x),x=n.add(y,m),E=n.sub(E,x),x=n.add(i,o),u=n.add(l,f),x=n.mul(x,u),u=n.add(w,m),x=n.sub(x,u),c=n.mul(g,E),u=n.mul(p,m),c=n.add(u,c),u=n.sub(w,c),c=n.add(w,c),h=n.mul(u,c),w=n.add(y,y),w=n.add(w,y),m=n.mul(g,m),E=n.mul(p,E),w=n.add(w,m),m=n.sub(y,m),m=n.mul(g,m),E=n.add(E,m),y=n.mul(w,E),h=n.add(h,y),y=n.mul(x,E),u=n.mul(b,u),u=n.sub(u,y),y=n.mul(b,w),c=n.mul(x,c),new d(u,h,c=n.add(c,y))}subtract(t){return this.add(t.negate())}is0(){return this.equals(d.ZERO)}wNAF(t){return g.wNAFCached(this,t,d.normalizeZ)}multiplyUnsafe(t){let{endo:e,n:i}=r;P("scalar",t,tb,i);let o=d.ZERO;if(t===tb)return o;if(this.is0()||t===tE)return this;if(!e||g.hasPrecomputes(this))return g.wNAFCachedUnsafe(this,t,d.normalizeZ);let{k1neg:s,k1:l,k2neg:f,k2:a}=e.splitScalar(t),u=o,h=o,c=this;for(;l>tb||a>tb;)l&tE&&(u=u.add(c)),a&tE&&(h=h.add(c)),c=c.double(),l>>=tE,a>>=tE;return s&&(u=u.negate()),f&&(h=h.negate()),h=new d(n.mul(h.px,e.beta),h.py,h.pz),u.add(h)}
1multiply(t){let e,i,{endo:o,n:s}=r;if(P("scalar",t,tE,s),o){let{k1neg:r,k1:s,k2neg:l,k2:f}=o.splitScalar(t),{p:a,f:u}=this.wNAF(s),{p:h,f:c}=this.wNAF(f);a=g.constTimeNegate(r,a),h=g.constTimeNegate(l,h),h=new d(n.mul(h.px,o.beta),h.py,h.pz),e=a.add(h),i=u.add(c)}else{let{p:r,f:n}=this.wNAF(t);e=r,i=n}return d.normalizeZ([e,i])[0]}multiplyAndAddUnsafe(t,e,r){let n=d.BASE,i=(t,e)=>e!==tb&&e!==tE&&t.equals(n)?t.multiply(e):t.multiplyUnsafe(e),o=i(this,e).add(i(t,r));return o.is0()?void 0:o}toAffine(t){return u(this,t)}isTorsionFree(){let{h:t,isTorsionFree:e}=r;if(t===tE)return!0;if(e)return e(d,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:t,clearCofactor:e}=r;return t===tE?this:e?e(d,this):this.multiplyUnsafe(r.h)}toRawBytes(t=!0){return x("isCompressed",t),this.assertValidity(),o(d,this,t)}toHex(t=!0){return x("isCompressed",t),v(this.toRawBytes(t))}}d.BASE=new d(r.Gx,r.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);let c=r.nBitLength,g=(e=r.endo?Math.ceil(c/2):c,{constTimeNegate:tl,hasPrecomputes:t=>1!==td(t),unsafeLadder(t,e,r=d.ZERO){let n=t;for(;e>to;)e&ts&&(r=r.add(n)),n=n.double(),e>>=ts;return r},precomputeWindow(t,r){let{windows:n,windowSize:i}=ta(r,e),o=[],s=t,l=s;for(let t=0;t<n;t++){l=s,o.push(l);for(let t=1;t<i;t++)l=l.add(s),o.push(l);s=l.double()}return o},wNAF(t,r,n){let{windows:i,windowSize:o}=ta(t,e),s=d.ZERO,l=d.BASE,f=BigInt(2**t-1),a=2**t,u=BigInt(t);for(let t=0;t<i;t++){let e=t*o,i=Number(n&f);n>>=u,i>o&&(i-=a,n+=ts);let h=e+Math.abs(i)-1,d=t%2!=0,c=i<0;0===i?l=l.add(tl(d,r[e])):s=s.add(tl(c,r[h]))}return{p:s,f:l}},wNAFUnsafe(t,r,n,i=d.ZERO){let{windows:o,windowSize:s}=ta(t,e),l=BigInt(2**t-1),f=2**t,a=BigInt(t);for(let t=0;t<o;t++){let e=t*s;if(n===to)break;let o=Number(n&l);if(n>>=a,o>s&&(o-=f,n+=ts),0===o)continue;let u=r[e+Math.abs(o)-1];o<0&&(u=u.negate()),i=i.add(u)}return i},getPrecomputes(t,e,r){let n=tu.get(e);return n||(n=this.precomputeWindow(e,t),1!==t&&tu.set(e,r(n))),n},wNAFCached(t,e,r){let n=td(t);return this.wNAF(n,this.getPrecomputes(n,t,r),e)},wNAFCachedUnsafe(t,e,r,n){let i=td(t);return 1===i?this.unsafeLadder(t,e,n):this.wNAFUnsafe(i,this.getPrecomputes(i,t,r),e,n)},setWindowSize(t,r){tf(r,e),th.set(t,r),tu.delete(t)}});return{CURVE:r,ProjectivePoint:d,normPrivateKeyToScalar:f,weierstrassEquation:l,isWithinCurveOrder:function(t){return z(t,tE,r.n)}}}({...r,toBytes(t,e,r){let i=e.toAffine(),o=n.toBytes(i.x),s=C;return(x("isCompressed",r),r)?s(Uint8Array.from([e.hasEvenY()?2:3]),o):s(Uint8Array.from([4]),o,n.toBytes(i.y))},fromBytes(t){let e=t.length,r=t[0],i=t.subarray(1);if(e===o&&(2===r||3===r)){let t,e=q(i);if(!z(e,tE,n.ORDER))throw Error("Point is not on curve");let o=u(e);try{t=n.sqrt(o)}catch(t){throw Error("Point is not on curve"+(t instanceof Error?": "+t.message:""))}return(1&r)==1!=((t&tE)===tE)&&(t=n.neg(t)),{x:e,y:t}}if(e===s&&4===r)return{x:n.fromBytes(i.subarray(0,n.BYTES)),y:n.fromBytes(i.subarray(n.BYTES,2*n.BYTES))};throw Error("invalid Point, expected length of "+o+", or uncompressed "+s+", got "+e)}}),d=t=>v(R(t,r.nByteLength)),c=(t,e,r)=>q(t.slice(e,r));class g{constructor(t,e,r){this.r=t,this.s=e,this.recovery=r,this.assertValidity()}static fromCompact(t){let e=r.nByteLength;return new g(c(t=U("compactSignature",t,2*e),0,e),c(t,e,2*e))}static fromDER(t){let{r:e,s:r}=tm.toSig(U("DER",t));return new g(e,r)}assertValidity(){P("r",this.r,tE,i),P("s",this.s,tE,i)}addRecoveryBit(t){return new g(this.r,this.s,t)}recoverPublicKey(t){let{r:e,s:o,recovery:s}=this,a=w(U("msgHash",t));if(null==s||![0,1,2,3].includes(s))throw Error("recovery id invalid");let u=2===s||3===s?e+r.n:e;if(u>=n.ORDER)throw Error("recovery id 2 or 3 invalid");let h=(1&s)==0?"02":"03",c=f.fromHex(h+d(u)),g=$(u,i),p=l(-a*g),y=l(o*g),m=f.BASE.multiplyAndAddUnsafe(c,p,y);if(!m)throw Error("point at infinify");return m.assertValidity(),m}hasHighS(){return this.s>i>>tE}normalizeS(){return this.hasHighS()?new g(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return S(this.toDERHex())}toDERHex(){return tm.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return S(this.toCompactHex())}toCompactHex(){return d(this.r)+d(this.s)}}function p(t){let e=b(t),r="string"==typeof t,n=(e||r)&&t.length;return e?n===o||n===s:r?n===2*o||n===2*s:t instanceof f}let y=r.bits2int||function(t){if(t.length>8192)throw Error("input is too large");let e=q(t),n=8*t.length-r.nBitLength;return n>0?e>>BigInt(n):e},w=r.bits2int_modN||function(t){return l(y(t))},m=F(r.nBitLength);function E(t){return P("num < 2^"+r.nBitLength,t,tb,m),R(t,r.nByteLength)}let B={lowS:r.lowS,prehash:!1},A={lowS:r.lowS,prehash:!1};return f.BASE._setWindowSize(8),{CURVE:r,getPublicKey:function(t,e=!0){return f.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e,r=!0){if(p(t))throw Error("first arg must be private key");if(!p(e))throw Error("second arg must be public key");return f.fromHex(e).multiply(a(t)).toRawBytes(r)},sign:function(t,e,o=B){let{seed:s,k2sig:u}=function(t,e,o=B){if(["recovered","canonical"].some(t=>t in o))throw Error("sign() legacy options not supported");let{hash:s,randomBytes:u}=r,{lowS:d,prehash:c,extraEntropy:p}=o;null==d&&(d=!0),t=U("msgHash",t),tg(o),c&&(t=U("prehashed msgHash",s(t)));let m=w(t),b=a(e),x=[E(b),E(m)];if(null!=p&&!1!==p){let t=!0===p?u(n.BYTES):p;x.push(U("extraEntropy",t))}
vendor: 1,730 bytes, line 1
1return{seed:C(...x),k2sig:function(t){var e;let r=y(t);if(!h(r))return;let n=$(r,i),o=f.BASE.multiply(r).toAffine(),s=l(o.x);if(s===tb)return;let a=l(n*l(m+s*b));if(a===tb)return;let u=2*(o.x!==s)|Number(o.y&tE),c=a;return d&&a>i>>tE&&(c=(e=a)>i>>tE?l(-e):e,u^=1),new g(s,c,u)}}}(t,e,o);return T(r.hash.outputLen,r.nByteLength,r.hmac)(s,u)},verify:function(t,e,n,o=A){let s,a;e=U("msgHash",e),n=U("publicKey",n);let{lowS:u,prehash:h,format:d}=o;if(tg(o),"strict"in o)throw Error("options.strict was renamed to lowS");if(void 0!==d&&"compact"!==d&&"der"!==d)throw Error("format must be compact or der");let c="string"==typeof t||b(t),p=!c&&!d&&"object"==typeof t&&null!==t&&"bigint"==typeof t.r&&"bigint"==typeof t.s;if(!c&&!p)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");try{if(p&&(a=new g(t.r,t.s)),c){try{"compact"!==d&&(a=g.fromDER(t))}catch(t){if(!(t instanceof tm.Err))throw t}a||"der"===d||(a=g.fromCompact(t))}s=f.fromHex(n)}catch(t){return!1}if(!a||u&&a.hasHighS())return!1;h&&(e=r.hash(e));let{r:y,s:m}=a,E=w(e),x=$(m,i),B=l(E*x),v=l(y*x),O=f.BASE.multiplyAndAddUnsafe(s,B,v)?.toAffine();return!!O&&l(O.x)===y},ProjectivePoint:f,Signature:g,utils:{isValidPrivateKey(t){try{return a(t),!0}catch(t){return!1}},normPrivateKeyToScalar:a,randomPrivateKey:()=>{let t=ti(r.n);return function(t,e,r=!1){let n=t.length,i=tn(e),o=ti(e);if(n<16||n<o||n>1024)throw Error("expected "+o+"-1024 bytes of input, got "+n);let s=Q(r?N(t):q(t),e-K)+K;return r?H(s,i):R(s,i)}(r.randomBytes(t),r.n)},precompute:(t=8,e=f.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)}}})({...i,...{hash:t,hmac:(e,...r)=>p(t,e,(0,l.Id)(...r)),randomBytes:l.po}}))(c),create:n});BigInt(0),tq.ProjectivePoint}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.