Skip to content

Commit 1ea28e0

Browse files
committed
test: added vector tests for extended byte lengths on CoinEntropy
1 parent cbb5757 commit 1ea28e0

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

‎crates/kdk-entropy/tests/coin.rs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,18 @@ macro_rules! coin_rejects {
5656
}
5757

5858
min_flips_ok!(min_flips_128bit, 16 => 128);
59+
min_flips_ok!(min_flips_160bit, 20 => 160);
60+
min_flips_ok!(min_flips_192bit, 24 => 192);
61+
min_flips_ok!(min_flips_224bit, 28 => 224);
5962
min_flips_ok!(min_flips_256bit, 32 => 256);
6063

6164
max_flips_ok!(max_flips_128bit, 16 => 256);
65+
max_flips_ok!(max_flips_160bit, 20 => 320);
66+
max_flips_ok!(max_flips_192bit, 24 => 384);
67+
max_flips_ok!(max_flips_224bit, 28 => 448);
6268
max_flips_ok!(max_flips_256bit, 32 => 512);
6369

64-
flips_unsupported!(flips_unsupported_24, 24);
70+
flips_unsupported!(flips_unsupported_18, 18);
6571
flips_unsupported!(flips_unsupported_1, 1);
6672

6773
// SHA-256("0" * 128)[:16]
@@ -78,7 +84,7 @@ coin_vector!(all_ones_matches_sha256, 16, [1u8; 128] => &[
7884

7985
coin_rejects!(too_few_flips, 16, [0u8; 127] => EntropyError::TooFewRolls(128, 127));
8086
coin_rejects!(too_many_flips, 16, [0u8; 257] => EntropyError::TooManyRolls(256, 257));
81-
coin_rejects!(unsupported_buffer_24, 24, [0u8; 192] => EntropyError::UnsupportedConfig(2, 24));
87+
coin_rejects!(unsupported_buffer_18, 18, [0u8; 144] => EntropyError::UnsupportedConfig(2, 18));
8288

8389
#[test]
8490
fn deterministic_for_same_input() {

0 commit comments

Comments
 (0)