/** * SDN unified cross-runtime ECIES (docs/UNIFIED_ECIES.md) — JS/browser side. * * Consumes/produces the same SDS `$ENC` header + `$KMF` payload as the Go * reference (sdn-server internal/ecies) and the C++/WASM path. The ECDH step * is parameterized by `ENC.KEY_EXCHANGE` (X25519 or Secp256k1); everything * after — HKDF-SHA256 key derivation and AES-256-CTR field encryption — is * curve-agnostic and byte-identical across runtimes. * * All crypto goes through the wasm wallet (native/WASM crypto boundary — no * WebCrypto, per the repo policy). */ /** Grant domain separator — matches the Go/C++ kGrantPayloadContext default. */ export declare const DEFAULT_GRANT_CONTEXT = "space-data-network/module-delivery/grant/v1"; export declare enum EciesKeyExchange { X25519 = 0, Secp256k1 = 1, P256 = 2 } export interface EciesWrapResult { encBytes: Uint8Array; kmfBytes: Uint8Array; } /** Unwrap a content key from an `$ENC` header + `$KMF` payload. */ export declare function eciesUnwrap(recipientPrivateKey: Uint8Array, encBytes: Uint8Array, kmfBytes: Uint8Array, context?: string): Promise; /** Wrap a 32-byte content key for a recipient, producing `$ENC` + `$KMF`. */ export declare function eciesWrap(recipientPublicKey: Uint8Array, contentKey: Uint8Array, options: { keyExchange: EciesKeyExchange; context?: string; ephemeralPrivateKey?: Uint8Array; recipientKeyId?: Uint8Array; nonceStart?: Uint8Array; }): Promise; /** One wrap target for a one-to-many content-key delivery. */ export interface EciesRecipient { /** X25519 (32 bytes) or secp256k1 compressed (33 bytes), matching keyExchange. */ publicKey: Uint8Array; keyExchange: EciesKeyExchange; /** Optional RECIPIENT_KEY_ID stamped into `$ENC` and echoed on the result. */ keyId?: Uint8Array; } /** One recipient's wrapped-key envelope produced by {@link eciesWrapForRecipients}. */ export interface EciesRecipientEnvelope { keyId?: Uint8Array; encBytes: Uint8Array; kmfBytes: Uint8Array; } /** * Unified ECIES one-to-many primitive (mirror of the Go `WrapForRecipients`): * the caller encrypts the content ONCE with `contentKey`, then this wraps that * single 32-byte content key independently for each recipient. Returns one * per-recipient `$ENC`/`$KMF` envelope; every envelope `eciesUnwrap`s to the * SAME `contentKey`, each recipient uses only its own envelope + private key, * and recipients may mix curves. This is the storefront/channel group-delivery * shape — encrypt-once content + N wrapped-key rows, no per-buyer re-encryption. */ export declare function eciesWrapForRecipients(contentKey: Uint8Array, recipients: EciesRecipient[], context?: string): Promise; //# sourceMappingURL=ecies.d.ts.map