Skip to content

Commit

Permalink
[Bugfix] Add debug_assertions requirement to rejects_the_same_index (#…
Browse files Browse the repository at this point in the history
…1415)

Add debug_assertions requirement to rejects_the_same_index
  • Loading branch information
tyurek authored Nov 7, 2024
1 parent 04ba0a7 commit ef3e3b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ipa-core/src/protocol/prss/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down

0 comments on commit ef3e3b3

Please sign in to comment.