add better dht debugging

This commit is contained in:
John Smith
2023-06-26 21:29:02 -04:00
parent 62aeec6faf
commit 291e3ef2fe
27 changed files with 817 additions and 95 deletions
+3 -3
View File
@@ -176,10 +176,10 @@ impl CryptoSystem for CryptoSystemVLD0 {
}
// Distance Metric
fn distance(&self, key1: &PublicKey, key2: &PublicKey) -> CryptoKeyDistance {
let mut bytes = [0u8; PUBLIC_KEY_LENGTH];
let mut bytes = [0u8; CRYPTO_KEY_LENGTH];
for (n, byte) in bytes.iter_mut().enumerate() {
*byte = key1.bytes[n] ^ key2.bytes[n];
for n in 0..CRYPTO_KEY_LENGTH {
bytes[n] = key1.bytes[n] ^ key2.bytes[n];
}
CryptoKeyDistance::new(bytes)