Skip to content
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 crate mpz-ole-core #135

Merged
merged 20 commits into from
May 29, 2024
Merged

Add crate mpz-ole-core #135

merged 20 commits into from
May 29, 2024

Conversation

th4s
Copy link
Member

@th4s th4s commented May 14, 2024

This PR adds the core crate for OLE, and makes ideal random OT more generic.

@th4s th4s mentioned this pull request May 14, 2024
@th4s th4s requested review from sinui0 and themighty1 May 14, 2024 17:02
crates/mpz-ole-core/src/core/mod.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/core/mod.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/core/receiver.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/ideal.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/lib.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/sender.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/sender.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/sender.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/sender.rs Outdated Show resolved Hide resolved
crates/mpz-ot-core/src/ideal/rot.rs Outdated Show resolved Hide resolved
@th4s th4s force-pushed the add-mpz-ole-core branch 2 times, most recently from 54e6667 to edd298e Compare May 16, 2024 07:00
@th4s
Copy link
Member Author

th4s commented May 16, 2024

Ok I think you can take a look again. I did it similar to mpz-ot-core.

@th4s th4s requested a review from sinui0 May 16, 2024 09:19
Copy link
Collaborator

@sinui0 sinui0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work, lgtm.

Only 1 nit

crates/mpz-ole-core/src/receiver.rs Show resolved Hide resolved
crates/mpz-ole-core/src/sender.rs Show resolved Hide resolved
Copy link
Collaborator

@themighty1 themighty1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gw! There are some comments, potentially blocking.

Since COPEe's computational security parameter depends on the Field size, can we also add a check that CSP >= Field::BIT_SIZE ?

crates/mpz-ole-core/src/core/sender.rs Show resolved Hide resolved
crates/mpz-ole-core/src/core/mod.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/core/sender.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/core/receiver.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/core/sender.rs Show resolved Hide resolved
crates/mpz-ole-core/src/receiver.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/receiver.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/sender.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/sender.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/sender.rs Outdated Show resolved Hide resolved
@th4s
Copy link
Member Author

th4s commented May 27, 2024

Thanks! Let's address all of these minus sign comments in one batch.

It all boils down to the question, if we implement COPE from the MASCOT paper as is, or if we build upon COPE to implement OLE. The difference is that COPE is y + x = a * b and OLE is y = a * b + x.

Since OLE is the more modern and widely used functionality, I decided for the latter. Can we agree to proceed that way?

crates/mpz-fields/src/lib.rs Outdated Show resolved Hide resolved
crates/mpz-ole-core/src/core/sender.rs Outdated Show resolved Hide resolved
crates/mpz-fields/src/lib.rs Outdated Show resolved Hide resolved
@themighty1 themighty1 self-requested a review May 29, 2024 07:35
Copy link
Collaborator

@themighty1 themighty1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, i agree it makes sense to take the a*b+x approach

crates/mpz-ole-core/src/core/mod.rs Show resolved Hide resolved
@th4s th4s force-pushed the add-mpz-ole-core branch from 5cdccea to 7a178ec Compare May 29, 2024 09:00
@th4s th4s merged commit 497a35a into threading-refactor May 29, 2024
@th4s th4s deleted the add-mpz-ole-core branch May 29, 2024 09:02
sinui0 pushed a commit that referenced this pull request Jun 25, 2024
* Add generic support for ideal random OT.

* Add crate `mpz-ole-core`.

* Improved ideal ROT implementation and adapted tests in `mpz-ole-core`.

* Remove unnecessary comment.

* Add feedback.

* Added `Serialize` and `Deserialize` for message types.

* Return `Option` instead of `Result`.

* Remove unused error enum.

* Add transfer id.

* Added using `TransferId` in new batch types.

* Use `split_off` instead of `drain`.

* Return correct number of OLEs from `consume`.

* Use `VecDeque` for cache and please clippy.

* Use `hybrid-array` and get rid of const generics.

* Apply suggestions for improving comments

Co-authored-by: dan <[email protected]>

* Remove `ByteRepr` from `Field` trait.

* Move from `MaskedInput` to `MaskedCorrelation` mental model.

* Simplify array creation in `core/sender.rs`.

* Add more feedback.

- Add default for `BIT_SIZE`
- Rename `BitSizeType` -> `BitSize`.

* Add comment about which function is evaluated.

Co-authored-by: dan <[email protected]>

---------

Co-authored-by: dan <[email protected]>
sinui0 pushed a commit that referenced this pull request Jun 25, 2024
* Add generic support for ideal random OT.

* Add crate `mpz-ole-core`.

* Improved ideal ROT implementation and adapted tests in `mpz-ole-core`.

* Remove unnecessary comment.

* Add feedback.

* Added `Serialize` and `Deserialize` for message types.

* Return `Option` instead of `Result`.

* Remove unused error enum.

* Add transfer id.

* Added using `TransferId` in new batch types.

* Use `split_off` instead of `drain`.

* Return correct number of OLEs from `consume`.

* Use `VecDeque` for cache and please clippy.

* Use `hybrid-array` and get rid of const generics.

* Apply suggestions for improving comments

Co-authored-by: dan <[email protected]>

* Remove `ByteRepr` from `Field` trait.

* Move from `MaskedInput` to `MaskedCorrelation` mental model.

* Simplify array creation in `core/sender.rs`.

* Add more feedback.

- Add default for `BIT_SIZE`
- Rename `BitSizeType` -> `BitSize`.

* Add comment about which function is evaluated.

Co-authored-by: dan <[email protected]>

---------

Co-authored-by: dan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants