PageSourceSearch

https://opencollective.xyz/_next/static/chunks/5595.8b9e9503038b01b5.js

js opencollective.xyz collected 2026-10-06 12:16:36 UTC 24,814 bytes, 1 lines download raw bytes

vendor: 4,238 bytes, line 1
1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5595],{35595:(t,e,r)=>{r.d(e,{secp256k1:()=>tx});var n=r(66746),i=r(43337),o=r(43331);let l=BigInt(0),f=BigInt(1);function a(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function u(t){if(!a(t))throw Error("Uint8Array expected")}function s(t,e){if("boolean"!=typeof e)throw Error(t+" boolean expected, got "+e)}function d(t){let e=t.toString(16);return 1&e.length?"0"+e:e}function c(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);return""===t?l:BigInt("0x"+t)}let h="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,g=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function p(t){if(u(t),h)return t.toHex();let e="";for(let r=0;r<t.length;r++)e+=g[t[r]];return e}let m={_0:48,_9:57,A:65,F:70,a:97,f:102};function y(t){return t>=m._0&&t<=m._9?t-m._0:t>=m.A&&t<=m.F?t-(m.A-10):t>=m.a&&t<=m.f?t-(m.a-10):void 0}function w(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);if(h)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 n=new Uint8Array(r);for(let e=0,i=0;e<r;e++,i+=2){let r=y(t.charCodeAt(i)),o=y(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 E(t){return c(p(t))}function b(t){return u(t),c(p(Uint8Array.from(t).reverse()))}function v(t,e){return w(t.toString(16).padStart(2*e,"0"))}function B(t,e){return v(t,e).reverse()}function x(t,e,r){let n;if("string"==typeof e)try{n=w(e)}catch(e){throw Error(t+" must be hex string or Uint8Array, cause: "+e)}else if(a(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 S(...t){let e=0;for(let r=0;r<t.length;r++){let n=t[r];u(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 A=t=>"bigint"==typeof t&&l<=t;function O(t,e,r){return A(t)&&A(e)&&A(r)&&e<=t&&t<r}function I(t,e,r,n){if(!O(e,r,n))throw Error("expected valid "+t+": "+r+" <= n < "+n+", got "+e)}let R=t=>(f<<BigInt(t))-f,q=t=>new Uint8Array(t),N=t=>Uint8Array.from(t),z={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||a(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 F(t,e,r={}){let n=(e,r,n)=>{let i=z[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 Z(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 P=BigInt(0),U=BigInt(1),C=BigInt(2),H=BigInt(3),T=BigInt(4),_=BigInt(5),V=BigInt(8);function k(t,e){let r=t%e;return r>=P?r:e+r}function L(t,e,r){let n=t;for(;e-- >P;)n*=n,n%=r;return n}function j(t,e){if(t===P)throw Error("invert: expected non-zero number");if(e<=P)throw Error("invert: expected positive modulus, got "+e);let r=k(t,e),n=e,i=P,o=U,l=U,f=P;for(;r!==P;){let t=n/r,e=n%r,a=i-l*t,u=o-f*t;n=r,r=e,i=l,o=f,l=a,f=u}if(n!==U)throw Error("invert: does not exist");return k(i,e)}function D(t,e){let r=(t.ORDER+U)/T,n=t.pow(e,r);if(!t.eql(t.sqr(n),e))throw Error("Cannot find square root");return n}function K(t,e){let r=(t.ORDER-_)/V,n=t.mul(e,C),i=t.pow(n,r),o=t.mul(e,i),l=t.mul(t.mul(o,C),i),f=t.mul(o,t.sub(l,t.ONE));if(!t.eql(t.sqr(f),e))throw Error("Cannot find square root");return f}let Y=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function M(t,e,r=!1){let n=Array(e.length).fill(r?t.ZERO:void 0),i=e.reduce((e,r,i)=>t.is0(r)?e:(n[i]=e,t.mul(e,r)),t.ONE),o=t.inv(i);
vendor: 20,576 bytes, line 1
1return e.reduceRight((e,r,i)=>t.is0(r)?e:(n[i]=t.mul(e,n[i]),t.mul(e,r)),o),n}function W(t,e){let r=(t.ORDER-U)/C,n=t.pow(e,r),i=t.eql(n,t.ONE),o=t.eql(n,t.ZERO),l=t.eql(n,t.neg(t.ONE));if(!i&&!o&&!l)throw Error("invalid Legendre symbol result");return i?1:o?0:-1}function G(t,e){void 0!==e&&(0,o.Fe)(e);let r=void 0!==e?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function J(t,e,r=!1,n={}){let i;if(t<=P)throw Error("invalid field: expected ORDER > 0, got "+t);let{nBitLength:o,nByteLength:l}=G(t,e);if(l>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let f=Object.freeze({ORDER:t,isLE:r,BITS:o,BYTES:l,MASK:R(o),ZERO:P,ONE:U,create:e=>k(e,t),isValid:e=>{if("bigint"!=typeof e)throw Error("invalid field element: expected bigint, got "+typeof e);return P<=e&&e<t},is0:t=>t===P,isOdd:t=>(t&U)===U,neg:e=>k(-e,t),eql:(t,e)=>t===e,sqr:e=>k(e*e,t),add:(e,r)=>k(e+r,t),sub:(e,r)=>k(e-r,t),mul:(e,r)=>k(e*r,t),pow:(t,e)=>(function(t,e,r){if(r<P)throw Error("invalid exponent, negatives unsupported");if(r===P)return t.ONE;if(r===U)return e;let n=t.ONE,i=e;for(;r>P;)r&U&&(n=t.mul(n,i)),i=t.sqr(i),r>>=U;return n})(f,t,e),div:(e,r)=>k(e*j(r,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>j(e,t),sqrt:n.sqrt||(e=>(!i&&(i=t%T===H?D:t%V===_?K:function(t){if(t<BigInt(3))throw Error("sqrt is not defined for small field");let e=t-U,r=0;for(;e%C===P;)e/=C,r++;let n=C,i=J(t);for(;1===W(i,n);)if(n++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return D;let o=i.pow(n,e),l=(e+U)/C;return function(t,n){if(t.is0(n))return n;if(1!==W(t,n))throw Error("Cannot find square root");let i=r,f=t.mul(t.ONE,o),a=t.pow(n,e),u=t.pow(n,l);for(;!t.eql(a,t.ONE);){if(t.is0(a))return t.ZERO;let e=1,r=t.sqr(a);for(;!t.eql(r,t.ONE);)if(e++,r=t.sqr(r),e===i)throw Error("Cannot find square root");let n=U<<BigInt(i-e-1),o=t.pow(f,n);i=e,f=t.sqr(o),a=t.mul(a,f),u=t.mul(u,o)}return u}}(t)),i(f,e))),toBytes:t=>r?B(t,l):v(t,l),fromBytes:t=>{if(t.length!==l)throw Error("Field.fromBytes: expected "+l+" bytes, got "+t.length);return r?b(t):E(t)},invertBatch:t=>M(f,t),cmov:(t,e,r)=>r?e:t});return Object.freeze(f)}function Q(t){if("bigint"!=typeof t)throw Error("field order must be bigint");return Math.ceil(t.toString(2).length/8)}function X(t){let e=Q(t);return e+Math.ceil(e/2)}let $=BigInt(0),tt=BigInt(1);function te(t,e){let r=e.negate();return t?r:e}function tr(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw Error("invalid window size, expected [1.."+e+"], got W="+t)}function tn(t,e){tr(t,e);let r=Math.ceil(e/t)+1,n=2**(t-1),i=2**t;return{windows:r,windowSize:n,mask:R(t),maxNumber:i,shiftBy:BigInt(t)}}function ti(t,e,r){let{windowSize:n,mask:i,maxNumber:o,shiftBy:l}=r,f=Number(t&i),a=t>>l;f>n&&(f-=o,a+=tt);let u=e*n,s=u+Math.abs(f)-1;return{nextN:a,offset:s,isZero:0===f,isNeg:f<0,isNegF:e%2!=0,offsetF:u}}let to=new WeakMap,tl=new WeakMap;function tf(t){return tl.get(t)||1}function ta(t){return F(t.Fp,Y.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),F(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...G(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}function tu(t){void 0!==t.lowS&&s("lowS",t.lowS),void 0!==t.prehash&&s("prehash",t.prehash)}class ts extends Error{constructor(t=""){super(t)}}let td={Err:ts,_tlv:{encode:(t,e)=>{let{Err:r}=td;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=d(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let o=n>127?d(i.length/2|128):"";return d(t)+o+i+e},decode(t,e){let{Err:r}=td,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 l=e.subarray(n,n+t);if(l.length!==t)throw new r("tlv.decode: length bytes not complete");if(0===l[0])throw new r("tlv.decode(long): zero leftmost byte");for(let t of l)o=o<<8|t;if(n+=t,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=i;let l=e.subarray(n,n+o);if(l.length!==o)throw new r("tlv.decode: wrong value length");return{v:l,l:e.subarray(n+o)}}},_int:{encode(t){let{Err:e}=td;if(t<tc)throw new e("integer: negative integers are not allowed");let r=d(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}=td;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 E(t)}},toSig(t){let{Err:e,_int:r,_tlv:n}=td,i=x("signature",t),{v:o,l:l}=n.decode(48,i);if(l.length)throw new e("invalid signature: left bytes after parsing");let{v:f,l:a}=n.decode(2,o),{v:u,l:s}=n.decode(2,a);if(s.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(f),s:r.decode(u)}},hexFromSig(t){let{_tlv:e,_int:r}=td,n=e.encode(2,r.encode(t.r)),i=e.encode(2,r.encode(t.s));return e.encode(48,n+i)}},tc=BigInt(0),th=BigInt(1),tg=(BigInt(2),BigInt(3)),tp=BigInt(4),tm=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),ty=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),tw=BigInt(0),tE=BigInt(1),tb=BigInt(2),tv=(t,e)=>(t+e/tb)/e,tB=J(tm,void 0,void 0,{sqrt:function(t){let e=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),l=BigInt(44),f=BigInt(88),a=t*t*t%tm,u=a*a*t%tm,s=L(u,e,tm)*u%tm,d=L(s,e,tm)*u%tm,c=L(d,tb,tm)*a%tm,h=L(c,n,tm)*c%tm,g=L(h,i,tm)*h%tm,p=L(g,l,tm)*g%tm,m=L(p,f,tm)*p%tm,y=L(m,l,tm)*g%tm,w=L(y,e,tm)*u%tm,E=L(w,o,tm)*h%tm,b=L(E,r,tm)*a%tm,v=L(b,tb,tm);if(!tB.eql(tB.sqr(v),t))throw Error("Cannot find square root");return v}}),tx=function(t,e){let r=e=>(function(t){let e=function(t){let e=ta(t);return F(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}(t),{Fp:r,n:n,nByteLength:i,nBitLength:o}=e,u=r.BYTES+1,d=2*r.BYTES+1;function c(t){return k(t,n)}let{ProjectivePoint:h,normPrivateKeyToScalar:g,weierstrassEquation:m,isWithinCurveOrder:y}=function(t){var e;let r=function(t){let e=ta(t);F(e,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:i}=e;if(r){if(!n.eql(i,n.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:n}=r,i=J(r.n,r.nBitLength),o=r.toBytes||((t,e,r)=>{let i=e.toAffine();return S(Uint8Array.from([4]),n.toBytes(i.x),n.toBytes(i.y))}),u=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 d(t){let{a:e,b:i}=r,o=n.sqr(t),l=n.mul(o,t);return n.add(n.add(l,n.mul(t,e)),i)}function c(t,e){let r=n.sqr(e),i=d(t);return n.eql(r,i)}if(!c(r.Gx,r.Gy))throw Error("bad curve params: generator point");let h=n.mul(n.pow(r.a,tg),tp),g=n.mul(n.sqr(r.b),BigInt(27));if(n.is0(n.add(h,g)))throw Error("bad curve params: a or b");function m(t){let e;let{allowedPrivateKeyLengths:n,nByteLength:i,wrapPrivateKey:o,n:l}=r;if(n&&"bigint"!=typeof t){if(a(t)&&(t=p(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:E(x("private key",t,i))}catch(e){throw Error("invalid private key, expected hex or "+i+" bytes, got "+typeof t)}return o&&(e=k(e,l)),I("private key",e,th,l),e}function y(t){if(!(t instanceof v))throw Error("ProjectivePoint expected")}let w=Z((t,e)=>{let{px:r,py:i,pz:o}=t;if(n.eql(o,n.ONE))return{x:r,y:i};let l=t.is0();null==e&&(e=l?n.ONE:n.inv(o));let f=n.mul(r,e),a=n.mul(i,e),u=n.mul(o,e);if(l)return{x:n.ZERO,y:n.ZERO};if(!n.eql(u,n.ONE))throw Error("invZ was invalid");return{x:f,y:a}}),b=Z(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");if(!c(e,i))throw Error("bad point: equation left != right");if(!t.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class v{constructor(t,e,r){if(null==t||!n.isValid(t))throw Error("x required");if(null==e||!n.isValid(e)||n.is0(e))throw Error("y required");if(null==r||!n.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||!n.isValid(e)||!n.isValid(r))throw Error("invalid affine point");if(t instanceof v)throw Error("projective point not allowed");let i=t=>n.eql(t,n.ZERO);return i(e)&&i(r)?v.ZERO:new v(e,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){let e=M(n,t.map(t=>t.pz));return t.map((t,r)=>t.toAffine(e[r])).map(v.fromAffine)}static fromHex(t){let e=v.fromAffine(u(x("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return v.BASE.multiply(m(t))}static msm(t,e){return function(t,e,r,n){(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)})}(n,e);let i=r.length,o=n.length;if(i!==o)throw Error("arrays of points and scalars must have equal length");let a=t.ZERO,u=function(t){let e;for(e=0;t>l;t>>=f,e+=1);return e}(BigInt(i)),s=1;u>12?s=u-3:u>4?s=u-2:u>0&&(s=2);let d=R(s),c=Array(Number(d)+1).fill(a),h=Math.floor((e.BITS-1)/s)*s,g=a;for(let t=h;t>=0;t-=s){c.fill(a);for(let e=0;e<o;e++){let i=Number(n[e]>>BigInt(t)&d);c[i]=c[i].add(r[e])}let e=a;for(let t=c.length-1,r=a;t>0;t--)r=r.add(c[t]),e=e.add(r);if(g=g.add(e),0!==t)for(let t=0;t<s;t++)g=g.double()}return g}(v,i,t,e)}_setWindowSize(t){q.setWindowSize(this,t)}assertValidity(){b(this)}hasEvenY(){let{y:t}=this.toAffine();if(n.isOdd)return!n.isOdd(t);throw Error("Field doesn't support isOdd")}equals(t){y(t);let{px:e,py:r,pz:i}=this,{px:o,py:l,pz:f}=t,a=n.eql(n.mul(e,f),n.mul(o,i)),u=n.eql(n.mul(r,f),n.mul(l,i));return a&&u}negate(){return new v(this.px,n.neg(this.py),this.pz)}double(){let{a:t,b:e}=r,i=n.mul(e,tg),{px:o,py:l,pz:f}=this,a=n.ZERO,u=n.ZERO,s=n.ZERO,d=n.mul(o,o),c=n.mul(l,l),h=n.mul(f,f),g=n.mul(o,l);return g=n.add(g,g),s=n.mul(o,f),s=n.add(s,s),a=n.mul(t,s),u=n.mul(i,h),u=n.add(a,u),a=n.sub(c,u),u=n.add(c,u),u=n.mul(a,u),a=n.mul(g,a),s=n.mul(i,s),h=n.mul(t,h),g=n.sub(d,h),g=n.mul(t,g),g=n.add(g,s),s=n.add(d,d),d=n.add(s,d),d=n.add(d,h),d=n.mul(d,g),u=n.add(u,d),h=n.mul(l,f),h=n.add(h,h),d=n.mul(h,g),a=n.sub(a,d),s=n.mul(h,c),s=n.add(s,s),new v(a,u,s=n.add(s,s))}add(t){y(t);let{px:e,py:i,pz:o}=this,{px:l,py:f,pz:a}=t,u=n.ZERO,s=n.ZERO,d=n.ZERO,c=r.a,h=n.mul(r.b,tg),g=n.mul(e,l),p=n.mul(i,f),m=n.mul(o,a),w=n.add(e,i),E=n.add(l,f);w=n.mul(w,E),E=n.add(g,p),w=n.sub(w,E),E=n.add(e,o);let b=n.add(l,a);return E=n.mul(E,b),b=n.add(g,m),E=n.sub(E,b),b=n.add(i,o),u=n.add(f,a),b=n.mul(b,u),u=n.add(p,m),b=n.sub(b,u),d=n.mul(c,E),u=n.mul(h,m),d=n.add(u,d),u=n.sub(p,d),d=n.add(p,d),s=n.mul(u,d),p=n.add(g,g),p=n.add(p,g),m=n.mul(c,m),E=n.mul(h,E),p=n.add(p,m),m=n.sub(g,m),m=n.mul(c,m),E=n.add(E,m),g=n.mul(p,E),s=n.add(s,g),g=n.mul(b,E),u=n.mul(w,u),u=n.sub(u,g),g=n.mul(w,p),d=n.mul(b,d),new v(u,s,d=n.add(d,g))}subtract(t){return this.add(t.negate())}is0(){return this.equals(v.ZERO)}wNAF(t){return q.wNAFCached(this,t,v.normalizeZ)}multiplyUnsafe(t){let{endo:e,n:i}=r;I("scalar",t,tc,i);let o=v.ZERO;if(t===tc)return o;if(this.is0()||t===th)return this;if(!e||q.hasPrecomputes(this))return q.wNAFCachedUnsafe(this,t,v.normalizeZ);let{k1neg:l,k1:f,k2neg:a,k2:u}=e.splitScalar(t),s=o,d=o,c=this;for(;f>tc||u>tc;)f&th&&(s=s.add(c)),u&th&&(d=d.add(c)),c=c.double(),f>>=th,u>>=th;return l&&(s=s.negate()),a&&(d=d.negate()),d=new v(n.mul(d.px,e.beta),d.py,d.pz),s.add(d)}multiply(t){let e,i;let{endo:o,n:l}=r;if(I("scalar",t,th,l),o){let{k1neg:r,k1:l,k2neg:f,k2:a}=o.splitScalar(t),{p:u,f:s}=this.wNAF(l),{p:d,f:c}=this.wNAF(a);u=q.constTimeNegate(r,u),d=q.constTimeNegate(f,d),d=new v(n.mul(d.px,o.beta),d.py,d.pz),e=u.add(d),i=s.add(c)}else{let{p:r,f:n}=this.wNAF(t);e=r,i=n}return v.normalizeZ([e,i])[0]}multiplyAndAddUnsafe(t,e,r){let n=v.BASE,i=(t,e)=>e!==tc&&e!==th&&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 w(this,t)}isTorsionFree(){let{h:t,isTorsionFree:e}=r;if(t===th)return!0;if(e)return e(v,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:t,clearCofactor:e}=r;return t===th?this:e?e(v,this):this.multiplyUnsafe(r.h)}toRawBytes(t=!0){return s("isCompressed",t),this.assertValidity(),o(v,this,t)}toHex(t=!0){return s("isCompressed",t),p(this.toRawBytes(t))}}v.BASE=new v(r.Gx,r.Gy,n.ONE),v.ZERO=new v(n.ZERO,n.ONE,n.ZERO);let{endo:B,nBitLength:A}=r,q=(e=B?Math.ceil(A/2):A,{constTimeNegate:te,hasPrecomputes:t=>1!==tf(t),unsafeLadder(t,e,r=v.ZERO){let n=t;for(;e>$;)e&tt&&(r=r.add(n)),n=n.double(),e>>=tt;return r},precomputeWindow(t,r){let{windows:n,windowSize:i}=tn(r,e),o=[],l=t,f=l;for(let t=0;t<n;t++){f=l,o.push(f);for(let t=1;t<i;t++)f=f.add(l),o.push(f);l=f.double()}return o},wNAF(t,r,n){let i=v.ZERO,o=v.BASE,l=tn(t,e);for(let t=0;t<l.windows;t++){let{nextN:e,offset:f,isZero:a,isNeg:u,isNegF:s,offsetF:d}=ti(n,t,l);n=e,a?o=o.add(te(s,r[d])):i=i.add(te(u,r[f]))}return{p:i,f:o}},wNAFUnsafe(t,r,n,i=v.ZERO){let o=tn(t,e);for(let t=0;t<o.windows&&n!==$;t++){let{nextN:e,offset:l,isZero:f,isNeg:a}=ti(n,t,o);if(n=e,!f){let t=r[l];i=i.add(a?t.negate():t)}}return i},getPrecomputes(t,e,r){let n=to.get(e);return n||(n=this.precomputeWindow(e,t),1!==t&&to.set(e,r(n))),n},wNAFCached(t,e,r){let n=tf(t);return this.wNAF(n,this.getPrecomputes(n,t,r),e)},wNAFCachedUnsafe(t,e,r,n){let i=tf(t);return 1===i?this.unsafeLadder(t,e,n):this.wNAFUnsafe(i,this.getPrecomputes(i,t,r),e,n)},setWindowSize(t,r){tr(r,e),tl.set(t,r),to.delete(t)}});return{CURVE:r,ProjectivePoint:v,normPrivateKeyToScalar:m,weierstrassEquation:d,isWithinCurveOrder:function(t){return O(t,th,r.n)}}}({...e,toBytes(t,e,n){let i=e.toAffine(),o=r.toBytes(i.x);return(s("isCompressed",n),n)?S(Uint8Array.from([e.hasEvenY()?2:3]),o):S(Uint8Array.from([4]),o,r.toBytes(i.y))},fromBytes(t){let e=t.length,n=t[0],i=t.subarray(1);if(e===u&&(2===n||3===n)){let t;let e=E(i);if(!O(e,th,r.ORDER))throw Error("Point is not on curve");let o=m(e);try{t=r.sqrt(o)}catch(t){throw Error("Point is not on curve"+(t instanceof Error?": "+t.message:""))}return(1&n)==1!=((t&th)===th)&&(t=r.neg(t)),{x:e,y:t}}if(e===d&&4===n)return{x:r.fromBytes(i.subarray(0,r.BYTES)),y:r.fromBytes(i.subarray(r.BYTES,2*r.BYTES))};throw Error("invalid Point, expected length of "+u+", or uncompressed "+d+", got "+e)}}),A=(t,e,r)=>E(t.slice(e,r));class z{constructor(t,e,r){I("r",t,th,n),I("s",e,th,n),this.r=t,this.s=e,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(t){return new z(A(t=x("compactSignature",t,2*i),0,i),A(t,i,2*i))}static fromDER(t){let{r:e,s:r}=td.toSig(x("DER",t));return new z(e,r)}assertValidity(){}addRecoveryBit(t){return new z(this.r,this.s,t)}recoverPublicKey(t){let{r:i,s:o,recovery:l}=this,f=H(x("msgHash",t));if(null==l||![0,1,2,3].includes(l))throw Error("recovery id invalid");let a=2===l||3===l?i+e.n:i;if(a>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let u=(1&l)==0?"02":"03",s=h.fromHex(u+p(v(a,r.BYTES))),d=j(a,n),g=c(-f*d),m=c(o*d),y=h.BASE.multiplyAndAddUnsafe(s,g,m);if(!y)throw Error("point at infinify");return y.assertValidity(),y}hasHighS(){return this.s>n>>th}normalizeS(){return this.hasHighS()?new z(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return w(this.toDERHex())}toDERHex(){return td.hexFromSig(this)}toCompactRawBytes(){return w(this.toCompactHex())}toCompactHex(){return p(v(this.r,i))+p(v(this.s,i))}}function P(t){if("bigint"==typeof t)return!1;if(t instanceof h)return!0;let n=x("key",t).length,o=r.BYTES,l=o+1;if(!e.allowedPrivateKeyLengths&&i!==l)return n===l||n===2*o+1}let C=e.bits2int||function(t){if(t.length>8192)throw Error("input is too large");let e=E(t),r=8*t.length-o;return r>0?e>>BigInt(r):e},H=e.bits2int_modN||function(t){return c(C(t))},T=R(o);function _(t){return I("num < 2^"+o,t,tc,T),v(t,i)}let V={lowS:e.lowS,prehash:!1},L={lowS:e.lowS,prehash:!1};return h.BASE._setWindowSize(8),{CURVE:e,getPublicKey:function(t,e=!0){return h.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e,r=!0){if(!0===P(t))throw Error("first arg must be private key");if(!1===P(e))throw Error("second arg must be public key");return h.fromHex(e).multiply(g(t)).toRawBytes(r)},sign:function(t,i,o=V){let{seed:l,k2sig:f}=function(t,i,o=V){if(["recovered","canonical"].some(t=>t in o))throw Error("sign() legacy options not supported");let{hash:l,randomBytes:f}=e,{lowS:a,prehash:u,extraEntropy:s}=o;null==a&&(a=!0),t=x("msgHash",t),tu(o),u&&(t=x("prehashed msgHash",l(t)));let d=H(t),p=g(i),m=[_(p),_(d)];if(null!=s&&!1!==s){let t=!0===s?f(r.BYTES):s;m.push(x("extraEntropy",t))}return{seed:S(...m),k2sig:function(t){let e=C(t);if(!y(e))return;let r=j(e,n),i=h.BASE.multiply(e).toAffine(),o=c(i.x);if(o===tc)return;let l=c(r*c(d+o*p));if(l===tc)return;let f=(i.x===o?0:2)|Number(i.y&th),u=l;if(a&&l>n>>th)u=l>n>>th?c(-l):l,f^=1;return new z(o,u,f)}}}(t,i,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 n=q(t),i=q(t),o=0,l=()=>{n.fill(1),i.fill(0),o=0},f=(...t)=>r(i,n,...t),a=(t=q(0))=>{i=f(N([0]),t),n=f(),0!==t.length&&(i=f(N([1]),t),n=f())},u=()=>{if(o++>=1e3)throw Error("drbg: tried 1000 values");let t=0,r=[];for(;t<e;){let e=(n=f()).slice();r.push(e),t+=n.length}return S(...r)};return(t,e)=>{let r;for(l(),a(t);!(r=e(u()));)a();return l(),r}})(e.hash.outputLen,e.nByteLength,e.hmac)(l,f)},verify:function(t,r,i,o=L){let l,f;r=x("msgHash",r),i=x("publicKey",i);let{lowS:u,prehash:s,format:d}=o;if(tu(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 g="string"==typeof t||a(t),p=!g&&!d&&"object"==typeof t&&null!==t&&"bigint"==typeof t.r&&"bigint"==typeof t.s;if(!g&&!p)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");try{if(p&&(f=new z(t.r,t.s)),g){try{"compact"!==d&&(f=z.fromDER(t))}catch(t){if(!(t instanceof td.Err))throw t}f||"der"===d||(f=z.fromCompact(t))}l=h.fromHex(i)}catch(t){return!1}if(!f||u&&f.hasHighS())return!1;s&&(r=e.hash(r));let{r:m,s:y}=f,w=H(r),E=j(y,n),b=c(w*E),v=c(m*E),B=h.BASE.multiplyAndAddUnsafe(l,b,v)?.toAffine();return!!B&&c(B.x)===m},ProjectivePoint:h,Signature:z,utils:{isValidPrivateKey(t){try{return g(t),!0}catch(t){return!1}},normPrivateKeyToScalar:g,randomPrivateKey:()=>{let t=X(e.n);return function(t,e,r=!1){let n=t.length,i=Q(e),o=X(e);if(n<16||n<o||n>1024)throw Error("expected "+o+"-1024 bytes of input, got "+n);let l=k(r?b(t):E(t),e-U)+U;return r?B(l,i):v(l,i)}(e.randomBytes(t),e.n)},precompute:(t=8,e=h.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)}}})({...t,hash:e,hmac:(t,...r)=>(0,i.w)(e,t,(0,o.Id)(...r)),randomBytes:o.po});return{...r(e),create:r}}({a:tw,b:BigInt(7),Fp:tB,n:ty,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{let e=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-tE*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=BigInt("0x100000000000000000000000000000000"),o=tv(e*t,ty),l=tv(-r*t,ty),f=k(t-o*e-l*n,ty),a=k(-o*r-l*e,ty),u=f>i,s=a>i;if(u&&(f=ty-f),s&&(a=ty-a),f>i||a>i)throw Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:u,k1:f,k2neg:s,k2:a}}}},n.sc)}}]);

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.