Updating to work with constant sized packets
This commit is contained in:
Generated
+1
@@ -558,6 +558,7 @@ dependencies = [
|
||||
"aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"blake2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"chacha 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"curve25519-dalek 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hkdf 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
||||
+2
-1
@@ -34,7 +34,8 @@ mod sending_a_sphinx_packet {
|
||||
let message = "Hello, Sphinx!".as_bytes().to_vec();
|
||||
let mixes = directory.get_mixes();
|
||||
let destination = directory.get_destination();
|
||||
let packet = SphinxPacket::new(message, &mixes, &destination);
|
||||
let delays = sphinx::header::delays::generate(2);
|
||||
let packet = SphinxPacket::new(message, &mixes, &destination, &delays).unwrap();
|
||||
let mix_client = MixClient::new();
|
||||
let first_hop = mixes.first().unwrap();
|
||||
|
||||
|
||||
+3
-1
@@ -13,13 +13,15 @@ async fn main() {
|
||||
let directory = DirectoryClient::new();
|
||||
let route = directory.get_mixes();
|
||||
let destination = directory.get_destination();
|
||||
let delays = sphinx::header::delays::generate(2);
|
||||
|
||||
// build the packet
|
||||
let packet = sphinx::SphinxPacket::new(message, &route[..], &destination);
|
||||
let packet = sphinx::SphinxPacket::new(message, &route[..], &destination, &delays).unwrap();
|
||||
|
||||
// send to mixnet
|
||||
let mix_client = MixClient::new();
|
||||
let result = mix_client.send(packet, route.first().unwrap()).await;
|
||||
println!("packet sent");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user