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
TNumeric 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
clientParametersDictionary<int, Vector<T>>Per-client parameter vectors.
clientWeightsDictionary<int, double>Per-client weights.
globalBaselineVector<T>Baseline vector used for indices not included in
encryptedIndices.encryptedIndicesIReadOnlyList<int>Indices to aggregate via HE.
optionsHomomorphicEncryptionOptionsHE options.
Returns
- Vector<T>
A vector containing the weighted average for encrypted indices (baseline elsewhere).
GetProviderName()
Gets the provider name.
public override string GetProviderName()