Skip to content

Commit

Permalink
Merge pull request #397 from Nitrokey/dedup
Browse files Browse the repository at this point in the history
Remove duplicate dependencies
  • Loading branch information
sosthene-nitrokey authored Dec 4, 2023
2 parents 77bc3eb + f9c9201 commit a6dbc61
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 91 deletions.
89 changes: 10 additions & 79 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ trussed-staging = { git = "https://github.com/Nitrokey/trussed-staging.git", tag
trussed-auth = { git = "https://github.com/trussed-dev/trussed-auth", rev = "4b8191f248c26cb074cdac887c7f3f48f9c449a4" }
trussed-rsa-alloc = { git = "https://github.com/trussed-dev/trussed-rsa-backend.git", rev = "2f51478f0861ff8db19fdd5290f023ab6f4c2fb9" }
trussed-usbip = { git = "https://github.com/Nitrokey/pc-usbip-runner.git", tag = "v0.0.1-nitrokey.3" }
trussed-se050-backend = { git = "https://github.com/Nitrokey/trussed-se050-backend.git", rev = "cb76fbff0bae365a474b8fbb12530d127ec995a9" }
trussed-se050-backend = { git = "https://github.com/Nitrokey/trussed-se050-backend.git", rev = "1bccc1d9ec9fafb9b769e32fcfe7476b9b034506" }

[profile.release]
codegen-units = 1
Expand Down
8 changes: 4 additions & 4 deletions runners/embedded/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ embedded-hal = "0.2.3"
embedded-time = "0.12"
generic-array = "0.14"
nfc-device = { path = "../../components/nfc-device" }
rand_chacha = { version = "0.3.1", default-features = false, optional = true }
rand_core = "0.6"
rtt-target = { version = "0.3", features = ["cortex-m"], optional = true }
spi-memory = "0.2.0"
Expand Down Expand Up @@ -47,13 +48,12 @@ usbd-ccid = "0.2"
usbd-ctaphid = "0.1"

### NRF52 specific dependencies
chacha20 = { version = "0.7", default-features = false, features = ["rng"], optional = true }
nrf52840-hal = { version = "0.15.1", optional = true }
nrf52840-pac = { version = "0.11", optional = true }

### LPC55 specific dependencies
cortex-m-semihosting = { version = "0.3.5", optional = true }
lpc55-hal = { version = "0.3", features = ["littlefs", "rtic-peripherals"], optional = true }
lpc55-hal = { version = "0.3", features = ["littlefs"], optional = true }
lpc55-pac = { version = "0.4", optional = true }
fm11nc08 = { path = "../../components/fm11nc08", optional = true }
nb = "1"
Expand Down Expand Up @@ -99,8 +99,8 @@ board-nk3am = ["soc-nrf52840", "extflash_spi"]

board-nk3xn = ["soc-lpc55"]

soc-nrf52840 = ["nrf52840-hal", "nrf52840-pac", "chacha20", "se05x?/nrf"]
soc-lpc55 = ["lpc55-hal", "lpc55-pac", "fm11nc08", "systick-monotonic", "se05x?/lpc55", "chacha20"]
soc-nrf52840 = ["nrf52840-hal", "nrf52840-pac", "rand_chacha", "se05x?/nrf"]
soc-lpc55 = ["lpc55-hal", "lpc55-pac", "fm11nc08", "systick-monotonic", "se05x?/lpc55", "rand_chacha"]

se050 = ["dep:se05x", "apps/se050"]

Expand Down
2 changes: 1 addition & 1 deletion runners/embedded/src/bin/app-nrf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ mod app {
#[cfg(not(feature = "se050"))]
use rand::{Rng as _, SeedableRng};
#[cfg(not(feature = "se050"))]
let chacha_rng = chacha20::ChaCha8Rng::from_seed(dev_rng.gen());
let chacha_rng = rand_chacha::ChaCha8Rng::from_seed(dev_rng.gen());

#[cfg(feature = "board-nk3am")]
let ui = ERL::soc::board::init_ui(
Expand Down
4 changes: 2 additions & 2 deletions runners/embedded/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ pub fn init_se050<
delay: D,
dev_rng: &mut R,
init_status: &mut InitStatus,
) -> (se05x::se05x::Se05X<I2C, D>, chacha20::ChaCha8Rng) {
use chacha20::ChaCha8Rng;
) -> (se05x::se05x::Se05X<I2C, D>, rand_chacha::ChaCha8Rng) {
use rand::{Rng as _, SeedableRng};
use rand_chacha::ChaCha8Rng;
use se05x::se05x::commands::GetRandom;

let seed: [u8; 32] = dev_rng.gen();
Expand Down
5 changes: 3 additions & 2 deletions runners/embedded/src/soc_lpc55/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ use interchange::Channel;
use lpc55_hal as hal;
#[cfg(feature = "log-info")]
use lpc55_hal::drivers::timer::Elapsed as _;
use rand_chacha::ChaCha8Rng;
use trussed::{platform::UserInterface, service::Service, types::Location};
use utils::OptionalStorage;

Expand Down Expand Up @@ -729,10 +730,10 @@ impl Stage5 {
);
(chacha_rng, Some(se050))
} else {
(chacha20::ChaCha8Rng::from_seed(dev_rng.gen()), None)
(ChaCha8Rng::from_seed(dev_rng.gen()), None)
};
#[cfg(not(feature = "se050"))]
let res = (chacha20::ChaCha8Rng::from_seed(dev_rng.gen()),);
let res = (ChaCha8Rng::from_seed(dev_rng.gen()),);
res
};

Expand Down
2 changes: 1 addition & 1 deletion runners/embedded/src/soc_lpc55/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl crate::types::Soc for Soc {
type ExternalFlashStorage = OptionalStorage<ExtFlashStorage<Spi, FlashCs>>;
type UsbBus = lpc55_hal::drivers::UsbBus<UsbPeripheral>;
type NfcDevice = super::nfc::NfcChip;
type Rng = chacha20::ChaCha8Rng;
type Rng = rand_chacha::ChaCha8Rng;
type TrussedUI = UserInterface<ThreeButtons, RgbLed>;
type Reboot = Lpc55Reboot;
type UUID = [u8; 16];
Expand Down
2 changes: 1 addition & 1 deletion runners/embedded/src/soc_nrf52840/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl crate::types::Soc for Soc {
type ExternalFlashStorage = ExternalStorage;
type UsbBus = Usbd<UsbPeripheral<'static>>;
type NfcDevice = DummyNfc;
type Rng = chacha20::ChaCha8Rng;
type Rng = rand_chacha::ChaCha8Rng;
type TrussedUI = super::board::TrussedUI;
type Reboot = self::Reboot;
type UUID = [u8; 16];
Expand Down

0 comments on commit a6dbc61

Please sign in to comment.