-
-
Notifications
You must be signed in to change notification settings - Fork 655
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
Add support for Zcash unified addresses #2371
Conversation
82cce03
to
ee68a69
Compare
core/SConscript.firmware
Outdated
@@ -5,6 +5,7 @@ import os | |||
|
|||
BITCOIN_ONLY = ARGUMENTS.get('BITCOIN_ONLY', '0') | |||
EVERYTHING = BITCOIN_ONLY != '1' | |||
USE_ZCASH = BITCOIN_ONLY == '1' # Zcash parasitizes on BITCOIN_ONLY free memory |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would mean that Bitcoin-only firmware automatically has Zcash, then it's not Bitcoin-only. This should be something like USE_ZCASH = ARGUMENTS.get('USE_ZCASH', '0')
.
- We should do some memory analysis on this branch to figure out what's bloating the firmware so much and whether it's really needed. I suppose it's the Rust crates? Will we really need the entire thing?
- If we accept that a special Zcash firmware will be needed, then we need to do some refactoring around
BITCOIN_ONLY
, seeBITCOIN_ONLY
feature is not additive #2370. - A separate CI build will then be needed for both the Zcash firmware and Zcash emulator.
@@ -145,6 +151,15 @@ def by_name(name: str) -> CoinInfo: | |||
${attr}=${func(coin[attr])}, | |||
% endfor | |||
) | |||
% endfor | |||
if utils.USE_ZCASH: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be utils.USE_ZCASH or not utils.BITCOIN_ONLY
, or something similar, depending on #2375.
I realized why the flash was overflowing. Crate According to my analysis, dependencies are under 8.7 KiB.
|
Is this for the firmware or for the emulator? I'm asking because e.g. Honestly, I am unsure whether SIMD makes sense for Cortex-M4 at all, because IIRC SIMD is supported only on Cortex-A series. So maybe we could switch to non-SIMD version of blake2b? |
Good job! The code duplication between C and Rust is unfortunate. The C implementation of blake2b also uses a lot of inlining and is one of the biggest crypto implementations that we have #1947 (comment). The only ones that are bigger are the ECC implementations that use precomputed tables. If we want to get rid of the code duplication, then one option is implementing f4jumble in C, which should be very easy. It's just a 4-round Feistel scheme with blake2b at its core: https://github.com/daira/jumble/blob/main/f4jumble.py. |
firmware
This is not so easy since we depend on
This is possible optimization for sure. |
I removed But since importing |
replacing this PR by #2398 |
Specification: ZIP-316
Unified addresses feature is conditioned by
USE_ZCASH
flag.USE_ZCASH=1
USE_ZCASH=BITCOIN_ONLY
, i.e. Zcash parasitizes on btconly free memory