@hive-p2p/browser 1.0.68 → 1.0.70

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/index.mjs CHANGED
@@ -12,7 +12,7 @@ import { Gossip, GossipMessage } from "./core/gossip.mjs";
12
12
  import { Topologist, OfferQueue } from "./core/topologist.mjs";
13
13
  import { NodeServices } from "./core/node-services.mjs";
14
14
  import { Converter } from "./services/converter.mjs";
15
- import { ed25519, Argon2Unified } from "./services/cryptos.mjs";
15
+ import { ed25519, x25519, chacha20poly1305, randomBytes, Argon2Unified } from "./services/cryptos.mjs";
16
16
 
17
17
  function mergeConfig(target, source) {
18
18
  for (const key in source)
@@ -23,8 +23,8 @@ function mergeConfig(target, source) {
23
23
  }
24
24
 
25
25
 
26
- const HiveP2P = { CLOCK, CONFIG, mergeConfig, Node, createNode, CryptoCodex, ed25519, Argon2Unified };
27
- export { CLOCK, CONFIG, mergeConfig, Node, createNode, CryptoCodex, ed25519, Argon2Unified };
26
+ const HiveP2P = { CLOCK, CONFIG, mergeConfig, Node, createNode, CryptoCodex, ed25519, x25519, chacha20poly1305, randomBytes, Argon2Unified };
27
+ export { CLOCK, CONFIG, mergeConfig, Node, createNode, CryptoCodex, ed25519, x25519, chacha20poly1305, randomBytes, Argon2Unified };
28
28
  export default HiveP2P;
29
29
 
30
30
  if (typeof window !== 'undefined') window.HiveP2P = HiveP2P;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hive-p2p/browser",
3
- "version": "1.0.68",
3
+ "version": "1.0.70",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -16,7 +16,8 @@
16
16
  "hive-p2p.min.js"
17
17
  ],
18
18
  "dependencies": {
19
- "@noble/ed25519": "3.0.0"
19
+ "@noble/curves": "2.0.1",
20
+ "@noble/ciphers": "2.0.1"
20
21
  },
21
22
  "devDependencies": {
22
23
  "esbuild": "^0.25.10"
@@ -2,19 +2,11 @@ import { Converter } from './converter.mjs';
2
2
  const IS_BROWSER = typeof window !== 'undefined';
3
3
 
4
4
  // ED25519 EXPOSURE NODEJS/BROWSER COMPATIBLE ---------------------------------
5
- /*const [ed_, {sha512}] = await Promise.all([
6
- import(IS_BROWSER ? '../libs/ed25519-custom.min.js' : '@noble/ed25519'),
7
- import(IS_BROWSER ? '../libs/ed25519-custom.min.js' : '@noble/hashes/sha2.js')
8
- ]);*/
5
+ const { ed25519, x25519 } = await import('@noble/curves/ed25519.js');
6
+ const { chacha20poly1305 } = await import('@noble/ciphers/chacha.js');
7
+ const { randomBytes } = await import('@noble/ciphers/utils.js');
9
8
 
10
- // Now we only use nodejs version without sha512
11
- const ed_ = await import('@noble/ed25519');
12
-
13
- /** @type {import('@noble/ed25519')} */
14
- const ed25519 = ed_.default || ed_;
15
- //ed25519.hashes.sha512 = sha512;
16
- //export { ed25519, sha512 };
17
- export { ed25519 };
9
+ export { ed25519, x25519, chacha20poly1305, randomBytes };
18
10
 
19
11
  //-----------------------------------------------------------------------------
20
12
 
@@ -1,4 +0,0 @@
1
- import * as ed25519 from '@noble/ed25519';
2
- import { sha512 } from '@noble/hashes/sha2.js';
3
- export { ed25519, sha512 };
4
- export default ed25519;
@@ -1,9 +0,0 @@
1
- var de=Object.defineProperty;var he=(t,e)=>{for(var n in e)de(t,n,{get:e[n],enumerable:!0})};var mt={};he(mt,{Point:()=>_,etc:()=>Se,getPublicKey:()=>jt,getPublicKeyAsync:()=>Mt,hash:()=>Ae,hashes:()=>At,keygen:()=>Ue,keygenAsync:()=>_e,sign:()=>He,signAsync:()=>Be,utils:()=>Ce,verify:()=>Le,verifyAsync:()=>Ee});var Vt={p:0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffedn,n:0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3edn,h:8n,a:0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffecn,d:0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3n,Gx:0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51an,Gy:0x6666666666666666666666666666666666666666666666666666666666666658n},{p:m,n:q,Gx:Ct,Gy:Tt,a:rt,d:ft,h:ue}=Vt,U=32,N=64,le=(...t)=>{"captureStackTrace"in Error&&typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(...t)},y=(t="")=>{let e=new Error(t);throw le(e,y),e},be=t=>typeof t=="bigint",pe=t=>typeof t=="string",ye=t=>t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array",B=(t,e,n="")=>{let s=ye(t),o=t?.length,c=e!==void 0;if(!s||c&&o!==e){let r=n&&`"${n}" `,i=c?` of length ${e}`:"",a=s?`length=${o}`:`type=${typeof t}`;y(r+"expected Uint8Array"+i+", got "+a)}return t},tt=t=>new Uint8Array(t),Zt=t=>Uint8Array.from(t),Xt=(t,e)=>t.toString(16).padStart(e,"0"),dt=t=>Array.from(B(t)).map(e=>Xt(e,2)).join(""),G={_0:48,_9:57,A:65,F:70,a:97,f:102},Ft=t=>{if(t>=G._0&&t<=G._9)return t-G._0;if(t>=G.A&&t<=G.F)return t-(G.A-10);if(t>=G.a&&t<=G.f)return t-(G.a-10)},ht=t=>{let e="hex invalid";if(!pe(t))return y(e);let n=t.length,s=n/2;if(n%2)return y(e);let o=tt(s);for(let c=0,r=0;c<s;c++,r+=2){let i=Ft(t.charCodeAt(r)),a=Ft(t.charCodeAt(r+1));if(i===void 0||a===void 0)return y(e);o[c]=i*16+a}return o},Ot=()=>globalThis?.crypto,ge=()=>Ot()?.subtle??y("crypto.subtle must be defined, consider polyfill"),O=(...t)=>{let e=tt(t.reduce((s,o)=>s+B(o).length,0)),n=0;return t.forEach(s=>{e.set(s,n),n+=s.length}),e},Yt=(t=U)=>Ot().getRandomValues(tt(t)),z=BigInt,X=(t,e,n,s="bad number: out of range")=>be(t)&&e<=t&&t<n?t:y(s),f=(t,e=m)=>{let n=t%e;return n>=0n?n:e+n},kt=t=>f(t,q),Rt=(t,e)=>{(t===0n||e<=0n)&&y("no inverse n="+t+" mod="+e);let n=f(t,e),s=e,o=0n,c=1n,r=1n,i=0n;for(;n!==0n;){let a=s/n,d=s%n,h=o-r*a,x=c-i*a;s=n,n=d,o=r,c=i,r=h,i=x}return s===1n?f(o,e):y("no inverse")},Kt=t=>{let e=At[t];return typeof e!="function"&&y("hashes."+t+" not set"),e},Ae=t=>Kt("sha512")(t),it=t=>t instanceof _?t:y("Point expected"),at=2n**256n,_=class t{static BASE;static ZERO;X;Y;Z;T;constructor(e,n,s,o){let c=at;this.X=X(e,0n,c),this.Y=X(n,0n,c),this.Z=X(s,1n,c),this.T=X(o,0n,c),Object.freeze(this)}static CURVE(){return Vt}static fromAffine(e){return new t(e.x,e.y,1n,f(e.x*e.y))}static fromBytes(e,n=!1){let s=ft,o=Zt(B(e,U)),c=e[31];o[31]=c&-129;let r=ut(o);X(r,0n,n?at:m);let a=f(r*r),d=f(a-1n),h=f(s*a+1n),{isValid:x,value:u}=me(d,h);x||y("bad point: y not sqrt");let b=(u&1n)===1n,p=(c&128)!==0;return!n&&u===0n&&p&&y("bad point: x==0, isLastByteOdd"),p!==b&&(u=f(-u)),new t(u,r,1n,f(u*r))}static fromHex(e,n){return t.fromBytes(ht(e),n)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}assertValidity(){let e=rt,n=ft,s=this;if(s.is0())return y("bad point: ZERO");let{X:o,Y:c,Z:r,T:i}=s,a=f(o*o),d=f(c*c),h=f(r*r),x=f(h*h),u=f(a*e),b=f(h*f(u+d)),p=f(x+f(n*f(a*d)));if(b!==p)return y("bad point: equation left != right (1)");let g=f(o*c),A=f(r*i);return g!==A?y("bad point: equation left != right (2)"):this}equals(e){let{X:n,Y:s,Z:o}=this,{X:c,Y:r,Z:i}=it(e),a=f(n*i),d=f(c*o),h=f(s*i),x=f(r*o);return a===d&&h===x}is0(){return this.equals(R)}negate(){return new t(f(-this.X),this.Y,this.Z,f(-this.T))}double(){let{X:e,Y:n,Z:s}=this,o=rt,c=f(e*e),r=f(n*n),i=f(2n*f(s*s)),a=f(o*c),d=e+n,h=f(f(d*d)-c-r),x=a+r,u=x-i,b=a-r,p=f(h*u),g=f(x*b),A=f(h*b),H=f(u*x);return new t(p,g,H,A)}add(e){let{X:n,Y:s,Z:o,T:c}=this,{X:r,Y:i,Z:a,T:d}=it(e),h=rt,x=ft,u=f(n*r),b=f(s*i),p=f(c*x*d),g=f(o*a),A=f((n+s)*(r+i)-u-b),H=f(g-p),I=f(g+p),l=f(b-h*u),E=f(A*H),L=f(I*l),K=f(A*l),v=f(H*I);return new t(E,L,v,K)}subtract(e){return this.add(it(e).negate())}multiply(e,n=!0){if(!n&&(e===0n||this.is0()))return R;if(X(e,1n,q),e===1n)return this;if(this.equals(D))return Ge(e).p;let s=R,o=D;for(let c=this;e>0n;c=c.double(),e>>=1n)e&1n?s=s.add(c):n&&(o=o.add(c));return s}multiplyUnsafe(e){return this.multiply(e,!1)}toAffine(){let{X:e,Y:n,Z:s}=this;if(this.equals(R))return{x:0n,y:1n};let o=Rt(s,m);f(s*o)!==1n&&y("invalid inverse");let c=f(e*o),r=f(n*o);return{x:c,y:r}}toBytes(){let{x:e,y:n}=this.assertValidity().toAffine(),s=vt(n);return s[31]|=e&1n?128:0,s}toHex(){return dt(this.toBytes())}clearCofactor(){return this.multiply(z(ue),!1)}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){let e=this.multiply(q/2n,!1).double();return q%2n&&(e=e.add(this)),e.is0()}},D=new _(Ct,Tt,1n,f(Ct*Tt)),R=new _(0n,1n,1n,0n);_.BASE=D;_.ZERO=R;var vt=t=>ht(Xt(X(t,0n,at),N)).reverse(),ut=t=>z("0x"+dt(Zt(B(t)).reverse())),S=(t,e)=>{let n=t;for(;e-- >0n;)n*=n,n%=m;return n},we=t=>{let n=t*t%m*t%m,s=S(n,2n)*n%m,o=S(s,1n)*t%m,c=S(o,5n)*o%m,r=S(c,10n)*c%m,i=S(r,20n)*r%m,a=S(i,40n)*i%m,d=S(a,80n)*a%m,h=S(d,80n)*a%m,x=S(h,10n)*c%m;return{pow_p_5_8:S(x,2n)*t%m,b2:n}},Gt=0x2b8324804fc1df0b2b4d00993dfbd7a72f431806ad2fe478c4ee1b274a0ea0b0n,me=(t,e)=>{let n=f(e*e*e),s=f(n*n*e),o=we(t*s).pow_p_5_8,c=f(t*n*o),r=f(e*c*c),i=c,a=f(c*Gt),d=r===t,h=r===f(-t),x=r===f(-t*Gt);return d&&(c=i),(h||x)&&(c=a),(f(c)&1n)===1n&&(c=f(-c)),{isValid:d||h,value:c}},J=t=>kt(ut(t)),lt=(...t)=>At.sha512Async(O(...t)),bt=(...t)=>Kt("sha512")(O(...t)),Nt=t=>{let e=t.slice(0,U);e[0]&=248,e[31]&=127,e[31]|=64;let n=t.slice(U,N),s=J(e),o=D.multiply(s),c=o.toBytes();return{head:e,prefix:n,scalar:s,point:o,pointBytes:c}},pt=t=>lt(B(t,U)).then(Nt),yt=t=>Nt(bt(B(t,U))),Mt=t=>pt(t).then(e=>e.pointBytes),jt=t=>yt(t).pointBytes,$t=t=>lt(t.hashable).then(t.finish),Wt=t=>t.finish(bt(t.hashable)),Pt=(t,e,n)=>{let{pointBytes:s,scalar:o}=t,c=J(e),r=D.multiply(c).toBytes();return{hashable:O(r,s,n),finish:d=>{let h=kt(c+J(d)*o);return B(O(r,vt(h)),N)}}},Be=async(t,e)=>{let n=B(t),s=await pt(e),o=await lt(s.prefix,n);return $t(Pt(s,o,n))},He=(t,e)=>{let n=B(t),s=yt(e),o=bt(s.prefix,n);return Wt(Pt(s,o,n))},gt={zip215:!0},qt=(t,e,n,s=gt)=>{t=B(t,N),e=B(e),n=B(n,U);let{zip215:o}=s,c,r,i,a,d=Uint8Array.of();try{c=_.fromBytes(n,o),r=_.fromBytes(t.slice(0,U),o),i=ut(t.slice(U,N)),a=D.multiply(i,!1),d=O(r.toBytes(),c.toBytes(),e)}catch{}return{hashable:d,finish:x=>{if(a==null||!o&&c.isSmallOrder())return!1;let u=J(x);return r.add(c.multiply(u,!1)).add(a.negate()).clearCofactor().is0()}}},Ee=async(t,e,n,s=gt)=>$t(qt(t,e,n,s)),Le=(t,e,n,s=gt)=>Wt(qt(t,e,n,s)),Se={bytesToHex:dt,hexToBytes:ht,concatBytes:O,mod:f,invert:Rt,randomBytes:Yt},At={sha512Async:async t=>{let e=ge(),n=O(t);return tt(await e.digest("SHA-512",n.buffer))},sha512:void 0},wt=(t=Yt(U))=>t,Ue=t=>{let e=wt(t),n=jt(e);return{secretKey:e,publicKey:n}},_e=async t=>{let e=wt(t),n=await Mt(e);return{secretKey:e,publicKey:n}},Ce={getExtendedPublicKeyAsync:pt,getExtendedPublicKey:yt,randomSecretKey:wt},Q=8,Te=256,zt=Math.ceil(Te/Q)+1,xt=2**(Q-1),Fe=()=>{let t=[],e=D,n=e;for(let s=0;s<zt;s++){n=e,t.push(n);for(let o=1;o<xt;o++)n=n.add(e),t.push(n);e=n.double()}return t},It,Dt=(t,e)=>{let n=e.negate();return t?n:e},Ge=t=>{let e=It||(It=Fe()),n=R,s=D,o=2**Q,c=o,r=z(o-1),i=z(Q);for(let a=0;a<zt;a++){let d=Number(t&r);t>>=i,d>xt&&(d-=c,t+=1n);let h=a*xt,x=h,u=h+Math.abs(d)-1,b=a%2!==0,p=d<0;d===0?s=s.add(Dt(b,e[x])):n=n.add(Dt(p,e[u]))}return t!==0n&&y("invalid wnaf"),{p:n,f:s}};function Ie(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Bt(t,e,n=""){let s=Ie(t),o=t?.length,c=e!==void 0;if(!s||c&&o!==e){let r=n&&`"${n}" `,i=c?` of length ${e}`:"",a=s?`length=${o}`:`type=${typeof t}`;throw new Error(r+"expected Uint8Array"+i+", got "+a)}return t}function Ht(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Jt(t,e){Bt(t,void 0,"digestInto() output");let n=e.outputLen;if(t.length<n)throw new Error('"digestInto() output" expected to be of length >='+n)}function M(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function et(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Qt(t,e={}){let n=(o,c)=>t(c).update(o).digest(),s=t(void 0);return n.outputLen=s.outputLen,n.blockLen=s.blockLen,n.create=o=>t(o),Object.assign(n,e),Object.freeze(n)}var te=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});var nt=class{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,n,s,o){this.blockLen=e,this.outputLen=n,this.padOffset=s,this.isLE=o,this.buffer=new Uint8Array(e),this.view=et(this.buffer)}update(e){Ht(this),Bt(e);let{view:n,buffer:s,blockLen:o}=this,c=e.length;for(let r=0;r<c;){let i=Math.min(o-this.pos,c-r);if(i===o){let a=et(e);for(;o<=c-r;r+=o)this.process(a,r);continue}s.set(e.subarray(r,r+i),this.pos),this.pos+=i,r+=i,this.pos===o&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Ht(this),Jt(e,this),this.finished=!0;let{buffer:n,view:s,blockLen:o,isLE:c}=this,{pos:r}=this;n[r++]=128,M(this.buffer.subarray(r)),this.padOffset>o-r&&(this.process(s,0),r=0);for(let x=r;x<o;x++)n[x]=0;s.setBigUint64(o-8,BigInt(this.length*8),c),this.process(s,0);let i=et(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let d=a/4,h=this.get();if(d>h.length)throw new Error("_sha2: outputLen bigger than state");for(let x=0;x<d;x++)i.setUint32(4*x,h[x],c)}digest(){let{buffer:e,outputLen:n}=this;this.digestInto(e);let s=e.slice(0,n);return this.destroy(),s}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:n,buffer:s,length:o,finished:c,destroyed:r,pos:i}=this;return e.destroyed=r,e.finished=c,e.length=o,e.pos=i,o%n&&e.buffer.set(s),e}clone(){return this._cloneInto()}};var w=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]);var st=BigInt(4294967295),ee=BigInt(32);function De(t,e=!1){return e?{h:Number(t&st),l:Number(t>>ee&st)}:{h:Number(t>>ee&st)|0,l:Number(t&st)|0}}function ne(t,e=!1){let n=t.length,s=new Uint32Array(n),o=new Uint32Array(n);for(let c=0;c<n;c++){let{h:r,l:i}=De(t[c],e);[s[c],o[c]]=[r,i]}return[s,o]}var Et=(t,e,n)=>t>>>n,Lt=(t,e,n)=>t<<32-n|e>>>n,Y=(t,e,n)=>t>>>n|e<<32-n,k=(t,e,n)=>t<<32-n|e>>>n,j=(t,e,n)=>t<<64-n|e>>>n-32,$=(t,e,n)=>t>>>n-32|e<<64-n;function C(t,e,n,s){let o=(e>>>0)+(s>>>0);return{h:t+n+(o/2**32|0)|0,l:o|0}}var se=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),oe=(t,e,n,s)=>e+n+s+(t/2**32|0)|0,ce=(t,e,n,s)=>(t>>>0)+(e>>>0)+(n>>>0)+(s>>>0),re=(t,e,n,s,o)=>e+n+s+o+(t/2**32|0)|0,fe=(t,e,n,s,o)=>(t>>>0)+(e>>>0)+(n>>>0)+(s>>>0)+(o>>>0),ie=(t,e,n,s,o,c)=>e+n+s+o+c+(t/2**32|0)|0;var ae=ne(["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(t=>BigInt(t))),Ze=ae[0],Xe=ae[1],V=new Uint32Array(80),Z=new Uint32Array(80),St=class extends nt{constructor(e){super(128,e,16,!1)}get(){let{Ah:e,Al:n,Bh:s,Bl:o,Ch:c,Cl:r,Dh:i,Dl:a,Eh:d,El:h,Fh:x,Fl:u,Gh:b,Gl:p,Hh:g,Hl:A}=this;return[e,n,s,o,c,r,i,a,d,h,x,u,b,p,g,A]}set(e,n,s,o,c,r,i,a,d,h,x,u,b,p,g,A){this.Ah=e|0,this.Al=n|0,this.Bh=s|0,this.Bl=o|0,this.Ch=c|0,this.Cl=r|0,this.Dh=i|0,this.Dl=a|0,this.Eh=d|0,this.El=h|0,this.Fh=x|0,this.Fl=u|0,this.Gh=b|0,this.Gl=p|0,this.Hh=g|0,this.Hl=A|0}process(e,n){for(let l=0;l<16;l++,n+=4)V[l]=e.getUint32(n),Z[l]=e.getUint32(n+=4);for(let l=16;l<80;l++){let E=V[l-15]|0,L=Z[l-15]|0,K=Y(E,L,1)^Y(E,L,8)^Et(E,L,7),v=k(E,L,1)^k(E,L,8)^Lt(E,L,7),T=V[l-2]|0,F=Z[l-2]|0,W=Y(T,F,19)^j(T,F,61)^Et(T,F,6),ot=k(T,F,19)^$(T,F,61)^Lt(T,F,6),P=ce(v,ot,Z[l-7],Z[l-16]),ct=re(P,K,W,V[l-7],V[l-16]);V[l]=ct|0,Z[l]=P|0}let{Ah:s,Al:o,Bh:c,Bl:r,Ch:i,Cl:a,Dh:d,Dl:h,Eh:x,El:u,Fh:b,Fl:p,Gh:g,Gl:A,Hh:H,Hl:I}=this;for(let l=0;l<80;l++){let E=Y(x,u,14)^Y(x,u,18)^j(x,u,41),L=k(x,u,14)^k(x,u,18)^$(x,u,41),K=x&b^~x&g,v=u&p^~u&A,T=fe(I,L,v,Xe[l],Z[l]),F=ie(T,H,E,K,Ze[l],V[l]),W=T|0,ot=Y(s,o,28)^j(s,o,34)^j(s,o,39),P=k(s,o,28)^$(s,o,34)^$(s,o,39),ct=s&c^s&i^c&i,xe=o&r^o&a^r&a;H=g|0,I=A|0,g=b|0,A=p|0,b=x|0,p=u|0,{h:x,l:u}=C(d|0,h|0,F|0,W|0),d=i|0,h=a|0,i=c|0,a=r|0,c=s|0,r=o|0;let _t=se(W,P,xe);s=oe(_t,F,ot,ct),o=_t|0}({h:s,l:o}=C(this.Ah|0,this.Al|0,s|0,o|0)),{h:c,l:r}=C(this.Bh|0,this.Bl|0,c|0,r|0),{h:i,l:a}=C(this.Ch|0,this.Cl|0,i|0,a|0),{h:d,l:h}=C(this.Dh|0,this.Dl|0,d|0,h|0),{h:x,l:u}=C(this.Eh|0,this.El|0,x|0,u|0),{h:b,l:p}=C(this.Fh|0,this.Fl|0,b|0,p|0),{h:g,l:A}=C(this.Gh|0,this.Gl|0,g|0,A|0),{h:H,l:I}=C(this.Hh|0,this.Hl|0,H|0,I|0),this.set(s,o,c,r,i,a,d,h,x,u,b,p,g,A,H,I)}roundClean(){M(V,Z)}destroy(){M(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}},Ut=class extends St{Ah=w[0]|0;Al=w[1]|0;Bh=w[2]|0;Bl=w[3]|0;Ch=w[4]|0;Cl=w[5]|0;Dh=w[6]|0;Dl=w[7]|0;Eh=w[8]|0;El=w[9]|0;Fh=w[10]|0;Fl=w[11]|0;Gh=w[12]|0;Gl=w[13]|0;Hh=w[14]|0;Hl=w[15]|0;constructor(){super(64)}};var Oe=Qt(()=>new Ut,te(3));var Qe=mt;export{Qe as default,mt as ed25519,Oe as sha512};
2
- /*! Bundled license information:
3
-
4
- @noble/ed25519/index.js:
5
- (*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) *)
6
-
7
- @noble/hashes/utils.js:
8
- (*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
9
- */