diff --git a/examples/common.rs b/examples/common.rs index 3f256afa..3505a1f2 100644 --- a/examples/common.rs +++ b/examples/common.rs @@ -67,7 +67,10 @@ pub fn aes_decrypt(key: &[u8], aead_pack: AEAD) -> Vec { let nonce: Vec = repeat(3).take(12).collect(); let aad: [u8; 0] = []; let mut gcm = AesGcm::new(KeySize256, key, &nonce[..], &aad); - gcm.decrypt(&aead_pack.ciphertext[..], &mut out, &aead_pack.tag[..]); + let successful_decrypt = gcm.decrypt(&aead_pack.ciphertext[..], &mut out, &aead_pack.tag[..]); + if !successful_decrypt { + panic!("Error: Could not decrypt AES ciphertext"); + } out } diff --git a/examples/gg20_sign_client.rs b/examples/gg20_sign_client.rs index 06fb2b8e..f735172c 100644 --- a/examples/gg20_sign_client.rs +++ b/examples/gg20_sign_client.rs @@ -170,6 +170,11 @@ fn main() { j += 1; } } + + assert_eq!(signers_vec.len(), (THRESHOLD + 1) as usize); + if signers_vec.len()> (THRESHOLD + 1) as usize{ + panic!("The assumption is that number of shares = threshold + 1"); + } let mut enc_key: Vec> = vec![]; for (i, k) in signers_vec.iter().enumerate() { if *k != signers_vec[party_num_int as usize - 1] as usize { diff --git a/params.json b/params.json index 8dcdefd6..a03898e5 100644 --- a/params.json +++ b/params.json @@ -1 +1 @@ -{"parties":"3", "threshold":"1"} +{"parties":"3", "threshold":"2"}