huskies: merge 925

This commit is contained in:
dave
2026-05-12 18:28:42 +00:00
parent 7660a460a5
commit f9f16d6a14
10 changed files with 187 additions and 344 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ use {
op::{print_hex, print_path, ROOT_ID},
},
colored::Colorize,
random_color::{Luminosity, RandomColor},
random_color::{options::Luminosity, RandomColor},
};
#[cfg(feature = "logging-list")]
+5 -3
View File
@@ -10,9 +10,10 @@ pub use fastcrypto::{
Ed25519KeyPair, Ed25519PublicKey, Ed25519Signature, ED25519_PUBLIC_KEY_LENGTH,
ED25519_SIGNATURE_LENGTH,
},
traits::{KeyPair, Signer},
traits::{KeyPair, Signer, ToFromBytes},
// Verifier,
};
use rand::RngCore as _;
use sha2::{Digest, Sha256};
/// Represents the ID of a unique node. An Ed25519 public key
@@ -48,8 +49,9 @@ pub fn sha256(input: String) -> [u8; 32] {
/// Generate a random Ed25519 keypair from OS rng
pub fn make_keypair() -> Ed25519KeyPair {
let mut csprng = rand::thread_rng();
Ed25519KeyPair::generate(&mut csprng)
let mut seed = [0u8; 32];
rand::rng().fill_bytes(&mut seed);
Ed25519KeyPair::from_bytes(&seed).expect("32-byte seed always yields a valid Ed25519 keypair")
}
/// Sign a byte array