trezor-firmware
trezor-firmware copied to clipboard
Unify secp256k1_zkp usage
Resolves https://github.com/trezor/trezor-firmware/issues/1864.
- Moves the dispatching of
zkp_ecdsa_*()vs.ecdsa_*()functions toecdsa.cto simplify usage (no more#ifdefsfor this incoreandlegacycode).- As a side-result the above change automatically causes
crypto/bip32.cto use the secp256k1_zkp functions for public key derivation and signing without any code changes inbip32.c. - I renamed the trezor-crypto native implementations of the relevant
ecdsa_*functions totc_ecdsa_*so that they can be tested independently in thecryptotests. - It seems that the usage of secp256k1_zkp in
bip32.ccauses a different amount of data to be taken from the PRNG, which in turn causes the PIN matrix layouts to change, hence the changes to UI tests.
- As a side-result the above change automatically causes
- Implements Ethereum and EOS canonical ECDSA signing using the secp256k1_zkp library.
- Some of the EOS signatures (10/16) had to be changed, because the signing retry works differently than in the trezor-crypto native implementation.
- Signing of EOS operations will need to be tested extensively by QA!