mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-03-30 23:15:44 +00:00
![]() The new method needs about 30 % less time for prime256k1 and is about twice as fast for other moduli. The base algorithm is the same. The code is also a bit smaller and doesn't need the 8 kb precomputed table. Important canges: 1. even/odd distinction so that we need to test only one of the numbers for being even. This also leads to less duplicated code. 2. Allow for shifting by 32 bits at a time in the even test. 3. Pack u,s and v,r into the same array, which saves a bit of stack memory. 4. Don't divide by two after subtraction; this simplifies code. 5. Abort as soon as u,v are equal, instead of subtracting them. 6. Use s instead of r after the loop; no negation needed. 7. New code that divides by 2^k fast without any precomputed values. |
||
---|---|---|
gui | ||
tools | ||
.gitignore | ||
aes_modes.c | ||
aes.h | ||
aescrypt.c | ||
aeskey.c | ||
aesopt.h | ||
aestab.c | ||
aestab.h | ||
AUTHORS | ||
base58.c | ||
base58.h | ||
bignum.c | ||
bignum.h | ||
bip32.c | ||
bip32.h | ||
bip39_english.h | ||
bip39.c | ||
bip39.h | ||
c.pxd | ||
CMakeLists.txt | ||
ecdsa.c | ||
ecdsa.h | ||
hmac.c | ||
hmac.h | ||
LICENSE | ||
Makefile | ||
MANIFEST.in | ||
options.h | ||
pbkdf2.c | ||
pbkdf2.h | ||
rand.c | ||
rand.h | ||
README.md | ||
ripemd160.c | ||
ripemd160.h | ||
secp256k1.c | ||
secp256k1.h | ||
setup.py | ||
sha2.c | ||
sha2.h | ||
test-openssl.c | ||
test.py | ||
tests.c | ||
TrezorCrypto.pyx |
trezor-crypto
Heavily optimized cryptography algorithms for embedded devices.
These include:
- AES/Rijndael encryption/decryption
- Big Number (256 bit) Arithmetics
- BIP32 Hierarchical Deterministic Wallets
- BIP39 Mnemonic code
- ECDSA signing/verifying (only hardcoded secp256k1 curve, uses RFC6979 for deterministic signatures)
- ECDSA public key derivation + Base58 address representation
- HMAC-SHA256 and HMAC-SHA512
- PBKDF2
- RIPEMD-160
- SHA256/SHA512
- unit tests (using Check - check.sf.net; in tests.c)
- tests against OpenSSL (in test-openssl.c)
Distibuted under MIT License.