Skip to content
YUENIX-FHEContact
Preview documentation. The YUENIX-FHE 1.0 API is in development and names or signatures may change before release. Request an evaluation

Encrypted aggregation

Aggregation programs combine one vector from each of many clients. A typical use is federated learning, where clients send model updates and the server combines them without seeing any single update.

A yuenix_vectors handle holds one encrypted vector per client (a row). Vectors longer than one ciphertext are split into blocks automatically. Rows come from encryption by the key holder or from transciphering.

Function Result
yuenix_sum encrypted sum of all rows
yuenix_mean encrypted mean of all rows
yuenix_weighted_sum Σ wᵢ·rowᵢ with public or encrypted weights wᵢ
yuenix_pairwise_distances encrypted matrix of squared L2 distances between rows

Robust aggregation rules discard outliers before averaging. In YUENIX the selection stays encrypted: the server never learns which rows were chosen.

Preset Rule
YUENIX_SELECT_KRUM choose the row whose n − f − 2 nearest neighbours are closest
YUENIX_SELECT_MULTI_KRUM average the n − f − 2 rows with the best Krum scores

In 1.0 the presets support n ∈ {8, 16, 32, 64, 128} rows with f = n/4.

with ev.vectors(rows=16, dimensions=d) as vs:
for i, rec in enumerate(records):
vs.transcipher(i, rec)
keys.admit(vs) # GCM only
result = vs.select(yuenix.Select.MULTI_KRUM)
update = keys.decrypt_vector(result) # numpy float64[d]

Distances and selections are approximate. The release notes for each SDK build list the measured error of every preset for the aggregated vector and for the selection mask.