NodeHash is a number

This commit is contained in:
2026-03-10 17:55:37 +01:00
parent a30448c130
commit 218042f552
6 changed files with 192 additions and 86 deletions

View File

@@ -13,6 +13,9 @@ const SHARED_SECRET_SIZE = 32;
const SIGNATURE_SIZE = 64;
const STATIC_SECRET_SIZE = 32;
// The "Public" group is a special group that all nodes are implicitly part of.
const publicSecret = hexToBytes("8b3387e9c5cdea6ac9e5edbaa115cd72", 16);
export class PublicKey implements IPublicKey {
public key: Uint8Array;
@@ -194,7 +197,7 @@ export class SharedSecret implements ISharedSecret {
static fromName(name: string): SharedSecret {
if (name === "Public") {
return new SharedSecret(hexToBytes("8b3387e9c5cdea6ac9e5edbaa115cd72", 16));
return new SharedSecret(publicSecret);
} else if (!/^#/.test(name)) {
throw new Error("Only the 'Public' group or groups starting with '#' are supported");
}