Table of Contents

Class SealHomomorphicEncryptionProvider<T>

Namespace
AiDotNet.FederatedLearning.Cryptography
Assembly
AiDotNet.dll

Homomorphic encryption provider implemented using Microsoft SEAL (.NET wrapper).

public sealed class SealHomomorphicEncryptionProvider<T> : HomomorphicEncryptionProviderBase<T>, IHomomorphicEncryptionProvider<T>

Type Parameters

T

Numeric type.

Inheritance
SealHomomorphicEncryptionProvider<T>
Implements
Inherited Members

Remarks

For Beginners: This provider enables "sum then decrypt" aggregation: clients are simulated as encrypting their weighted updates, the server adds ciphertexts, and the trusted key holder decrypts the result.

Methods

AggregateEncryptedWeightedAverage(Dictionary<int, Vector<T>>, Dictionary<int, double>, Vector<T>, IReadOnlyList<int>, HomomorphicEncryptionOptions)

Aggregates selected parameter indices using homomorphic encryption to produce a weighted average.

public override Vector<T> AggregateEncryptedWeightedAverage(Dictionary<int, Vector<T>> clientParameters, Dictionary<int, double> clientWeights, Vector<T> globalBaseline, IReadOnlyList<int> encryptedIndices, HomomorphicEncryptionOptions options)

Parameters

clientParameters Dictionary<int, Vector<T>>

Per-client parameter vectors.

clientWeights Dictionary<int, double>

Per-client weights.

globalBaseline Vector<T>

Baseline vector used for indices not included in encryptedIndices.

encryptedIndices IReadOnlyList<int>

Indices to aggregate via HE.

options HomomorphicEncryptionOptions

HE options.

Returns

Vector<T>

A vector containing the weighted average for encrypted indices (baseline elsewhere).

GetProviderName()

Gets the provider name.

public override string GetProviderName()

Returns

string