HashCommitmentScheme<T>
Models & Types · AiDotNet.FederatedLearning.Verification
Implements a hash-based commitment scheme using SHA-256.
Inheritance: FederatedLearningComponentBase<T> → HashCommitmentScheme<T>
Implements: IGradientCommitment<T>, IZkProofSystem
For Beginners
This is the simplest commitment scheme. To commit to a value v:
How It Works
Security:
Limitation: Hash commitments are NOT homomorphic — the server cannot verify sums
of committed values. Use PedersenCommitment if you need that property.
Constructors
| Constructor | Summary |
|---|---|
HashCommitmentScheme(int randomnessLength) |
Initializes a new instance of HashCommitmentScheme. |
Properties
| Property | Summary |
|---|---|
string Name { get; } |
Methods
| Method | Summary |
|---|---|
GradientCommitmentData<T> Commit(Tensor<T> gradient) |
|
Tensor<T> Open(GradientCommitmentData<T> commitment) |
|
ValueTuple<byte[], byte[]> Commit(byte[] value) |
|
bool Verify(GradientCommitmentData<T> commitment) |
|
bool VerifyAggregation(IReadOnlyList<GradientCommitmentData<T>> individualCommitments, GradientCommitmentData<T> aggregateCommitment) |
Not supported for hash commitments (not homomorphic). |
bool VerifyOpening(byte[] commitment, byte[] value, byte[] randomness) |
|
bool VerifyRangeProof(byte[] proof, byte[] upperBound, byte[] commitment) |
|
byte[] GenerateRangeProof(byte[] value, byte[] upperBound, byte[] commitment, byte[] randomness) |