vendor: 4,206 bytes, line 1
1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[634],{66634:(t,e,r)=>{r.d(e,{secp256k1:()=>tH});var i=r(43331);class n extends i.Vw{constructor(t,e,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=e,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(t),this.view=(0,i.O8)(this.buffer)}update(t){(0,i.CC)(this),t=(0,i.ZJ)(t),(0,i.DO)(t);let{view:e,buffer:r,blockLen:n}=this,o=t.length;for(let f=0;f<o;){let a=Math.min(n-this.pos,o-f);if(a===n){let e=(0,i.O8)(t);for(;n<=o-f;f+=n)this.process(e,f);continue}r.set(t.subarray(f,f+a),this.pos),this.pos+=a,f+=a,this.pos===n&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,i.CC)(this),(0,i.Ht)(t,this),this.finished=!0;let{buffer:e,view:r,blockLen:n,isLE:o}=this,{pos:f}=this;e[f++]=128,(0,i.uH)(this.buffer.subarray(f)),this.padOffset>n-f&&(this.process(r,0),f=0);for(let t=f;t<n;t++)e[t]=0;!function(t,e,r,i){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,r,i);let n=BigInt(32),o=BigInt(0xffffffff),f=Number(r>>n&o),a=Number(r&o),s=i?4:0,l=i?0:4;t.setUint32(e+s,f,i),t.setUint32(e+l,a,i)}(r,n-8,BigInt(8*this.length),o),this.process(r,0);let a=(0,i.O8)(t),s=this.outputLen;if(s%4)throw Error("_sha2: outputLen should be aligned to 32bit");let l=s/4,d=this.get();if(l>d.length)throw Error("_sha2: outputLen bigger than state");for(let t=0;t<l;t++)a.setUint32(4*t,d[t],o)}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:i,finished:n,destroyed:o,pos:f}=this;return t.destroyed=o,t.finished=n,t.length=i,t.pos=f,i%e&&t.buffer.set(r),t}clone(){return this._cloneInto()}}let o=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]);var f=r(62980);let a=Uint32Array.from([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]),s=new Uint32Array(64);class l extends n{constructor(t=32){super(64,t,8,!1),this.A=0|o[0],this.B=0|o[1],this.C=0|o[2],this.D=0|o[3],this.E=0|o[4],this.F=0|o[5],this.G=0|o[6],this.H=0|o[7]}get(){let{A:t,B:e,C:r,D:i,E:n,F:o,G:f,H:a}=this;return[t,e,r,i,n,o,f,a]}set(t,e,r,i,n,o,f,a){this.A=0|t,this.B=0|e,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|o,this.G=0|f,this.H=0|a}process(t,e){for(let r=0;r<16;r++,e+=4)s[r]=t.getUint32(e,!1);for(let t=16;t<64;t++){let e=s[t-15],r=s[t-2],n=(0,i.Ow)(e,7)^(0,i.Ow)(e,18)^e>>>3,o=(0,i.Ow)(r,17)^(0,i.Ow)(r,19)^r>>>10;s[t]=o+s[t-7]+n+s[t-16]|0}let{A:r,B:n,C:o,D:f,E:l,F:d,G:u,H:c}=this;for(let t=0;t<64;t++){var h,b,g,p;let e=c+((0,i.Ow)(l,6)^(0,i.Ow)(l,11)^(0,i.Ow)(l,25))+((h=l)&d^~h&u)+a[t]+s[t]|0,x=((0,i.Ow)(r,2)^(0,i.Ow)(r,13)^(0,i.Ow)(r,22))+((b=r)&(g=n)^b&(p=o)^g&p)|0;c=u,u=d,d=l,l=f+e|0,f=o,o=n,n=r,r=e+x|0}r=r+this.A|0,n=n+this.B|0,o=o+this.C|0,f=f+this.D|0,l=l+this.E|0,d=d+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(r,n,o,f,l,d,u,c)}roundClean(){(0,i.uH)(s)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,i.uH)(this.buffer)}}let d=f.lD(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0
1x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t)));d[0],d[1];let u=(0,i.qj)(()=>new l);class c extends i.Vw{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,(0,i.sd)(t);let r=(0,i.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;let n=this.blockLen,o=new Uint8Array(n);o.set(r.length>n?t.create().update(r).digest():r);for(let t=0;t<o.length;t++)o[t]^=54;this.iHash.update(o),this.oHash=t.create();for(let t=0;t<o.length;t++)o[t]^=106;this.oHash.update(o),(0,i.uH)(o)}update(t){return(0,i.CC)(this),this.iHash.update(t),this}digestInto(t){(0,i.CC)(this),(0,i.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:i,destroyed:n,blockLen:o,outputLen:f}=this;return t.finished=i,t.destroyed=n,t.blockLen=o,t.outputLen=f,t.oHash=e._cloneInto(t.oHash),t.iHash=r._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let h=(t,e,r)=>new c(t,e).update(r).digest();h.create=(t,e)=>new c(t,e);let b=BigInt(0),g=BigInt(1);function p(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function x(t){if(!p(t))throw Error("Uint8Array expected")}function y(t,e){if("boolean"!=typeof e)throw Error(t+" boolean expected, got "+e)}function w(t){let e=t.toString(16);return 1&e.length?"0"+e:e}function m(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);return""===t?b:BigInt("0x"+t)}let E="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,v=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function B(t){if(x(t),E)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=v[t[r]];return e}let A={_0:48,_9:57,A:65,F:70,a:97,f:102};function O(t){return t>=A._0&&t<=A._9?t-A._0:t>=A.A&&t<=A.F?t-(A.A-10):t>=A.a&&t<=A.f?t-(A.a-10):void 0}function I(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);if(E)return Uint8Array.fromHex(t);let e=t.length,r=e/2;if(e%2)throw Error("hex string expected, got unpadded hex of length "+e);let i=new Uint8Array(r);for(let e=0,n=0;e<r;e++,n+=2){let r=O(t.charCodeAt(n)),o=O(t.charCodeAt(n+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(t[n]+t[n+1])+'" at index '+n);i[e]=16*r+o}return i}function S(t){return m(B(t))}function R(t){return x(t),m(B(Uint8Array.from(t).reverse()))}function N(t,e){return I(t.toString(16).padStart(2*e,"0"))}function q(t,e){return N(t,e).reverse()}function H(t,e,r){let i;if("string"==typeof e)try{i=I(e)}catch(e){throw Error(t+" must be hex string or Uint8Array, cause: "+e)}else if(p(e))i=Uint8Array.from(e);else throw Error(t+" must be hex string or Uint8Array");let n=i.length;if("number"==typeof r&&n!==r)throw Error(t+" of length "+r+" expected, got "+n);return i}function U(...t){let e=0;for(let r=0;r<t.length;r++){let i=t[r];x(i),e+=i.length}let r=new Uint8Array(e);for(let e=0,i=0;e<t.length;e++){let n=t[e];r.set(n,i),i+=n.length}return r}let C=t=>"bigint"==typeof t&&b<=t;function F(t,e,r){return C(t)&&C(e)&&C(r)&&e<=t&&t<r}
vendor: 5,388 bytes, line 1
1function z(t,e,r,i){if(!F(e,r,i))throw Error("expected valid "+t+": "+r+" <= n < "+i+", got "+e)}let L=t=>(g<<BigInt(t))-g,Z=t=>new Uint8Array(t),P=t=>Uint8Array.from(t),_={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||p(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 k(t,e,r={}){let i=(e,r,i)=>{let n=_[r];if("function"!=typeof n)throw Error("invalid validator function");let o=t[e];if((!i||void 0!==o)&&!n(o,t))throw Error("param "+String(e)+" is invalid. Expected "+r+", got "+o)};for(let[t,r]of Object.entries(e))i(t,r,!1);for(let[t,e]of Object.entries(r))i(t,e,!0);return t}function D(t){let e=new WeakMap;return(r,...i)=>{let n=e.get(r);if(void 0!==n)return n;let o=t(r,...i);return e.set(r,o),o}}let T=BigInt(0),V=BigInt(1),j=BigInt(2),K=BigInt(3),Y=BigInt(4),M=BigInt(5),W=BigInt(8);function G(t,e){let r=t%e;return r>=T?r:e+r}function J(t,e,r){let i=t;for(;e-- >T;)i*=i,i%=r;return i}function Q(t,e){if(t===T)throw Error("invert: expected non-zero number");if(e<=T)throw Error("invert: expected positive modulus, got "+e);let r=G(t,e),i=e,n=T,o=V,f=V,a=T;for(;r!==T;){let t=i/r,e=i%r,s=n-f*t,l=o-a*t;i=r,r=e,n=f,o=a,f=s,a=l}if(i!==V)throw Error("invert: does not exist");return G(n,e)}function X(t,e){let r=(t.ORDER+V)/Y,i=t.pow(e,r);if(!t.eql(t.sqr(i),e))throw Error("Cannot find square root");return i}function $(t,e){let r=(t.ORDER-M)/W,i=t.mul(e,j),n=t.pow(i,r),o=t.mul(e,n),f=t.mul(t.mul(o,j),n),a=t.mul(o,t.sub(f,t.ONE));if(!t.eql(t.sqr(a),e))throw Error("Cannot find square root");return a}let tt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function te(t,e,r=!1){let i=Array(e.length).fill(r?t.ZERO:void 0),n=e.reduce((e,r,n)=>t.is0(r)?e:(i[n]=e,t.mul(e,r)),t.ONE),o=t.inv(n);return e.reduceRight((e,r,n)=>t.is0(r)?e:(i[n]=t.mul(e,i[n]),t.mul(e,r)),o),i}function tr(t,e){let r=(t.ORDER-V)/j,i=t.pow(e,r),n=t.eql(i,t.ONE),o=t.eql(i,t.ZERO),f=t.eql(i,t.neg(t.ONE));if(!n&&!o&&!f)throw Error("invalid Legendre symbol result");return n?1:o?0:-1}function ti(t,e){void 0!==e&&(0,i.Fe)(e);let r=void 0!==e?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function tn(t,e,r=!1,i={}){let n;if(t<=T)throw Error("invalid field: expected ORDER > 0, got "+t);let{nBitLength:o,nByteLength:f}=ti(t,e);if(f>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let a=Object.freeze({ORDER:t,isLE:r,BITS:o,BYTES:f,MASK:L(o),ZERO:T,ONE:V,create:e=>G(e,t),isValid:e=>{if("bigint"!=typeof e)throw Error("invalid field element: expected bigint, got "+typeof e);return T<=e&&e<t},is0:t=>t===T,isOdd:t=>(t&V)===V,neg:e=>G(-e,t),eql:(t,e)=>t===e,sqr:e=>G(e*e,t),add:(e,r)=>G(e+r,t),sub:(e,r)=>G(e-r,t),mul:(e,r)=>G(e*r,t),pow:(t,e)=>(function(t,e,r){if(r<T)throw Error("invalid exponent, negatives unsupported");if(r===T)return t.ONE;if(r===V)return e;let i=t.ONE,n=e;for(;r>T;)r&V&&(i=t.mul(i,n)),n=t.sqr(n),r>>=V;return i})(a,t,e),div:(e,r)=>G(e*Q(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>Q(e,t),sqrt:i.sqrt||(e=>(!n&&(n=t%Y===K?X:t%W===M?$:function(t){if(t<BigInt(3))throw Error("sqrt is not defined for small field");let e=t-V,r=0;for(;e%j===T;)e/=j,r++;let i=j,n=tn(t);for(;1===tr(n,i);)if(i++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return X;let o=n.pow(i,e),f=(e+V)/j;return function(t,i){if(t.is0(i))return i;if(1!==tr(t,i))throw Error("Cannot find square root");let n=r,a=t.mul(t.ONE,o),s=t.pow(i,e),l=t.pow(i,f);for(;!t.eql(s,t.ONE);){if(t.is0(s))return t.ZERO;let e=1,r=t.sqr(s);for(;!t.eql(r,t.ONE);)if(e++,r=t.sqr(r),e===n)throw Error("Cannot find square root");let i=V<<BigInt(n-e-1),o=t.pow(a,i);n=e,a=t.sqr(o),s=t.mul(s,a),l=t.mul(l,o)}return l}}(t)),n(a,e))),toBytes:t=>r?q(t,f):N(t,f),fromBytes:t=>{if(t.length!==f)throw Error("Field.fromBytes: expected "+f+" bytes, got "+t.length);return r?R(t):S(t)},invertBatch:t=>te(a,t),cmov:(t,e,r)=>r?e:t});return Object.freeze(a)}function to(t){if("bigint"!=typeof t)throw Error("field order must be bigint");return Math.ceil(t.toString(2).length/8)}function tf(t){let e=to(t);return e+Math.ceil(e/2)}let ta=BigInt(0),ts=BigInt(1);function tl(t,e){let r=e.negate();return t?r:e}function td(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw Error("invalid window size, expected [1.."+e+"], got W="+t)}function tu(t,e){td(t,e);let r=Math.ceil(e/t)+1,i=2**(t-1),n=2**t;return{windows:r,windowSize:i,mask:L(t),maxNumber:n,shiftBy:BigInt(t)}}function tc(t,e,r){let{windowSize:i,mask:n,maxNumber:o,shiftBy:f}=r,a=Number(t&n),s=t>>f;a>i&&(a-=o,s+=ts);let l=e*i,d=l+Math.abs(a)-1;return{nextN:s,offset:d,isZero:0===a,isNeg:a<0,isNegF:e%2!=0,offsetF:l}}let th=new WeakMap,tb=new WeakMap;function tg(t){return tb.get(t)||1}function tp(t){return k(t.Fp,tt.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),k(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...ti(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}function tx(t){void 0!==t.lowS&&y("lowS",t.lowS),void 0!==t.prehash&&y("prehash",t.prehash)}
vendor: 4,528 bytes, line 1
1class ty extends Error{constructor(t=""){super(t)}}let tw={Err:ty,_tlv:{encode:(t,e)=>{let{Err:r}=tw;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(1&e.length)throw new r("tlv.encode: unpadded data");let i=e.length/2,n=w(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let o=i>127?w(n.length/2|128):"";return w(t)+o+n+e},decode(t,e){let{Err:r}=tw,i=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[i++]!==t)throw new r("tlv.decode: wrong tlv");let n=e[i++],o=0;if(128&n){let t=127&n;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 f=e.subarray(i,i+t);if(f.length!==t)throw new r("tlv.decode: length bytes not complete");if(0===f[0])throw new r("tlv.decode(long): zero leftmost byte");for(let t of f)o=o<<8|t;if(i+=t,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=n;let f=e.subarray(i,i+o);if(f.length!==o)throw new r("tlv.decode: wrong value length");return{v:f,l:e.subarray(i+o)}}},_int:{encode(t){let{Err:e}=tw;if(t<tm)throw new e("integer: negative integers are not allowed");let r=w(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}=tw;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 S(t)}},toSig(t){let{Err:e,_int:r,_tlv:i}=tw,n=H("signature",t),{v:o,l:f}=i.decode(48,n);if(f.length)throw new e("invalid signature: left bytes after parsing");let{v:a,l:s}=i.decode(2,o),{v:l,l:d}=i.decode(2,s);if(d.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(l)}},hexFromSig(t){let{_tlv:e,_int:r}=tw,i=e.encode(2,r.encode(t.r)),n=e.encode(2,r.encode(t.s));return e.encode(48,i+n)}},tm=BigInt(0),tE=BigInt(1),tv=(BigInt(2),BigInt(3)),tB=BigInt(4),tA=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),tO=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),tI=BigInt(0),tS=BigInt(1),tR=BigInt(2),tN=(t,e)=>(t+e/tR)/e,tq=tn(tA,void 0,void 0,{sqrt:function(t){let e=BigInt(3),r=BigInt(6),i=BigInt(11),n=BigInt(22),o=BigInt(23),f=BigInt(44),a=BigInt(88),s=t*t*t%tA,l=s*s*t%tA,d=J(l,e,tA)*l%tA,u=J(d,e,tA)*l%tA,c=J(u,tR,tA)*s%tA,h=J(c,i,tA)*c%tA,b=J(h,n,tA)*h%tA,g=J(b,f,tA)*b%tA,p=J(g,a,tA)*g%tA,x=J(p,f,tA)*b%tA,y=J(x,e,tA)*l%tA,w=J(y,o,tA)*h%tA,m=J(w,r,tA)*s%tA,E=J(m,tR,tA);if(!tq.eql(tq.sqr(E),t))throw Error("Cannot find square root");return E}}),tH=function(t,e){let r=e=>(function(t){let e=function(t){let e=tp(t);return k(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}(t),{Fp:r,n:i,nByteLength:n,nBitLength:o}=e,f=r.BYTES+1,a=2*r.BYTES+1;function s(t){return G(t,i)}let{ProjectivePoint:l,normPrivateKeyToScalar:d,weierstrassEquation:u,isWithinCurveOrder:c}=function(t){var e;let r=function(t){let e=tp(t);k(e,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:i,a:n}=e;if(r){if(!i.eql(n,i.ZERO))throw Error("invalid endo: CURVE.a must be 0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...e})}(t),{Fp:i}=r,n=tn(r.n,r.nBitLength),o=r.toBytes||((t,e,r)=>{let n=e.toAffine();return U(Uint8Array.from([4]),i.toBytes(n.x),i.toBytes(n.y))}),f=r.fromBytes||(t=>{let e=t.subarray(1);return{x:i.fromBytes(e.subarray(0,i.BYTES)),y:i.fromBytes(e.subarray(i.BYTES,2*i.BYTES))}});function a(t){let{a:e,b:n}=r,o=i.sqr(t),f=i.mul(o,t);return i.add(i.add(f,i.mul(t,e)),n)}function s(t,e){let r=i.sqr(e),n=a(t);return i.eql(r,n)}if(!s(r.Gx,r.Gy))throw Error("bad curve params: generator point");let l=i.mul(i.pow(r.a,tv),tB),d=i.mul(i.sqr(r.b),BigInt(27));if(i.is0(i.add(l,d)))throw Error("bad curve params: a or b");function u(t){let e;let{allowedPrivateKeyLengths:i,nByteLength:n,wrapPrivateKey:o,n:f}=r;if(i&&"bigint"!=typeof t){if(p(t)&&(t=B(t)),"string"!=typeof t||!i.includes(t.length))throw Error("invalid private key");t=t.padStart(2*n,"0")}try{e="bigint"==typeof t?t:S(H("private key",t,n))}catch(e){throw Error("invalid private key, expected hex or "+n+" b
1ytes, got "+typeof t)}return o&&(e=G(e,f)),z("private key",e,tE,f),e}function c(t){if(!(t instanceof w))throw Error("ProjectivePoint expected")}let h=D((t,e)=>{let{px:r,py:n,pz:o}=t;if(i.eql(o,i.ONE))return{x:r,y:n};let f=t.is0();null==e&&(e=f?i.ONE:i.inv(o));let a=i.mul(r,e),s=i.mul(n,e),l=i.mul(o,e);if(f)return{x:i.ZERO,y:i.ZERO};if(!i.eql(l,i.ONE))throw Error("invZ was invalid");return{x:a,y:s}}),x=D(t=>{if(t.is0()){if(r.allowInfinityPoint&&!i.is0(t.py))return;throw Error("bad point: ZERO")}let{x:e,y:n}=t.toAffine();if(!i.isValid(e)||!i.isValid(n))throw Error("bad point: x or y not FE");if(!s(e,n))throw Error("bad point: equation left != right");if(!t.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class w{constructor(t,e,r){if(null==t||!i.isValid(t))throw Error("x required");if(null==e||!i.isValid(e)||i.is0(e))throw Error("y required");if(null==r||!i.isValid(r))throw Error("z required");this.px=t,this.py=e,this.pz=r,Object.freeze(this)}static fromAffine(t){let{x:e,y:r}=t||{};if(!t||!i.isValid(e)||!i.isValid(r))throw Error("invalid affine point");if(t instanceof w)throw Error("projective point not allowed");let n=t=>i.eql(t,i.ZERO);return n(e)&&n(r)?w.ZERO:new w(e,r,i.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){let e=te(i,t.map(t=>t.pz));return t.map((t,r)=>t.toAffine(e[r])).map(w.fromAffine)}static fromHex(t){let e=w.fromAffine(f(H("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return w.BASE.multiply(u(t))}static msm(t,e){return function(t,e,r,i){(function(t,e){if(!Array.isArray(t))throw Error("array expected");t.forEach((t,r)=>{if(!(t instanceof e))throw Error("invalid point at index "+r)})})(r,t),function(t,e){if(!Array.isArray(t))throw Error("array of scalars expected");t.forEach((t,r)=>{if(!e.isValid(t))throw Error("invalid scalar at index "+r)})}(i,e);let n=r.length,o=i.length;if(n!==o)throw Error("arrays of points and scalars must have equal length");let f=t.ZERO,a=function(t){let e;for(e=0;t>b;t>>=g,e+=1);return e}(BigInt(n)),s=1;a>12?s=a-3:a>4?s=a-2:a>0&&(s=2);let l=L(s),d=Array(Number(l)+1).fill(f),u=Math.floor((e.BITS-1)/s)*s,c=f;for(let t=u;t>=0;t-=s){d.fill(f);for(let e=0;e<o;e++){let n=Number(i[e]>>BigInt(t)&l);d[n]=d[n].add(r[e])}let e=f;for(let t=d.length-1,r=f;t>0;t--)r=r.add(d[t]),e=e.add(r);if(c=c.add(e),0!==t)for(let t=0;t<s;t++)c=c.double()}return c}(w,n,t,e)}_setWindowSize(t){v.setWindowSize(this,t)}assertValidity(){x(this)}hasEvenY(){let{y:t}=this.toAffine();if(i.isOdd)return!i.isOdd(t);throw Error("Field doesn't support isOdd")}equals(t){c(t);let{px:e,py:r,pz:n}=this,{px:o,py:f,pz:a}=t,s=i.eql(i.mul(e,a),i.mul(o,n)),l=i.eql(i.mul(r,a),i.mul(f,n));return s&&l}negate(){return new w(this.px,i.neg(this.py),this.pz)}double(){let{a:t,b:e}=r,n=i.mul(e,tv),{px:o,py:f,pz:a}=this,s=i.ZERO,l=i.ZERO,d=i.ZERO,u=i.mul(o,o),c=i.mul(f,f),h=i.mul(a,a),b=i.mul(o,f);return b=i.add(b,b),d=i.mul(o,a),d=i.add(d,d),s=i.mul(t,d),l=i.mul(n,h),l=i.add(s,l),s=i.sub(c,l),l=i.add(c,l),l=i.mul(s,l),s=i.mul(b,s),d=i.mul(n,d),h=i.mul(t,h),b=i.sub(u,h),b=i.mul(t,b),b=i.add(b,d),d=i.add(u,u),u=i.add(d,u),u=i.add(u,h),u=i.mul(u,b),l=i.add(l,u),h=i.mul(f,a),h=i.add(h,h),u=i.mul(h,b),s=i.sub(s,u),d=i.mul(h,c),d=i.add(d,d),new w(s,l,d=i.add(d,d))}add(t){c(t);let{px:e,py:n,pz:o}=this,{px:f,py:a,pz:s}=t,l=i.ZERO,d=i.ZERO,u=i.ZERO,h=r.a,b=i.mul(r.b,tv),g=i.mul(e,f),p=i.mul(n,a),x=i.mul(o,s),y=i.add(e,n),m=i.add(f,a);y=i.mul(y,m),m=i.add(g,p),y=i.sub(y,m),m=i.add(e,o);let E=i.add(f,s);return m=i.mul(m,E),E=i.add(g,x),m=i.sub(m,E),E=i.add(n,o),l=i.add(a,s),E=i.mul(E,l),l=i.add(p,x),E=i.sub(E,l),u=i.mul(h,m),l=i.mul(b,x),u=i.add(l,u),l=i.sub(p,u),u=i.add(p,u),d=i.mul(l,u),p=i.add(g,g),p=i.add(p,g),x=i.mul(h,x),m=i.mul(b,m),p=i.add(p,x),x=i.sub(g,x),x=i.mul(h,x),m=i.add(m,x),g=i.mul(p,m),d=i.add(d,g),g=i.mul(E,m),l=i.mul(y,l),l=i.sub(l,g),g=i.mul(y,p),u=i.mul(E,u),new w(l,d,u=i.add(u,g))}subtract(t){return this.add(t.negate())}is0(){return this.equals(w.ZERO)}wNAF(t){return v.wNAFCached(this,t,w.normalizeZ)}multiplyUnsafe(t){let{endo:e,n:n}=r;z("scalar",t,tm,n);let o=w.ZERO;if(t===tm)return o;if(this.is0()||t===tE)return this;if(!e||v.hasPrecomputes(this))return v.wNAFCachedUnsafe(this,t,w.normalizeZ);
vendor: 8,417 bytes, line 1
1let{k1neg:f,k1:a,k2neg:s,k2:l}=e.splitScalar(t),d=o,u=o,c=this;for(;a>tm||l>tm;)a&tE&&(d=d.add(c)),l&tE&&(u=u.add(c)),c=c.double(),a>>=tE,l>>=tE;return f&&(d=d.negate()),s&&(u=u.negate()),u=new w(i.mul(u.px,e.beta),u.py,u.pz),d.add(u)}multiply(t){let e,n;let{endo:o,n:f}=r;if(z("scalar",t,tE,f),o){let{k1neg:r,k1:f,k2neg:a,k2:s}=o.splitScalar(t),{p:l,f:d}=this.wNAF(f),{p:u,f:c}=this.wNAF(s);l=v.constTimeNegate(r,l),u=v.constTimeNegate(a,u),u=new w(i.mul(u.px,o.beta),u.py,u.pz),e=l.add(u),n=d.add(c)}else{let{p:r,f:i}=this.wNAF(t);e=r,n=i}return w.normalizeZ([e,n])[0]}multiplyAndAddUnsafe(t,e,r){let i=w.BASE,n=(t,e)=>e!==tm&&e!==tE&&t.equals(i)?t.multiply(e):t.multiplyUnsafe(e),o=n(this,e).add(n(t,r));return o.is0()?void 0:o}toAffine(t){return h(this,t)}isTorsionFree(){let{h:t,isTorsionFree:e}=r;if(t===tE)return!0;if(e)return e(w,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(w,this):this.multiplyUnsafe(r.h)}toRawBytes(t=!0){return y("isCompressed",t),this.assertValidity(),o(w,this,t)}toHex(t=!0){return y("isCompressed",t),B(this.toRawBytes(t))}}w.BASE=new w(r.Gx,r.Gy,i.ONE),w.ZERO=new w(i.ZERO,i.ONE,i.ZERO);let{endo:m,nBitLength:E}=r,v=(e=m?Math.ceil(E/2):E,{constTimeNegate:tl,hasPrecomputes:t=>1!==tg(t),unsafeLadder(t,e,r=w.ZERO){let i=t;for(;e>ta;)e&ts&&(r=r.add(i)),i=i.double(),e>>=ts;return r},precomputeWindow(t,r){let{windows:i,windowSize:n}=tu(r,e),o=[],f=t,a=f;for(let t=0;t<i;t++){a=f,o.push(a);for(let t=1;t<n;t++)a=a.add(f),o.push(a);f=a.double()}return o},wNAF(t,r,i){let n=w.ZERO,o=w.BASE,f=tu(t,e);for(let t=0;t<f.windows;t++){let{nextN:e,offset:a,isZero:s,isNeg:l,isNegF:d,offsetF:u}=tc(i,t,f);i=e,s?o=o.add(tl(d,r[u])):n=n.add(tl(l,r[a]))}return{p:n,f:o}},wNAFUnsafe(t,r,i,n=w.ZERO){let o=tu(t,e);for(let t=0;t<o.windows&&i!==ta;t++){let{nextN:e,offset:f,isZero:a,isNeg:s}=tc(i,t,o);if(i=e,!a){let t=r[f];n=n.add(s?t.negate():t)}}return n},getPrecomputes(t,e,r){let i=th.get(e);return i||(i=this.precomputeWindow(e,t),1!==t&&th.set(e,r(i))),i},wNAFCached(t,e,r){let i=tg(t);return this.wNAF(i,this.getPrecomputes(i,t,r),e)},wNAFCachedUnsafe(t,e,r,i){let n=tg(t);return 1===n?this.unsafeLadder(t,e,i):this.wNAFUnsafe(n,this.getPrecomputes(n,t,r),e,i)},setWindowSize(t,r){td(r,e),tb.set(t,r),th.delete(t)}});return{CURVE:r,ProjectivePoint:w,normPrivateKeyToScalar:u,weierstrassEquation:a,isWithinCurveOrder:function(t){return F(t,tE,r.n)}}}({...e,toBytes(t,e,i){let n=e.toAffine(),o=r.toBytes(n.x);return(y("isCompressed",i),i)?U(Uint8Array.from([e.hasEvenY()?2:3]),o):U(Uint8Array.from([4]),o,r.toBytes(n.y))},fromBytes(t){let e=t.length,i=t[0],n=t.subarray(1);if(e===f&&(2===i||3===i)){let t;let e=S(n);if(!F(e,tE,r.ORDER))throw Error("Point is not on curve");let o=u(e);try{t=r.sqrt(o)}catch(t){throw Error("Point is not on curve"+(t instanceof Error?": "+t.message:""))}return(1&i)==1!=((t&tE)===tE)&&(t=r.neg(t)),{x:e,y:t}}if(e===a&&4===i)return{x:r.fromBytes(n.subarray(0,r.BYTES)),y:r.fromBytes(n.subarray(r.BYTES,2*r.BYTES))};throw Error("invalid Point, expected length of "+f+", or uncompressed "+a+", got "+e)}}),h=(t,e,r)=>S(t.slice(e,r));class x{constructor(t,e,r){z("r",t,tE,i),z("s",e,tE,i),this.r=t,this.s=e,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(t){return new x(h(t=H("compactSignature",t,2*n),0,n),h(t,n,2*n))}static fromDER(t){let{r:e,s:r}=tw.toSig(H("DER",t));return new x(e,r)}assertValidity(){}addRecoveryBit(t){return new x(this.r,this.s,t)}recoverPublicKey(t){let{r:n,s:o,recovery:f}=this,a=E(H("msgHash",t));if(null==f||![0,1,2,3].includes(f))throw Error("recovery id invalid");let d=2===f||3===f?n+e.n:n;if(d>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let u=(1&f)==0?"02":"03",c=l.fromHex(u+B(N(d,r.BYTES))),h=Q(d,i),b=s(-a*h),g=s(o*h),p=l.BASE.multiplyAndAddUnsafe(c,b,g);if(!p)throw Error("point at infinify");return p.assertValidity(),p}hasHighS(){return this.s>i>>tE}normalizeS(){return this.hasHighS()?new x(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return I(this.toDERHex())}toDERHex(){return tw.hexFromSig(this)}toCompactRawBytes(){return I(this.toCompactHex())}toCompactHex(){return B(N(this.r,n))+B(N(this.s,n))}}function w(t){if("bigint"==typeof t)return!1;if(t instanceof l)return!0;let i=H("key",t).length,o=r.BYTES,f=o+1;if(!e.allowedPrivateKeyLengths&&n!==f)return i===f||i===2*o+1}let m=e.bits2int||function(t){if(t.length>8192)throw Error("input is too large");let e=S(t),r=8*t.length-o;return r>0?e>>BigInt(r):e},E=e.bits2int_modN||function(t){return s(m(t))},v=L(o);function A(t){return z("num < 2^"+o,t,tm,v),N(t,n)}let O={lowS:e.lowS,prehash:!1},C={lowS:e.lowS,prehash:!1};return l.BASE._setWindowSize(8),{CURVE:e,getPublicKey:function(t,e=!0){return l.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e,r=!0){if(!0===w(t))throw Error("first arg must be private key");if(!1===w(e))throw Error("second arg must be public key");return l.fromHex(e).multiply(d(t)).toRawBytes(r)},sign:function(t,n,o=O){let{seed:f,k2sig:a}=function(t,n,o=O){if(["recovered","canonical"].some(t=>t in o))throw Error("sign() legacy options not supported");let{hash:f,randomBytes:a}=e,{lowS:u,prehash:h,extraEntropy:b}=o;null==u&&(u=!0),t=H("msgHash",t),tx(o),h&&(t=H("prehashed msgHash",f(t)));let g=E(t),p=d(n),y=[A(p),A(g)];if(null!=b&&!1!==b){let t=!0===b?a(r.BYTES):b;y.push(H("extraEntropy",t))}return{seed:U(...y),k2sig:function(t){let e=m(t);if(!c(e))return;let r=Q(e,i),n=l.BASE.multiply(e).toAffine(),o=s(n.x);if(o===tm)return;let f=s(r*s(g+o*p));if(f===tm)return;let a=(n.x===o?0:2)|Number(n.y&tE),d=f;if(u&&f>i>>tE)d=f>i>>tE?s(-f):f,a^=1;return new x(o,d,a)}}}(t,n,o);return(function(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 i=Z(t),n=Z(t),o=0,f=()=>{i.fill(1),n.fill(0),o=0},a=(...t)=>r(n,i,...t),s=(t=Z(0))=>{n=a(P([0]),t),i=a(),0!==t.length&&(n=a(P([1]),t),i=a())},l=()=>{if(o++>=1e3)throw Error("drbg: tried 1000 values");let t=0,r=[];for(;t<e;){let e=(i=a()).slice();r.push(e),t+=i.length}return U(...r)};return(t,e)=>{let r;for(f(),s(t);!(r=e(l()));)s();return f(),r}})(e.hash.outputLen,e.nByteLength,e.hmac)(f,a)},verify:function(t,r,n,o=C){let f,a;r=H("msgHash",r),n=H("publicKey",n);let{lowS:d,prehash:u,format:c}=o;if(tx(o),"strict"in o)throw Error("options.strict was renamed to lowS");if(void 0!==c&&"compact"!==c&&"der"!==c)throw Error("format must be compact or der");let h="string"==typeof t||p(t),b=!h&&!c&&"object"==typeof t&&null!==t&&"bigint"==typeof t.r&&"bigint"==typeof t.s;if(!h&&!b)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");try{if(b&&(a=new x(t.r,t.s)),h){try{"compact"!==c&&(a=x.fromDER(t))}catch(t){if(!(t instanceof tw.Err))throw t}a||"der"===c||(a=x.fromCompact(t))}f=l.fromHex(n)}catch(t){return!1}if(!a||d&&a.hasHighS())return!1;u&&(r=e.hash(r));let{r:g,s:y}=a,w=E(r),m=Q(y,i),v=s(w*m),B=s(g*m),A=l.BASE.multiplyAndAddUnsafe(f,v,B)?.toAffine();return!!A&&s(A.x)===g},ProjectivePoint:l,Signature:x,utils:{isValidPrivateKey(t){try{return d(t),!0}catch(t){return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{let t=tf(e.n);return function(t,e,r=!1){let i=t.length,n=to(e),o=tf(e);if(i<16||i<o||i>1024)throw Error("expected "+o+"-1024 bytes of input, got "+i);let f=G(r?R(t):S(t),e-V)+V;return r?q(f,n):N(f,n)}(e.randomBytes(t),e.n)},precompute:(t=8,e=l.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)}}})({...t,hash:e,hmac:(t,...r)=>h(e,t,(0,i.Id)(...r)),randomBytes:i.po});return{...r(e),create:r}}({a:tI,b:BigInt(7),Fp:tq,n:tO,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-tS*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),n=BigInt("0x100000000000000000000000000000000"),o=tN(e*t,tO),f=tN(-r*t,tO),a=G(t-o*e-f*i,tO),s=G(-o*r-f*e,tO),l=a>n,d=s>n;if(l&&(a=tO-a),d&&(s=tO-s),a>n||s>n)throw Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:l,k1:a,k2neg:d,k2:s}}}},u)}}]);
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.