cosmos / ledger-cosmos-obsolete

Ledger Nano S support for Tendermint/Cosmos
Apache License 2.0
42 stars 29 forks source link

Extract correct public key for ed25519 #44

Closed brejski closed 6 years ago

brejski commented 6 years ago

Ledger keeps all the public keys in cx_ecfp_public_key_t structure, inside the 65 byte long buffer. ed25519 public key has 32 bytes which are stored at the end in the reverse order (different endianess).

This fix was inspired by the Stellar app (https://github.com/lenondupe/ledger-app-stellar) This change fixes Test_TestPublicKeyFromLedgerAndTendermint test which compares public key created by ledger with public key created by tendermint api (for the same private key bytes).