/**
 * ThreadlineCrypto — Cryptographic utilities for the Threadline handshake.
 *
 * Implements Ed25519 identity keys, X25519 ephemeral key exchange,
 * HKDF-SHA256 relay token derivation, and challenge-response signing.
 *
 * All operations use Node.js native `node:crypto` — no external libraries.
 *
 * Part of Threadline Protocol Phase 3.
 */
export interface KeyPair {
    publicKey: Buffer;
    privateKey: Buffer;
}
/**
 * Generate an Ed25519 identity key pair for an agent.
 * The identity key is long-lived — generated once and persisted.
 */
export declare function generateIdentityKeyPair(): KeyPair;
/**
 * Generate an ephemeral X25519 key pair for Diffie-Hellman exchange.
 * Ephemeral keys are single-use per handshake.
 */
export declare function generateEphemeralKeyPair(): KeyPair;
/**
 * Ed25519 sign a message.
 * Returns a 64-byte signature.
 */
export declare function sign(privateKeyRaw: Buffer, message: Buffer): Buffer;
/**
 * Ed25519 verify a signature.
 */
export declare function verify(publicKeyRaw: Buffer, message: Buffer, signature: Buffer): boolean;
/**
 * X25519 Diffie-Hellman key exchange.
 * Returns a 32-byte shared secret.
 */
export declare function ecdh(privateKeyRaw: Buffer, publicKeyRaw: Buffer): Buffer;
/**
 * HKDF-SHA256 key derivation for relay tokens.
 * Returns a 32-byte derived key.
 */
export declare function deriveRelayToken(sharedSecret: Buffer, salt: Buffer, info: string): Buffer;
/** Pinned BIP-39 English wordlist sha256 (newline-joined) — asserted at load (FD1). */
export declare const SAS_WORDLIST_SHA256 = "187db04a869dd9bc7be80d21a86497d692c0db6abd3aa8cb6be5d618ff757fae";
/**
 * Load + verify the vendored BIP-39 English wordlist (2048 words, 11 bits/word).
 * ONLY a fixed index→word table is used — NONE of BIP-39's mnemonic/checksum/
 * seed/PBKDF2/NFKD semantics apply (FD1). Fails closed on tamper/length/hash.
 */
export declare function loadSasWordlist(): string[];
/**
 * Derive the 12-byte SAS key material (FD2).
 * `sasBits = HKDF-SHA256(ikm=sharedSecret, salt=sort(idPubA‖idPubB), info="threadline-sas-v1", L=12)`.
 */
export declare function deriveSasBits(sharedSecret: Buffer, identityPubA: Buffer, identityPubB: Buffer): Buffer;
/**
 * Render the 6-word SAS from the SAS bits (FD1/FD2): leading 66 bits, big-endian,
 * split into 6 × 11-bit indices into the wordlist. Both sides produce the identical array.
 */
export declare function deriveSAS(sharedSecret: Buffer, identityPubA: Buffer, identityPubB: Buffer): string[];
/**
 * sasFingerprint (FD3) = first 8 bytes (hex) of SHA-256("threadline-sas-fp-v1" ‖ sasBits).
 * This is the value logged/audited + bound into the receipt; the SAS WORDS are never logged.
 */
export declare function deriveSasFingerprint(sasBits: Buffer): string;
/**
 * pairingId (FD4) — identifies THIS handshake instance (epoch binding).
 * `HKDF-SHA256(ikm=sharedSecret, salt=sort(idPubA‖idPubB), info="threadline-pairing-id-v1", L=16)` hex.
 */
export declare function derivePairingId(sharedSecret: Buffer, identityPubA: Buffer, identityPubB: Buffer): string;
/**
 * Compute a challenge response for the handshake.
 *
 * Signs: SHA256(nonce || identity_pub_A || identity_pub_B || eph_pub_A || eph_pub_B)
 *
 * This binds the challenge to both identities and both ephemeral keys,
 * preventing relay and mismatch attacks.
 */
export declare function computeChallengeResponse(signingKey: Buffer, nonce: string, identityPubA: Buffer, identityPubB: Buffer, ephPubA: Buffer, ephPubB: Buffer): Buffer;
//# sourceMappingURL=ThreadlineCrypto.d.ts.map