@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.
- package/index.js +451 -443
- package/package.json +1 -1
- package/protocol.d.ts +5 -0
package/package.json
CHANGED
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<{
|