ISecureComputationProtocol<T>

Interfaces · AiDotNet.FederatedLearning.MPC

Defines the contract for a multi-party computation protocol that can perform secure arithmetic and comparison operations on secret-shared values.

Known implementations: ArithmeticSecretSharing<T>, HybridMpcProtocol<T>

For Beginners

Imagine several parties each hold a piece of a number (a “share”). None of them know the original number, but together they can add, multiply, or compare secret numbers by exchanging specially crafted messages — all without ever revealing the actual values. This interface defines those operations.

How It Works

How it works in FL:

Methods

Method Summary
Tensor<T> Reconstruct(Tensor<T>[] shares) Reconstructs the plaintext value from a set of shares.
Tensor<T>[] ScalarMultiply(Tensor<T>[] shares, T scalar) Multiplies shares by a public (non-secret) scalar.
Tensor<T>[] SecureAdd(Tensor<T>[] sharesA, Tensor<T>[] sharesB) Performs element-wise secure addition of two sets of shares.
Tensor<T>[] SecureCompare(Tensor<T>[] sharesA, Tensor<T>[] sharesB) Performs secure comparison: is sharesA element-wise greater than sharesB? Returns shares of a binary tensor (1 where true, 0 where false).
Tensor<T>[] SecureMultiply(Tensor<T>[] sharesA, Tensor<T>[] sharesB) Performs element-wise secure multiplication of two sets of shares.
Tensor<T>[] Share(Tensor<T> value, int numberOfParties) Splits a plaintext value into secret shares for the specified number of parties.