hashgraph / hedera-services

Crypto, token, consensus, file, and smart contract services for the Hedera public ledger
Apache License 2.0
295 stars 129 forks source link

TSS Library: Define and create a Test Plan #14134

Closed mxtartaglia-sl closed 1 month ago

mxtartaglia-sl commented 3 months ago

This task aims to define the testing plan for assuring the quality of the project's cryptographic components.

Goals:

Since cryptographic code is often difficult to test, we should design our test cases based on the cryptographic properties that these implementations should satisfy.

Proposed tests

Pairings Keys

What should the comparison check?

Pairings Signatures

Pairings

TSS

Other tests mentioned in the bibliography that might apply for the TssMessage generation:

EVM

Material:

mxtartaglia-sl commented 3 months ago

In the TSS-Library, the operations that rely on a source of randomness are:

As for the operations that rely on order:

In Pairings-Signature-Library, the creation of the private key depends on a random value.

mxtartaglia-sl commented 1 month ago

Here is the document: https://docs.google.com/document/d/1Dc22J8-E39Bq__soPwh1yhDPrhXZE_aeoeJeBaugapo/edit?usp=sharing @rsinha @litt3 @edward-swirldslabs @timo0 @lpetrovic05 cc: @poulok Please review Thanks

lpetrovic05 commented 1 month ago

@mxtartaglia-sl It seems I cannot comment in the doc, so I will leave my comments here:

Measure the time taken for pairings, group operations, and field operations. → what are the performance parameters to compare against? What do we do with the results?

I would say we should have a JMH performance test at the top level. So generate shares, aggregate signatures and so on. What I have been doing with JMH results is just adding them to the class as a comment. I think these results should give us an idea about how long certain tasks take, how many shares can we practically support etc.

edward-swirldslabs commented 1 month ago

I'm in favor of prioritizing the complex algorithmic tests and leaving the functionality tests of basic algebraic operations till the vary end.