(head: string, key: string)
| 110 | |
| 111 | /** HMAC-SHA256 over the chain head. PURE (deterministic). */ |
| 112 | export function signChainHead(head: string, key: string): string { |
| 113 | return createHmac('sha256', key).update(head).digest('hex'); |
| 114 | } |
| 115 | |
| 116 | /** Timing-safe verification of a head signature. PURE. */ |
| 117 | export function verifyChainSignature(head: string, signature: string, key: string): boolean { |
no test coverage detected