boot: update ed25519-dalek in dev-dependencies.
This commit is contained in:
parent
7591a6abc5
commit
da5d577215
@ -32,20 +32,16 @@ embassy-sync = { version = "0.5.0", path = "../../embassy-sync" }
|
|||||||
embedded-storage = "0.3.1"
|
embedded-storage = "0.3.1"
|
||||||
embedded-storage-async = { version = "0.4.1" }
|
embedded-storage-async = { version = "0.4.1" }
|
||||||
salty = { version = "0.3", optional = true }
|
salty = { version = "0.3", optional = true }
|
||||||
signature = { version = "2.2", default-features = false }
|
signature = { version = "2.0", default-features = false }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
env_logger = "0.9"
|
env_logger = "0.9"
|
||||||
rand = "0.7" # ed25519-dalek v1.0.1 depends on this exact version
|
rand = "0.8"
|
||||||
futures = { version = "0.3", features = ["executor"] }
|
futures = { version = "0.3", features = ["executor"] }
|
||||||
sha1 = "0.10.5"
|
sha1 = "0.10.5"
|
||||||
critical-section = { version = "1.1.1", features = ["std"] }
|
critical-section = { version = "1.1.1", features = ["std"] }
|
||||||
|
ed25519-dalek = { version = "2", default_features = false, features = ["std", "rand_core", "digest"] }
|
||||||
[dev-dependencies.ed25519-dalek]
|
|
||||||
version = "1.0.1"
|
|
||||||
default_features = false
|
|
||||||
features = ["rand", "std", "u32_backend"]
|
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
ed25519-dalek = ["dep:ed25519-dalek", "_verify"]
|
ed25519-dalek = ["dep:ed25519-dalek", "_verify"]
|
||||||
|
@ -275,21 +275,19 @@ mod tests {
|
|||||||
// The following key setup is based on:
|
// The following key setup is based on:
|
||||||
// https://docs.rs/ed25519-dalek/latest/ed25519_dalek/#example
|
// https://docs.rs/ed25519-dalek/latest/ed25519_dalek/#example
|
||||||
|
|
||||||
use ed25519_dalek::Keypair;
|
use ed25519_dalek::{Digest, Sha512, Signature, Signer, SigningKey, VerifyingKey};
|
||||||
use rand::rngs::OsRng;
|
use rand::rngs::OsRng;
|
||||||
|
|
||||||
let mut csprng = OsRng {};
|
let mut csprng = OsRng {};
|
||||||
let keypair: Keypair = Keypair::generate(&mut csprng);
|
let keypair = SigningKey::generate(&mut csprng);
|
||||||
|
|
||||||
use ed25519_dalek::{Digest, Sha512, Signature, Signer};
|
|
||||||
let firmware: &[u8] = b"This are bytes that would otherwise be firmware bytes for DFU.";
|
let firmware: &[u8] = b"This are bytes that would otherwise be firmware bytes for DFU.";
|
||||||
let mut digest = Sha512::new();
|
let mut digest = Sha512::new();
|
||||||
digest.update(&firmware);
|
digest.update(&firmware);
|
||||||
let message = digest.finalize();
|
let message = digest.finalize();
|
||||||
let signature: Signature = keypair.sign(&message);
|
let signature: Signature = keypair.sign(&message);
|
||||||
|
|
||||||
use ed25519_dalek::PublicKey;
|
let public_key = keypair.verifying_key();
|
||||||
let public_key: PublicKey = keypair.public;
|
|
||||||
|
|
||||||
// Setup flash
|
// Setup flash
|
||||||
let flash = BlockingTestFlash::new(BootLoaderConfig {
|
let flash = BlockingTestFlash::new(BootLoaderConfig {
|
||||||
|
Loading…
Reference in New Issue
Block a user