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

Commits on May 13, 2024

  1. SFT-3618: Rename Schnorr sign function.

    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.
    jeandudey committed May 13, 2024
    Configuration menu
    Copy the full SHA
    0c78488 View commit details
    Browse the repository at this point in the history

Commits on May 14, 2024

  1. SFT-3618: Add foundation.secp256k1.sign_ecdsa.

    * 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.
    jeandudey committed May 14, 2024
    Configuration menu
    Copy the full SHA
    16dbb7d View commit details
    Browse the repository at this point in the history
  2. SFT-3618: Add foundation.secp256k1.public_key_schnorr.

    * 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.
    jeandudey committed May 14, 2024
    Configuration menu
    Copy the full SHA
    e2dcec5 View commit details
    Browse the repository at this point in the history
  3. SFT-3618: Use foundation.secp256k1.public_key_schnorr.

    * 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.
    jeandudey committed May 14, 2024
    Configuration menu
    Copy the full SHA
    0608f52 View commit details
    Browse the repository at this point in the history
  4. SFT-3618: Use foundation.secp256k1.sign_ecdsa.

    * 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.
    jeandudey committed May 14, 2024
    Configuration menu
    Copy the full SHA
    961d88a View commit details
    Browse the repository at this point in the history
  5. SFT-3618: Disable trezorcrypto.secp256k1.

    * extmod/trezor-firmware/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c:
    (modtrezorcrypto-secp256k1.h): Remove inclusion.
    (mp_module_trezorcrypto_globals_table): Remove MP_QSTR_secp256k1.
    jeandudey committed May 14, 2024
    Configuration menu
    Copy the full SHA
    4162ca6 View commit details
    Browse the repository at this point in the history
  6. SFT-3618: Don't compile unused files.

    * py/py.mk (PY_EXTMOD_O_BASENAME): Remove
    extmod/trezor-firmware/crypto/shamir.o and
    extmod/trezor-firmware/crypto/schnorr.o.
    jeandudey committed May 14, 2024
    Configuration menu
    Copy the full SHA
    6c01bc5 View commit details
    Browse the repository at this point in the history
  7. SFT-3618: Move FOUNDATION_ADDITIONS definition.

    * extmod/trezor-firmware/core/embed/extmod/modtrezorcrypto/modtrezorcrypto.c
    (FOUNDATION_ADDITIONS): Remove definition.
    * py/py.mk (CFLAGS_MOD): Add -DFOUNDATION_ADDITIONS=1.
    jeandudey committed May 14, 2024
    Configuration menu
    Copy the full SHA
    0912ff8 View commit details
    Browse the repository at this point in the history
  8. SFT-3618: Disable nist256p1 curve.

    * 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.
    jeandudey committed May 14, 2024
    Configuration menu
    Copy the full SHA
    7fab49a View commit details
    Browse the repository at this point in the history
  9. SFT-3618: Disable various hash algorithms.

    * 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.
    jeandudey committed May 14, 2024
    Configuration menu
    Copy the full SHA
    ffaaf04 View commit details
    Browse the repository at this point in the history
  10. SFT-3618: Disable secp256k1 precomputed table.

    * py/py.mk (CFLAGS_MOD): Add -DUSE_PRECOMPUTED_CP=0.
    jeandudey committed May 14, 2024
    Configuration menu
    Copy the full SHA
    40d1545 View commit details
    Browse the repository at this point in the history
  11. SFT-3618: Use lowmemory for secp256k1.

    * extmod/foundation-rust/Cargo.toml (dependencies) <secp256k1>: Enable
    lowmemory feature.
    jeandudey committed May 14, 2024
    Configuration menu
    Copy the full SHA
    b11b26b View commit details
    Browse the repository at this point in the history
  12. SFT-3618: Enable small-hash in bitcoin_hashes.

    * extmod/foundation-rust/Cargo.lock: Update lockfile.
    * extmod/foundation-rust/Cargo.toml (dependencies) <bitcoin_hashes>: New
    dependency, enable small-hash.
    jeandudey committed May 14, 2024
    Configuration menu
    Copy the full SHA
    059eb58 View commit details
    Browse the repository at this point in the history