Skip to content

Commit 81dde95

Browse files
committed
security: fix silent OT mal OT security
The malicious version of the silent OT protocol mistakenly used a semi-honest OT protocol for the base OTs used in silent OT. This commit changes it so that the security of the base OT protocol depends on the chosen security of the silent OT protocol.
1 parent 6b311a1 commit 81dde95

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

cryprot-ot/src/extension.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub const BASE_OT_COUNT: usize = 128;
4747
pub const DEFAULT_OT_BATCH_SIZE: usize = 2_usize.pow(16);
4848

4949
/// OT extension sender generic over its [`Security`] level.
50-
pub struct OtExtensionSender<S: Security> {
50+
pub struct OtExtensionSender<S> {
5151
rng: StdRng,
5252
base_ot: SimplestOt,
5353
conn: Connection,
@@ -59,7 +59,7 @@ pub struct OtExtensionSender<S: Security> {
5959
}
6060

6161
/// OT extension receiver generic over its [`Security`] level.
62-
pub struct OtExtensionReceiver<S: Security> {
62+
pub struct OtExtensionReceiver<S> {
6363
base_ot: SimplestOt,
6464
conn: Connection,
6565
base_rngs: Vec<[AesRng; 2]>,

cryprot-ot/src/silent_ot.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Semi-honest and malicious Silent OT implementation using expand-convolute code [[RRT23](https://eprint.iacr.org/2023/882)].
22
#![allow(non_snake_case)]
3-
use std::{io, marker::PhantomData, mem};
3+
use std::{io, mem};
44

55
use bytemuck::cast_slice_mut;
66
use cryprot_codes::ex_conv::{ExConvCode, ExConvCodeConfig};
@@ -34,9 +34,8 @@ pub type MaliciousSilentOtReceiver = SilentOtReceiver<MaliciousMarker>;
3434

3535
pub struct SilentOtSender<S> {
3636
conn: Connection,
37-
ot_sender: OtExtensionSender<SemiHonestMarker>,
37+
ot_sender: OtExtensionSender<S>,
3838
rng: StdRng,
39-
s: PhantomData<S>,
4039
}
4140

4241
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq)]
@@ -73,7 +72,6 @@ impl<S: Security> SilentOtSender<S> {
7372
conn,
7473
ot_sender,
7574
rng: StdRng::from_os_rng(),
76-
s: PhantomData,
7775
}
7876
}
7977

@@ -224,9 +222,8 @@ impl<S: Security> SilentOtSender<S> {
224222

225223
pub struct SilentOtReceiver<S> {
226224
conn: Connection,
227-
ot_receiver: OtExtensionReceiver<SemiHonestMarker>,
225+
ot_receiver: OtExtensionReceiver<S>,
228226
rng: StdRng,
229-
s: PhantomData<S>,
230227
}
231228

232229
impl<S: Security> SilentOtReceiver<S> {
@@ -236,7 +233,6 @@ impl<S: Security> SilentOtReceiver<S> {
236233
conn,
237234
ot_receiver,
238235
rng: StdRng::from_os_rng(),
239-
s: PhantomData,
240236
}
241237
}
242238

0 commit comments

Comments
 (0)