Hex-encoded deterministic signing key file (test-owned, never the global identity store).
(root: &Path, name: &str, seed: u8)
| 45 | /// Hex-encoded deterministic signing key file (test-owned, never the global |
| 46 | /// identity store). |
| 47 | fn write_key_file(root: &Path, name: &str, seed: u8) -> std::path::PathBuf { |
| 48 | let mut secret = [0u8; 32]; |
| 49 | for (index, byte) in secret.iter_mut().enumerate() { |
| 50 | *byte = seed.wrapping_add((index as u8) * 7 + 11); |
| 51 | } |
| 52 | let hex: String = secret.iter().map(|byte| format!("{byte:02x}")).collect(); |
| 53 | let path = root.join(name); |
| 54 | fs::write(&path, hex).expect("write key file"); |
| 55 | path |
| 56 | } |
| 57 | |
| 58 | fn setup_fixture(root: &Path, home: &Path) { |
| 59 | { |
no test coverage detected