-
Notifications
You must be signed in to change notification settings - Fork 25
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
[RFC][oprf][shuffle] OPRF Shuffle using a 2-round 4-message shuffle protocol #809
Changes from 2 commits
dae7449
cd6b5d2
f9119bf
110a7e6
90afdbb
dd44876
a53692d
7cba0bd
cd59872
9043ec3
adc46da
38ca599
2ea0ca1
1d9138d
cf865b0
7791ae0
b3b09ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Debug, Copy, Clone, PartialEq, Eq)] | ||
#[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))] | ||
pub struct QueryConfig { | ||
pub bk_size: u8, // breakdown key size bits | ||
pub tv_size: u8, // trigger value size bits | ||
} | ||
|
||
impl Default for QueryConfig { | ||
fn default() -> Self { | ||
Self { | ||
bk_size: 40, | ||
tv_size: 40, | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
pub mod malicious; | ||
pub mod oprf; | ||
pub mod prss; | ||
pub mod semi_honest; | ||
pub mod upgrade; | ||
|
@@ -8,6 +9,7 @@ use std::{num::NonZeroUsize, sync::Arc}; | |
|
||
use async_trait::async_trait; | ||
pub use malicious::{Context as MaliciousContext, Upgraded as UpgradedMaliciousContext}; | ||
pub use oprf::Context as OPRFContext; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. leftover? |
||
use prss::{InstrumentedIndexedSharedRandomness, InstrumentedSequentialSharedRandomness}; | ||
pub use semi_honest::{Context as SemiHonestContext, Upgraded as UpgradedSemiHonestContext}; | ||
pub use upgrade::{UpgradeContext, UpgradeToMalicious}; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
use std::num::NonZeroUsize; | ||
|
||
use crate::{ | ||
helpers::{Gateway, Message, ReceivingEnd, Role, SendingEnd, TotalRecords}, | ||
protocol::{ | ||
context::{ | ||
Base, InstrumentedIndexedSharedRandomness, InstrumentedSequentialSharedRandomness, | ||
}, | ||
prss::Endpoint as PrssEndpoint, | ||
step::{Gate, Step, StepNarrow}, | ||
}, | ||
seq_join::SeqJoin, | ||
}; | ||
|
||
#[derive(Clone)] | ||
pub struct Context<'a> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the purpose of this code? |
||
inner: Base<'a>, | ||
} | ||
|
||
impl<'a> Context<'a> { | ||
pub fn new(participant: &'a PrssEndpoint, gateway: &'a Gateway) -> Self { | ||
Self { | ||
inner: Base::new(participant, gateway), | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
#[must_use] | ||
pub fn from_base(base: Base<'a>) -> Self { | ||
Self { inner: base } | ||
} | ||
} | ||
|
||
impl<'a> super::Context for Context<'a> { | ||
fn role(&self) -> Role { | ||
self.inner.role() | ||
} | ||
|
||
fn gate(&self) -> &Gate { | ||
self.inner.gate() | ||
} | ||
|
||
fn narrow<S: Step + ?Sized>(&self, step: &S) -> Self | ||
where | ||
Gate: StepNarrow<S>, | ||
{ | ||
Self { | ||
inner: self.inner.narrow(step), | ||
} | ||
} | ||
|
||
fn set_total_records<T: Into<TotalRecords>>(&self, total_records: T) -> Self { | ||
Self { | ||
inner: self.inner.set_total_records(total_records), | ||
} | ||
} | ||
|
||
fn total_records(&self) -> TotalRecords { | ||
self.inner.total_records() | ||
} | ||
|
||
fn prss(&self) -> InstrumentedIndexedSharedRandomness<'_> { | ||
self.inner.prss() | ||
} | ||
|
||
fn prss_rng( | ||
&self, | ||
) -> ( | ||
InstrumentedSequentialSharedRandomness, | ||
InstrumentedSequentialSharedRandomness, | ||
) { | ||
self.inner.prss_rng() | ||
} | ||
|
||
fn send_channel<M: Message>(&self, role: Role) -> SendingEnd<M> { | ||
self.inner.send_channel(role) | ||
} | ||
|
||
fn recv_channel<M: Message>(&self, role: Role) -> ReceivingEnd<M> { | ||
self.inner.recv_channel(role) | ||
} | ||
} | ||
|
||
impl<'a> SeqJoin for Context<'a> { | ||
fn active_work(&self) -> NonZeroUsize { | ||
self.inner.active_work() | ||
} | ||
} |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -6,6 +6,7 @@ pub mod context; | |||||||
pub mod dp; | ||||||||
pub mod ipa; | ||||||||
pub mod modulus_conversion; | ||||||||
pub mod oprf; | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I used the ipa-prf feature which requires descriptive gate, but it hasn't landed yet but probably will land soon. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should probably not call this oprf since it is just a shuffle and a basic protocol that could be used in different context. It is not related to an oprf other than that we want to use it together with a prf/orpf in our new IPA version. |
||||||||
#[cfg(feature = "descriptive-gate")] | ||||||||
pub mod prf_sharding; | ||||||||
pub mod prss; | ||||||||
|
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 could probably be smaller.