1/*! For license information please see 4504.a8fe9ea6.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkliquidity_dex=self.webpackChunkliquidity_dex||[]).push([[4504],{94504:(t,e,n)=>{n.d(e,{secp256k1:()=>Zt});var r=n(25344),o=n(48898);class i extends o.Vw{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,(0,o.sd)(t);const n=(0,o.ZJ)(e);if(this.iHash=t.create(),"function"!==typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,i=new Uint8Array(r);i.set(n.length>r?t.create().update(n).digest():n);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=t.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),(0,o.uH)(i)}update(t){return(0,o.CC)(this),this.iHash.update(t),this}digestInto(t){(0,o.CC)(this),(0,o.DO)(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:n,finished:r,destroyed:o,blockLen:i,outputLen:s}=this;return t.finished=r,t.destroyed=o,t.blockLen=i,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const s=(t,e,n)=>new i(t,e).update(n).digest();s.create=(t,e)=>new i(t,e);const f=BigInt(0),a=BigInt(1);function u(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function c(t){if(!u(t))throw new Error("Uint8Array expected")}function l(t,e){if("boolean"!==typeof e)throw new Error(t+" boolean expected, got "+e)}function d(t){const e=t.toString(16);return 1&e.length?"0"+e:e}function h(t){if("string"!==typeof t)throw new Error("hex string expected, got "+typeof t);return""===t?f:BigInt("0x"+t)}const g="function"===typeof Uint8Array.from([]).toHex&&"function"===typeof Uint8Array.fromHex,w=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function p(t){if(c(t),g)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=w[t[n]];return e}const y=48,m=57,E=65,b=70,v=97,B=102;function x(t){return t>=y&&t<=m?t-y:t>=E&&t<=b?t-(E-10):t>=v&&t<=B?t-(v-10):void 0}function S(t){if("string"!==typeof t)throw new Error("hex string expected, got "+typeof t);if(g)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let o=0,i=0;o<n;o++,i+=2){const e=x(t.charCodeAt(i)),n=x(t.charCodeAt(i+1));if(void 0===e||void 0===n){const e=t[i]+t[i+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+i)}r[o]=16*e+n}return r}function A(t){return h(p(t))}function O(t){return c(t),h(p(Uint8Array.from(t).reverse()))}function I(t,e){return S(t.toString(16).padStart(2*e,"0"))}function R(t,e){return I(t,e).reverse()}function N(t,e,n){let r;if("string"===typeof e)try{r=S(e)}catch(i){throw new Error(t+" must be hex string or Uint8Array, cause: "+i)}else{if(!u(e))throw new Error(t+" must be hex string or Uint8Array");r=Uint8Array.from(e)}const o=r.length;if("number"===typeof n&&o!==n)throw new Error(t+" of length "+n+" expected, got "+o);return r}function q(){let t=0;for(let n=0;n<arguments.length;n++){const e=n<0||arguments.length<=n?void 0:arguments[n];c(e),t+=e.length}const e=new Uint8Array(t);for(let n=0,r=0;n<arguments.length;n++){const t=n<0||arguments.length<=n?void 0:arguments[n];e.set(t,r),r+=t.length}return e}const H=t=>"bigint"===typeof t&&f<=t;function k(t,e,n){return H(t)&&H(e)&&H(n)&&e<=t&&t<n}function z(t,e,n,r){if(!k(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}const F=t=>(a<<BigInt(t))-a,L=t=>new Uint8Array(t),C=t=>Uint8Array.from(t);const P={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||u(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 U(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=(e,n,r)=>{const o=P[n];if("function"!==typeof o)throw new Error("invalid validator function");const i=t[e];if((!r||void 0!==i)&&!o(i,t))throw new Error("param "+String(e)+" is invali
2d. Expected "+n+", got "+i)};for(const[o,i]of Object.entries(e))r(o,i,!1);for(const[o,i]of Object.entries(n))r(o,i,!0);return t}function Z(t){const e=new WeakMap;return function(n){const r=e.get(n);if(void 0!==r)return r;for(var o=arguments.length,i=new Array(o>1?o-1:0),s=1;s<o;s++)i[s-1]=arguments[s];const f=t(n,...i);return e.set(n,f),f}}const T=BigInt(0),V=BigInt(1),j=BigInt(2),D=BigInt(3),K=BigInt(4),_=BigInt(5),Y=BigInt(8);function W(t,e){const n=t%e;return n>=T?n:e+n}function M(t,e,n){let r=t;for(;e-- >T;)r*=r,r%=n;return r}function G(t,e){if(t===T)throw new Error("invert: expected non-zero number");if(e<=T)throw new Error("invert: expected positive modulus, got "+e);let n=W(t,e),r=e,o=T,i=V,s=V,f=T;for(;n!==T;){const t=r/n,e=r%n,a=o-s*t,u=i-f*t;r=n,n=e,o=s,i=f,s=a,f=u}if(r!==V)throw new Error("invert: does not exist");return W(o,e)}function J(t,e){const n=(t.ORDER+V)/K,r=t.pow(e,n);if(!t.eql(t.sqr(r),e))throw new Error("Cannot find square root");return r}function Q(t,e){const n=(t.ORDER-_)/Y,r=t.mul(e,j),o=t.pow(r,n),i=t.mul(e,o),s=t.mul(t.mul(i,j),o),f=t.mul(i,t.sub(s,t.ONE));if(!t.eql(t.sqr(f),e))throw new Error("Cannot find square root");return f}function X(t){return t%K===D?J:t%Y===_?Q:function(t){if(t<BigInt(3))throw new Error("sqrt is not defined for small field");let e=t-V,n=0;for(;e%j===T;)e/=j,n++;let r=j;const o=ot(t);for(;1===nt(o,r);)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(1===n)return J;let i=o.pow(r,e);const s=(e+V)/j;return function(t,r){if(t.is0(r))return r;if(1!==nt(t,r))throw new Error("Cannot find square root");let o=n,f=t.mul(t.ONE,i),a=t.pow(r,e),u=t.pow(r,s);for(;!t.eql(a,t.ONE);){if(t.is0(a))return t.ZERO;let e=1,n=t.sqr(a);for(;!t.eql(n,t.ONE);)if(e++,n=t.sqr(n),e===o)throw new Error("Cannot find square root");const r=V<<BigInt(o-e-1),i=t.pow(f,r);o=e,f=t.sqr(i),a=t.mul(a,f),u=t.mul(u,i)}return u}}(t)}const $=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function tt(t,e,n){if(n<T)throw new Error("invalid exponent, negatives unsupported");if(n===T)return t.ONE;if(n===V)return e;let r=t.ONE,o=e;for(;n>T;)n&V&&(r=t.mul(r,o)),o=t.sqr(o),n>>=V;return r}function et(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=new Array(e.length).fill(n?t.ZERO:void 0),o=e.reduce(((e,n,o)=>t.is0(n)?e:(r[o]=e,t.mul(e,n))),t.ONE),i=t.inv(o);return e.reduceRight(((e,n,o)=>t.is0(n)?e:(r[o]=t.mul(e,r[o]),t.mul(e,n))),i),r}function nt(t,e){const n=(t.ORDER-V)/j,r=t.pow(e,n),o=t.eql(r,t.ONE),i=t.eql(r,t.ZERO),s=t.eql(r,t.neg(t.ONE));if(!o&&!i&&!s)throw new Error("invalid Legendre symbol result");return o?1:i?0:-1}function rt(t,e){void 0!==e&&(0,o.Fe)(e);const n=void 0!==e?e:t.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function ot(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(t<=T)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:o,nByteLength:i}=rt(t,e);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const f=Object.freeze({ORDER:t,isLE:n,BITS:o,BYTES:i,MASK:F(o),ZERO:T,ONE:V,create:e=>W(e,t),isValid:e=>{if("bigint"!==typeof e)throw new 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=>W(-e,t),eql:(t,e)=>t===e,sqr:e=>W(e*e,t),add:(e,n)=>W(e+n,t),sub:(e,n)=>W(e-n,t),mul:(e,n)=>W(e*n,t),pow:(t,e)=>tt(f,t,e),div:(e,n)=>W(e*G(n,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>G(e,t),sqrt:r.sqrt||(e=>(s||(s=X(t)),s(f,e))),toBytes:t=>n?R(t,i):I(t,i),fromBytes:t=>{if(t.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+t.length);return n?O(t):A(t)},invertBatch:t=>et(f,t),cmov:(t,e,n)=>n?e:t});return Object.freeze(f)}function it(t){if("bigint"!==typeof t)throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function st(t){const e=it(t);return e+Math.ceil(e/2)}const ft=BigInt(0),at=BigInt(1);function ut(t,e){const n=e.negate();return t?n:e}function ct(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function lt(t,e){ct(t,e);const n=2**t;return{windows:Math.ceil(e/t)+1,windowSize:2**(t-1),mask:F(t),maxNumber:n,shiftBy:BigInt(t)}}function dt(t,e,n){const{windowSize:r,mask:o,maxNumber:i,shiftBy:s}=n;let f=Number(t&o),a=t>>s;f>r&&(f-=i,a+=at);const u=e*r;return{nextN:a,offset:u+Math.abs(f)-1,isZero:0===f,isNeg:f<0,isNegF:e%2!==0,offsetF:u}}function ht(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach(((t,n)=>{if(!(t instanceof e))throw new Error("invalid point at index "+n)}))}function gt(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach(((t,n)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+n)}))}const wt=new WeakMap,pt=new WeakMap;function yt(t){return pt.get(t)||1}function mt(t,e,n,r){ht(n,t),gt(r,e);const o=n.length,i=r.length;if(o!==i)throw new Error("arrays of points and scalars must have equal length");const s=t.ZERO,u=function(t){let e;for(e=0;t>f;t>>=a,e+=1);return e}(BigInt(o));let c=1;u>12?c=u-3:u>4?c=u-2:u>0&&(c=2);const l=F(c),d=new Array(Number(l)+1).fill(s);let h=s;for(let f=Math.floor((e.BITS-1)/c)*c;f>=0;f-=c){d.fill(s);for(let e=0;e<i;e++){const t=r[e],o=Number(t>>BigInt(f)&l);d[o]=d[o].add(n[e])}let t=s;for(let e=d.length-1,n=s;e>0;e--)n=n.add(d[e]),t=t.add(n);if(h=h.add(t),0!==f)for(let e=0;e<c;e++)h=h.double()}return h}function Et(t){return U(t.Fp,$.reduce(((t,e)=>(t[e]="function",t)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),U(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...rt(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}function bt(t){void 0!==t.lowS&&l("lowS",t.lowS),void 0!==t.prehash&&l("prehash",t.prehash)}
2class vt extends Error{constructor(){super(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"")}}const Bt={Err:vt,_tlv:{encode:(t,e)=>{const{Err:n}=Bt;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(1&e.length)throw new n("tlv.encode: unpadded data");const r=e.length/2,o=d(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const i=r>127?d(o.length/2|128):"";return d(t)+i+o+e},decode(t,e){const{Err:n}=Bt;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const o=e[r++];let i=0;if(!!(128&o)){const t=127&o;if(!t)throw new n("tlv.decode(long): indefinite length not supported");if(t>4)throw new n("tlv.decode(long): byte length is too big");const s=e.subarray(r,r+t);if(s.length!==t)throw new n("tlv.decode: length bytes not complete");if(0===s[0])throw new n("tlv.decode(long): zero leftmost byte");for(const e of s)i=i<<8|e;if(r+=t,i<128)throw new n("tlv.decode(long): not minimal encoding")}else i=o;const s=e.subarray(r,r+i);if(s.length!==i)throw new n("tlv.decode: wrong value length");return{v:s,l:e.subarray(r+i)}}},_int:{encode(t){const{Err:e}=Bt;if(t<St)throw new e("integer: negative integers are not allowed");let n=d(t);if(8&Number.parseInt(n[0],16)&&(n="00"+n),1&n.length)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=Bt;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 A(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=Bt,o=N("signature",t),{v:i,l:s}=r.decode(48,o);if(s.length)throw new e("invalid signature: left bytes after parsing");const{v:f,l:a}=r.decode(2,i),{v:u,l:c}=r.decode(2,a);if(c.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(f),s:n.decode(u)}},hexFromSig(t){const{_tlv:e,_int:n}=Bt,r=e.encode(2,n.encode(t.r))+e.encode(2,n.encode(t.s));return e.encode(48,r)}};function xt(t,e){return p(I(t,e))}const St=BigInt(0),At=BigInt(1),Ot=(BigInt(2),BigInt(3)),It=BigInt(4);function Rt(t){const e=function(t){const e=Et(t);U(e,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});const{endo:n,Fp:r,a:o}=e;if(n){if(!r.eql(o,r.ZERO))throw new Error("invalid endo: CURVE.a must be 0");if("object"!==typeof n||"bigint"!==typeof n.beta||"function"!==typeof n.splitScalar)throw new Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...e})}(t),{Fp:n}=e,r=ot(e.n,e.nBitLength),o=e.toBytes||((t,e,r)=>{const o=e.toAffine();return q(Uint8Array.from([4]),n.toBytes(o.x),n.toBytes(o.y))}),i=e.fromBytes||(t=>{const e=t.subarray(1);return{x:n.fromBytes(e.subarray(0,n.BYTES)),y:n.fromBytes(e.subarray(n.BYTES,2*n.BYTES))}});function s(t){const{a:r,b:o}=e,i=n.sqr(t),s=n.mul(i,t);return n.add(n.add(s,n.mul(t,r)),o)}function f(t,e){const r=n.sqr(e),o=s(t);return n.eql(r,o)}if(!f(e.Gx,e.Gy))throw new Error("bad curve params: generator point");const a=n.mul(n.pow(e.a,Ot),It),c=n.mul(n.sqr(e.b),BigInt(27));if(n.is0(n.add(a,c)))throw new Error("bad curve params: a or b");function d(t){const{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:o,n:i}=e;if(n&&"bigint"!==typeof t){if(u(t)&&(t=p(t)),"string"!==typeof t||!n.includes(t.length))throw new Error("invalid private key");t=t.padStart(2*r,"0")}let s;try{s="bigint"===typeof t?t:A(N("private key",t,r))}catch(f){throw new Error("invalid private key, expected hex or "+r+" bytes, got "+typeof t)}return o&&(s=W(s,i)),z("private key",s,At,i),s}function h(t){if(!(t instanceof y))throw new Error("ProjectivePoint expected")}const g=Z(((t,e)=>{const{px:r,py:o,pz:i}=t;if(n.eql(i,n.ONE))return{x:r,y:o};const s=t.is0();null==e&&(e=s?n.ONE:n.inv(i));const f=n.mul(r,e),a=n.mul(o,e),u=n.mul(i,e);if(s)return{x:n.ZERO,y:n.ZERO};if(!n.eql(u,n.ONE))throw new Error("invZ was invalid");return{x:f,y:a}})),w=Z((t=>{if(t.is0()){if(e.allowInfinityPoint&&!n.is0(t.py))return;throw new Error("bad point: ZERO")}const{x:r,y:o}=t.toAffine();if(!n.isValid(r)||!n.isValid(o))throw new Error("bad point: x or y not FE");if(!f(r,o))throw new Error("bad point: equation left != right");
vendor: 4,191 bytes, line 2
2if(!t.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0}));class y{constructor(t,e,r){if(null==t||!n.isValid(t))throw new Error("x required");if(null==e||!n.isValid(e)||n.is0(e))throw new Error("y required");if(null==r||!n.isValid(r))throw new Error("z required");this.px=t,this.py=e,this.pz=r,Object.freeze(this)}static fromAffine(t){const{x:e,y:r}=t||{};if(!t||!n.isValid(e)||!n.isValid(r))throw new Error("invalid affine point");if(t instanceof y)throw new Error("projective point not allowed");const o=t=>n.eql(t,n.ZERO);return o(e)&&o(r)?y.ZERO:new y(e,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){const e=et(n,t.map((t=>t.pz)));return t.map(((t,n)=>t.toAffine(e[n]))).map(y.fromAffine)}static fromHex(t){const e=y.fromAffine(i(N("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return y.BASE.multiply(d(t))}static msm(t,e){return mt(y,r,t,e)}_setWindowSize(t){b.setWindowSize(this,t)}assertValidity(){w(this)}hasEvenY(){const{y:t}=this.toAffine();if(n.isOdd)return!n.isOdd(t);throw new Error("Field doesn't support isOdd")}equals(t){h(t);const{px:e,py:r,pz:o}=this,{px:i,py:s,pz:f}=t,a=n.eql(n.mul(e,f),n.mul(i,o)),u=n.eql(n.mul(r,f),n.mul(s,o));return a&&u}negate(){return new y(this.px,n.neg(this.py),this.pz)}double(){const{a:t,b:r}=e,o=n.mul(r,Ot),{px:i,py:s,pz:f}=this;let a=n.ZERO,u=n.ZERO,c=n.ZERO,l=n.mul(i,i),d=n.mul(s,s),h=n.mul(f,f),g=n.mul(i,s);return g=n.add(g,g),c=n.mul(i,f),c=n.add(c,c),a=n.mul(t,c),u=n.mul(o,h),u=n.add(a,u),a=n.sub(d,u),u=n.add(d,u),u=n.mul(a,u),a=n.mul(g,a),c=n.mul(o,c),h=n.mul(t,h),g=n.sub(l,h),g=n.mul(t,g),g=n.add(g,c),c=n.add(l,l),l=n.add(c,l),l=n.add(l,h),l=n.mul(l,g),u=n.add(u,l),h=n.mul(s,f),h=n.add(h,h),l=n.mul(h,g),a=n.sub(a,l),c=n.mul(h,d),c=n.add(c,c),c=n.add(c,c),new y(a,u,c)}add(t){h(t);const{px:r,py:o,pz:i}=this,{px:s,py:f,pz:a}=t;let u=n.ZERO,c=n.ZERO,l=n.ZERO;const d=e.a,g=n.mul(e.b,Ot);let w=n.mul(r,s),p=n.mul(o,f),m=n.mul(i,a),E=n.add(r,o),b=n.add(s,f);E=n.mul(E,b),b=n.add(w,p),E=n.sub(E,b),b=n.add(r,i);let v=n.add(s,a);return b=n.mul(b,v),v=n.add(w,m),b=n.sub(b,v),v=n.add(o,i),u=n.add(f,a),v=n.mul(v,u),u=n.add(p,m),v=n.sub(v,u),l=n.mul(d,b),u=n.mul(g,m),l=n.add(u,l),u=n.sub(p,l),l=n.add(p,l),c=n.mul(u,l),p=n.add(w,w),p=n.add(p,w),m=n.mul(d,m),b=n.mul(g,b),p=n.add(p,m),m=n.sub(w,m),m=n.mul(d,m),b=n.add(b,m),w=n.mul(p,b),c=n.add(c,w),w=n.mul(v,b),u=n.mul(E,u),u=n.sub(u,w),w=n.mul(E,p),l=n.mul(v,l),l=n.add(l,w),new y(u,c,l)}subtract(t){return this.add(t.negate())}is0(){return this.equals(y.ZERO)}wNAF(t){return b.wNAFCached(this,t,y.normalizeZ)}multiplyUnsafe(t){const{endo:r,n:o}=e;z("scalar",t,St,o);const i=y.ZERO;if(t===St)return i;if(this.is0()||t===At)return this;if(!r||b.hasPrecomputes(this))return b.wNAFCachedUnsafe(this,t,y.normalizeZ);let{k1neg:s,k1:f,k2neg:a,k2:u}=r.splitScalar(t),c=i,l=i,d=this;for(;f>St||u>St;)f&At&&(c=c.add(d)),u&At&&(l=l.add(d)),d=d.double(),f>>=At,u>>=At;return s&&(c=c.negate()),a&&(l=l.negate()),l=new y(n.mul(l.px,r.beta),l.py,l.pz),c.add(l)}multiply(t){const{endo:r,n:o}=e;let i,s;if(z("scalar",t,At,o),r){const{k1neg:e,k1:o,k2neg:f,k2:a}=r.splitScalar(t);let{p:u,f:c}=this.wNAF(o),{p:l,f:d}=this.wNAF(a);u=b.constTimeNegate(e,u),l=b.constTimeNegate(f,l),l=new y(n.mul(l.px,r.beta),l.py,l.pz),i=u.add(l),s=c.add(d)}else{const{p:e,f:n}=this.wNAF(t);i=e,s=n}return y.normalizeZ([i,s])[0]}multiplyAndAddUnsafe(t,e,n){const r=y.BASE,o=(t,e)=>e!==St&&e!==At&&t.equals(r)?t.multiply(e):t.multiplyUnsafe(e),i=o(this,e).add(o(t,n));return i.is0()?void 0:i}toAffine(t){return g(this,t)}isTorsionFree(){const{h:t,isTorsionFree:n}=e;if(t===At)return!0;if(n)return n(y,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:t,clearCofactor:n}=e;return t===At?this:n?n(y,this):this.multiplyUnsafe(e.h)}toRawBytes(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return l("isCompressed",t),this.assertValidity(),o(y,this,t)}toHex(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return l("isCompressed",t),p(this.toRawBytes(t))}}y.BASE=new y(e.Gx,e.Gy,n.ONE),y.ZERO=new y(n.ZERO,n.ONE,n.ZERO);
2const{endo:m,nBitLength:E}=e,b=(v=y,B=m?Math.ceil(E/2):E,{constTimeNegate:ut,hasPrecomputes:t=>1!==yt(t),unsafeLadder(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v.ZERO,r=t;for(;e>ft;)e&at&&(n=n.add(r)),r=r.double(),e>>=at;return n},precomputeWindow(t,e){const{windows:n,windowSize:r}=lt(e,B),o=[];let i=t,s=i;for(let f=0;f<n;f++){s=i,o.push(s);for(let t=1;t<r;t++)s=s.add(i),o.push(s);i=s.double()}return o},wNAF(t,e,n){let r=v.ZERO,o=v.BASE;const i=lt(t,B);for(let s=0;s<i.windows;s++){const{nextN:t,offset:f,isZero:a,isNeg:u,isNegF:c,offsetF:l}=dt(n,s,i);n=t,a?o=o.add(ut(c,e[l])):r=r.add(ut(u,e[f]))}return{p:r,f:o}},wNAFUnsafe(t,e,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:v.ZERO;const o=lt(t,B);for(let i=0;i<o.windows&&n!==ft;i++){const{nextN:t,offset:s,isZero:f,isNeg:a}=dt(n,i,o);if(n=t,!f){const t=e[s];r=r.add(a?t.negate():t)}}return r},getPrecomputes(t,e,n){let r=wt.get(e);return r||(r=this.precomputeWindow(e,t),1!==t&&wt.set(e,n(r))),r},wNAFCached(t,e,n){const r=yt(t);
2return this.wNAF(r,this.getPrecomputes(r,t,n),e)},wNAFCachedUnsafe(t,e,n,r){const o=yt(t);return 1===o?this.unsafeLadder(t,e,r):this.wNAFUnsafe(o,this.getPrecomputes(o,t,n),e,r)},setWindowSize(t,e){ct(e,B),pt.set(t,e),wt.delete(t)}});var v,B;return{CURVE:e,ProjectivePoint:y,normPrivateKeyToScalar:d,weierstrassEquation:s,isWithinCurveOrder:function(t){return k(t,At,e.n)}}}function Nt(t){const e=function(t){const e=Et(t);return U(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}(t),{Fp:n,n:r,nByteLength:o,nBitLength:i}=e,s=n.BYTES+1,f=2*n.BYTES+1;function a(t){return W(t,r)}function c(t){return G(t,r)}const{ProjectivePoint:d,normPrivateKeyToScalar:h,weierstrassEquation:g,isWithinCurveOrder:w}=Rt({...e,toBytes(t,e,r){const o=e.toAffine(),i=n.toBytes(o.x),s=q;return l("isCompressed",r),r?s(Uint8Array.from([e.hasEvenY()?2:3]),i):s(Uint8Array.from([4]),i,n.toBytes(o.y))},fromBytes(t){const e=t.length,r=t[0],o=t.subarray(1);if(e!==s||2!==r&&3!==r){if(e===f&&4===r){return{x:n.fromBytes(o.subarray(0,n.BYTES)),y:n.fromBytes(o.subarray(n.BYTES,2*n.BYTES))}}throw new Error("invalid Point, expected length of "+s+", or uncompressed "+f+", got "+e)}{const t=A(o);if(!k(t,At,n.ORDER))throw new Error("Point is not on curve");const e=g(t);let s;try{s=n.sqrt(e)}catch(i){const t=i instanceof Error?": "+i.message:"";throw new Error("Point is not on curve"+t)}return 1===(1&r)!==((s&At)===At)&&(s=n.neg(s)),{x:t,y:s}}}});function p(t){return t>r>>At}const y=(t,e,n)=>A(t.slice(e,n));class m{constructor(t,e,n){z("r",t,At,r),z("s",e,At,r),this.r=t,this.s=e,null!=n&&(this.recovery=n),Object.freeze(this)}static fromCompact(t){const e=o;return t=N("compactSignature",t,2*e),new m(y(t,0,e),y(t,e,2*e))}static fromDER(t){const{r:e,s:n}=Bt.toSig(N("DER",t));return new m(e,n)}assertValidity(){}addRecoveryBit(t){return new m(this.r,this.s,t)}recoverPublicKey(t){const{r:r,s:o,recovery:i}=this,s=B(N("msgHash",t));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const f=2===i||3===i?r+e.n:r;if(f>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const u=0===(1&i)?"02":"03",l=d.fromHex(u+xt(f,n.BYTES)),h=c(f),g=a(-s*h),w=a(o*h),p=d.BASE.multiplyAndAddUnsafe(l,g,w);if(!p)throw new Error("point at infinify");return p.assertValidity(),p}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return S(this.toDERHex())}toDERHex(){return Bt.hexFromSig(this)}toCompactRawBytes(){return S(this.toCompactHex())}toCompactHex(){const t=o;return xt(this.r,t)+xt(this.s,t)}}const E={isValidPrivateKey(t){try{return h(t),!0}catch(e){return!1}},normPrivateKeyToScalar:h,randomPrivateKey:()=>{const t=st(e.n);return function(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const r=t.length,o=it(e),i=st(e);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const s=W(n?O(t):A(t),e-V)+V;return n?R(s,o):I(s,o)}(e.randomBytes(t),e.n)},precompute(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:d.BASE;return e._setWindowSize(t),e.multiply(BigInt(3)),e}};function b(t){if("bigint"===typeof t)return!1;if(t instanceof d)return!0;const r=N("key",t).length,i=n.BYTES,s=i+1,f=2*i+1;return e.allowedPrivateKeyLengths||o===s?void 0:r===s||r===f}const v=e.bits2int||function(t){if(t.length>8192)throw new Error("input is too large");const e=A(t),n=8*t.length-i;return n>0?e>>BigInt(n):e},B=e.bits2int_modN||function(t){return a(v(t))},x=F(i);function H(t){return z("num < 2^"+i,t,St,x),I(t,o)}function P(t,r){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Z;if(["recovered","canonical"].some((t=>t in o)))throw new Error("sign() legacy options not supported");const{hash:i,randomBytes:s}=e;let{lowS:f,prehash:u,extraEntropy:l}=o;null==f&&(f=!0),t=N("msgHash",t),bt(o),u&&(t=N("prehashed msgHash",i(t)));const g=B(t),y=h(r),E=[H(y),H(g)];if(null!=l&&!1!==l){const t=!0===l?s(n.BYTES):l;E.push(N("extraEntropy",t))}const b=q(...E),x=g;return{seed:b,k2sig:function(t){const e=v(t);if(!w(e))return;const n=c(e),r=d.BASE.multiply(e).toAffine(),o=a(r.x);if(o===St)return;const i=a(n*a(x+o*y));if(i===St)return;let s=(r.x===o?0:2)|Number(r.y&At),u=i;return f&&p(i)&&(u=function(t){return p(t)?a(-t):t}(i),s^=1),new m(o,u,s)}}}const Z={lowS:e.lowS,prehash:!1},T={lowS:e.lowS,prehash:!1};return d.BASE._setWindowSize(8),{CURVE:e,getPublicKey:function(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return d.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e){let n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!0===b(t))throw new Error("first arg must be private key");if(!1===b(e))throw new Error("second arg must be public key");return d.fromHex(e).multiply(h(t)).toRawBytes(n)},sign:function(t,n){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Z;const{seed:o,k2sig:i}=P(t,n,r),s=e,f=function(t,e,n){if("number"!==typeof t||t<2)throw new Error("hashLen must be a number");if("number"!==typeof e||e<2)throw new Error("qByteLen must be a number");if("function"!==typeof n)throw new Error("hmacFn must be a function");let r=L(t),o=L(t),i=0;const s=()=>{r.fill(1),o.fill(0),i=0},f=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return n(o,r,...e)},a=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:L(0);o=f(C([0]),t),r=f(),0!==t.length&&(o=f(C([1]),t),r=f())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let t=0;const n=[];for(;t<e;){r=f();const e=r.slice();n.push(e),t+=r.length}return q(...n)};return(t,e)=>{let n;for(s(),a(t);!(n=e(u()));)a();return s(),n}}(s.hash.outputLen,s.nByteLength,s.hmac);return f(o,i)},verify:function(t,n,r){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:T;const i=t;n=N("msgHash",n),r=N("publicKey",r);const{lowS:s,prehash:f,format:l}=o;if(bt(o),"strict"in o)throw new Error("options.strict was renamed to lowS");if(void 0!==l&&"compact"!==l&&"der"!==l)throw new Error("format must be compact or der");const h="string"===typeof i||u(i),g=!h&&!l&&"object"===typeof i&&null!==i&&"bigint"===typeof i.r&&"bigint"===typeof i.s;if(!h&&!g)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let w,p;try{if(g&&(w=new m(i.r,i.s)),h){try{"compact"!==l&&(w=m.fromDER(i))}catch(O){if(!(O instanceof Bt.Err))throw O}w||"der"===l||(w=m.fromCompact(i))}p=d.fromHex(r)}catch(I){return!1}if(!w)return!1;if(s&&w.hasHighS())return!1;f&&(n=e.hash(n));const{r:y,s:E}=w,b=B(n),v=c(E),x=a(b*v),S=a(y*v),A=d.BASE.multiplyAndAddUnsafe(p,x,S)?.toAffine();return!!A&&a(A.x)===y},ProjectivePoint:d,Signature:m,utils:E}}function qt(t){return{hash:t,hmac:function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return s(t,e,(0,o.Id)(...r))},randomBytes:o.po}}const Ht=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),kt=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),zt=BigInt(0),Ft=BigInt(1),Lt=BigInt(2),Ct=(t,e)=>(t+e/Lt)/e;function Pt(t){const e=Ht,n=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),s=BigInt(23),f=BigInt(44),a=BigInt(88),u=t*t*t%e,c=u*u*t%e,l=M(c,n,e)*c%e,d=M(l,n,e)*c%e,h=M(d,Lt,e)*u%e,g=M(h,o,e)*h%e,w=M(g,i,e)*g%e,p=M(w,f,e)*w%e,y=M(p,a,e)*p%e,m=M(y,f,e)*w%e,E=M(m,n,e)*c%e,b=M(E,s,e)*g%e,v=M(b,r,e)*u%e,B=M(v,Lt,e);if(!Ut.eql(Ut.sqr(B),t))throw new Error("Cannot find square root");return B}const Ut=ot(Ht,void 0,void 0,{sqrt:Pt}),Zt=function(t,e){const n=e=>Nt({...t,...qt(e)});return{...n(e),create:n}}({a:zt,b:BigInt(7),Fp:Ut,n:kt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=kt,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Ft*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,s=BigInt("0x100000000000000000000000000000000"),f=Ct(i*t,e),a=Ct(-r*t,e);let u=W(t-f*n-a*o,e),c=W(-f*r-a*i,e);const l=u>s,d=c>s;if(l&&(u=e-u),d&&(c=e-c),u>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:l,k1:u,k2neg:d,k2:c}}}},r.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.