Closed afck closed 6 years ago
Here's the current plan of attack: We want to replace the underlying groups (G1, G2) of the pairing based crypto with those that are cheaper to operate, only preserving "accidental collision resistance". Any attacker will be able to trivially break our new crypto-system, but we still expect no collisions or valid signatures when generating things randomly or performing trivial replay attacks.
Currently, the plan is to choose G_1 = G_2 = (F_p, +)
, with F_p
being the finite field of order p
, p
being prime and e : (G_1, G_2) -> G_T
defined as e(q, p) := q * p
. This should vastly speed-up test-cases and allow focusing on attacks on the protocol instead of the underlying cryptography.
To implement this, we add type aliases for the types from pairing
currently used, possibly using associated types again. A feature flag that disables cryptography/enables mocktography by changing the definition of the type alias should be added to threshold_crypto
and hbbft
. Optionally, it should add a prominent warning if it is enabled.
As discussed, let's:
mock-pairing
?)pairing
.i-know-what-i-am-doing-and-want-to-disable-encryption-for-testing-purposes
feature to threshold_crypto
.pairing
from threshold_crypto
.pairing
dependency from hbbft
and add the i-know-what-i-am-doing-and-want-to-disable-encryption-for-testing-purposes
flag there, too.all(not(test), feature = "i-know-…")
?This was merged in #268.
The tests spend most of their time doing cryptography. We should add (via a feature flag?) mock crypto primitives so that we can test more different message flows and scenarios in a reasonable amount of time.