-
Notifications
You must be signed in to change notification settings - Fork 49
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
add Mpcot #87
add Mpcot #87
Conversation
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.
Looks good, and simpler than I thought. I'll stop this review here with the provided feedback and circle back once we encapsulate CuckooHash
and Bucket
a bit better. I think that will really help with duplication/readability.
We need to determine if we keep cuckoo hash and buckets stuck to MPCOT or make them independent. |
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.
Thanks for adding the additional state. We just need to address the outstanding comments then we can merge 🚀
Regarding the encapsulation, I'm ok with putting that off to another PR so we can get this thing over the finish line
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.
💪
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.
Sorry for the belated review. @xiangxiecrypto , could you pls clarify a few things.
let queries_length = if n % t == 0 { | ||
vec![k as usize; t as usize] | ||
} else { | ||
let mut tmp = vec![k as usize; (t - 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.
Hi, @xiangxiecrypto , I only just now got around to reviewing this PR.
Could you please clarify the following:
The paper says all intervals must be of the same size.
What is the justification of having the last interval be of a different size?
What if the last interval happens to be of size 1?
If there is a justification, could you formulate it, so I could add it here as a comment.
Or maybe we can just stick to always requiring that arguments (n,t) are such that n % t == 0
?
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.
Consider if n == 91 and t == 10 then the last interval will be 1, since k == 10.
But if k instead was set to 9, then all intervals (except the last one) would be of length 9 and the last one would be of length 10, which I think is what we want 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.
In the current choosing parameters, we actually have n % t == 0
. But in order to select more other parameters, I make it a little bit more flexible 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.
In the following implementations, I will add a more general way to estimate different LPN parameters. If all the parameters we choose satisfy n % t == 0
, I will remove the other part.
let mut tmp = vec![k as usize; (t - 1) as usize]; | ||
tmp.push((n % k) as usize); | ||
if tmp.iter().sum::<usize>() != n as usize { | ||
return Err(ReceiverError::InvalidInput( |
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.
Also, @xiangxiecrypto , I cant think of what values of (n,t) would cause this error to trigger. I think it never will.
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.
ah, nvm, (101, 10) will trigger this error
Add two versions of mpcot protocols, taking spcot as an ideal functionality.