Skip to content

Commit f8679ee

Browse files
committed
Merge branch 'rust-2021'
2 parents ff94842 + 1a56765 commit f8679ee

File tree

22 files changed

+44
-52
lines changed

22 files changed

+44
-52
lines changed

src/rust/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ members = [
2323
"bitbox02-sys",
2424
]
2525

26+
resolver = "2"
27+
28+
[workspace.dependencies]
29+
bitcoin = { version = "0.31.0", default-features = false, features = ["no-std"] }
30+
hex = { version = "0.4", default-features = false, features = ["alloc"] }
31+
lazy_static = { version = "1.4.0" }
32+
num-bigint = { version = "0.4.3", default-features = false }
33+
sha2 = { version = "0.10.8", default-features = false }
34+
sha3 = { version = "0.10.8", default-features = false }
35+
zeroize = "1.6.0"
36+
2637
[profile.release]
2738
# This only affects the .elf output. Debug info is stripped from the final .bin.
2839
# Paths to source code can still appear in the final bin, as they are part of the panic!() output.

src/rust/bitbox02-noise/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright 2020 Shift Cryptosecurity AG
2+
# Copyright 2024 Shift Crypto AG
23
#
34
# Licensed under the Apache License, Version 2.0 (the "License");
45
# you may not use this file except in compliance with the License.
@@ -15,8 +16,8 @@
1516
[package]
1617
name = "bitbox02-noise"
1718
version = "0.1.0"
18-
authors = ["Shift Crypto AG <support@shiftcrypto.ch>"]
19-
edition = "2018"
19+
authors = ["Shift Crypto AG <support@bitbox.swiss>"]
20+
edition = "2021"
2021
description = "BitBox02 noise protocol primitives"
2122
license = "Apache-2.0"
2223

src/rust/bitbox02-rust-c/Cargo.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright 2020 Shift Cryptosecurity AG
2+
# Copyright 2024 Shift Crypto AG
23
#
34
# Licensed under the Apache License, Version 2.0 (the "License");
45
# you may not use this file except in compliance with the License.
@@ -15,8 +16,8 @@
1516
[package]
1617
name = "bitbox02-rust-c"
1718
version = "0.1.0"
18-
authors = ["Shift Crypto AG <support@shiftcrypto.ch>"]
19-
edition = "2018"
19+
authors = ["Shift Crypto AG <support@bitbox.swiss>"]
20+
edition = "2021"
2021
license = "Apache-2.0"
2122

2223
[lib]
@@ -27,10 +28,10 @@ bitbox02-rust = { path = "../bitbox02-rust", optional = true }
2728
bitbox02 = { path = "../bitbox02", optional = true }
2829
bitbox02-noise = { path = "../bitbox02-noise", optional = true }
2930
util = { path = "../util" }
30-
hex = { version = "0.4", default-features = false }
31-
sha2 = { version = "0.10.8", default-features = false, optional = true }
32-
sha3 = { version = "0.10.8", default-features = false, optional = true }
33-
bitcoin = { version = "0.31.0", default-features = false, features = ["no-std"], optional = true }
31+
hex = { workspace = true }
32+
sha2 = { workspace = true, optional = true }
33+
sha3 = { workspace = true, optional = true }
34+
bitcoin = { workspace = true, optional = true }
3435

3536
[features]
3637
# Only one of the "target-" should be activated, which in turn defines/activates the dependent features.

src/rust/bitbox02-rust/Cargo.toml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Copyright 2020 Shift Cryptosecurity AG
2+
# Copyright 2024 Shift Crypto AG
23
#
34
# Licensed under the Apache License, Version 2.0 (the "License");
45
# you may not use this file except in compliance with the License.
@@ -15,8 +16,8 @@
1516
[package]
1617
name = "bitbox02-rust"
1718
version = "0.1.0"
18-
authors = ["Shift Crypto AG <support@shiftcrypto.ch>"]
19-
edition = "2018"
19+
authors = ["Shift Crypto AG <support@bitbox.swiss>"]
20+
edition = "2021"
2021
description = "BitBox02 functionality implemented in rust"
2122
license = "Apache-2.0"
2223

@@ -30,12 +31,12 @@ bitbox02 = {path = "../bitbox02"}
3031
util = {path = "../util"}
3132
binascii = { version = "0.1.4", default-features = false, features = ["encode"] }
3233
bitbox02-noise = {path = "../bitbox02-noise"}
33-
hex = { version = "0.4", default-features = false, features = ["alloc"] }
34-
sha2 = { version = "0.10.8", default-features = false }
35-
sha3 = { version = "0.10.8", default-features = false, optional = true }
34+
hex = { workspace = true }
35+
sha2 = { workspace = true }
36+
sha3 = { workspace = true, optional = true }
3637
digest = "0.10.6"
37-
zeroize = "1.6.0"
38-
num-bigint = { version = "0.4.3", default-features = false, optional = true }
38+
zeroize = { workspace = true }
39+
num-bigint = { workspace = true, optional = true }
3940
num-traits = { version = "0.2", default-features = false, optional = true }
4041
# If you change this, also change src/rust/.cargo/config.toml.
4142
bip32-ed25519 = { git = "https://github.com/digitalbitbox/rust-bip32-ed25519", tag = "v0.1.2", optional = true }
@@ -44,11 +45,11 @@ blake2 = { version = "0.10.6", default-features = false, optional = true }
4445
minicbor = { version = "0.20.0", default-features = false, features = ["alloc"], optional = true }
4546
crc = { version = "3.0.1", optional = true }
4647
ed25519-dalek = { version = "2.0.0", default-features = false, features = ["hazmat"], optional = true }
47-
lazy_static = { version = "1.4.0", optional = true }
48+
lazy_static = { workspace = true, optional = true }
4849
hmac = { version = "0.12.1", default-features = false, features = ["reset"] }
4950

5051
miniscript = { version = "11.0.0", default-features = false, features = ["no-std"], optional = true }
51-
bitcoin = { version = "0.31.0", default-features = false, features = ["no-std"], optional = true }
52+
bitcoin = { workspace = true, optional = true }
5253
# We don't rely on this dep directly, the miniscript/bitcoin deps do. We list it here to enable the
5354
# small-hash feature to reduce the binary size, saving around 2784 bytes (as measured at time of
5455
# writing, this might fluctuate over time).

src/rust/bitbox02-rust/src/hww/api/bitcoin.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ use pb::BtcCoin;
4646
use pb::BtcScriptConfig;
4747

4848
use alloc::string::String;
49-
use core::convert::TryFrom;
50-
use core::convert::TryInto;
5149

5250
/// Like `hww::next_request`, but for Bitcoin requests/responses.
5351
pub async fn next_request(response: pb::btc_response::Response) -> Result<Request, Error> {

src/rust/bitbox02-rust/src/hww/api/bitcoin/common.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use crate::xpubcache::Bip32XpubCache;
1919

2020
use alloc::string::String;
2121
use alloc::vec::Vec;
22-
use core::convert::TryFrom;
2322

2423
use pb::btc_script_config::SimpleType;
2524
pub use pb::btc_sign_init_request::FormatUnit;

src/rust/bitbox02-rust/src/hww/api/bitcoin/multisig.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ use crate::workflow::confirm;
2626

2727
use alloc::string::String;
2828
use alloc::vec::Vec;
29-
use core::convert::TryFrom;
30-
use core::convert::TryInto;
3129

3230
use sha2::{Digest, Sha256};
3331

src/rust/bitbox02-rust/src/hww/api/bitcoin/registration.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ use pb::btc_response::Response;
2323
use pb::btc_script_config::Config;
2424
use pb::BtcCoin;
2525

26-
use core::convert::TryFrom;
27-
2826
use super::multisig::SortXpubs;
2927

3028
use crate::workflow::{confirm, status, trinary_input_string};

src/rust/bitbox02-rust/src/hww/api/bitcoin/signmsg.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
// limitations under the License.
1414

1515
use alloc::vec::Vec;
16-
use core::convert::TryFrom;
17-
use core::convert::TryInto;
1816

1917
use sha2::{Digest, Sha256};
2018

src/rust/bitbox02-rust/src/hww/api/bitcoin/signtx.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ use crate::workflow::{confirm, status, transaction};
2323
use crate::xpubcache::Bip32XpubCache;
2424

2525
use alloc::vec::Vec;
26-
use core::convert::TryFrom;
27-
use core::convert::TryInto;
2826

2927
use pb::request::Request;
3028
use pb::response::Response;

0 commit comments

Comments
 (0)