diff --git a/ipa-core/src/protocol/prss/crypto.rs b/ipa-core/src/protocol/prss/crypto.rs index 53d3b5e34..4337a354d 100644 --- a/ipa-core/src/protocol/prss/crypto.rs +++ b/ipa-core/src/protocol/prss/crypto.rs @@ -364,15 +364,15 @@ impl UsedSet { #[cfg(all(test, unit_test))] mod tests { - use rand::thread_rng; - - use crate::protocol::prss::KeyExchange; - #[test] + #[cfg(debug_assertions)] #[should_panic( expected = "Generated randomness for index '0:0' twice using the same key 'foo'" )] fn rejects_the_same_index() { + use rand::thread_rng; + + use crate::protocol::prss::KeyExchange; let other_gen = KeyExchange::new(&mut thread_rng()); let gen = KeyExchange::new(&mut thread_rng()) .key_exchange(&other_gen.public_key())