PageSourceSearch

https://smilecoin.ai/assets/secp256k1.js-Cwel67ap.js

js smilecoin.ai collected 2026-10-05 15:07:46 UTC 31,520 bytes, 10 lines download raw bytes

vendor: 19,027 bytes, lines 1-7
1import{H as t,G as e,I as n,J as r,K as o,L as i,N as s,P as f,Q as a,U as u,V as c}from"./chunk-C74OP4fS.js";import"./chunk-ZLwEzXoy.js";import"./chunk-64Y5F-uU.js";import"./chunk-Gmj5k1uE.js";import"./chunk-CdSArBFG.js";function h(t,e,n){return t&e^~t&n}function l(t,e,n){return t&e^t&n^e&n}class d extends t{constructor(t,n,r,o){super(),this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=o,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=e(this.buffer)}update(t){n(this);const{view:o,buffer:i,blockLen:s}=this,f=(t=r(t)).length;for(let n=0;n<f;){const r=Math.min(s-this.pos,f-n);if(r===s){const r=e(t);for(;s<=f-n;n+=s)this.process(r,n);continue}i.set(t.subarray(n,n+r),this.pos),this.pos+=r,n+=r,this.pos===s&&(this.process(o,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){n(this),o(t,this),this.finished=!0;const{buffer:r,view:i,blockLen:s,isLE:f}=this;let{pos:a}=this;r[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(i,0),a=0);for(let e=a;e<s;e++)r[e]=0;!function(t,e,n,r){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,n,r);const o=BigInt(32),i=BigInt(4294967295),s=Number(n>>o&i),f=Number(n&i),a=r?4:0,u=r?0:4;t.setUint32(e+a,s,r),t.setUint32(e+u,f,r)}(i,s-8,BigInt(8*this.length),f),this.process(i,0);const u=e(t),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const h=c/4,l=this.get();if(h>l.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<h;e++)u.setUint32(4*e,l[e],f)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:n,length:r,finished:o,destroyed:i,pos:s}=this;return t.length=r,t.pos=s,t.finished=o,t.destroyed=i,r%e&&t.buffer.set(n),t}}const g=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),w=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),p=new Uint32Array(64);class y extends d{constructor(){super(64,32,8,!1),this.A=0|w[0],this.B=0|w[1],this.C=0|w[2],this.D=0|w[3],this.E=0|w[4],this.F=0|w[5],this.G=0|w[6],this.H=0|w[7]}get(){const{A:t,B:e,C:n,D:r,E:o,F:i,G:s,H:f}=this;return[t,e,n,r,o,i,s,f]}set(t,e,n,r,o,i,s,f){this.A=0|t,this.B=0|e,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|i,this.G=0|s,this.H=0|f}process(t,e){for(let s=0;s<16;s++,e+=4)p[s]=t.getUint32(e,!1);for(let h=16;h<64;h++){const t=p[h-15],e=p[h-2],n=s(t,7)^s(t,18)^t>>>3,r=s(e,17)^s(e,19)^e>>>10;p[h]=r+p[h-7]+n+p[h-16]|0}let{A:n,B:r,C:o,D:i,E:f,F:a,G:u,H:c}=this;for(let d=0;d<64;d++){const t=c+(s(f,6)^s(f,11)^s(f,25))+h(f,a,u)+g[d]+p[d]|0,e=(s(n,2)^s(n,13)^s(n,22))+l(n,r,o)|0;c=u,u=a,a=f,f=i+t|0,i=o,o=r,r=n,n=t+e|0}n=n+this.A|0,r=r+this.B|0,o=o+this.C|0,i=i+this.D|0,f=f+this.E|0,a=a+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(n,r,o,i,f,a,u,c)}roundClean(){p.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const m=i(()=>new y),E=BigInt(0),b=BigInt(1),B=BigInt(2);
2/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function v(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function x(t){if(!v(t))throw new Error("Uint8Array expected")}function S(t,e){if("boolean"!=typeof e)throw new Error(t+" boolean expected, got "+e)}const I=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function A(t){x(t);let e="";for(let n=0;n<t.length;n++)e+=I[t[n]];return e}function O(t){const e=t.toString(16);return 1&e.length?"0"+e:e}function R(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return""===t?E:BigInt("0x"+t)}const q=48,N=57,L=65,H=70,U=97,k=102;function z(t){return t>=q&&t<=N?t-q:t>=L&&t<=H?t-(L-10):t>=U&&t<=k?t-(U-10):void 0}function T(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof 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=z(t.charCodeAt(i)),n=z(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 P(t){return R(A(t))}function F(t){return x(t),R(A(Uint8Array.from(t).reverse()))}function C(t,e){return T(t.toString(16).padStart(2*e,"0"))}function Z(t,e){return C(t,e).reverse()}function j(t,e,n){let r;if("string"==typeof e)try{r=T(e)}catch(i){throw new Error(t+" must be hex string or Uint8Array, cause: "+i)}else{if(!v(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 V(...t){let e=0;for(let r=0;r<t.length;r++){const n=t[r];x(n),e+=n.length}const n=new Uint8Array(e);for(let r=0,o=0;r<t.length;r++){const e=t[r];n.set(e,o),o+=e.length}return n}const _=t=>"bigint"==typeof t&&E<=t;function D(t,e,n){return _(t)&&_(e)&&_(n)&&e<=t&&t<n}function K(t,e,n,r){if(!D(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function M(t){let e;for(e=0;t>E;t>>=b,e+=1);return e}const G=t=>(B<<BigInt(t-1))-b,W=t=>new Uint8Array(t),Y=t=>Uint8Array.from(t);function J(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=W(t),o=W(t),i=0;const s=()=>{r.fill(1),o.fill(0),i=0},f=(...t)=>n(o,r,...t),a=(t=W())=>{o=f(Y([0]),t),r=f(),0!==t.length&&(o=f(Y([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 V(...n)};return(t,e)=>{let n;for(s(),a(t);!(n=e(u()));)a();return s(),n}}const Q={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||v(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 X(t,e,n={}){const r=(e,n,r)=>{const o=Q[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 invalid. 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 $(t){const e=new WeakMap;return(n,...r)=>{const o=e.get(n);if(void 0!==o)return o;const i=t(n,...r);return e.set(n,i),i}}const tt=Object.freeze(Object.defineProperty({__proto__:null,aInRange:K,abool:S,abytes:x,bitGet:function(t,e){return t>>BigInt(e)&b},bitLen:M,bitMask:G,bitSet:function(t,e,n){return t|(n?b:E)<<BigInt(e)},bytesToHex:A,bytesToNumberBE:P,bytesToNumberLE:F,concatBytes:V,createHmacDrbg:J,ensureBytes:j,equalBytes:function(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return 0===n},hexToBytes:T,hexToNumber:R,inRange:D,isBytes:v,memoized:$,notImplemented:()=>{throw new Error("not implemented")},numberToBytesBE:C,numberToBytesLE:Z,numberToHexUnpadded:O,numberToVarBytesBE:function(t){return T(O(t))},utf8ToBytes:function(t){if("string"!=typeof t)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(t))},validateObject:X},Symbol.toStringTag,{value:"Module"}));class et extends t{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,f(t);const n=r(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 o=this.blockLen,i=new Uint8Array(o);i.set(n.length>o?t.create().update(n).digest():n);for(let r=0;r<i.length;r++)i[r]^=54;this.iHash.update(i),this.oHash=t.create();for(let r=0;r<i.length;r++)i[r]^=106;this.oHash.update(i),i.fill(0)}update(t){return n(this),this.iHash.update(t),this}digestInto(t){n(this),a(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}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const nt=(t,e,n)=>new et(t,e).update(n).digest();nt.create=(t,e)=>new et(t,e);
3/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
4const rt=BigInt(0),ot=BigInt(1),it=BigInt(2),st=BigInt(3),ft=BigInt(4),at=BigInt(5),ut=BigInt(8);function ct(t,e){const n=t%e;return n>=rt?n:e+n}function ht(t,e,n){if(e<rt)throw new Error("invalid exponent, negatives unsupported");if(n<=rt)throw new Error("invalid modulus");if(n===ot)return rt;let r=ot;for(;e>rt;)e&ot&&(r=r*t%n),t=t*t%n,e>>=ot;return r}function lt(t,e,n){let r=t;for(;e-- >rt;)r*=r,r%=n;return r}function dt(t,e){if(t===rt)throw new Error("invert: expected non-zero number");if(e<=rt)throw new Error("invert: expected positive modulus, got "+e);let n=ct(t,e),r=e,o=rt,i=ot;for(;n!==rt;){const t=r%n,e=o-i*(r/n);r=n,n=t,o=i,i=e}if(r!==ot)throw new Error("invert: does not exist");return ct(o,e)}function gt(t){if(t%ft===st){const e=(t+ot)/ft;return function(t,n){const r=t.pow(n,e);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}}if(t%ut===at){const e=(t-at)/ut;return function(t,n){const r=t.mul(n,it),o=t.pow(r,e),i=t.mul(n,o),s=t.mul(t.mul(i,it),o),f=t.mul(i,t.sub(s,t.ONE));if(!t.eql(t.sqr(f),n))throw new Error("Cannot find square root");return f}}return function(t){const e=(t-ot)/it;let n,r,o;for(n=t-ot,r=0;n%it===rt;n/=it,r++);for(o=it;o<t&&ht(o,e,t)!==t-ot;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===r){const e=(t+ot)/ft;return function(t,n){const r=t.pow(n,e);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}}const i=(n+ot)/it;return function(t,s){if(t.pow(s,e)===t.neg(t.ONE))throw new Error("Cannot find square root");let f=r,a=t.pow(t.mul(t.ONE,o),n),u=t.pow(s,i),c=t.pow(s,n);for(;!t.eql(c,t.ONE);){if(t.eql(c,t.ZERO))return t.ZERO;let e=1;for(let r=t.sqr(c);e<f&&!t.eql(r,t.ONE);e++)r=t.sqr(r);const n=t.pow(a,ot<<BigInt(f-e-1));a=t.sqr(n),u=t.mul(u,n),c=t.mul(c,a),f=e}return u}}(t)}const wt=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function pt(t,e){const n=void 0!==e?e:t.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function yt(t,e,n=!1,r={}){if(t<=rt)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:o,nByteLength:i}=pt(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:G(o),ZERO:rt,ONE:ot,create:e=>ct(e,t),isValid:e=>{if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return rt<=e&&e<t},is0:t=>t===rt,isOdd:t=>(t&ot)===ot,neg:e=>ct(-e,t),eql:(t,e)=>t===e,sqr:e=>ct(e*e,t),add:(e,n)=>ct(e+n,t),sub:(e,n)=>ct(e-n,t),mul:(e,n)=>ct(e*n,t),pow:(t,e)=>function(t,e,n){if(n<rt)throw new Error("invalid exponent, negatives unsupported");if(n===rt)return t.ONE;if(n===ot)return e;let r=t.ONE,o=e;for(;n>rt;)n&ot&&(r=t.mul(r,o)),o=t.sqr(o),n>>=ot;return r}(f,t,e),div:(e,n)=>ct(e*dt(n,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>dt(e,t),sqrt:r.sqrt||(e=>(s||(s=gt(t)),s(f,e))),invertBatch:t=>function(t,e){const n=new Array(e.length),r=e.reduce((e,r,o)=>t.is0(r)?e:(n[o]=e,t.mul(e,r)),t.ONE),o=t.inv(r);return e.reduceRight((e,r,o)=>t.is0(r)?e:(n[o]=t.mul(e,n[o]),t.mul(e,r)),o),n}(f,t),cmov:(t,e,n)=>n?e:t,toBytes:t=>n?Z(t,i):C(t,i),fromBytes:t=>{if(t.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+t.length);return n?F(t):P(t)}});return Object.freeze(f)}function mt(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 Et(t){const e=mt(t);return e+Math.ceil(e/2)}
5/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
6const bt=BigInt(0),Bt=BigInt(1);function vt(t,e){const n=e.negate();return t?n:e}function xt(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function St(t,e){xt(t,e);return{windows:Math.ceil(e/t)+1,windowSize:2**(t-1)}}const It=new WeakMap,At=new WeakMap;function Ot(t){return At.get(t)||1}function Rt(t,e,n,r){if(function(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)})}(n,t),function(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)})}(r,e),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const o=t.ZERO,i=M(BigInt(n.length)),s=i>12?i-3:i>4?i-2:i?2:1,f=(1<<s)-1,a=new Array(f+1).fill(o);let u=o;for(let c=Math.floor((e.BITS-1)/s)*s;c>=0;c-=s){a.fill(o);for(let e=0;e<r.length;e++){const t=r[e],o=Number(t>>BigInt(c)&BigInt(f));a[o]=a[o].add(n[e])}let t=o;for(let e=a.length-1,n=o;e>0;e--)n=n.add(a[e]),t=t.add(n);if(u=u.add(t),0!==c)for(let e=0;e<s;e++)u=u.double()}return u}function qt(t){return X(t.Fp,wt.reduce((t,e)=>(t[e]="function",t),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),X(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...pt(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}
7/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Nt(t){void 0!==t.lowS&&S("lowS",t.lowS),void 0!==t.prehash&&S("prehash",t.prehash)}const{bytesToNumberBE:Lt,hexToBytes:Ht}=tt;class Ut extends Error{constructor(t=""){super(t)}}const kt={Err:Ut,_tlv:{encode:(t,e)=>{const{Err:n}=kt;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=O(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const i=r>127?O(o.length/2|128):"";return O(t)+i+o+e},decode(t,e){const{Err:n}=kt;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}=kt;if(t<zt)throw new e("integer: negative integers are not allowed");let n=O(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}=kt;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 Lt(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=kt,o="string"==typeof t?Ht(t):t;x(o);const{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}=kt,r=e.encode(2,n.encode(t.r))+e.encode(2,n.encode(t.s));return e.encode(48,r)}},zt=BigInt(0),Tt=BigInt(1);BigInt(2);const Pt=BigInt(3);function Ft(t){const e=function(t){const e=qt(t);X(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:o}=e;if(n){if(!r.eql(o,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if("object"!=typeof n||"bigint"!=typeof n.beta||"function"!=typeof n.splitScalar)throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}(t),{Fp:n}=e,r=yt(e.n,e.nBitLength),o=e.toBytes||((t,e,r)=>{const o=e.toAffine();return V(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)}if(!n.eql(n.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function f(t){const{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:o,n:i}=e;if(n&&"bigint"!=typeof t){if(v(t)&&(t=A(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:P(j("private key",t,r))}catch(f){throw new Error("invalid private key, expected hex or "+r+" bytes, got "+typeof t)}return o&&(s=ct(s,i)),K("private key",s,Tt,i),s}function a(t){if(!(t instanceof h))throw new Error("ProjectivePoint expected")}const u=$((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}}),c=$(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");const i=n.sqr(o),f=s(r);if(!n.eql(i,f))throw new Error("bad point: equation left != right");
vendor: 5,006 bytes, line 7
7if(!t.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class h{constructor(t,e,r){if(this.px=t,this.py=e,this.pz=r,null==t||!n.isValid(t))throw new Error("x required");if(null==e||!n.isValid(e))throw new Error("y required");if(null==r||!n.isValid(r))throw new Error("z required");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 h)throw new Error("projective point not allowed");const o=t=>n.eql(t,n.ZERO);return o(e)&&o(r)?h.ZERO:new h(e,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){const e=n.invertBatch(t.map(t=>t.pz));return t.map((t,n)=>t.toAffine(e[n])).map(h.fromAffine)}static fromHex(t){const e=h.fromAffine(i(j("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return h.BASE.multiply(f(t))}static msm(t,e){return Rt(h,r,t,e)}_setWindowSize(t){d.setWindowSize(this,t)}assertValidity(){c(this)}hasEvenY(){const{y:t}=this.toAffine();if(n.isOdd)return!n.isOdd(t);throw new Error("Field doesn't support isOdd")}equals(t){a(t);const{px:e,py:r,pz:o}=this,{px:i,py:s,pz:f}=t,u=n.eql(n.mul(e,f),n.mul(i,o)),c=n.eql(n.mul(r,f),n.mul(s,o));return u&&c}negate(){return new h(this.px,n.neg(this.py),this.pz)}double(){const{a:t,b:r}=e,o=n.mul(r,Pt),{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),g=n.mul(f,f),w=n.mul(i,s);return w=n.add(w,w),c=n.mul(i,f),c=n.add(c,c),a=n.mul(t,c),u=n.mul(o,g),u=n.add(a,u),a=n.sub(d,u),u=n.add(d,u),u=n.mul(a,u),a=n.mul(w,a),c=n.mul(o,c),g=n.mul(t,g),w=n.sub(l,g),w=n.mul(t,w),w=n.add(w,c),c=n.add(l,l),l=n.add(c,l),l=n.add(l,g),l=n.mul(l,w),u=n.add(u,l),g=n.mul(s,f),g=n.add(g,g),l=n.mul(g,w),a=n.sub(a,l),c=n.mul(g,d),c=n.add(c,c),c=n.add(c,c),new h(a,u,c)}add(t){a(t);const{px:r,py:o,pz:i}=this,{px:s,py:f,pz:u}=t;let c=n.ZERO,l=n.ZERO,d=n.ZERO;const g=e.a,w=n.mul(e.b,Pt);let p=n.mul(r,s),y=n.mul(o,f),m=n.mul(i,u),E=n.add(r,o),b=n.add(s,f);E=n.mul(E,b),b=n.add(p,y),E=n.sub(E,b),b=n.add(r,i);let B=n.add(s,u);return b=n.mul(b,B),B=n.add(p,m),b=n.sub(b,B),B=n.add(o,i),c=n.add(f,u),B=n.mul(B,c),c=n.add(y,m),B=n.sub(B,c),d=n.mul(g,b),c=n.mul(w,m),d=n.add(c,d),c=n.sub(y,d),d=n.add(y,d),l=n.mul(c,d),y=n.add(p,p),y=n.add(y,p),m=n.mul(g,m),b=n.mul(w,b),y=n.add(y,m),m=n.sub(p,m),m=n.mul(g,m),b=n.add(b,m),p=n.mul(y,b),l=n.add(l,p),p=n.mul(B,b),c=n.mul(E,c),c=n.sub(c,p),p=n.mul(E,y),d=n.mul(B,d),d=n.add(d,p),new h(c,l,d)}subtract(t){return this.add(t.negate())}is0(){return this.equals(h.ZERO)}wNAF(t){return d.wNAFCached(this,t,h.normalizeZ)}multiplyUnsafe(t){const{endo:r,n:o}=e;K("scalar",t,zt,o);const i=h.ZERO;if(t===zt)return i;if(this.is0()||t===Tt)return this;if(!r||d.hasPrecomputes(this))return d.wNAFCachedUnsafe(this,t,h.normalizeZ);let{k1neg:s,k1:f,k2neg:a,k2:u}=r.splitScalar(t),c=i,l=i,g=this;for(;f>zt||u>zt;)f&Tt&&(c=c.add(g)),u&Tt&&(l=l.add(g)),g=g.double(),f>>=Tt,u>>=Tt;return s&&(c=c.negate()),a&&(l=l.negate()),l=new h(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(K("scalar",t,Tt,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:g}=this.wNAF(a);u=d.constTimeNegate(e,u),l=d.constTimeNegate(f,l),l=new h(n.mul(l.px,r.beta),l.py,l.pz),i=u.add(l),s=c.add(g)}else{const{p:e,f:n}=this.wNAF(t);i=e,s=n}return h.normalizeZ([i,s])[0]}multiplyAndAddUnsafe(t,e,n){const r=h.BASE,o=(t,e)=>e!==zt&&e!==Tt&&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 u(this,t)}isTorsionFree(){const{h:t,isTorsionFree:n}=e;if(t===Tt)return!0;if(n)return n(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:t,clearCofactor:n}=e;return t===Tt?this:n?n(h,this):this.multiplyUnsafe(e.h)}toRawBytes(t=!0){return S("isCompressed",t),this.assertValidity(),o(h,this,t)}toHex(t=!0){return S("isCompressed",t),A(this.toRawBytes(t))}}h.BASE=new h(e.Gx,e.Gy,n.ONE),h.ZERO=new h(n.ZERO,n.ONE,n.ZERO);const l=e.nBitLength,d=(g=h,w=e.endo?Math.ceil(l/2):l,{constTimeNegate:vt,hasPrecomputes:t=>1!==Ot(t),unsafeLadder(t,e,n=g.ZERO){let r=t;for(;e>bt;)e&Bt&&(n=n.add(r)),r=r.double(),e>>=Bt;return n},precomputeWindow(t,e){const{windows:n,windowSize:r}=St(e,w),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){const{windows:r,windowSize:o}=St(t,w);let i=g.ZERO,s=g.BASE;const f=BigInt(2**t-1),a=2**t,u=BigInt(t);for(let c=0;c<r;c++){const t=c*o;let r=Number(n&f);n>>=u,r>o&&(r-=a,n+=Bt);const h=t,l=t+Math.abs(r)-1,d=c%2!=0,g=r<0;0===r?s=s.add(vt(d,e[h])):i=i.add(vt(g,e[l]))}return{p:i,f:s}},wNAFUnsafe(t,e,n,r=g.ZERO){const{windows:o,windowSize:i}=St(t,w),s=BigInt(2**t-1),f=2**t,a=BigInt(t);for(let u=0;u<o;u++){const t=u*i;if(n===bt)break;let o=Number(n&s);if(n>>=a,o>i&&(o-=f,n+=Bt),0===o)continue;let c=e[t+Math.abs(o)-1];o<0&&(c=c.negate()),r=r.add(c)}return r}
vendor: 7,485 bytes, lines 7-10
7,getPrecomputes(t,e,n){let r=It.get(e);return r||(r=this.precomputeWindow(e,t),1!==t&&It.set(e,n(r))),r},wNAFCached(t,e,n){const r=Ot(t);return this.wNAF(r,this.getPrecomputes(r,t,n),e)},wNAFCachedUnsafe(t,e,n,r){const o=Ot(t);return 1===o?this.unsafeLadder(t,e,r):this.wNAFUnsafe(o,this.getPrecomputes(o,t,n),e,r)},setWindowSize(t,e){xt(e,w),At.set(t,e),It.delete(t)}});var g,w;return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:f,weierstrassEquation:s,isWithinCurveOrder:function(t){return D(t,Tt,e.n)}}}function Ct(t){const e=function(t){const e=qt(t);return X(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}(t),{Fp:n,n:r}=e,o=n.BYTES+1,i=2*n.BYTES+1;function s(t){return ct(t,r)}function f(t){return dt(t,r)}const{ProjectivePoint:a,normPrivateKeyToScalar:u,weierstrassEquation:c,isWithinCurveOrder:h}=Ft({...e,toBytes(t,e,r){const o=e.toAffine(),i=n.toBytes(o.x),s=V;return S("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],s=t.subarray(1);if(e!==o||2!==r&&3!==r){if(e===i&&4===r){return{x:n.fromBytes(s.subarray(0,n.BYTES)),y:n.fromBytes(s.subarray(n.BYTES,2*n.BYTES))}}throw new Error("invalid Point, expected length of "+o+", or uncompressed "+i+", got "+e)}{const t=P(s);if(!D(t,Tt,n.ORDER))throw new Error("Point is not on curve");const e=c(t);let o;try{o=n.sqrt(e)}catch(f){const t=f instanceof Error?": "+f.message:"";throw new Error("Point is not on curve"+t)}return!(1&~r)!==((o&Tt)===Tt)&&(o=n.neg(o)),{x:t,y:o}}}}),l=t=>A(C(t,e.nByteLength));function d(t){return t>r>>Tt}const g=(t,e,n)=>P(t.slice(e,n));class w{constructor(t,e,n){this.r=t,this.s=e,this.recovery=n,this.assertValidity()}static fromCompact(t){const n=e.nByteLength;return t=j("compactSignature",t,2*n),new w(g(t,0,n),g(t,n,2*n))}static fromDER(t){const{r:e,s:n}=kt.toSig(j("DER",t));return new w(e,n)}assertValidity(){K("r",this.r,Tt,r),K("s",this.s,Tt,r)}addRecoveryBit(t){return new w(this.r,this.s,t)}recoverPublicKey(t){const{r:r,s:o,recovery:i}=this,u=E(j("msgHash",t));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const c=2===i||3===i?r+e.n:r;if(c>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const h=1&i?"03":"02",d=a.fromHex(h+l(c)),g=f(c),w=s(-u*g),p=s(o*g),y=a.BASE.multiplyAndAddUnsafe(d,w,p);if(!y)throw new Error("point at infinify");return y.assertValidity(),y}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new w(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return T(this.toDERHex())}toDERHex(){return kt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return T(this.toCompactHex())}toCompactHex(){return l(this.r)+l(this.s)}}const p={isValidPrivateKey(t){try{return u(t),!0}catch(e){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const t=Et(e.n);return function(t,e,n=!1){const r=t.length,o=mt(e),i=Et(e);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const s=ct(n?F(t):P(t),e-ot)+ot;return n?Z(s,o):C(s,o)}(e.randomBytes(t),e.n)},precompute:(t=8,e=a.BASE)=>(e._setWindowSize(t),e.multiply(BigInt(3)),e)};function y(t){const e=v(t),n="string"==typeof t,r=(e||n)&&t.length;return e?r===o||r===i:n?r===2*o||r===2*i:t instanceof a}const m=e.bits2int||function(t){if(t.length>8192)throw new Error("input is too large");const n=P(t),r=8*t.length-e.nBitLength;return r>0?n>>BigInt(r):n},E=e.bits2int_modN||function(t){return s(m(t))},b=G(e.nBitLength);function B(t){return K("num < 2^"+e.nBitLength,t,zt,b),C(t,e.nByteLength)}function x(t,r,o=I){if(["recovered","canonical"].some(t=>t in o))throw new Error("sign() legacy options not supported");const{hash:i,randomBytes:c}=e;let{lowS:l,prehash:g,extraEntropy:p}=o;null==l&&(l=!0),t=j("msgHash",t),Nt(o),g&&(t=j("prehashed msgHash",i(t)));const y=E(t),b=u(r),v=[B(b),B(y)];if(null!=p&&!1!==p){const t=!0===p?c(n.BYTES):p;v.push(j("extraEntropy",t))}const x=V(...v),S=y;return{seed:x,k2sig:function(t){const e=m(t);if(!h(e))return;const n=f(e),r=a.BASE.multiply(e).toAffine(),o=s(r.x);if(o===zt)return;const i=s(n*s(S+o*b));if(i===zt)return;let u=(r.x===o?0:2)|Number(r.y&Tt),c=i;return l&&d(i)&&(c=function(t){return d(t)?s(-t):t}(i),u^=1),new w(o,c,u)}}}const I={lowS:e.lowS,prehash:!1},O={lowS:e.lowS,prehash:!1};return a.BASE._setWindowSize(8),{CURVE:e,getPublicKey:function(t,e=!0){return a.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e,n=!0){if(y(t))throw new Error("first arg must be private key");if(!y(e))throw new Error("second arg must be public key");return a.fromHex(e).multiply(u(t)).toRawBytes(n)},sign:function(t,n,r=I){const{seed:o,k2sig:i}=x(t,n,r),s=e;return J(s.hash.outputLen,s.nByteLength,s.hmac)(o,i)},verify:function(t,n,r,o=O){var i;const u=t;n=j("msgHash",n),r=j("publicKey",r);const{lowS:c,prehash:h,format:l}=o;if(Nt(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 d="string"==typeof u||v(u),g=!d&&!l&&"object"==typeof u&&null!==u&&"bigint"==typeof u.r&&"bigint"==typeof u.s;if(!d&&!g)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let p,y;try{if(g&&(p=new w(u.r,u.s)),d){try{"compact"!==l&&(p=w.fromDER(u))}catch(R){if(!(R instanceof kt.Err))throw R}p||"der"===l||(p=w.fromCompact(u))}y=a.fromHex(r)}catch(q){return!1}if(!p)return!1;if(c&&p.hasHighS())return!1;h&&(n=e.hash(n));const{r:m,s:b}=p,B=E(n),x=f(b),S=s(B*x),I=s(m*x),A=null==(i=a.BASE.multiplyAndAddUnsafe(y,S,I))?void 0:i.toAffine();return!!A&&s(A.x)===m},ProjectivePoint:a,Signature:w,utils:p}}
8/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Zt(t){return{hash:t,hmac:(e,...n)=>nt(t,e,c(...n)),randomBytes:u}}BigInt(4);
9/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
10const jt=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Vt=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_t=BigInt(1),Dt=BigInt(2),Kt=(t,e)=>(t+e/Dt)/e;const Mt=yt(jt,void 0,void 0,{sqrt:function(t){const e=jt,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,h=lt(c,n,e)*c%e,l=lt(h,n,e)*c%e,d=lt(l,Dt,e)*u%e,g=lt(d,o,e)*d%e,w=lt(g,i,e)*g%e,p=lt(w,f,e)*w%e,y=lt(p,a,e)*p%e,m=lt(y,f,e)*w%e,E=lt(m,n,e)*c%e,b=lt(E,s,e)*g%e,B=lt(b,r,e)*u%e,v=lt(B,Dt,e);if(!Mt.eql(Mt.sqr(v),t))throw new Error("Cannot find square root");return v}}),Gt=function(t,e){const n=e=>Ct({...t,...Zt(e)});return{...n(e),create:n}}({a:BigInt(0),b:BigInt(7),Fp:Mt,n:Vt,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=Vt,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-_t*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,s=BigInt("0x100000000000000000000000000000000"),f=Kt(i*t,e),a=Kt(-r*t,e);let u=ct(t-f*n-a*o,e),c=ct(-f*r-a*i,e);const h=u>s,l=c>s;if(h&&(u=e-u),l&&(c=e-c),u>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:u,k2neg:l,k2:c}}}},m);BigInt(0),Gt.ProjectivePoint;export{Gt as secp256k1}
vendor: 2 bytes, line 10
10;

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.