Packing Whole Synchronization Windows into Ciphertexts for Private Multirate Co-Simulation

When several organizations couple their simulators, such as a transmission grid operator and distribution operators, or two subcontractors' thermal and control models, someone has to compute what each simulator feeds the others at every synchronization point. Today that coordinator sees everyone's boundary data in the clear. Homomorphic encryption fixes this in principle. It is a way to compute on encrypted numbers, and its modern lattice versions can hold thousands of values in one ciphertext and process them together, which is called ciphertext packing. In practice, each encrypted synchronization round carries a large fixed cost in key-switching operations, ciphertext transfer, and decryption, so encrypting the usual lock-step exchange of a few boundary values per step would multiply an already painful round-trip cost.

Our proposal is to stop encrypting synchronization points and instead encrypt synchronization windows. Each party simulates a whole window and packs its entire fine-grained boundary trajectory, sample by sample along the time axis, into the slots of a single CKKS ciphertext. CKKS is the approximate-arithmetic encryption scheme used for real-valued data. The coordinator then applies, under encryption, one fused linear map that does two jobs at once: it converts between the parties' different time grids, and it applies the private coupling model. This yields every partner's input trajectory for the next pass. The window is iterated until the trajectories agree, which is the standard waveform-relaxation pattern for co-simulation. The central technical claim is that with a time-major slot layout, the number of expensive slot rotations grows with the width of the resampling stencil and the coupling bandwidth, not with the number of samples in the window. If that holds, encryption makes rounds expensive but samples nearly free, which reverses the plaintext trade-off where wider windows buy speed at the cost of temporal precision.

Why this intersection, and what is new

Three findings frame the problem. Multiscale co-simulation of spiking and mean-field brain models is dominated by waiting at synchronization barriers. In that setting, aggregating data over longer windows "can increase speed by a factor of six" but costs temporal precision (Kusch et al., multiscale co-simulation design pattern). This motivates trading many small rounds for fewer large ones. In hybrid co-simulation, fixed communication intervals let a continuous state overshoot a threshold unnoticed (Co-Simulation of Hybrid Systems with SpaceEx and Uppaal). This constrains us: wider windows are only acceptable if fine intra-window resolution survives, which is exactly what packing the whole trajectory preserves. The closest privacy work couples a 57-bus transmission system with two 33-bus distribution systems through the ALADIN distributed optimizer. Its parties send only derivatives and dual variables, and runtime grows from about 0.42 s centralized to about 18.15 s geographically distributed, roughly a 25x slowdown, mostly from multi-round network latency (Ensuring Data Privacy in AC Optimal Power Flow with a Distributed Co-Simulation Framework). That paper motivates the problem twice over. Its coordinator still computes in plaintext, and its cost is driven by rounds, not by payload size. We differ in encrypting the coordinator's computation and in deliberately restructuring the exchange so that round count, not payload, is what we minimize.

On the packing side we reuse techniques rather than invent them. Packing independent samples so that data never crosses slots gives rotation-free throughput (CryptoNets). Row-wise dense packing with a few cyclic rotations supports iterative gradient methods under CKKS (Kim et al., logistic regression on approximate HE). Multiplexed channel packing cut rotations by 62% for encrypted convolutions (Lee et al., multiplexed parallel convolutions). Balanced 2D packing with interleaved repacking handles irregular graph aggregation (Penguin). All four target static, feed-forward computations on a fixed data shape. None packs a time axis, handles two simulators sampled at different rates, or sits inside an iterative synchronization loop. The research file found no paper that combines co-simulation synchronization with SIMD ciphertext packing.

Core Claim

Let party $B$'s boundary output over one window be the vector $y_B$ of $n_B$ samples on its fine time grid. Let $R$ be the resampling matrix onto party $A$'s grid, which in the multirate case is interpolation or decimation with a short stencil. Let $C$ be the coordinator's private coupling model, a block-banded matrix that mixes interface variables and possibly short time lags. The coordinator computes $A$'s next input trajectory as

$$u_A^{(k+1)} = C\,R\,y_B^{(k)},$$

where $k$ is the waveform-relaxation iteration index. Under encryption, a matrix applied to a packed vector costs one rotation per nonzero generalized diagonal of the matrix in the chosen slot layout. With samples placed in consecutive slots by time and interface variables interleaved at fixed stride, the product $CR$ has a number of nonzero diagonals bounded by roughly (stencil width) × (coupling bandwidth) × (rate ratio). This bound does not depend on $n_B$. We claim that fusing $C$ and $R$ into one precomputed plaintext matrix and choosing this layout keeps rotations per round essentially flat as the window grows, up to the slot capacity of $N/2$ for ring dimension $N$.

Encrypted results return to the parties after every iteration because they need their inputs anyway, so each ciphertext is freshly encrypted each round. Each round then consumes one or two multiplicative levels and needs no bootstrapping, the expensive noise-refreshing step. This sidesteps the noise-accumulation problem that Lee et al. had to solve for deep networks.

The threat model is honest-but-curious. The coordinator holds $C$ and no decryption key. Decryption is threshold-shared, so each party learns only its own coupled input. What a party can infer from its own input is inherent to the coupling and is out of scope.

Research Program

The first component is the layout and fused-map compiler. Given the parties' step sizes, the interface variables, and $C$, it emits the time-major slot layout and the diagonal decomposition of $CR$. It also chooses the window length that fits slot capacity, splitting across ciphertexts with a block arrangement in the style of Penguin when a window overflows one ciphertext.

The second component is the encrypted waveform-relaxation loop. We will study how CKKS approximation error, a small relative error injected each round, interacts with the convergence of the relaxation. The working hypothesis is that a contractive iteration keeps the injected error bounded at a level set by the encryption precision, not amplified by iteration count. We will measure this directly.

The third component handles events within a window. Threshold crossings cannot be detected on encrypted slots without polynomial approximation of comparison. Because each party sees its own trajectory in plaintext, we will have parties detect crossings locally and truncate the window at the event, with a zero-duration step as in Bogomolov et al.. The cost is a shorter window and an extra round, never an encrypted comparison.

Baselines

The naive reference point is lock-step plaintext co-simulation with a trusted coordinator over TLS at the finest common step. This is the accuracy ground truth and the speed floor. It is run on the same machines and network emulation as every other configuration.

The strongest existing privacy-oriented system is the ALADIN/eCoSim arrangement of Jiang et al., where the coordinator sees only derivative and dual information in plaintext. Its reported figures are about 0.42 s centralized, about 18.15 s distributed, and five iterations to an optimality gap of $2.46\times10^{-8}$ on the 57+2×33-bus system. We will reproduce its network setting with the same emulated latency on our hardware before any comparison. Beating it means matching its convergence quality with the coordinator learning nothing, at a wall-clock cost within a small constant factor of its distributed runtime. We do not expect to beat its speed.

The strongest cryptographic competitor is unpacked encrypted lock-step exchange. In one version each boundary sample is a separate CKKS ciphertext. In the other, matrix-vector work runs on scalar Paillier additive encryption, which suffices for a plaintext matrix times an encrypted vector. For a fair test we will also give Paillier the dense integer packing of Ge and Zdonik, since that paper reports packed Paillier aggregation running "slightly faster than symmetric encryption (DES) in some tests." No reported result was found on Lacuna for any homomorphically encrypted co-simulation coordinator, so this baseline is built by us under an identical security level of 128 bits.

Two ablations isolate the key ingredient. The first keeps CKKS packing but uses an interface-major layout, with variables contiguous and time strided. The second applies $R$ and $C$ as separate encrypted maps instead of fusing them. As an indication of how much layout alone can matter, Penguin reports a 10.62× speedup on Cora over prior layouts. Our claim succeeds if time-major fused packing shows rotations per round flat in window length while the ablations grow linearly.

Why not just…?

Why not just use a plaintext coordinator over a secure channel? It is faster, and if the coordinator is trusted it is the right answer. The setting here is one where the coordinator is a party with its own interests, such as a transmission operator coordinating competing distribution operators. Encryption in transit leaves its working memory exposed, which is the insider threat Ge and Zdonik describe. The plaintext baseline stays in every plot as the price of privacy.

Why not just widen the plaintext synchronization window? That buys the factor-of-six speedup Kusch et al. report, but only by averaging away intra-window detail, and it risks the overshoot Bogomolov et al. document. Our design also widens windows, but it keeps every fine sample. The experiment that settles this compares trajectory error against the fine lock-step truth at matched round counts.

Why not just use secure aggregation by additive masking, with no encryption scheme at all? This is a real threat. If the coordinator only needs sums of party contributions, masking is cheaper and we should use it. It fails once the coordinator applies its own private model $C$, because a masked vector cannot be multiplied by a secret matrix without heavier multiparty protocols. We will report which coupling structures in our benchmarks reduce to pure sums. For those, masking is the recommended baseline, and our method is claimed only for the rest.

Why not just replace the simulators with learned surrogates? The LIPS benchmark finds 10–100× speedups but frequent violations of physical laws and poor transfer to unseen topologies (LIPS). Surrogates also do not remove the need for a coordinator between private parties. They are orthogonal at best.

Proposed Experiments

The first testbed is a time-domain version of the integrated transmission–distribution system: the 57-bus transmission model with two 33-bus distribution models from Jiang et al., driven by load profiles. The distribution parties step faster than the transmission side, and the transmission operator's interface model plays the role of $C$. The second testbed is the room-heating co-simulation of Bogomolov et al., with plant and controller treated as separate private parties. Its single-model trajectory is a fidelity reference, reported as nearly identical at step 0.01. Its threshold events exercise the window-truncation mechanism.

The metrics are rotations and key-switches per round, wall-clock time per simulated second under emulated wide-area latency, waveform-relaxation iterations per window, and maximum trajectory error against fine lock-step plaintext. For the thermal benchmark we add event-timing error.

The decisive checks are three. First, rotations per round must stay flat as window length grows from tens to thousands of samples under the time-major fused layout, while growing for the ablations. If this fails, the core claim is false. Second, the error of the encrypted relaxation must plateau near CKKS precision rather than grow with iteration count. Third, at matched accuracy, total wall-clock time must beat both unpacked encrypted lock-step and packed Paillier by a margin that widens with network latency, since our gain comes from cutting rounds. If packed Paillier matches CKKS on these benchmarks, we will report that the time-major layout and fused map, not the scheme, carry the result.