boltlabs-inc / tss-ecdsa

An implementation of a threshold ECDSA signature scheme
Other
11 stars 5 forks source link

Change hashing function to `keccak256` #520

Closed gatoWololo closed 6 months ago

gatoWololo commented 6 months ago

Problem

We rely on the k256 and ecdsa Rust crypto libraries for signing and hashing. These libraries have a default hash function (digest) based on the curve you are using. We are using the Secp256k1 curve as you can see here:

k256::ecdsa
pub type VerifyingKey = ecdsa_core::VerifyingKey<Secp256k1>

So calling methods on our VerifyingKey will, by default, select a sha2 hash that corresponds to the Secp256k1 curve. This is not what we want. We need messages hashed and verified with keccak256 hash.

The easiest way to implement this seem to use the *_digest variant of the methods.

Task