-
Notifications
You must be signed in to change notification settings - Fork 313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
address issues raised by Nitin #105
base: master
Are you sure you want to change the base?
Conversation
@@ -1 +1 @@ | |||
{"parties":"3", "threshold":"1"} | |||
{"parties":"3", "threshold":"2"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason to change the threshold to 2 here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I changed it while testing to be consistent with the assumption. Though I don't thing the threshold value is meaningful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
threshold value is meaningful but not for this demo. So can leave it as is
@@ -67,7 +67,10 @@ pub fn aes_decrypt(key: &[u8], aead_pack: AEAD) -> Vec<u8> { | |||
let nonce: Vec<u8> = 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[..]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably can just be written as:
if !gcm.decrypt(&aead_pack.ciphertext[..], &mut out, &aead_pack.tag[..]) {
panic!("Error: Could not decrypt AES ciphertext");
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a matter of style, but I can change it as you suggested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed.
@@ -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{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the assert_eq! can just be removed and the if can be changed to:
if signers_vec.len() != (THRESHOLD + 1) as usize{
panic!("For the demo we always sign with minimum number of parties(THRESHOLD + 1). This should not happen.");
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why minimum number of parties, shouldn't it be exactly THRESHOLD + 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's what I meant by minimum number of parties. You need minimum THRESHOLD + 1 signers to generate a usable signature.
Also this comment is just for style. We don't need an assert and an if statement. Could just use an if statement only.
But that should not stop you from merging this as is.
No description provided.