/** * @octomil/browser — Secure aggregation (SecAgg / SecAgg+) * * Implements pairwise masking using ECDH key exchange and Shamir's * secret sharing, all via the Web Crypto API. Ensures the server * only sees the aggregate of client updates, never individual deltas. */ import type { WeightMap } from "./types.js"; export declare class SecureAggregation { private keyPair; /** Generate an ECDH key pair for this round. */ generateKeyPair(): Promise<{ publicKey: JsonWebKey; }>; /** Derive a shared secret with a peer using ECDH. */ deriveSharedSecret(peerPublicKeyJwk: JsonWebKey): Promise; /** * Generate a deterministic PRG mask from a shared secret. * Uses the secret as a seed to produce `length` float values. */ createMask(secret: ArrayBuffer, length: number): Promise; /** Add masks to a weight update: masked = delta + sum(masks). */ maskUpdate(delta: WeightMap, masks: Map): WeightMap; /** Remove masks of dropped peers from the aggregated sum. */ unmask(maskedSum: WeightMap, droppedMasks: Map): WeightMap; } export interface SecretShare { x: number; y: number; } /** * Split a secret into `numShares` shares requiring `threshold` to reconstruct. */ export declare function shamirSplit(secret: number, threshold: number, numShares: number): SecretShare[]; /** * Reconstruct a secret from `threshold` shares via Lagrange interpolation. */ export declare function shamirReconstruct(shares: SecretShare[]): number; export declare class SecAggPlus extends SecureAggregation { private readonly threshold; constructor(threshold: number); /** * Split a shared secret into Shamir shares so that any `threshold` * surviving peers can reconstruct the mask of a dropped peer. */ splitSecret(secret: number, numPeers: number): SecretShare[]; /** Reconstruct a dropped peer's secret from collected shares. */ reconstructSecret(shares: SecretShare[]): number; } //# sourceMappingURL=secure-aggregation.d.ts.map