Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme update #87

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Unit + integration test coverage is currently well above 90%, please ensure that

### Benchmarks

To run benchmarks, use:
To run benchmarks, use:

```
cargo bench
Expand All @@ -40,3 +40,7 @@ test tests::bench_process ... bench: 157.322 us/iter

* `1000000 / 386.348` = ~2588 packet creations per second
* `1000000 / 157.322` = ~6356 packet unwrappings per second


### Acknowledgments
This code has received partial funding from the Next Generation Internet POINTER programme of the European Commission, as part of the Horizon 2020 Research and Innovation Programme, under Grant Agreement Nº 871528.
2 changes: 1 addition & 1 deletion src/header/delays.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use std::{borrow::Borrow, time::Duration};

// TODO: once we get to proper refactoring, I think this should just be
// a type alias to probably time::Duration
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Delay(u64);

impl Delay {
Expand Down
2 changes: 1 addition & 1 deletion src/header/filler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::{constants, utils};

pub const FILLER_STEP_SIZE_INCREASE: usize = NODE_META_INFO_SIZE + HEADER_INTEGRITY_MAC_SIZE;

#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Eq)]
pub struct Filler {
value: Vec<u8>,
}
Expand Down
2 changes: 1 addition & 1 deletion src/header/routing/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ impl RawRoutingInformation {
FINAL_HOP => Ok(self.parse_as_final_hop()),
_ => Err(Error::new(
ErrorKind::InvalidRouting,
format!("tried to parse unknown routing flag: {}", flag),
format!("tried to parse unknown routing flag: {flag}"),
)),
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/payload/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ impl Payload {
if let Err(err) = lioness_cipher.encrypt(&mut self.0) {
return Err(Error::new(
ErrorKind::InvalidPayload,
format!("error while encrypting payload - {}", err),
format!("error while encrypting payload - {err}"),
));
};
Ok(self)
Expand All @@ -127,7 +127,7 @@ impl Payload {
if let Err(err) = lioness_cipher.decrypt(&mut self.0) {
return Err(Error::new(
ErrorKind::InvalidPayload,
format!("error while unwrapping payload - {}", err),
format!("error while unwrapping payload - {err}"),
));
};
Ok(self)
Expand Down
6 changes: 3 additions & 3 deletions src/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ impl DestinationAddressBytes {
Err(e) => {
return Err(Error::new(
ErrorKind::InvalidRouting,
format!("failed to decode destination from b58 string: {:?}", e),
format!("failed to decode destination from b58 string: {e:?}"),
))
}
};
Expand Down Expand Up @@ -100,7 +100,7 @@ impl NodeAddressBytes {
Err(e) => {
return Err(Error::new(
ErrorKind::InvalidRouting,
format!("failed to decode node address from b58 string: {:?}", e),
format!("failed to decode node address from b58 string: {e:?}"),
))
}
};
Expand Down Expand Up @@ -156,7 +156,7 @@ impl Display for NodeAddressBytes {
// in paper I
pub type SURBIdentifier = [u8; IDENTIFIER_LENGTH];

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Destination {
// address in theory could be changed to a vec<u8> as it does not need to be strictly DESTINATION_ADDRESS_LENGTH long
// but cannot be longer than that (assuming longest possible route)
Expand Down
4 changes: 2 additions & 2 deletions src/surb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ impl fmt::Debug for SURB {

write!(
f,
"SURB: {{ SURB_header: {:?}, first_hop_address: {:?}, payload_keys: {:?} }}",
self.SURB_header, self.first_hop_address, formatted_keys
"SURB: {{ SURB_header: {:?}, first_hop_address: {:?}, payload_keys: {formatted_keys:?} }}",
self.SURB_header, self.first_hop_address
)
}
}
Expand Down