Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SFT-3618: Use only rust-secp256k1. #502

Merged
merged 13 commits into from
May 15, 2024

Conversation

jeandudey
Copy link
Contributor

No description provided.

For consistency.

* extmod/foundation-rust/include/foundation.h: Re-generate file.
* extmod/foundation-rust/src/secp256k1.rs
(foundation_secp256k1_schnorr_sign): Rename this ...
(foundation_secp256k1_sign_schnorr): ... to this.
* extmod/foundation/modfoundation-secp56k1.h
(mod_foundation_secp256k1_sign_schnorr): Update.
* extmod/foundation-rust/include/foundation.h: Re-generate file.
* extmod/foundation-rust/src/secp256k1.rs
(foundation_secp256k1_sign_ecdsa): New function.
* extmod/foundation/modfoundation-secp56k1.h
(mod_foundation_secp256k1_sign_ecdsa): New function.
(mod_foundation_secp256k1_sign_ecdsa_obj): New variable.
(mod_foundation_secp256k1_globals_table): Add MP_QSTR_sign_ecdsa.
* extmod/foundation/modfoundation-secp56k1.h
(mod_foundation_secp256k1_public_key_schnorr): New function.
(mod_foundation_secp256k1_public_key_schnorr_obj): New variable.
(mod_foundation_secp256k1_globals_table): Add MP_QSTR_public_key_schnorr.
* extmod/foundation-rust/include/foundation.h: Re-generate file.
* extmod/foundation-rust/src/secp256k1.rs
(secp256k1_public_key_schnorr): New function.
* ports/stm32/boards/Passport/modules/tasks/nostr_key_task.py
(nostr_key_task): Use secp256k1.public_key_schnorr instead of
nostr_pubkey_from_pk.
* ports/stm32/boards/Passport/modules/utils.py
(nostr_pubkey_from_pk): Remove function.
* ports/stm32/boards/Passport/modules/tasks/sign_psbt_task.py
(sign_psbt_task): Use foundation.secp256k1.sign_ecdsa.
* ports/stm32/boards/Passport/modules/utils.py
(sign_message_digest): Ditto.
* extmod/trezor-firmware/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c:
(modtrezorcrypto-secp256k1.h): Remove inclusion.
(mp_module_trezorcrypto_globals_table): Remove MP_QSTR_secp256k1.
* py/py.mk (PY_EXTMOD_O_BASENAME): Remove
extmod/trezor-firmware/crypto/shamir.o and
extmod/trezor-firmware/crypto/schnorr.o.
* extmod/trezor-firmware/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c
(FOUNDATION_ADDITIONS): Remove definition.
* py/py.mk (CFLAGS_MOD): Add -DFOUNDATION_ADDITIONS=1.
* extmod/trezor-firmware/crypto/bip32.c (get_curve_by_name): Disable
getting nist256p1 information to avoid linking.
* py/py.mk (PY_EXTMOD_O_BASENAME): Remove
extmod/trezor-firmware/crypto/nist256p1.o.
* extmod/trezor-firmware/crypto/bip32.c: Avoid using unused curves.
* extmod/trezor-firmware/crypto/hasher.c: Disable various hashes.
* extmod/trezor-firmware/crypto/hasher.h: Ditto.
* extmod/trezor-firmware/crypto/secp256k1.c: Remove unused curves.
* py/py.mk (PY_EXTMOD_O_BASENAME): Remove
extmod/trezor-firmware/crypto/groestl.o,
extmod/trezor-firmware/crypto/blake256.o,
extmod/trezor-firmware/crypto/blake2b.o and
extmod/trezor-firmware/crypto/blake2s.o.
* py/py.mk (CFLAGS_MOD): Add -DUSE_PRECOMPUTED_CP=0.
* extmod/foundation-rust/Cargo.toml (dependencies) <secp256k1>: Enable
lowmemory feature.
* extmod/foundation-rust/Cargo.lock: Update lockfile.
* extmod/foundation-rust/Cargo.toml (dependencies) <bitcoin_hashes>: New
dependency, enable small-hash.
@jeandudey jeandudey merged commit c166616 into dev-v2.4.0 May 15, 2024
18 checks passed
@jeandudey jeandudey deleted the jeandudey/sft-3618-use-only-rust-secp256k1 branch May 15, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants