verklegarden / crysol

Elliptic curve cryptography in pure Solidity for on- and offchain operations
Apache License 2.0
54 stars 2 forks source link

secp256k1: Introduce Felt type #10

Open pmerkleplant opened 8 months ago

pmerkleplant commented 8 months ago

Introduce field element type, called Felt, to circumvent having to bound scalar to Q manually. This should generally increase crysol's reliability, especially with regared to future curves.

Note that this requires refactoring of multiple types (eg SecretKey) and most of the testsuite.

pmerkleplant commented 8 months ago

This seems only reasonable if operator overloading is implemented to support common arithmetic and binary operators. However, it's questionable whether the increased security is worth the cumbersome implementation and, especially for users, type conversions.