Add comprehensive tests for BLS SecretKeyShare, PublicKeyShare, and DHKeyExchange functions #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR addresses missing test coverage for critical BLS threshold cryptography functions and DHKeyExchange implementation in
src/test/bls_tests.cpp.Problem
The BLS module was missing comprehensive tests for:
SecretKeyShareandPublicKeySharethreshold cryptography functionsDHKeyExchangeimplementation edge cases and error conditionsWhile basic functionality was tested in
FuncThresholdSignatureandFuncDHExchange, there was no focused testing of error conditions, edge cases, and specific properties of these cryptographic primitives.Solution
Added four new comprehensive test functions:
1.
FuncSecretKeyShare()- Threshold Secret Key Testing2.
FuncPublicKeyShare()- Threshold Public Key TestingSecretKeyShareandPublicKeyShare(derived public keys must match)3. Enhanced
FuncDHExchange()- Diffie-Hellman Key ExchangeDH(a,B) == DH(b,A)4.
FuncDHExchangeExtended()- Multi-Participant DH TestingTest Cases Added
bls_secret_key_share_testsbls_public_key_share_testsbls_dh_exchange_extended_testsAll tests are implemented to work with both legacy and new BLS schemes, following the existing pattern of testing each function with both
trueandfalselegacy scheme parameters.Validation
The implementation has been validated for:
This ensures the critical threshold cryptography and key exchange functions are thoroughly tested against edge cases and error conditions that could affect security in production.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
dash-depends-sources.s3-website-us-west-2.amazonaws.comcurl --location --fail --connect-timeout 30 --retry 3 -o /home/REDACTED/work/dash/dash/depends/work/download/gmp-6.3.0/gmp-6.3.0.tar.bz2.temp REDACTED(dns block)ftp.gnu.orgcurl --location --fail --connect-timeout 30 --retry 3 -o /home/REDACTED/work/dash/dash/depends/work/download/gmp-6.3.0/gmp-6.3.0.tar.bz2.temp REDACTED(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.