export declare const NET_PACKET_COOKIE_REQUEST = 24; export declare const NET_PACKET_COOKIE_RESPONSE = 25; export declare const NET_PACKET_CRYPTO_HS = 26; export declare const NET_PACKET_CRYPTO_DATA = 27; export type CookieRequest = { senderDhtPublicKey: Uint8Array; senderRealPublicKey: Uint8Array; echo: bigint; }; export type CookieResponse = { cookie: Uint8Array; echo: bigint; }; export type CryptoHandshake = { recipientCookie: Uint8Array; baseNonce: Uint8Array; sessionPublicKey: Uint8Array; cookieHash: Uint8Array; embeddedCookie: Uint8Array; senderRealPublicKey: Uint8Array; senderDhtPublicKey: Uint8Array; }; export declare function createCookieRequest(opts: { senderRealPublicKey: Uint8Array; senderDhtPublicKey: Uint8Array; senderDhtSecretKey: Uint8Array; receiverDhtPublicKey: Uint8Array; echo: bigint; }): Uint8Array; export declare function openCookieRequest(packet: Uint8Array, opts: { receiverDhtSecretKey: Uint8Array; }): CookieRequest | undefined; export declare function createCookieResponse(opts: { request: CookieRequest; receiverDhtSecretKey: Uint8Array; receiverCookieSymmetricKey: Uint8Array; }): Uint8Array; export declare function openCookieResponse(packet: Uint8Array, opts: { receiverDhtPublicKey: Uint8Array; senderDhtSecretKey: Uint8Array; }): CookieResponse | undefined; export declare function openCookie(cookie: Uint8Array, opts: { symmetricKey: Uint8Array; }): { timestamp: bigint; realPublicKey: Uint8Array; dhtPublicKey: Uint8Array; } | undefined; export declare function createCryptoHandshake(opts: { recipientCookie: Uint8Array; baseNonce: Uint8Array; sessionPublicKey: Uint8Array; senderRealSecretKey: Uint8Array; senderRealPublicKey: Uint8Array; senderDhtPublicKey: Uint8Array; receiverRealPublicKey: Uint8Array; /** * Peer's DHT public key. Falls back to receiverRealPublicKey when omitted * (Carrier C SDK uses the same key for real and DHT identity). */ receiverDhtPublicKey?: Uint8Array; localCookieSymmetricKey: Uint8Array; }): Uint8Array; export declare function openCryptoHandshake(packet: Uint8Array, opts: { receiverRealSecretKey: Uint8Array; receiverCookieSymmetricKey: Uint8Array; }): CryptoHandshake | undefined; export declare function createCryptoDataPacket(opts: { sessionSharedKey: Uint8Array; sentNonce: Uint8Array; bufferStart: number; packetNumber: number; payload: Uint8Array; }): Uint8Array; export declare function openCryptoDataPacket(packet: Uint8Array, opts: { sessionSharedKey: Uint8Array; recvBaseNonce: Uint8Array; }): { payload: Uint8Array; bufferStart: number; packetNumber: number; nonceLast2: number; /** The exact nonce this packet decrypted with. The caller must track * recvBaseNonce = usedNonce (+1 for the next expected) — NOT overwrite * just the low two bytes, which loses the carry into byte 21. */ usedNonce: Uint8Array; } | undefined; export declare function incrementNonce(nonce: Uint8Array): void;