Skip to content

Commit

Permalink
Merge pull request #75 from rex4539/typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
futurechimp authored Jan 29, 2021
2 parents 9b938e0 + 4b07e88 commit b168f70
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/crypto/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl PrivateKey {
PrivateKey(self.0)
}

// honestly, this method shouldn't really be exist, but right now we have no decent
// honestly, this method shouldn't really exist, but right now we have no decent
// rng propagation in the library
pub fn new() -> Self {
let mut rng = OsRng;
Expand Down
2 changes: 1 addition & 1 deletion src/packet/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl<'a> SphinxPacketBuilder<'a> {
None => SphinxHeader::new(&EphemeralSecret::new(), route, delays, destination),
};

// no need to check for if plaintext has correct length as this check is already performed in payload encapsulation
// no need to check if plaintext has correct length as this check is already performed in payload encapsulation
let payload = Payload::encapsulate_message(&message, &payload_keys, self.payload_size)?;
Ok(SphinxPacket { header, payload })
}
Expand Down
6 changes: 3 additions & 3 deletions src/payload/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl Payload {
Ok(())
}

/// Attaches leading and trailing paddings of correct lenghts to the provided plaintext message.
/// Attaches leading and trailing paddings of correct lengths to the provided plaintext message.
/// Note: this function should only ever be called in [`encapsulate_message`] after
/// [`validate_parameters`] was performed.
fn set_final_payload(plaintext_message: &[u8], payload_size: usize) -> Self {
Expand Down Expand Up @@ -256,8 +256,8 @@ mod final_payload_setting {

#[test]
fn adds_correct_padding() {
let plaintext_lenghts = vec![0, 1, 16, 128, 4096];
for plaintext_length in plaintext_lenghts {
let plaintext_lengths = vec![0, 1, 16, 128, 4096];
for plaintext_length in plaintext_lengths {
// ensure payload always has correct length, because we're not testing for that
let payload_size = plaintext_length + lioness::DIGEST_RESULT_SIZE;
let final_payload =
Expand Down

0 comments on commit b168f70

Please sign in to comment.