1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-10-13 11:29:11 +00:00
Commit Graph

15 Commits

Author SHA1 Message Date
matejcik
eb2b58e1f4 cosi: tests for new verify_m_of_n method 2018-10-12 12:58:49 +02:00
matejcik
ba365b5486 cosi: replace slow djb implementation of ed25519 with an optimized one
from https://github.com/pyca/ed25519

This makes the calculations several orders of magnitude faster, which
allows us to run the CoSi test in Travis. It also doesn't stop firmware
update for several seconds while we validate the CoSi signatures.

It's still essentially the same insecure implementation, fallible to all
the same timing attacks, and it shouldn't be used for anything except
validating public signatures of public data. But now it also takes about
as much time as it should on modern hardware.
2018-10-12 12:58:44 +02:00
matejcik
a66cf99b74 cosi: fix bug in signing code, make tests pass 2018-10-02 16:11:20 +02:00
matejcik
15d3b0c722 cosi: clarify convoluted parts of local signing code 2018-09-27 16:53:57 +02:00
Pavol Rusnak
4a0ca873eb trezorlib+tools: remove usage of binascii 2018-09-27 16:52:28 +02:00
matejcik
3d3e9b67b4 style: apply black/isort 2018-08-13 18:22:19 +02:00
matejcik
29f928e4f2 style: bare excepts, left-over bad imports 2018-08-10 16:05:14 +02:00
matejcik
5259146a0b style: remove unused imports with autoflake 2018-08-10 15:48:39 +02:00
matejcik
7e90e89e69 client: get rid of TrezorClient._convert_prime 2018-07-09 13:56:22 +02:00
matejcik
f3a042db80 trezorlib: split out methods from ProtocolMixin 2018-07-09 13:56:22 +02:00
matejcik
54f1599a5a regenerate license headers
This clarifies the intent: the project is licenced under terms
of LGPL version 3 only, but the standard headers cover only "3 or later",
so we had to rewrite them.

In the same step, we removed author information from individual files
in favor of "SatoshiLabs and contributors", and include an AUTHORS
file that lists the contributors.

Apologies to those whose names are missing; please contact us if you wish
to add your info to the AUTHORS file.
2018-06-21 16:49:13 +02:00
matejcik
a0f73b726d cosi: typehints, documentation, removed selftest 2018-05-28 14:20:26 +02:00
matejcik
2fdb5cd538 cosi: publish "pubkey from privkey" operation from ed25519 2018-05-25 13:12:42 +02:00
matejcik
886e269e2f trezorlib: mark ed25519 impl as private 2018-05-25 13:07:02 +02:00
matejcik
db92b13f97 cosi: move things around
ed25519raw is moved back to trezorlib
ed25519cosi is renamed to cosi, and has a couple more functions,
with the expectation that TrezorClient.cosi_* methods will move there.

Also most code shouldn't need ed25519raw for anything, so it might get
renamed to "_ed25519" to indicate that it's a private implementation.

For now, I added a "verify" method to cosi, so that you don't need to
call into ed25519raw.checkvalid. But trezor-core's keyctl is also
using ed25519raw.publickey. I'm not sure if that's worth replicating
in cosi, or whether to just leave it be, so I'm leaving it be for now.

Importantly, new function "sign_with_privkey" does that math thing that
was part of the selftest and is also explicitly listed in keyctl.
(it's called sign_with_privkey because I expect to have a "sign" method
here that calls into Trezor)
2018-05-17 12:53:01 +02:00