You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Keep thiserror usage behind thiserror feature — thiserror does not support #![no_std] and hardware wallets will want to minimize code size so core::fmt is out of the question.
Add trait Blake2b and provide implementation for blake2b_simd when feature is enabled. Hardware wallets have their own BLAKE2b implementations and will want to minimize code size by not adding another. For other embedded systems, there may be implementations more suitable than blake2b_simd. This requires adding a Blake2b type parameter to struct HStar, PublicKey::verify, and SecretKey::sign.
Wrap blake2b_simd and thiserror in an std feature, and add #![cfg_attr(not(feature = "std"), no_std)]. Replace all use std:: with use core::.
Issues
The BLAKE2b issue will be present in other crates that hardware wallets need to use, so trait Blake2b would be useful there. Therefore, it doesn't seem like a good idea to define that trait in this crate. Which crate should it go in?
How much code size does rand_core add? This is important for hardware wallets, especially ones that are not already using Rust as they will also incur the code size cost of the standard library. If it adds too much code size, perhaps another signing method should be added to SecretKey, which accepts the entropy as a parameter, rather than accepting a CryptoRng instance.
The text was updated successfully, but these errors were encountered:
@saleemrashid commented on Tue Feb 25 2020
Current Plan
Keep
thiserror
usage behindthiserror
feature —thiserror
does not support#![no_std]
and hardware wallets will want to minimize code size socore::fmt
is out of the question.Add
trait Blake2b
and provide implementation forblake2b_simd
when feature is enabled. Hardware wallets have their own BLAKE2b implementations and will want to minimize code size by not adding another. For other embedded systems, there may be implementations more suitable thanblake2b_simd
. This requires adding aBlake2b
type parameter tostruct HStar
,PublicKey::verify
, andSecretKey::sign
.Wrap
blake2b_simd
andthiserror
in anstd
feature, and add#![cfg_attr(not(feature = "std"), no_std)]
. Replace alluse std::
withuse core::
.Issues
The BLAKE2b issue will be present in other crates that hardware wallets need to use, so
trait Blake2b
would be useful there. Therefore, it doesn't seem like a good idea to define that trait in this crate. Which crate should it go in?How much code size does
rand_core
add? This is important for hardware wallets, especially ones that are not already using Rust as they will also incur the code size cost of the standard library. If it adds too much code size, perhaps another signing method should be added toSecretKey
, which accepts the entropy as a parameter, rather than accepting aCryptoRng
instance.The text was updated successfully, but these errors were encountered: