Skip to content

Commit

Permalink
Fix nightly breakage on compiler warnings. Bump to 0.14.5
Browse files Browse the repository at this point in the history
  • Loading branch information
brycx committed Jan 25, 2020
1 parent fada4b5 commit 97940e5
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "orion"
version = "0.14.4" # Update html_root_url in lib.rs along with this.
version = "0.14.5" # Update html_root_url in lib.rs along with this.
authors = ["brycx <[email protected]>"]
description = "Easy and usable rust crypto"
keywords = [ "cryptography", "crypto", "aead", "hash", "mac" ]
Expand Down
2 changes: 1 addition & 1 deletion src/aead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ mod public {
let ct = seal(&sk, &pt).unwrap();
let pt_decrypted = open(&sk, &ct).unwrap();

(pt == pt_decrypted)
pt == pt_decrypted
}
}

Expand Down
12 changes: 6 additions & 6 deletions src/endianness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ mod public {
let mut dst_store = src.clone();
store_u32_into_le(&dst_load[..], &mut dst_store);

(dst_store == src)
dst_store == src
} else {
// if not, it panics
true
Expand All @@ -428,7 +428,7 @@ mod public {
let mut dst_store = src.clone();
store_u64_into_le(&dst_load[..], &mut dst_store);

(dst_store == src)
dst_store == src
} else {
// if not, it panics
true
Expand All @@ -445,7 +445,7 @@ mod public {
let mut dst_store = src.clone();
store_u64_into_be(&dst_load[..], &mut dst_store);

(dst_store == src)
dst_store == src
} else {
// if not, it panics
true
Expand All @@ -466,7 +466,7 @@ mod public {
dst_load[0] = load_u32_le(&dst_store[..4]);
}

(dst_load == src)
dst_load == src
}
}

Expand All @@ -479,7 +479,7 @@ mod public {
let mut dst_load = src.clone();
load_u64_into_le(&dst_store[..], &mut dst_load);

(dst_load == src)
dst_load == src
}
}

Expand All @@ -492,7 +492,7 @@ mod public {
let mut dst_load = src.clone();
load_u64_into_be(&dst_store[..], &mut dst_load);

(dst_load == src)
dst_load == src
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ mod public {
quickcheck! {
/// Hashing twice with same input should always produce same output.
fn prop_digest_same_result(input: Vec<u8>) -> bool {
(digest(&input[..]).unwrap() == digest(&input[..]).unwrap())
digest(&input[..]).unwrap() == digest(&input[..]).unwrap()
}
}

quickcheck! {
/// Hashing twice with different input should never produce same output.
fn prop_digest_diff_result(input: Vec<u8>) -> bool {
(digest(&input[..]).unwrap() != digest(b"Completely wrong input").unwrap())
digest(&input[..]).unwrap() != digest(b"Completely wrong input").unwrap()
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/hazardous/aead/chacha20poly1305.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ mod private {
fn prop_padding_result(input: Vec<u8>) -> bool {
let rem = padding(&input[..]);

(((input.len() + rem) % 16) == 0)
((input.len() + rem) % 16) == 0
}
}

Expand All @@ -698,7 +698,7 @@ mod private {
fn prop_result_never_above_15(input: Vec<u8>) -> bool {
let rem: usize = padding(&input[..]);

(rem < 16)
rem < 16
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/hazardous/hash/blake2b.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ mod public {
let mut state = init(None, 32).unwrap();
state.update(&data[..]).unwrap();

(d256 == state.finalize().unwrap())
d256 == state.finalize().unwrap()
}
}

Expand All @@ -688,7 +688,7 @@ mod public {
let mut state = init(None, 48).unwrap();
state.update(&data[..]).unwrap();

(d256 == state.finalize().unwrap())
d256 == state.finalize().unwrap()
}
}

Expand All @@ -701,7 +701,7 @@ mod public {
let mut state = init(None, 64).unwrap();
state.update(&data[..]).unwrap();

(d256 == state.finalize().unwrap())
d256 == state.finalize().unwrap()
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/hazardous/hash/sha512.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ mod public {
let stream = state.finalize().unwrap();
let one_shot = digest(&data[..]).unwrap();

(one_shot == stream)
one_shot == stream
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/hazardous/kdf/hkdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ mod public {
let mut out_one_shot = vec![0u8; outsize_checked];
derive_key(&salt[..], &ikm[..], Some(&info[..]), &mut out_one_shot).unwrap();

(out == out_one_shot)
out == out_one_shot
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/hazardous/mac/hmac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ mod public {
let stream = state.finalize().unwrap();
let one_shot = hmac(&sk, &data[..]).unwrap();

(one_shot == stream)
one_shot == stream
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/hazardous/mac/poly1305.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl Poly1305 {
let hibit: u32 = if self.is_finalized {
0
} else {
(1 << 24)
1 << 24
};

let r0: u32 = self.r[0];
Expand Down Expand Up @@ -806,7 +806,7 @@ mod public {
let stream = state.finalize().unwrap();
let one_shot = poly1305(&sk, &data[..]).unwrap();

(one_shot == stream)
one_shot == stream
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/hazardous/stream/chacha20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ mod public {
&mut dst_out_pt,
).unwrap();

(dst_out_pt != pt)
dst_out_pt != pt
}
}

Expand Down Expand Up @@ -739,7 +739,7 @@ mod public {
&mut dst_out_pt,
).unwrap();

(dst_out_pt != pt)
dst_out_pt != pt
}
}

Expand Down Expand Up @@ -775,7 +775,7 @@ mod public {
&mut dst_out_pt,
).unwrap();

(dst_out_pt != pt)
dst_out_pt != pt
}
}
}
Expand Down Expand Up @@ -885,7 +885,7 @@ mod public {
counter,
).unwrap();

(keystream1[..] == keystream2[..])
keystream1[..] == keystream2[..]
}
}
}
Expand Down Expand Up @@ -1073,7 +1073,7 @@ mod test_vectors {
#[must_use]
#[inline(always)]
fn eq(&self, other: &Self) -> bool {
(self.0 == other.0 && self.1 == other.1 && self.2 == other.2 && self.3 == other.3)
self.0 == other.0 && self.1 == other.1 && self.2 == other.2 && self.3 == other.3
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/hazardous/stream/xchacha20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ mod public {
&mut dst_out_pt,
).unwrap();

(dst_out_pt != pt)
dst_out_pt != pt
}
}

Expand Down Expand Up @@ -379,7 +379,7 @@ mod public {
&mut dst_out_pt,
).unwrap();

(dst_out_pt != pt)
dst_out_pt != pt
}
}

Expand Down Expand Up @@ -415,7 +415,7 @@ mod public {
&mut dst_out_pt,
).unwrap();

(dst_out_pt != pt)
dst_out_pt != pt
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#![deny(overflowing_literals)]
#![deny(missing_docs)]
#![deny(warnings)]
#![doc(html_root_url = "https://docs.rs/orion/0.14.4")]
#![doc(html_root_url = "https://docs.rs/orion/0.14.5")]

#[cfg(feature = "safe_api")]
extern crate getrandom;
Expand Down
2 changes: 1 addition & 1 deletion tests/kdf/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ pub fn hkdf_test_runner(
let mut okm_one_shot_dst = okm_out.to_vec();
derive_key(salt, ikm, Some(&info), &mut okm_one_shot_dst).unwrap();

((okm_out == excp_okm) == (okm_one_shot_dst == excp_okm))
(okm_out == excp_okm) == (okm_one_shot_dst == excp_okm)
}

0 comments on commit 97940e5

Please sign in to comment.