From ef3e3b34f859a5ff3134aa4c7d0edcb96b302a28 Mon Sep 17 00:00:00 2001 From: tyurek Date: Thu, 7 Nov 2024 16:58:21 -0600 Subject: [PATCH] [Bugfix] Add debug_assertions requirement to rejects_the_same_index (#1415) Add debug_assertions requirement to rejects_the_same_index --- ipa-core/src/protocol/prss/crypto.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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())