@7h3/protocol 0.5.1 → 0.5.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.
Files changed (3) hide show
  1. package/index.js +451 -443
  2. package/package.json +1 -1
  3. package/protocol.d.ts +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@7h3/protocol",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "7h3 Protocol: deterministic, signed, replay-safe AI-to-AI message envelopes (wire 7h3/0.1).",
5
5
  "type": "module",
6
6
  "main": "./index.js",
package/protocol.d.ts CHANGED
@@ -37,6 +37,11 @@ export type SignatureVerificationMaterial = {
37
37
  publicKey: string;
38
38
  };
39
39
  export declare function canonicalizeEnvelope(envelope: Omit<ProtocolEnvelope, 'signature'>): string;
40
+ /**
41
+ * Cryptographically secure random hex string. Nonces are the replay-protection
42
+ * primitive, so they must come from a CSPRNG — never Math.random().
43
+ */
44
+ export declare function randomHex(bytes?: number): string;
40
45
  export declare function signCanonicalPayloadHmac(payload: string, secret: string): Promise<string>;
41
46
  export declare function verifyCanonicalPayloadHmac(payload: string, signature: string, secret: string): Promise<boolean>;
42
47
  export declare function generateEd25519KeypairBase64Url(): Promise<{