@smartledger/bsv 6.0.1 → 6.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +38 -38
- package/bsv-covenant.min.js +1 -1
- package/bsv-gdaf.min.js +1 -1
- package/bsv-ltp.min.js +1 -1
- package/bsv-smartcontract.min.js +1 -1
- package/bsv.bundle.js +1 -1
- package/bsv.d.ts +1 -1
- package/bsv.min.js +1 -1
- package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
- package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
- package/docs/getting-started/INSTALLATION.md +23 -23
- package/docs/getting-started/QUICK_START.md +7 -7
- package/docs/migration/FROM_BSV_1_5_6.md +5 -5
- package/package.json +4 -1
- package/test/security/fail_closed_contracts.js +100 -0
package/bsv.min.js
CHANGED
|
@@ -42,4 +42,4 @@ const re=BigInt(0),ie=BigInt(1);function ne(e,t){const r=t.negate();return e?r:t
|
|
|
42
42
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
43
43
|
const ge=(e,t)=>(e+(e>=0?t:-t)/Se)/t;function me(e){if(!["compact","recovered","der"].includes(e))throw new Error('Signature format must be "compact", "recovered", or "der"');return e}function ye(e,t){A(e);const r={};for(let i of Object.keys(t))r[i]=void 0===e[i]?t[i]:e[i];return d(r.lowS,"lowS"),d(r.prehash,"prehash"),void 0!==r.format&&me(r.format),r}class ve extends Error{constructor(e=""){super(e)}}const be={Err:ve,_tlv:{encode:(e,t)=>{const{Err:r}=be;if(m(e,"tag"),e<0||e>255)throw new r("tlv.encode: wrong tag");if("string"!=typeof t)throw new TypeError('"data" expected string, got type='+typeof t);if(1&t.length)throw new r("tlv.encode: unpadded data");const i=t.length/2,n=y(i);if(n.length/2&128)throw new r("tlv.encode: long form length too big");const o=i>127?y(n.length/2|128):"";return y(e)+o+n+t},decode(e,t){const{Err:r}=be;t=o(t,void 0,"DER data");let i=0;if(e<0||e>255)throw new r("tlv.encode: wrong tag");if(t.length<2||t[i++]!==e)throw new r("tlv.decode: wrong tlv");const n=t[i++];let a=0;if(!!(128&n)){const e=127&n;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");const o=t.subarray(i,i+e);if(o.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===o[0])throw new r("tlv.decode(long): zero leftmost byte");for(const e of o)a=a<<8|e;if(i+=e,a<128)throw new r("tlv.decode(long): not minimal encoding")}else a=n;const s=t.subarray(i,i+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(i+a)}}},_int:{encode(e){const{Err:t}=be;if(g(e),e<_e)throw new t("integer: negative integers are not allowed");let r=y(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){const{Err:t}=be;if(e.length<1)throw new t("invalid signature integer: empty");if(128&e[0])throw new t("invalid signature integer: negative");if(e.length>1&&0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return b(e)}},toSig(e){const{Err:t,_int:r,_tlv:i}=be,n=o(e,void 0,"signature"),{v:a,l:s}=i.decode(48,n);if(s.length)throw new t("invalid signature: left bytes after parsing");const{v:u,l:c}=i.decode(2,a),{v:h,l}=i.decode(2,c);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(u),s:r.decode(h)}},hexFromSig(e){const{_tlv:t,_int:r}=be,i=t.encode(2,r.encode(e.r))+t.encode(2,r.encode(e.s));return t.encode(48,i)}};Object.freeze(be._tlv),Object.freeze(be._int),Object.freeze(be);const _e=BigInt(0),we=BigInt(1),Se=BigInt(2),Ee=BigInt(3),ke=BigInt(4);function Oe(e,t={}){const r=function(e,t,r={},i){if(void 0===i&&(i="edwards"===e),!t||"object"!=typeof t)throw new Error(`expected valid ${e} CURVE object`);for(const e of["p","n","h"]){const r=t[e];if(!("bigint"==typeof r&&r>re))throw new Error(`CURVE.${e} must be positive bigint`)}const n=de(t.p,r.Fp,i),o=de(t.n,r.Fn,i),a=["Gx","Gy","a","weierstrass"===e?"b":"d"];for(const e of a)if(!n.isValid(t[e]))throw new Error(`CURVE.${e} must be valid field element of CURVE.Fp`);return{CURVE:t=Object.freeze(Object.assign({},t)),Fp:n,Fn:o}}("weierstrass",e,t),i=r.Fp,n=r.Fn;let a=r.CURVE;const{h,n:l}=a;A(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object"});const{endo:f,allowInfinityPoint:p}=t;if(f&&(!i.is0(a.a)||"bigint"!=typeof f.beta||!Array.isArray(f.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const g=Ae(i,n);function m(){if(!i.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}const y=void 0===t.toBytes?function(e,t,r){if(p&&t.is0())return Uint8Array.of(0);const{x:n,y:o}=t.toAffine(),a=i.toBytes(n);if(d(r,"isCompressed"),r){m();const e=!i.isOdd(o);return u(Ie(e),a)}return u(Uint8Array.of(4),a,i.toBytes(o))}:t.toBytes,v=void 0===t.fromBytes?function(e){o(e,void 0,"Point");const{publicKey:t,publicKeyUncompressed:r}=g,n=e.length,a=e[0],s=e.subarray(1);if(p&&1===n&&0===a)return{x:i.ZERO,y:i.ZERO};if(n!==t||2!==a&&3!==a){if(n===r&&4===a){const e=i.BYTES,t=i.fromBytes(s.subarray(0,e)),r=i.fromBytes(s.subarray(e,2*e));if(!_(t,r))throw new Error("bad point: is not on curve");return{x:t,y:r}}throw new Error(`bad point: got length ${n}, expected compressed=${t} or uncompressed=${r}`)}{const e=i.fromBytes(s);if(!i.isValid(e))throw new Error("bad point: is not on curve, wrong x");const t=b(e);let r;try{r=i.sqrt(t)}catch(e){const t=e instanceof Error?": "+e.message:"";throw new Error("bad point: is not on curve, sqrt error"+t)}m();return!(1&~a)!==i.isOdd(r)&&(r=i.neg(r)),{x:e,y:r}}}:t.fromBytes;function b(e){const t=i.sqr(e),r=i.mul(t,e);return i.add(i.add(r,i.mul(e,a.a)),a.b)}function _(e,t){const r=i.sqr(t),n=b(e);return i.eql(r,n)}if(!_(a.Gx,a.Gy))throw new Error("bad curve params: generator point");const w=i.mul(i.pow(a.a,Ee),ke),S=i.mul(i.sqr(a.b),BigInt(27));if(i.is0(i.add(w,S)))throw new Error("bad curve params: a or b");function E(e,t,r=!1){if(!i.isValid(t)||r&&i.is0(t))throw new Error(`bad point coordinate ${e}`);return t}function P(e){if(!(e instanceof R))throw new Error("Weierstrass Point expected")}function x(e){if(!f||!f.basises)throw new Error("no endo");return function(e,t,r){k("scalar",e,_e,r);const[[i,n],[o,a]]=t,s=ge(a*e,r),u=ge(-n*e,r);let c=e-s*i-u*o,h=-s*n-u*a;const l=c<_e,f=h<_e;l&&(c=-c),f&&(h=-h);const p=I(Math.ceil(O(r)/2))+we;if(c<_e||c>=p||h<_e||h>=p)throw new Error("splitScalar (endomorphism): failed for k");return{k1neg:l,k1:c,k2neg:f,k2:h}}(e,f.basises,n.ORDER)}function T(e,t,r,n,o){return r=new R(i.mul(r.X,e),r.Y,r.Z),t=ne(n,t),r=ne(o,r),t.add(r)}class R{static BASE=new R(a.Gx,a.Gy,i.ONE);static ZERO=new R(i.ZERO,i.ONE,i.ZERO);static Fp=i;static Fn=n;X;Y;Z;constructor(e,t,r){this.X=E("x",e),this.Y=E("y",t,!0),this.Z=E("z",r),Object.freeze(this)}static CURVE(){return a}static fromAffine(e){const{x:t,y:r}=e||{};if(!e||!i.isValid(t)||!i.isValid(r))throw new Error("invalid affine point");if(e instanceof R)throw new Error("projective point not allowed");return i.is0(t)&&i.is0(r)?R.ZERO:new R(t,r,i.ONE)}static fromBytes(e){const t=R.fromAffine(v(o(e,void 0,"point")));return t.assertValidity(),t}static fromHex(e){return R.fromBytes(c(e))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(e=8,t=!0){return B.createCache(this,e),t||this.multiply(Ee),this}assertValidity(){const e=this;if(e.is0()){if(t.allowInfinityPoint&&i.is0(e.X)&&i.eql(e.Y,i.ONE)&&i.is0(e.Z))return;throw new Error("bad point: ZERO")}const{x:r,y:n}=e.toAffine();if(!i.isValid(r)||!i.isValid(n))throw new Error("bad point: x or y not field elements");if(!_(r,n))throw new Error("bad point: equation left != right");if(!e.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:e}=this.toAffine();if(!i.isOdd)throw new Error("Field doesn't support isOdd");return!i.isOdd(e)}equals(e){P(e);const{X:t,Y:r,Z:n}=this,{X:o,Y:a,Z:s}=e,u=i.eql(i.mul(t,s),i.mul(o,n)),c=i.eql(i.mul(r,s),i.mul(a,n));return u&&c}negate(){return new R(this.X,i.neg(this.Y),this.Z)}double(){const{a:e,b:t}=a,r=i.mul(t,Ee),{X:n,Y:o,Z:s}=this;let u=i.ZERO,c=i.ZERO,h=i.ZERO,l=i.mul(n,n),f=i.mul(o,o),p=i.mul(s,s),d=i.mul(n,o);return d=i.add(d,d),h=i.mul(n,s),h=i.add(h,h),u=i.mul(e,h),c=i.mul(r,p),c=i.add(u,c),u=i.sub(f,c),c=i.add(f,c),c=i.mul(u,c),u=i.mul(d,u),h=i.mul(r,h),p=i.mul(e,p),d=i.sub(l,p),d=i.mul(e,d),d=i.add(d,h),h=i.add(l,l),l=i.add(h,l),l=i.add(l,p),l=i.mul(l,d),c=i.add(c,l),p=i.mul(o,s),p=i.add(p,p),l=i.mul(p,d),u=i.sub(u,l),h=i.mul(p,f),h=i.add(h,h),h=i.add(h,h),new R(u,c,h)}add(e){P(e);const{X:t,Y:r,Z:n}=this,{X:o,Y:s,Z:u}=e;let c=i.ZERO,h=i.ZERO,l=i.ZERO;const f=a.a,p=i.mul(a.b,Ee);let d=i.mul(t,o),g=i.mul(r,s),m=i.mul(n,u),y=i.add(t,r),v=i.add(o,s);y=i.mul(y,v),v=i.add(d,g),y=i.sub(y,v),v=i.add(t,n);let b=i.add(o,u);return v=i.mul(v,b),b=i.add(d,m),v=i.sub(v,b),b=i.add(r,n),c=i.add(s,u),b=i.mul(b,c),c=i.add(g,m),b=i.sub(b,c),l=i.mul(f,v),c=i.mul(p,m),l=i.add(c,l),c=i.sub(g,l),l=i.add(g,l),h=i.mul(c,l),g=i.add(d,d),g=i.add(g,d),m=i.mul(f,m),v=i.mul(p,v),g=i.add(g,m),m=i.sub(d,m),m=i.mul(f,m),v=i.add(v,m),d=i.mul(g,v),h=i.add(h,d),d=i.mul(b,v),c=i.mul(y,c),c=i.sub(c,d),d=i.mul(y,g),l=i.mul(b,l),l=i.add(l,d),new R(c,h,l)}subtract(e){return P(e),this.add(e.negate())}is0(){return this.equals(R.ZERO)}multiply(e){const{endo:r}=t;if(!n.isValidNot0(e))throw new RangeError("invalid scalar: out of range");let i,o;const a=e=>B.cached(this,e,e=>oe(R,e));if(r){const{k1neg:t,k1:n,k2neg:s,k2:u}=x(e),{p:c,f:h}=a(n),{p:l,f}=a(u);o=h.add(f),i=T(r.beta,c,l,t,s)}else{const{p:t,f:r}=a(e);i=t,o=r}return oe(R,[i,o])[0]}multiplyUnsafe(e){const{endo:r}=t,i=this,o=e;if(!n.isValid(o))throw new RangeError("invalid scalar: out of range");if(o===_e||i.is0())return R.ZERO;if(o===we)return i;if(B.hasCache(this))return this.multiply(o);if(r){const{k1neg:e,k1:t,k2neg:n,k2:a}=x(o),{p1:s,p2:u}=function(e,t,r,i){let n=t,o=e.ZERO,a=e.ZERO;for(;r>re||i>re;)r&ie&&(o=o.add(n)),i&ie&&(a=a.add(n)),n=n.double(),r>>=ie,i>>=ie;return{p1:o,p2:a}}(R,i,t,a);return T(r.beta,s,u,e,n)}return B.unsafe(i,o)}toAffine(e){let t=e;const{X:r,Y:n,Z:o}=this;if(i.eql(o,i.ONE))return{x:r,y:n};const a=this.is0();null==t&&(t=a?i.ONE:i.inv(o));const s=i.mul(r,t),u=i.mul(n,t),c=i.mul(o,t);if(a)return{x:i.ZERO,y:i.ZERO};if(!i.eql(c,i.ONE))throw new Error("invZ was invalid");return{x:s,y:u}}isTorsionFree(){const{isTorsionFree:e}=t;return h===we||(e?e(R,this):B.unsafe(this,l).is0())}clearCofactor(){const{clearCofactor:e}=t;return h===we?this:e?e(R,this):this.multiplyUnsafe(h)}isSmallOrder(){return h===we?this.is0():this.clearCofactor().is0()}toBytes(e=!0){return d(e,"isCompressed"),this.assertValidity(),y(R,this,e)}toHex(e=!0){return s(this.toBytes(e))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}const M=n.BITS,B=new pe(R,t.endo?Math.ceil(M/2):M);return M>=8&&R.BASE.precompute(8),Object.freeze(R.prototype),Object.freeze(R),R}function Ie(e){return Uint8Array.of(e?2:3)}function Ae(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function Pe(e,t={}){const{Fn:r}=e,i=void 0===t.randomBytes?l:t.randomBytes,n=Object.assign(Ae(e.Fp,r),{seed:Math.max(ee(r.ORDER),16)});function a(e){return e=void 0===e?i(n.seed):e,function(e,t,r=!1){o(e);const i=e.length,n=Q(t),a=Math.max(ee(t),16);if(i<a||i>1024)throw new Error("expected "+a+"-1024 bytes of input, got "+i);const s=j(r?_(e):b(e),t-x)+x;return r?S(s,n):w(s,n)}(o(e,n.seed,"seed"),r.ORDER)}function s(t,i=!0){return e.BASE.multiply(r.fromBytes(t)).toBytes(i)}function u(e){const{secretKey:t,publicKey:i,publicKeyUncompressed:a}=n,s=r._lengths;if(!h(e))return;const u=o(e,void 0,"key").length,c=u===i||u===a,l=u===t||!!s?.includes(u);return c&&l?void 0:c}const c={isValidSecretKey:function(e){try{const t=r.fromBytes(e);return r.isValidNot0(t)}catch(e){return!1}},isValidPublicKey:function(t,r){const{publicKey:i,publicKeyUncompressed:o}=n;try{const n=t.length;return(!0!==r||n===i)&&((!1!==r||n===o)&&!!e.fromBytes(t))}catch(e){return!1}},randomSecretKey:a},f=function(e,t){return function(r){const i=e(r);return{secretKey:i,publicKey:t(i)}}}(a,s);return Object.freeze(c),Object.freeze(n),Object.freeze({getPublicKey:s,getSharedSecret:function(t,i,n=!0){if(!0===u(t))throw new Error("first arg must be private key");if(!1===u(i))throw new Error("second arg must be public key");const o=r.fromBytes(t);return e.fromBytes(i).multiply(o).toBytes(n)},keygen:f,Point:e,utils:c,lengths:n})}function xe(e,t,r={}){const i=t;(0,n.sd)(i),A(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const a=void 0===(r=Object.assign({},r)).randomBytes?l:r.randomBytes,f=void 0===r.hmac?(e,t)=>(0,te.hmac)(i,e,t):r.hmac,{Fp:p,Fn:d}=e,{ORDER:g,BITS:m}=d,{keygen:y,getPublicKey:v,getSharedSecret:_,utils:w,lengths:S}=Pe(e,r),E={prehash:!0,lowS:"boolean"!=typeof r.lowS||r.lowS,format:"compact",extraEntropy:!1},O=g*Se+we<p.ORDER;function P(e){return e>g>>we}function x(e,t){if(!d.isValidNot0(t))throw new Error(`invalid signature ${e}: out of range 1..Point.Fn.ORDER`);return t}function T(){if(O)throw new Error('"recovered" sig type is not supported for cofactor >2 curves')}function R(e,t){me(t);const r=S.signature;return o(e,"compact"===t?r:"recovered"===t?r+1:void 0)}class M{r;s;recovery;constructor(e,t,r){if(this.r=x("r",e),this.s=x("s",t),null!=r){if(T(),![0,1,2,3].includes(r))throw new Error("invalid recovery id");this.recovery=r}Object.freeze(this)}static fromBytes(e,t=E.format){let r;if(R(e,t),"der"===t){const{r:t,s:r}=be.toSig(o(e));return new M(t,r)}"recovered"===t&&(r=e[0],t="compact",e=e.subarray(1));const i=S.signature/2,n=e.subarray(0,i),a=e.subarray(i,2*i);return new M(d.fromBytes(n),d.fromBytes(a),r)}static fromHex(e,t){return this.fromBytes(c(e),t)}assertRecovery(){const{recovery:e}=this;if(null==e)throw new Error("invalid recovery id: must be present");return e}addRecoveryBit(e){return new M(this.r,this.s,e)}recoverPublicKey(t){const{r,s:i}=this,n=this.assertRecovery(),a=2===n||3===n?r+g:r;if(!p.isValid(a))throw new Error("invalid recovery id: sig.r+curve.n != R.x");const s=p.toBytes(a),c=e.fromBytes(u(Ie(!(1&n)),s)),h=d.inv(a),l=C(o(t,void 0,"msgHash")),f=d.create(-l*h),m=d.create(i*h),y=e.BASE.multiplyUnsafe(f).add(c.multiplyUnsafe(m));if(y.is0())throw new Error("invalid recovery: point at infinify");return y.assertValidity(),y}hasHighS(){return P(this.s)}toBytes(e=E.format){if(me(e),"der"===e)return c(be.hexFromSig(this));const{r:t,s:r}=this,i=d.toBytes(t),n=d.toBytes(r);return"recovered"===e?(T(),u(Uint8Array.of(this.assertRecovery()),i,n)):u(i,n)}toHex(e){return s(this.toBytes(e))}}Object.freeze(M.prototype),Object.freeze(M);const B=void 0===r.bits2int?function(e){if(e.length>8192)throw new Error("input is too large");const t=b(e),r=8*e.length-m;return r>0?t>>BigInt(r):t}:r.bits2int,C=void 0===r.bits2int_modN?function(e){return d.create(B(e))}:r.bits2int_modN,N=I(m);function D(e){return k("num < 2^"+m,e,_e,N),d.toBytes(e)}function L(e,t){return o(e,void 0,"message"),t?o(i(e),void 0,"prehashed message"):e}return Object.freeze({keygen:y,getPublicKey:v,getSharedSecret:_,utils:w,lengths:S,Point:e,sign:function(t,r,s={}){const{seed:c,k2sig:h}=function(t,r,i){const{lowS:n,prehash:s,extraEntropy:c}=ye(i,E);t=L(t,s);const h=C(t),l=d.fromBytes(r);if(!d.isValidNot0(l))throw new Error("invalid private key");const f=[D(l),D(h)];if(null!=c&&!1!==c){const e=!0===c?a(S.secretKey):c;f.push(o(e,void 0,"extraEntropy"))}const p=u(...f),g=h;return{seed:p,k2sig:function(t){const r=B(t);if(!d.isValidNot0(r))return;const i=d.inv(r),o=e.BASE.multiply(r).toAffine(),a=d.create(o.x);if(a===_e)return;const s=d.create(i*d.create(g+a*l));if(s===_e)return;let u=(o.x===a?0:2)|Number(o.y&we),c=s;return n&&P(s)&&(c=d.neg(s),u^=1),new M(a,c,O?void 0:u)}}}(t,r,s);return function(e,t,r){if((0,n.Fe)(e,"hashLen"),(0,n.Fe)(t,"qByteLen"),"function"!=typeof r)throw new TypeError("hmacFn must be a function");const i=e=>new Uint8Array(e),o=Uint8Array.of(),a=Uint8Array.of(0),s=Uint8Array.of(1);let c=i(e),h=i(e),l=0;const f=()=>{c.fill(1),h.fill(0),l=0},p=(...e)=>r(h,u(c,...e)),d=(e=o)=>{h=p(a,e),c=p(),0!==e.length&&(h=p(s,e),c=p())},g=()=>{if(l++>=1e3)throw new Error("drbg: tried max amount of iterations");let e=0;const r=[];for(;e<t;){c=p();const t=c.slice();r.push(t),e+=c.length}return u(...r)};return(e,t)=>{let r;for(f(),d(e);void 0===(r=t(g()));)d();return f(),r}}(i.outputLen,d.BYTES,f)(c,h).toBytes(s.format)},verify:function(t,r,i,n={}){const{lowS:a,prehash:s,format:u}=ye(n,E);if(i=o(i,void 0,"publicKey"),r=L(r,s),!h(t)){throw new Error("verify expects Uint8Array signature"+(t instanceof M?", use sig.toBytes()":""))}R(t,u);try{const n=M.fromBytes(t,u),o=e.fromBytes(i);if(a&&n.hasHighS())return!1;const{r:s,s:c}=n,h=C(r),l=d.inv(c),f=d.create(h*l),p=d.create(s*l),g=e.BASE.multiplyUnsafe(f).add(o.multiplyUnsafe(p));if(g.is0())return!1;return d.create(g.x)===s}catch(e){return!1}},recoverPublicKey:function(e,t,r={}){const{prehash:i}=ye(r,E);return t=L(t,i),M.fromBytes(e,"recovered").recoverPublicKey(t).toBytes()},Signature:M,hash:i})}
|
|
44
44
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
45
|
-
const Te={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},Re={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},Me=BigInt(2);const Be=J(Te.p,{sqrt:function(e){const t=Te.p,r=BigInt(3),i=BigInt(6),n=BigInt(11),o=BigInt(22),a=BigInt(23),s=BigInt(44),u=BigInt(88),c=e*e*e%t,h=c*c*e%t,l=U(h,r,t)*h%t,f=U(l,r,t)*h%t,p=U(f,Me,t)*c%t,d=U(p,n,t)*p%t,g=U(d,o,t)*d%t,m=U(g,s,t)*g%t,y=U(m,u,t)*m%t,v=U(y,s,t)*g%t,b=U(v,r,t)*h%t,_=U(b,a,t)*d%t,w=U(_,i,t)*c%t,S=U(w,Me,t);if(!Be.eql(Be.sqr(S),e))throw new Error("Cannot find square root");return S}}),Ce=Oe(Te,{Fp:Be,endo:Re}),Ne=xe(Ce,i.sha256)},7474(e,t,r){"use strict";r.d(t,{hmac:()=>o});var i=r(508);class n{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(e,t){if((0,i.sd)(e),(0,i.DO)(t,void 0,"key"),this.iHash=e.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,n=new Uint8Array(r);n.set(t.length>r?e.create().update(t).digest():t);for(let e=0;e<n.length;e++)n[e]^=54;this.iHash.update(n),this.oHash=e.create();for(let e=0;e<n.length;e++)n[e]^=106;this.oHash.update(n),(0,i.uH)(n)}update(e){return(0,i.CC)(this),this.iHash.update(e),this}digestInto(e){(0,i.CC)(this),(0,i.Ht)(e,this),this.finished=!0;const t=e.subarray(0,this.outputLen);this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});const{oHash:t,iHash:r,finished:i,destroyed:n,blockLen:o,outputLen:a}=this;return e.finished=i,e.destroyed=n,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const o=(()=>{const e=(e,t,r)=>new n(e,t).update(r).digest();return e.create=(e,t)=>new n(e,t),e})()},4544(e,t,r){"use strict";r.d(t,{sha256:()=>L,sha512:()=>j});var i=r(508);function n(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}class a{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,n){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=(0,i.O8)(this.buffer)}update(e){(0,i.CC)(this),(0,i.DO)(e);const{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let a=0;a<o;){const s=Math.min(n-this.pos,o-a);if(s===n){const t=(0,i.O8)(e);for(;n<=o-a;a+=n)this.process(t,a);continue}r.set(e.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,i.CC)(this),(0,i.Ht)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:a}=this;t[a++]=128,(0,i.uH)(this.buffer.subarray(a)),this.padOffset>n-a&&(this.process(r,0),a=0);for(let e=a;e<n;e++)t[e]=0;r.setBigUint64(n-8,BigInt(8*this.length),o),this.process(r,0);const s=(0,i.O8)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const c=u/4,h=this.get();if(c>h.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,h[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||=new this.constructor,e.set(...this.get());const{blockLen:t,buffer:r,length:i,finished:n,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=n,e.length=i,e.pos=a,i%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const s=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),c=BigInt(2**32-1),h=BigInt(32);function l(e,t=!1){return t?{h:Number(e&c),l:Number(e>>h&c)}:{h:0|Number(e>>h&c),l:0|Number(e&c)}}function f(e,t=!1){const r=e.length;let i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){const{h:r,l:a}=l(e[o],t);[i[o],n[o]]=[r,a]}return[i,n]}const p=(e,t,r)=>e>>>r,d=(e,t,r)=>e<<32-r|t>>>r,g=(e,t,r)=>e>>>r|t<<32-r,m=(e,t,r)=>e<<32-r|t>>>r,y=(e,t,r)=>e<<64-r|t>>>r-32,v=(e,t,r)=>e>>>r-32|t<<64-r;function b(e,t,r,i){const n=(t>>>0)+(i>>>0);return{h:e+r+(n/2**32|0)|0,l:0|n}}const _=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),w=(e,t,r,i)=>t+r+i+(e/2**32|0)|0,S=(e,t,r,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0),E=(e,t,r,i,n)=>t+r+i+n+(e/2**32|0)|0,k=(e,t,r,i,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0)+(n>>>0),O=(e,t,r,i,n,o)=>t+r+i+n+o+(e/2**32|0)|0;const I=Uint32Array.from([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]),A=new Uint32Array(64);class P extends a{constructor(e){super(64,e,8,!1)}get(){const{A:e,B:t,C:r,D:i,E:n,F:o,G:a,H:s}=this;return[e,t,r,i,n,o,a,s]}set(e,t,r,i,n,o,a,s){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|o,this.G=0|a,this.H=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)A[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=A[e-15],r=A[e-2],n=(0,i.Ow)(t,7)^(0,i.Ow)(t,18)^t>>>3,o=(0,i.Ow)(r,17)^(0,i.Ow)(r,19)^r>>>10;A[e]=o+A[e-7]+n+A[e-16]|0}let{A:r,B:a,C:s,D:u,E:c,F:h,G:l,H:f}=this;for(let e=0;e<64;e++){const t=f+((0,i.Ow)(c,6)^(0,i.Ow)(c,11)^(0,i.Ow)(c,25))+n(c,h,l)+I[e]+A[e]|0,p=((0,i.Ow)(r,2)^(0,i.Ow)(r,13)^(0,i.Ow)(r,22))+o(r,a,s)|0;f=l,l=h,h=c,c=u+t|0,u=s,s=a,a=r,r=t+p|0}r=r+this.A|0,a=a+this.B|0,s=s+this.C|0,u=u+this.D|0,c=c+this.E|0,h=h+this.F|0,l=l+this.G|0,f=f+this.H|0,this.set(r,a,s,u,c,h,l,f)}roundClean(){(0,i.uH)(A)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),(0,i.uH)(this.buffer)}}class x extends P{A=0|s[0];B=0|s[1];C=0|s[2];D=0|s[3];E=0|s[4];F=0|s[5];G=0|s[6];H=0|s[7];constructor(){super(32)}}const T=(()=>f(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","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(e=>BigInt(e))))(),R=(()=>T[0])(),M=(()=>T[1])(),B=new Uint32Array(80),C=new Uint32Array(80);class N extends a{constructor(e){super(128,e,16,!1)}get(){const{Ah:e,Al:t,Bh:r,Bl:i,Ch:n,Cl:o,Dh:a,Dl:s,Eh:u,El:c,Fh:h,Fl:l,Gh:f,Gl:p,Hh:d,Hl:g}=this;return[e,t,r,i,n,o,a,s,u,c,h,l,f,p,d,g]}set(e,t,r,i,n,o,a,s,u,c,h,l,f,p,d,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|h,this.Fl=0|l,this.Gh=0|f,this.Gl=0|p,this.Hh=0|d,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)B[r]=e.getUint32(t),C[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|B[e-15],r=0|C[e-15],i=g(t,r,1)^g(t,r,8)^p(t,0,7),n=m(t,r,1)^m(t,r,8)^d(t,r,7),o=0|B[e-2],a=0|C[e-2],s=g(o,a,19)^y(o,a,61)^p(o,0,6),u=m(o,a,19)^v(o,a,61)^d(o,a,6),c=S(n,u,C[e-7],C[e-16]),h=E(c,i,s,B[e-7],B[e-16]);B[e]=0|h,C[e]=0|c}let{Ah:r,Al:i,Bh:n,Bl:o,Ch:a,Cl:s,Dh:u,Dl:c,Eh:h,El:l,Fh:f,Fl:I,Gh:A,Gl:P,Hh:x,Hl:T}=this;for(let e=0;e<80;e++){const t=g(h,l,14)^g(h,l,18)^y(h,l,41),p=m(h,l,14)^m(h,l,18)^v(h,l,41),d=h&f^~h&A,S=k(T,p,l&I^~l&P,M[e],C[e]),E=O(S,x,t,d,R[e],B[e]),N=0|S,D=g(r,i,28)^y(r,i,34)^y(r,i,39),L=m(r,i,28)^v(r,i,34)^v(r,i,39),j=r&n^r&a^n&a,U=i&o^i&s^o&s;x=0|A,T=0|P,A=0|f,P=0|I,f=0|h,I=0|l,({h,l}=b(0|u,0|c,0|E,0|N)),u=0|a,c=0|s,a=0|n,s=0|o,n=0|r,o=0|i;const H=_(N,L,U);r=w(H,E,D,j),i=0|H}({h:r,l:i}=b(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:o}=b(0|this.Bh,0|this.Bl,0|n,0|o)),({h:a,l:s}=b(0|this.Ch,0|this.Cl,0|a,0|s)),({h:u,l:c}=b(0|this.Dh,0|this.Dl,0|u,0|c)),({h,l}=b(0|this.Eh,0|this.El,0|h,0|l)),({h:f,l:I}=b(0|this.Fh,0|this.Fl,0|f,0|I)),({h:A,l:P}=b(0|this.Gh,0|this.Gl,0|A,0|P)),({h:x,l:T}=b(0|this.Hh,0|this.Hl,0|x,0|T)),this.set(r,i,n,o,a,s,u,c,h,l,f,I,A,P,x,T)}roundClean(){(0,i.uH)(B,C)}destroy(){this.destroyed=!0,(0,i.uH)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class D extends N{Ah=0|u[0];Al=0|u[1];Bh=0|u[2];Bl=0|u[3];Ch=0|u[4];Cl=0|u[5];Dh=0|u[6];Dl=0|u[7];Eh=0|u[8];El=0|u[9];Fh=0|u[10];Fl=0|u[11];Gh=0|u[12];Gl=0|u[13];Hh=0|u[14];Hl=0|u[15];constructor(){super(64)}}const L=(0,i.qj)(()=>new x,(0,i.nx)(1)),j=(0,i.qj)(()=>new D,(0,i.nx)(3))},508(e,t,r){"use strict";function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name&&"BYTES_PER_ELEMENT"in e&&1===e.BYTES_PER_ELEMENT}function n(e,t=""){if("number"!=typeof e){throw new TypeError(`${t&&`"${t}" `}expected number, got ${typeof e}`)}if(!Number.isSafeInteger(e)||e<0){throw new RangeError(`${t&&`"${t}" `}expected integer >= 0, got ${e}`)}}function o(e,t,r=""){const n=i(e),o=e?.length,a=void 0!==t;if(!n||a&&o!==t){const i=(r&&`"${r}" `)+"expected Uint8Array"+(a?` of length ${t}`:"")+", got "+(n?`length=${o}`:"type="+typeof e);if(!n)throw new TypeError(i);throw new RangeError(i)}return e}function a(e){if("function"!=typeof e||"function"!=typeof e.create)throw new TypeError("Hash must wrapped by utils.createHasher");if(n(e.outputLen),n(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function u(e,t){o(e,void 0,"digestInto() output");const r=t.outputLen;if(e.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}function c(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function l(e,t){return e<<32-t|e>>>t}r.d(t,{CC:()=>s,DO:()=>o,Fe:()=>n,Ht:()=>u,Id:()=>E,My:()=>d,O8:()=>h,Ow:()=>l,aT:()=>S,aY:()=>i,nx:()=>I,po:()=>O,qj:()=>k,sd:()=>a,uH:()=>c});const f=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),p=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function d(e){if(o(e),f)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=p[e[r]];return t}const g=48,m=57,y=65,v=70,b=97,_=102;function w(e){return e>=g&&e<=m?e-g:e>=y&&e<=v?e-(y-10):e>=b&&e<=_?e-(b-10):void 0}function S(e){if("string"!=typeof e)throw new TypeError("hex string expected, got "+typeof e);if(f)try{return Uint8Array.fromHex(e)}catch(e){if(e instanceof SyntaxError)throw new RangeError(e.message);throw e}const t=e.length,r=t/2;if(t%2)throw new RangeError("hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(r);for(let t=0,n=0;t<r;t++,n+=2){const r=w(e.charCodeAt(n)),o=w(e.charCodeAt(n+1));if(void 0===r||void 0===o){const t=e[n]+e[n+1];throw new RangeError('hex string expected, got non-hex character "'+t+'" at index '+n)}i[t]=16*r+o}return i}function E(...e){let t=0;for(let r=0;r<e.length;r++){const i=e[r];o(i),t+=i.length}const r=new Uint8Array(t);for(let t=0,i=0;t<e.length;t++){const n=e[t];r.set(n,i),i+=n.length}return r}function k(e,t={}){const r=(t,r)=>e(r).update(t).digest(),i=e(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.canXOF=i.canXOF,r.create=t=>e(t),Object.assign(r,t),Object.freeze(r)}function O(e=32){n(e,"bytesLength");const t="object"==typeof globalThis?globalThis.crypto:null;if("function"!=typeof t?.getRandomValues)throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const I=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])})},9294(e,t,r){"use strict";r.d(t,{c:()=>i});var i=r(4233)},3219(e){"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},3241(e){"use strict";e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},5579(e){"use strict";e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},8330(e){"use strict";e.exports={rE:"6.0.1"}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.c=__webpack_module_cache__,__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__=__webpack_require__(__webpack_require__.s=5237);return __webpack_exports__})());
|
|
45
|
+
const Te={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},Re={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},Me=BigInt(2);const Be=J(Te.p,{sqrt:function(e){const t=Te.p,r=BigInt(3),i=BigInt(6),n=BigInt(11),o=BigInt(22),a=BigInt(23),s=BigInt(44),u=BigInt(88),c=e*e*e%t,h=c*c*e%t,l=U(h,r,t)*h%t,f=U(l,r,t)*h%t,p=U(f,Me,t)*c%t,d=U(p,n,t)*p%t,g=U(d,o,t)*d%t,m=U(g,s,t)*g%t,y=U(m,u,t)*m%t,v=U(y,s,t)*g%t,b=U(v,r,t)*h%t,_=U(b,a,t)*d%t,w=U(_,i,t)*c%t,S=U(w,Me,t);if(!Be.eql(Be.sqr(S),e))throw new Error("Cannot find square root");return S}}),Ce=Oe(Te,{Fp:Be,endo:Re}),Ne=xe(Ce,i.sha256)},7474(e,t,r){"use strict";r.d(t,{hmac:()=>o});var i=r(508);class n{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(e,t){if((0,i.sd)(e),(0,i.DO)(t,void 0,"key"),this.iHash=e.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,n=new Uint8Array(r);n.set(t.length>r?e.create().update(t).digest():t);for(let e=0;e<n.length;e++)n[e]^=54;this.iHash.update(n),this.oHash=e.create();for(let e=0;e<n.length;e++)n[e]^=106;this.oHash.update(n),(0,i.uH)(n)}update(e){return(0,i.CC)(this),this.iHash.update(e),this}digestInto(e){(0,i.CC)(this),(0,i.Ht)(e,this),this.finished=!0;const t=e.subarray(0,this.outputLen);this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});const{oHash:t,iHash:r,finished:i,destroyed:n,blockLen:o,outputLen:a}=this;return e.finished=i,e.destroyed=n,e.blockLen=o,e.outputLen=a,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const o=(()=>{const e=(e,t,r)=>new n(e,t).update(r).digest();return e.create=(e,t)=>new n(e,t),e})()},4544(e,t,r){"use strict";r.d(t,{sha256:()=>L,sha512:()=>j});var i=r(508);function n(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}class a{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,n){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=(0,i.O8)(this.buffer)}update(e){(0,i.CC)(this),(0,i.DO)(e);const{view:t,buffer:r,blockLen:n}=this,o=e.length;for(let a=0;a<o;){const s=Math.min(n-this.pos,o-a);if(s===n){const t=(0,i.O8)(e);for(;n<=o-a;a+=n)this.process(t,a);continue}r.set(e.subarray(a,a+s),this.pos),this.pos+=s,a+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,i.CC)(this),(0,i.Ht)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:o}=this;let{pos:a}=this;t[a++]=128,(0,i.uH)(this.buffer.subarray(a)),this.padOffset>n-a&&(this.process(r,0),a=0);for(let e=a;e<n;e++)t[e]=0;r.setBigUint64(n-8,BigInt(8*this.length),o),this.process(r,0);const s=(0,i.O8)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const c=u/4,h=this.get();if(c>h.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,h[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||=new this.constructor,e.set(...this.get());const{blockLen:t,buffer:r,length:i,finished:n,destroyed:o,pos:a}=this;return e.destroyed=o,e.finished=n,e.length=i,e.pos=a,i%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const s=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),u=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),c=BigInt(2**32-1),h=BigInt(32);function l(e,t=!1){return t?{h:Number(e&c),l:Number(e>>h&c)}:{h:0|Number(e>>h&c),l:0|Number(e&c)}}function f(e,t=!1){const r=e.length;let i=new Uint32Array(r),n=new Uint32Array(r);for(let o=0;o<r;o++){const{h:r,l:a}=l(e[o],t);[i[o],n[o]]=[r,a]}return[i,n]}const p=(e,t,r)=>e>>>r,d=(e,t,r)=>e<<32-r|t>>>r,g=(e,t,r)=>e>>>r|t<<32-r,m=(e,t,r)=>e<<32-r|t>>>r,y=(e,t,r)=>e<<64-r|t>>>r-32,v=(e,t,r)=>e>>>r-32|t<<64-r;function b(e,t,r,i){const n=(t>>>0)+(i>>>0);return{h:e+r+(n/2**32|0)|0,l:0|n}}const _=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),w=(e,t,r,i)=>t+r+i+(e/2**32|0)|0,S=(e,t,r,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0),E=(e,t,r,i,n)=>t+r+i+n+(e/2**32|0)|0,k=(e,t,r,i,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0)+(n>>>0),O=(e,t,r,i,n,o)=>t+r+i+n+o+(e/2**32|0)|0;const I=Uint32Array.from([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]),A=new Uint32Array(64);class P extends a{constructor(e){super(64,e,8,!1)}get(){const{A:e,B:t,C:r,D:i,E:n,F:o,G:a,H:s}=this;return[e,t,r,i,n,o,a,s]}set(e,t,r,i,n,o,a,s){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|o,this.G=0|a,this.H=0|s}process(e,t){for(let r=0;r<16;r++,t+=4)A[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=A[e-15],r=A[e-2],n=(0,i.Ow)(t,7)^(0,i.Ow)(t,18)^t>>>3,o=(0,i.Ow)(r,17)^(0,i.Ow)(r,19)^r>>>10;A[e]=o+A[e-7]+n+A[e-16]|0}let{A:r,B:a,C:s,D:u,E:c,F:h,G:l,H:f}=this;for(let e=0;e<64;e++){const t=f+((0,i.Ow)(c,6)^(0,i.Ow)(c,11)^(0,i.Ow)(c,25))+n(c,h,l)+I[e]+A[e]|0,p=((0,i.Ow)(r,2)^(0,i.Ow)(r,13)^(0,i.Ow)(r,22))+o(r,a,s)|0;f=l,l=h,h=c,c=u+t|0,u=s,s=a,a=r,r=t+p|0}r=r+this.A|0,a=a+this.B|0,s=s+this.C|0,u=u+this.D|0,c=c+this.E|0,h=h+this.F|0,l=l+this.G|0,f=f+this.H|0,this.set(r,a,s,u,c,h,l,f)}roundClean(){(0,i.uH)(A)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),(0,i.uH)(this.buffer)}}class x extends P{A=0|s[0];B=0|s[1];C=0|s[2];D=0|s[3];E=0|s[4];F=0|s[5];G=0|s[6];H=0|s[7];constructor(){super(32)}}const T=(()=>f(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","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(e=>BigInt(e))))(),R=(()=>T[0])(),M=(()=>T[1])(),B=new Uint32Array(80),C=new Uint32Array(80);class N extends a{constructor(e){super(128,e,16,!1)}get(){const{Ah:e,Al:t,Bh:r,Bl:i,Ch:n,Cl:o,Dh:a,Dl:s,Eh:u,El:c,Fh:h,Fl:l,Gh:f,Gl:p,Hh:d,Hl:g}=this;return[e,t,r,i,n,o,a,s,u,c,h,l,f,p,d,g]}set(e,t,r,i,n,o,a,s,u,c,h,l,f,p,d,g){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|i,this.Ch=0|n,this.Cl=0|o,this.Dh=0|a,this.Dl=0|s,this.Eh=0|u,this.El=0|c,this.Fh=0|h,this.Fl=0|l,this.Gh=0|f,this.Gl=0|p,this.Hh=0|d,this.Hl=0|g}process(e,t){for(let r=0;r<16;r++,t+=4)B[r]=e.getUint32(t),C[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|B[e-15],r=0|C[e-15],i=g(t,r,1)^g(t,r,8)^p(t,0,7),n=m(t,r,1)^m(t,r,8)^d(t,r,7),o=0|B[e-2],a=0|C[e-2],s=g(o,a,19)^y(o,a,61)^p(o,0,6),u=m(o,a,19)^v(o,a,61)^d(o,a,6),c=S(n,u,C[e-7],C[e-16]),h=E(c,i,s,B[e-7],B[e-16]);B[e]=0|h,C[e]=0|c}let{Ah:r,Al:i,Bh:n,Bl:o,Ch:a,Cl:s,Dh:u,Dl:c,Eh:h,El:l,Fh:f,Fl:I,Gh:A,Gl:P,Hh:x,Hl:T}=this;for(let e=0;e<80;e++){const t=g(h,l,14)^g(h,l,18)^y(h,l,41),p=m(h,l,14)^m(h,l,18)^v(h,l,41),d=h&f^~h&A,S=k(T,p,l&I^~l&P,M[e],C[e]),E=O(S,x,t,d,R[e],B[e]),N=0|S,D=g(r,i,28)^y(r,i,34)^y(r,i,39),L=m(r,i,28)^v(r,i,34)^v(r,i,39),j=r&n^r&a^n&a,U=i&o^i&s^o&s;x=0|A,T=0|P,A=0|f,P=0|I,f=0|h,I=0|l,({h,l}=b(0|u,0|c,0|E,0|N)),u=0|a,c=0|s,a=0|n,s=0|o,n=0|r,o=0|i;const H=_(N,L,U);r=w(H,E,D,j),i=0|H}({h:r,l:i}=b(0|this.Ah,0|this.Al,0|r,0|i)),({h:n,l:o}=b(0|this.Bh,0|this.Bl,0|n,0|o)),({h:a,l:s}=b(0|this.Ch,0|this.Cl,0|a,0|s)),({h:u,l:c}=b(0|this.Dh,0|this.Dl,0|u,0|c)),({h,l}=b(0|this.Eh,0|this.El,0|h,0|l)),({h:f,l:I}=b(0|this.Fh,0|this.Fl,0|f,0|I)),({h:A,l:P}=b(0|this.Gh,0|this.Gl,0|A,0|P)),({h:x,l:T}=b(0|this.Hh,0|this.Hl,0|x,0|T)),this.set(r,i,n,o,a,s,u,c,h,l,f,I,A,P,x,T)}roundClean(){(0,i.uH)(B,C)}destroy(){this.destroyed=!0,(0,i.uH)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class D extends N{Ah=0|u[0];Al=0|u[1];Bh=0|u[2];Bl=0|u[3];Ch=0|u[4];Cl=0|u[5];Dh=0|u[6];Dl=0|u[7];Eh=0|u[8];El=0|u[9];Fh=0|u[10];Fl=0|u[11];Gh=0|u[12];Gl=0|u[13];Hh=0|u[14];Hl=0|u[15];constructor(){super(64)}}const L=(0,i.qj)(()=>new x,(0,i.nx)(1)),j=(0,i.qj)(()=>new D,(0,i.nx)(3))},508(e,t,r){"use strict";function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name&&"BYTES_PER_ELEMENT"in e&&1===e.BYTES_PER_ELEMENT}function n(e,t=""){if("number"!=typeof e){throw new TypeError(`${t&&`"${t}" `}expected number, got ${typeof e}`)}if(!Number.isSafeInteger(e)||e<0){throw new RangeError(`${t&&`"${t}" `}expected integer >= 0, got ${e}`)}}function o(e,t,r=""){const n=i(e),o=e?.length,a=void 0!==t;if(!n||a&&o!==t){const i=(r&&`"${r}" `)+"expected Uint8Array"+(a?` of length ${t}`:"")+", got "+(n?`length=${o}`:"type="+typeof e);if(!n)throw new TypeError(i);throw new RangeError(i)}return e}function a(e){if("function"!=typeof e||"function"!=typeof e.create)throw new TypeError("Hash must wrapped by utils.createHasher");if(n(e.outputLen),n(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function s(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function u(e,t){o(e,void 0,"digestInto() output");const r=t.outputLen;if(e.length<r)throw new RangeError('"digestInto() output" expected to be of length >='+r)}function c(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function h(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function l(e,t){return e<<32-t|e>>>t}r.d(t,{CC:()=>s,DO:()=>o,Fe:()=>n,Ht:()=>u,Id:()=>E,My:()=>d,O8:()=>h,Ow:()=>l,aT:()=>S,aY:()=>i,nx:()=>I,po:()=>O,qj:()=>k,sd:()=>a,uH:()=>c});const f=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),p=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function d(e){if(o(e),f)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=p[e[r]];return t}const g=48,m=57,y=65,v=70,b=97,_=102;function w(e){return e>=g&&e<=m?e-g:e>=y&&e<=v?e-(y-10):e>=b&&e<=_?e-(b-10):void 0}function S(e){if("string"!=typeof e)throw new TypeError("hex string expected, got "+typeof e);if(f)try{return Uint8Array.fromHex(e)}catch(e){if(e instanceof SyntaxError)throw new RangeError(e.message);throw e}const t=e.length,r=t/2;if(t%2)throw new RangeError("hex string expected, got unpadded hex of length "+t);const i=new Uint8Array(r);for(let t=0,n=0;t<r;t++,n+=2){const r=w(e.charCodeAt(n)),o=w(e.charCodeAt(n+1));if(void 0===r||void 0===o){const t=e[n]+e[n+1];throw new RangeError('hex string expected, got non-hex character "'+t+'" at index '+n)}i[t]=16*r+o}return i}function E(...e){let t=0;for(let r=0;r<e.length;r++){const i=e[r];o(i),t+=i.length}const r=new Uint8Array(t);for(let t=0,i=0;t<e.length;t++){const n=e[t];r.set(n,i),i+=n.length}return r}function k(e,t={}){const r=(t,r)=>e(r).update(t).digest(),i=e(void 0);return r.outputLen=i.outputLen,r.blockLen=i.blockLen,r.canXOF=i.canXOF,r.create=t=>e(t),Object.assign(r,t),Object.freeze(r)}function O(e=32){n(e,"bytesLength");const t="object"==typeof globalThis?globalThis.crypto:null;if("function"!=typeof t?.getRandomValues)throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const I=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])})},9294(e,t,r){"use strict";r.d(t,{c:()=>i});var i=r(4233)},3219(e){"use strict";e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},3241(e){"use strict";e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},5579(e){"use strict";e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},8330(e){"use strict";e.exports={rE:"6.0.2"}}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.c=__webpack_module_cache__,__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__=__webpack_require__(__webpack_require__.s=5237);return __webpack_exports__})());
|
|
@@ -55,19 +55,19 @@ Three advanced modules totaling **~2.7MB** of functionality:
|
|
|
55
55
|
- **Purpose**: Threshold cryptography for secure secret distribution
|
|
56
56
|
- **Use Cases**: Backup keys, multi-party security, key recovery
|
|
57
57
|
- **Features**: Split secrets into N shares, require M to reconstruct
|
|
58
|
-
- **CDN**: `unpkg.com/@smartledger/bsv@6.0.
|
|
58
|
+
- **CDN**: `unpkg.com/@smartledger/bsv@6.0.2/bsv-shamir.min.js`
|
|
59
59
|
|
|
60
60
|
#### **🌐 Global Digital Attestation Framework - GDAF (1184KB)**
|
|
61
61
|
- **Purpose**: W3C Verifiable Credentials and decentralized identity
|
|
62
62
|
- **Use Cases**: Identity verification, attestations, zero-knowledge proofs
|
|
63
63
|
- **Features**: DID creation, credential issuance, selective disclosure
|
|
64
|
-
- **CDN**: `unpkg.com/@smartledger/bsv@6.0.
|
|
64
|
+
- **CDN**: `unpkg.com/@smartledger/bsv@6.0.2/bsv-gdaf.min.js`
|
|
65
65
|
|
|
66
66
|
#### **⚖️ Legal Token Protocol - LTP (1184KB)**
|
|
67
67
|
- **Purpose**: Legal compliance framework for tokenized assets
|
|
68
68
|
- **Use Cases**: Property rights, obligations, compliant tokenization
|
|
69
69
|
- **Features**: Legal primitives, compliance checking, attestation anchoring
|
|
70
|
-
- **CDN**: `unpkg.com/@smartledger/bsv@6.0.
|
|
70
|
+
- **CDN**: `unpkg.com/@smartledger/bsv@6.0.2/bsv-ltp.min.js`
|
|
71
71
|
|
|
72
72
|
### **2. Incorrect File Sizes in Documentation**
|
|
73
73
|
|
|
@@ -81,18 +81,18 @@ Three advanced modules totaling **~2.7MB** of functionality:
|
|
|
81
81
|
|
|
82
82
|
| Module | Size | Use Case | CDN Link |
|
|
83
83
|
|--------|------|----------|----------|
|
|
84
|
-
| **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@6.0.
|
|
85
|
-
| **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@6.0.
|
|
86
|
-
| **bsv-smartcontract.min.js** | 937KB | Covenant development | `unpkg.com/@smartledger/bsv@6.0.
|
|
87
|
-
| **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@6.0.
|
|
88
|
-
| **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@6.0.
|
|
89
|
-
| **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@6.0.
|
|
90
|
-
| **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@6.0.
|
|
91
|
-
| **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@6.0.
|
|
92
|
-
| **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@6.0.
|
|
93
|
-
| **🆕 bsv-shamir.min.js** | 432KB | **Secret sharing** | `unpkg.com/@smartledger/bsv@6.0.
|
|
94
|
-
| **🆕 bsv-gdaf.min.js** | 1184KB | **Digital attestation** | `unpkg.com/@smartledger/bsv@6.0.
|
|
95
|
-
| **🆕 bsv-ltp.min.js** | 1184KB | **Legal tokens** | `unpkg.com/@smartledger/bsv@6.0.
|
|
84
|
+
| **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@6.0.2/bsv.min.js` |
|
|
85
|
+
| **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@6.0.2/bsv.bundle.js` |
|
|
86
|
+
| **bsv-smartcontract.min.js** | 937KB | Covenant development | `unpkg.com/@smartledger/bsv@6.0.2/bsv-smartcontract.min.js` |
|
|
87
|
+
| **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@6.0.2/bsv-covenant.min.js` |
|
|
88
|
+
| **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@6.0.2/bsv-script-helper.min.js` |
|
|
89
|
+
| **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@6.0.2/bsv-security.min.js` |
|
|
90
|
+
| **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@6.0.2/bsv-ecies.min.js` |
|
|
91
|
+
| **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@6.0.2/bsv-message.min.js` |
|
|
92
|
+
| **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@6.0.2/bsv-mnemonic.min.js` |
|
|
93
|
+
| **🆕 bsv-shamir.min.js** | 432KB | **Secret sharing** | `unpkg.com/@smartledger/bsv@6.0.2/bsv-shamir.min.js` |
|
|
94
|
+
| **🆕 bsv-gdaf.min.js** | 1184KB | **Digital attestation** | `unpkg.com/@smartledger/bsv@6.0.2/bsv-gdaf.min.js` |
|
|
95
|
+
| **🆕 bsv-ltp.min.js** | 1184KB | **Legal tokens** | `unpkg.com/@smartledger/bsv@6.0.2/bsv-ltp.min.js` |
|
|
96
96
|
|
|
97
97
|
## 🎯 **Updated Usage Examples**
|
|
98
98
|
|
|
@@ -100,22 +100,22 @@ Three advanced modules totaling **~2.7MB** of functionality:
|
|
|
100
100
|
|
|
101
101
|
#### **1. Basic Development (~963KB)**
|
|
102
102
|
```html
|
|
103
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
104
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
103
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.min.js"></script>
|
|
104
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-script-helper.min.js"></script>
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
#### **2. Smart Contract Development (~2.7MB — each bundle re-embeds core BSV)**
|
|
108
108
|
```html
|
|
109
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
110
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
111
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
109
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.min.js"></script>
|
|
110
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-covenant.min.js"></script>
|
|
111
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-smartcontract.min.js"></script>
|
|
112
112
|
```
|
|
113
113
|
|
|
114
114
|
#### **3. 🆕 Legal & Compliance Development (~3.2MB — each bundle re-embeds core BSV)**
|
|
115
115
|
```html
|
|
116
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
117
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
118
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
116
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.min.js"></script>
|
|
117
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-ltp.min.js"></script>
|
|
118
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-gdaf.min.js"></script>
|
|
119
119
|
<script>
|
|
120
120
|
// Legal Token Protocol
|
|
121
121
|
const legalToken = bsv.createLegalToken({
|
|
@@ -132,9 +132,9 @@ Three advanced modules totaling **~2.7MB** of functionality:
|
|
|
132
132
|
|
|
133
133
|
#### **4. 🆕 Security & Cryptography (~1.4MB)**
|
|
134
134
|
```html
|
|
135
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
136
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
137
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
135
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.min.js"></script>
|
|
136
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-security.min.js"></script>
|
|
137
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-shamir.min.js"></script>
|
|
138
138
|
<script>
|
|
139
139
|
// Shamir Secret Sharing
|
|
140
140
|
const shares = bsv.splitSecret('my_secret_key', 5, 3); // 5 shares, 3 needed
|
|
@@ -146,7 +146,7 @@ Three advanced modules totaling **~2.7MB** of functionality:
|
|
|
146
146
|
|
|
147
147
|
#### **5. Everything Bundle (937KB)**
|
|
148
148
|
```html
|
|
149
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
149
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.bundle.js"></script>
|
|
150
150
|
<script>
|
|
151
151
|
// Everything available immediately
|
|
152
152
|
const shares = bsv.splitSecret('secret', 5, 3);
|
|
@@ -722,7 +722,7 @@ interface UTXO {
|
|
|
722
722
|
<html>
|
|
723
723
|
<head>
|
|
724
724
|
<title>UTXO Manager Demo</title>
|
|
725
|
-
<script src="https://cdn.jsdelivr.net/npm/@smartledger/bsv@6.0.
|
|
725
|
+
<script src="https://cdn.jsdelivr.net/npm/@smartledger/bsv@6.0.2/bsv.min.js"></script>
|
|
726
726
|
</head>
|
|
727
727
|
<body>
|
|
728
728
|
<script>
|
|
@@ -48,7 +48,7 @@ const tx: Transaction = new Transaction();
|
|
|
48
48
|
#### **Core Library Only (937KB)**
|
|
49
49
|
For basic Bitcoin SV operations:
|
|
50
50
|
```html
|
|
51
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
51
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.min.js"></script>
|
|
52
52
|
<script>
|
|
53
53
|
const privateKey = new bsv.PrivateKey();
|
|
54
54
|
const address = privateKey.toAddress();
|
|
@@ -58,7 +58,7 @@ For basic Bitcoin SV operations:
|
|
|
58
58
|
#### **Complete Bundle (937KB)**
|
|
59
59
|
Everything in one file:
|
|
60
60
|
```html
|
|
61
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
61
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.bundle.js"></script>
|
|
62
62
|
<script>
|
|
63
63
|
// All features available immediately
|
|
64
64
|
const shares = bsv.splitSecret('secret', 5, 3);
|
|
@@ -71,9 +71,9 @@ Everything in one file:
|
|
|
71
71
|
|
|
72
72
|
#### **Smart Contract Development (~2.7MB total — each bundle is self-contained and re-embeds core BSV)**
|
|
73
73
|
```html
|
|
74
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
75
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
76
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
74
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.min.js"></script>
|
|
75
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-covenant.min.js"></script>
|
|
76
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-smartcontract.min.js"></script>
|
|
77
77
|
<script>
|
|
78
78
|
const covenant = bsv.SmartContract.createCovenantBuilder()
|
|
79
79
|
.extractField('amount').push(50000).greaterThanOrEqual().build();
|
|
@@ -82,9 +82,9 @@ Everything in one file:
|
|
|
82
82
|
|
|
83
83
|
#### **Legal & Identity Development (~3.2MB total — each bundle is self-contained and re-embeds core BSV)**
|
|
84
84
|
```html
|
|
85
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
86
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
87
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
85
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.min.js"></script>
|
|
86
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-ltp.min.js"></script>
|
|
87
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-gdaf.min.js"></script>
|
|
88
88
|
<script>
|
|
89
89
|
// Legal Token Protocol
|
|
90
90
|
const propertyToken = bsv.createPropertyToken({
|
|
@@ -98,9 +98,9 @@ Everything in one file:
|
|
|
98
98
|
|
|
99
99
|
#### **Security & Cryptography (~1.4MB total — each bundle is self-contained and re-embeds core BSV)**
|
|
100
100
|
```html
|
|
101
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
102
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
103
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
101
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.min.js"></script>
|
|
102
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-security.min.js"></script>
|
|
103
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-shamir.min.js"></script>
|
|
104
104
|
<script>
|
|
105
105
|
// Threshold Cryptography
|
|
106
106
|
const shares = bsv.splitSecret('my_secret_key', 5, 3);
|
|
@@ -114,18 +114,18 @@ Everything in one file:
|
|
|
114
114
|
|
|
115
115
|
| Module | Size | Purpose | CDN Link |
|
|
116
116
|
|--------|------|---------|----------|
|
|
117
|
-
| **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@6.0.
|
|
118
|
-
| **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@6.0.
|
|
119
|
-
| **bsv-smartcontract.min.js** | 937KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@6.0.
|
|
120
|
-
| **bsv-ltp.min.js** | 1184KB | **Legal Token Protocol** | `unpkg.com/@smartledger/bsv@6.0.
|
|
121
|
-
| **bsv-gdaf.min.js** | 1184KB | **Digital Identity & Attestation** | `unpkg.com/@smartledger/bsv@6.0.
|
|
122
|
-
| **bsv-shamir.min.js** | 432KB | **Threshold Cryptography** | `unpkg.com/@smartledger/bsv@6.0.
|
|
123
|
-
| **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@6.0.
|
|
124
|
-
| **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@6.0.
|
|
125
|
-
| **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@6.0.
|
|
126
|
-
| **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@6.0.
|
|
127
|
-
| **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@6.0.
|
|
128
|
-
| **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@6.0.
|
|
117
|
+
| **bsv.min.js** | 937KB | Core BSV + SmartContract | `unpkg.com/@smartledger/bsv@6.0.2/bsv.min.js` |
|
|
118
|
+
| **bsv.bundle.js** | 937KB | Everything in one file | `unpkg.com/@smartledger/bsv@6.0.2/bsv.bundle.js` |
|
|
119
|
+
| **bsv-smartcontract.min.js** | 937KB | Complete covenant framework | `unpkg.com/@smartledger/bsv@6.0.2/bsv-smartcontract.min.js` |
|
|
120
|
+
| **bsv-ltp.min.js** | 1184KB | **Legal Token Protocol** | `unpkg.com/@smartledger/bsv@6.0.2/bsv-ltp.min.js` |
|
|
121
|
+
| **bsv-gdaf.min.js** | 1184KB | **Digital Identity & Attestation** | `unpkg.com/@smartledger/bsv@6.0.2/bsv-gdaf.min.js` |
|
|
122
|
+
| **bsv-shamir.min.js** | 432KB | **Threshold Cryptography** | `unpkg.com/@smartledger/bsv@6.0.2/bsv-shamir.min.js` |
|
|
123
|
+
| **bsv-security.min.js** | 26KB | Security enhancements (opt-in helpers — see README › Security) | `unpkg.com/@smartledger/bsv@6.0.2/bsv-security.min.js` |
|
|
124
|
+
| **bsv-mnemonic.min.js** | 681KB | HD wallets | `unpkg.com/@smartledger/bsv@6.0.2/bsv-mnemonic.min.js` |
|
|
125
|
+
| **bsv-ecies.min.js** | 71KB | Encryption | `unpkg.com/@smartledger/bsv@6.0.2/bsv-ecies.min.js` |
|
|
126
|
+
| **bsv-covenant.min.js** | 913KB | Covenant operations | `unpkg.com/@smartledger/bsv@6.0.2/bsv-covenant.min.js` |
|
|
127
|
+
| **bsv-script-helper.min.js** | 26KB | Custom script tools | `unpkg.com/@smartledger/bsv@6.0.2/bsv-script-helper.min.js` |
|
|
128
|
+
| **bsv-message.min.js** | 26KB | Message signing | `unpkg.com/@smartledger/bsv@6.0.2/bsv-message.min.js` |
|
|
129
129
|
|
|
130
130
|
## ⚙️ **Development Environment Setup**
|
|
131
131
|
|
|
@@ -14,10 +14,10 @@ npm install @smartledger/bsv
|
|
|
14
14
|
### Browser CDN (Instant)
|
|
15
15
|
```html
|
|
16
16
|
<!-- Core library (937KB) -->
|
|
17
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
17
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.min.js"></script>
|
|
18
18
|
|
|
19
19
|
<!-- Everything included (937KB) -->
|
|
20
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
20
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.bundle.js"></script>
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## 💰 **Your First Transaction (60 seconds)**
|
|
@@ -127,19 +127,19 @@ SmartLedger-BSV offers 12 different loading options - use only what you need:
|
|
|
127
127
|
|
|
128
128
|
```html
|
|
129
129
|
<!-- Core BSV only (937KB) -->
|
|
130
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
130
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.min.js"></script>
|
|
131
131
|
|
|
132
132
|
<!-- Smart contracts (937KB) -->
|
|
133
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
133
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-smartcontract.min.js"></script>
|
|
134
134
|
|
|
135
135
|
<!-- Legal tokens (1.16MB) -->
|
|
136
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
136
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-ltp.min.js"></script>
|
|
137
137
|
|
|
138
138
|
<!-- Digital identity (1.16MB) -->
|
|
139
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
139
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-gdaf.min.js"></script>
|
|
140
140
|
|
|
141
141
|
<!-- Everything (937KB) -->
|
|
142
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
142
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.bundle.js"></script>
|
|
143
143
|
```
|
|
144
144
|
|
|
145
145
|
## ⚡ **Key Advantages**
|
|
@@ -159,17 +159,17 @@ const recovered = bsv.reconstructSecret([shares[0], shares[2], shares[4]]);
|
|
|
159
159
|
### **New Modular Options**
|
|
160
160
|
```html
|
|
161
161
|
<!-- Core compatibility (same size as bsv@1.5.6) -->
|
|
162
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
162
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.min.js"></script>
|
|
163
163
|
|
|
164
164
|
<!-- Add smart contracts when ready -->
|
|
165
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
165
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-smartcontract.min.js"></script>
|
|
166
166
|
|
|
167
167
|
<!-- Add advanced features as needed -->
|
|
168
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
169
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
168
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-ltp.min.js"></script>
|
|
169
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv-gdaf.min.js"></script>
|
|
170
170
|
|
|
171
171
|
<!-- Everything in one file -->
|
|
172
|
-
<script src="https://unpkg.com/@smartledger/bsv@6.0.
|
|
172
|
+
<script src="https://unpkg.com/@smartledger/bsv@6.0.2/bsv.bundle.js"></script>
|
|
173
173
|
```
|
|
174
174
|
|
|
175
175
|
## 🔍 **Testing Your Migration**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smartledger/bsv",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.2",
|
|
4
4
|
"description": "🚀 Complete Bitcoin SV development framework with legally-recognizable DID:web + W3C VC-JWT toolkit, Legal Token Protocol (LTP), Global Digital Attestation Framework (GDAF), StatusList2021 revocation, and 16 flexible loading options. Standards-based credentials with ES256/ES256K support, on-chain BSV anchoring, and comprehensive Bitcoin SV API. Perfect for legal tokens, verifiable credentials, DeFi, smart contracts, and secure Bitcoin applications.",
|
|
5
5
|
"author": "SmartLedger Technology <hello@smartledger.technology> (https://smartledger.technology)",
|
|
6
6
|
"homepage": "https://github.com/codenlighten/smartledger-bsv#readme",
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
},
|
|
10
10
|
"main": "index.js",
|
|
11
11
|
"types": "bsv.d.ts",
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=20.19.0"
|
|
14
|
+
},
|
|
12
15
|
"bin": {
|
|
13
16
|
"smartledger-bsv": "./bin/cli.js"
|
|
14
17
|
},
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
/* global describe, it */
|
|
4
|
+
|
|
5
|
+
// FAIL-CLOSED CONTRACTS — a mechanical guard for the operating principle that every
|
|
6
|
+
// security-critical verification "returns a bool or throws, never a chainable object"
|
|
7
|
+
// and that a forged/invalid input is REJECTED (never accepted).
|
|
8
|
+
//
|
|
9
|
+
// This exists because the v6.0.0 security-hardening pass fixed four CRITICAL fail-open
|
|
10
|
+
// forgery bugs, all of the same shape: code read a truthy return value (an ECDSA
|
|
11
|
+
// *instance*, a stub `{verified:true}`) as if it meant "valid". These tests assert the
|
|
12
|
+
// negative — a bad input must not verify — and pin the return-type contract so a
|
|
13
|
+
// regression to fail-open trips a red test instead of shipping.
|
|
14
|
+
|
|
15
|
+
require('chai').should()
|
|
16
|
+
var assert = require('assert')
|
|
17
|
+
var bsv = require('../..')
|
|
18
|
+
|
|
19
|
+
var Hash = bsv.crypto.Hash
|
|
20
|
+
var ECDSA = bsv.crypto.ECDSA
|
|
21
|
+
|
|
22
|
+
function isStrictBool (v) { return v === true || v === false }
|
|
23
|
+
|
|
24
|
+
describe('security: fail-closed verification contracts', function () {
|
|
25
|
+
// A signature over `hash` by `signer`, and a different key it was NOT signed by.
|
|
26
|
+
var signer = bsv.PrivateKey.fromRandom()
|
|
27
|
+
var hash = Hash.sha256(Buffer.from('the message'))
|
|
28
|
+
var goodSig = ECDSA.sign(hash, signer)
|
|
29
|
+
var rightPub = signer.toPublicKey()
|
|
30
|
+
var wrongPub = bsv.PrivateKey.fromRandom().toPublicKey()
|
|
31
|
+
|
|
32
|
+
describe('ECDSA signature verification', function () {
|
|
33
|
+
it('static ECDSA.verify returns a STRICT boolean (never a truthy object)', function () {
|
|
34
|
+
isStrictBool(ECDSA.verify(hash, goodSig, rightPub)).should.equal(true)
|
|
35
|
+
isStrictBool(ECDSA.verify(hash, goodSig, wrongPub)).should.equal(true)
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it('static ECDSA.verify accepts a valid signature and REJECTS a forged one', function () {
|
|
39
|
+
ECDSA.verify(hash, goodSig, rightPub).should.equal(true)
|
|
40
|
+
ECDSA.verify(hash, goodSig, wrongPub).should.equal(false) // forged: wrong key
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it('instance verifyBool() is the safe boolean path and fails closed on a forgery', function () {
|
|
44
|
+
function inst (pub) {
|
|
45
|
+
var e = new ECDSA(); e.hashbuf = hash; e.sig = goodSig; e.pubkey = pub; return e
|
|
46
|
+
}
|
|
47
|
+
isStrictBool(inst(rightPub).verifyBool()).should.equal(true)
|
|
48
|
+
inst(rightPub).verifyBool().should.equal(true)
|
|
49
|
+
inst(wrongPub).verifyBool().should.equal(false)
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
// Locks the documented trap: instance .verify() returns the INSTANCE (truthy), so it
|
|
53
|
+
// must never be read as a boolean. If this ever changes (e.g. a deliberate 7.0 that
|
|
54
|
+
// makes verify() return a bool), this test forces the change to be intentional.
|
|
55
|
+
it('instance .verify() returns the instance with the result on .verified (documented trap)', function () {
|
|
56
|
+
var e = new ECDSA(); e.hashbuf = hash; e.sig = goodSig; e.pubkey = wrongPub
|
|
57
|
+
var r = e.verify()
|
|
58
|
+
;(typeof r).should.equal('object') // NOT a boolean — the trap
|
|
59
|
+
isStrictBool(r.verified).should.equal(true)
|
|
60
|
+
r.verified.should.equal(false) // forged → verified is false, even though `r` is truthy
|
|
61
|
+
})
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
describe('SmartVerify (hardened secp256k1 verify)', function () {
|
|
65
|
+
it('returns a STRICT boolean and rejects a forged signature', function () {
|
|
66
|
+
var ok = bsv.SmartVerify.smartVerify(hash, goodSig.toBuffer(), rightPub)
|
|
67
|
+
var bad = bsv.SmartVerify.smartVerify(hash, goodSig.toBuffer(), wrongPub)
|
|
68
|
+
isStrictBool(ok).should.equal(true)
|
|
69
|
+
isStrictBool(bad).should.equal(true)
|
|
70
|
+
ok.should.equal(true)
|
|
71
|
+
bad.should.equal(false)
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
describe('SPV inclusion / header-chain verification', function () {
|
|
76
|
+
it('verifyHeaderChain fails closed on empty / malformed input (throws, not truthy)', function () {
|
|
77
|
+
assert.throws(function () { bsv.SPV.verifyHeaderChain([], {}) })
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
it('verifyMerkleProof rejects a bad proof without ever returning a truthy non-boolean', function () {
|
|
81
|
+
var fakeRoot = Buffer.alloc(32, 1)
|
|
82
|
+
var fakeTxid = Buffer.alloc(32, 2)
|
|
83
|
+
var res
|
|
84
|
+
try {
|
|
85
|
+
res = bsv.SPV.verifyMerkleProof(fakeTxid, { index: 0, nodes: ['00'.repeat(32)] }, fakeRoot)
|
|
86
|
+
} catch (e) { res = false } // throwing is an acceptable fail-closed outcome
|
|
87
|
+
// Whatever the shape, it must not be a truthy value that reads as "included".
|
|
88
|
+
var included = (res === true) || (res && res.valid === true) || (res && res.verified === true)
|
|
89
|
+
included.should.equal(false)
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
describe('SmartContract script verification', function () {
|
|
94
|
+
it('verifyScript reports a boolean ok and fails an unsatisfiable lock', function () {
|
|
95
|
+
var r = bsv.SmartContract.verifyScript(new bsv.Script(), new bsv.Script().add(bsv.Opcode.OP_FALSE))
|
|
96
|
+
isStrictBool(r.ok).should.equal(true)
|
|
97
|
+
r.ok.should.equal(false)
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
})
|