-
Notifications
You must be signed in to change notification settings - Fork 73
feat(garble-core): randomize gate id and cipher key #348
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
Conversation
|
@sinui0 , could you ack the conceptual approach of this PR? Then I can resolve the conflicts. |
crates/garble-core/Cargo.toml
Outdated
| [dev-dependencies] | ||
| mpz-ot-core = { workspace = true, features = ["test-utils"] } | ||
|
|
||
| bincode = { workspace = true } |
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.
| bincode = { workspace = true } |
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.
we use bincode in a test which serializes and deserializes the SetupMsg to simulate a realistic scenario where the setup message is transmitted
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 is essentially just testing serde, I would omit that in unit tests unless you're specifically testing a custom serialization impl
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, I misspoke, it is actually used in crates/garble-core/benches/garble.rs
b.iter(|| {
let setup: SetupMsg = bincode::deserialize(&msg).unwrap();
let mut ev = Evaluator::default();
ev.setup(setup).unwrap();
I used it to avoid making SetupMsg Clone/Copy.
(oops, I noticed that I made SetupMsg Clone and Copy already which I shouldn't have)
do you agree with keeping bincode and removing Clone/Copy ?
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.
@sinui0 , i think you may have missed my last question 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.
I would just keep it Clone. Nothing wrong with that. Copy is too presumptuous. The serialization is unnecessary, IMO, but its just a nit
|
Addressed feedback, merged dev. |
This PR adds randomization to garbler's initial gate id and key.
The rationale for it was discussed in:
#341
#7