MOTION
0.01
Framework for mixed-protocol multi-party computation
|
Go to the documentation of this file.
44 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function,
72 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& Send,
88 ROtSender(std::size_t ot_id, std::size_t number_of_ots, std::size_t bitlength,
90 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
100 assert(outputs_computed_);
112 std::vector<BitVector<>> outputs_;
115 bool outputs_computed_ =
false;
123 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
133 assert(outputs_computed_);
148 bool outputs_computed_ =
false;
156 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
163 assert(outputs_computed_);
175 bool outputs_computed_ =
false;
182 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
187 correlations_ = std::move(correlations);
191 correlations_ = correlations;
202 assert(outputs_computed_);
217 bool outputs_computed_ =
false;
223 XcOtSender(std::size_t ot_id, std::size_t number_of_ots, std::size_t bitlength,
225 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
230 correlations_ = std::move(correlations);
234 correlations_.assign(correlations.begin(), correlations.end());
245 assert(outputs_computed_);
254 std::vector<BitVector<>> correlations_;
257 std::vector<BitVector<>> outputs_;
260 bool outputs_computed_ =
false;
266 ROtReceiver(std::size_t ot_id, std::size_t number_of_ots, std::size_t bitlength,
268 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
278 assert(outputs_computed_);
283 assert(outputs_computed_);
295 std::vector<BitVector<>> outputs_;
298 bool outputs_computed_ =
false;
305 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
312 assert(outputs_computed_);
324 bool outputs_computed_ =
false;
330 XcOtReceiver(std::size_t ot_id, std::size_t number_of_ots, std::size_t bitlength,
332 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
339 assert(outputs_computed_);
348 std::vector<BitVector<>> outputs_;
351 bool outputs_computed_ =
false;
355 template <
typename T>
360 AcOtSender(std::size_t ot_id, std::size_t number_of_ots, std::size_t vector_size,
362 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
367 correlations_ = std::move(correlations);
371 correlations_ = correlations;
382 assert(outputs_computed_);
391 const std::size_t vector_size_;
394 std::vector<T> correlations_;
397 std::vector<T> outputs_;
400 bool outputs_computed_ =
false;
404 template <
typename T>
409 AcOtReceiver(std::size_t ot_id, std::size_t number_of_ots, std::size_t vector_size,
411 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
418 assert(outputs_computed_);
424 const std::size_t vector_size_;
430 std::vector<T> outputs_;
433 bool outputs_computed_ =
false;
440 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
458 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
465 assert(outputs_computed_);
477 bool outputs_computed_ =
false;
484 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
501 GOtSender(std::size_t ot_id, std::size_t number_of_ots, std::size_t bitlength,
503 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
508 inputs_.assign(inputs.begin(), inputs.end());
516 std::vector<BitVector<>> inputs_;
523 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
530 assert(outputs_computed_);
542 bool outputs_computed_ =
false;
548 GOtReceiver(std::size_t ot_id, std::size_t number_of_ots, std::size_t bitlength,
550 const std::function<
void(flatbuffers::FlatBufferBuilder&&)>& send_function);
557 assert(outputs_computed_);
566 std::vector<BitVector<>> outputs_;
569 bool outputs_computed_ =
false;
ReusableFiberFuture< Block128Vector > RegisterForBlock128SenderMessage(std::size_t ot_id, std::size_t size)
Definition: ot_extension_data.cpp:183
void resize(std::size_t new_size)
Resize the Block128Vector to contain new_size elements. New elements are left uninitialized.
Definition: block.h:233
void SetCorrelations(BitVector<> &&correlations)
Definition: ot_flavors.h:185
void WaitSetup() const
Definition: ot_flavors.cpp:93
std::enable_if_t< std::conjunction_v< std::is_integral< T >, std::is_unsigned< T >, std::negation< std::is_same< T, bool > >> > IsUnsignedInt
Definition: type_traits.h:31
OtExtensionReceiverData & data_
Definition: ot_flavors.h:76
XcOtReceiver(std::size_t ot_id, std::size_t number_of_ots, std::size_t bitlength, OtExtensionReceiverData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:212
FixedXcOt128Sender(std::size_t ot_id, std::size_t number_of_ots, OtExtensionSenderData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:246
void SetInputs(BitVector<> &&inputs)
Definition: ot_flavors.h:487
void ComputeOutputs()
Definition: ot_flavors.cpp:158
std::unordered_map< std::size_t, std::unique_ptr< FiberCondition > > received_correction_offsets_condition
Definition: ot_extension_data.h:158
Definition: ot_flavors.h:86
void ComputeOutputs()
Definition: ot_flavors.cpp:311
const std::span< const BitVector<> > GetOutputs() const
Definition: ot_flavors.h:556
std::function< void(flatbuffers::FlatBufferBuilder &&)> send_function_
Definition: ot_provider.h:97
std::span< const BitVector<> > GetOutputs() const
Definition: ot_flavors.h:99
void SetCorrelations(const BitVector<> &correlations)
Definition: ot_flavors.h:189
std::unordered_map< std::size_t, std::size_t > number_of_ots_in_batch
Definition: ot_extension_data.h:152
void SendMessages() const
Definition: ot_flavors.cpp:643
void WaitSetup() const
Definition: ot_flavors.cpp:65
Definition: ot_flavors.h:455
GOt128Receiver(std::size_t ot_id, std::size_t number_of_ots, OtExtensionReceiverData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:603
const auto & GetData() const noexcept
Get const reference to content of BitVector.
Definition: bit_vector.h:152
Definition: ot_extension_data.h:133
XcOtSender(std::size_t ot_id, std::size_t number_of_ots, std::size_t bitlength, OtExtensionSenderData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:153
Definition: reusable_future.h:129
Definition: ot_provider.h:80
void SetCorrelations(std::span< const BitVector<>> correlations)
Definition: ot_flavors.h:232
void ComputeOutputs()
Definition: ot_flavors.cpp:95
std::span< const BitVector<> > GetOutputs() const
Definition: ot_flavors.h:244
Definition: ot_flavors.h:405
Block128Vector & GetOutputs()
Definition: ot_flavors.h:132
void SendMessages() const
Definition: ot_flavors.cpp:372
void SetCorrelation(Block128 correlation)
Definition: ot_flavors.h:126
Definition: ot_flavors.h:302
Definition: ot_flavors.h:546
void SetChoices(BitVector<> &&choices)
Definition: ot_flavors.h:58
GOtSender(std::size_t ot_id, std::size_t number_of_ots, std::size_t bitlength, OtExtensionSenderData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:704
void ComputeOutputs()
Definition: ot_flavors.cpp:678
void Set(bool value) noexcept
Sets or unsets all bits in the BitVector.
Definition: bit_vector.cpp:440
std::size_t ByteSize() const
Get size of the Block128Vector content in bytes.
Definition: block.h:228
ReusableFiberFuture< BitVector<> > RegisterForBitSenderMessage(std::size_t ot_id, std::size_t size)
Definition: ot_extension_data.cpp:196
@ kAcOt
Definition: benchmark_providers.h:36
const std::vector< T > & GetCorrelations() const
Definition: ot_flavors.h:375
@ kROt
Definition: ot_provider.h:52
XcOtBitSender(std::size_t ot_id, std::size_t number_of_ots, OtExtensionSenderData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:333
Definition: ot_flavors.h:221
void SendMessages() const
Definition: ot_flavors.cpp:577
Vector of 128 bit / 16 B blocks.
Definition: block.h:168
@ kXcOt
Definition: ot_provider.h:53
const std::size_t number_of_ots_
Definition: ot_provider.h:94
Definition: ot_flavors.h:120
void Reserve(std::size_t number_of_bits)
Reserves new space for BitVector, so that it can contain at least number_of_bits bits.
Definition: bit_vector.h:185
void SetInputs(const std::span< BitVector<>> inputs)
Definition: ot_flavors.h:507
bool corrections_sent_
Definition: ot_flavors.h:82
std::unique_ptr< AlignedBitVector > random_choices
Definition: ot_extension_data.h:120
void ComputeOutputs()
Definition: ot_flavors.cpp:395
void SetCorrelations(std::vector< BitVector<>> &&correlations)
Definition: ot_flavors.h:228
XcOtBitReceiver(std::size_t ot_id, std::size_t number_of_ots, OtExtensionReceiverData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:386
BasicOtSender(std::size_t ot_id, std::size_t number_of_ots, std::size_t bitlength, OtProtocol p, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function, OtExtensionSenderData &data)
Definition: ot_flavors.cpp:33
AcOtReceiver(std::size_t ot_id, std::size_t number_of_ots, std::size_t vector_size, OtExtensionReceiverData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:499
GOt128Sender(std::size_t ot_id, std::size_t number_of_ots, OtExtensionSenderData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:572
Definition: ot_flavors.h:499
const Block128Vector & GetOutputs() const
Definition: ot_flavors.h:162
choices
Definition: geninput.py:153
const BitVector & GetChoices() const
Definition: ot_flavors.h:62
void SetCorrelations(const std::vector< T > &correlations)
Definition: ot_flavors.h:369
std::unordered_set< std::size_t > received_correction_offsets
Definition: ot_extension_data.h:156
@ kFixedXcOt128
Definition: ot_provider.h:55
OtExtensionSenderData & data_
Definition: ot_flavors.h:48
ROtReceiver(std::size_t ot_id, std::size_t number_of_ots, std::size_t bitlength, OtExtensionReceiverData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:121
std::vector< T > & GetOutputs()
Definition: ot_flavors.h:417
Definition: ot_flavors.h:356
BitVector choices_
Definition: ot_flavors.h:79
std::vector< BitVector<> > y1
Definition: ot_extension_data.h:164
flatbuffers::FlatBufferBuilder BuildOtExtensionMessageSender(const std::byte *buffer, const std::size_t size, const std::size_t i)
Definition: ot_extension_message.cpp:31
void SendMessages() const
Definition: ot_flavors.cpp:289
std::vector< std::size_t > bitlengths
Definition: ot_extension_data.h:167
GOtBitReceiver(std::size_t ot_id, std::size_t number_of_ots, OtExtensionReceiverData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:670
const std::size_t ot_id_
Definition: ot_provider.h:94
Definition: ot_flavors.h:481
void SendMessages() const
Definition: ot_flavors.cpp:709
Block128 * data()
Get pointer to the first Block128.
Definition: block.h:219
bool Empty() const
Check if BitVector is empty.
Definition: bit_vector.h:146
void WaitSetup() const
Definition: ot_flavors.cpp:130
Definition: algorithm_description.cpp:35
auto GetSize() const noexcept
Get size of BitVector.
Definition: bit_vector.h:149
BitVector & GetOutputs()
Definition: ot_flavors.h:201
GOtBitSender(std::size_t ot_id, std::size_t number_of_ots, OtExtensionSenderData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:638
void SendMessages() const
Definition: ot_flavors.cpp:474
@ kXcOtBit
Definition: ot_provider.h:56
Definition: ot_flavors.h:179
const Block128Vector & GetOutputs() const
Definition: ot_flavors.h:464
std::vector< std::size_t > bitlengths
Definition: ot_extension_data.h:91
Block of aligned 128 bit / 16 B.
Definition: block.h:34
void ComputeOutputs()
Definition: ot_flavors.cpp:612
Definition: ot_flavors.h:437
ReusableFiberFuture< std::vector< BitVector<> > > RegisterForGenericSenderMessage(std::size_t ot_id, std::size_t size, std::size_t bitlength)
Definition: ot_extension_data.cpp:210
Definition: ot_flavors.h:52
@ kGOt
Definition: benchmark_providers.h:34
void SetChoices(const BitVector<> &choices)
Definition: ot_flavors.h:59
Definition: ot_flavors.h:328
void ComputeOutputs()
Definition: ot_flavors.cpp:426
std::unordered_map< std::size_t, OtMessageType > message_type
Definition: ot_extension_data.h:94
ROtSender(std::size_t ot_id, std::size_t number_of_ots, std::size_t bitlength, OtExtensionSenderData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:77
@ kAcOt
Definition: ot_provider.h:54
void SetInputs(std::vector< BitVector<>> &&inputs)
Definition: ot_flavors.h:506
void ComputeOutputs()
Definition: ot_flavors.cpp:338
AcOtSender(std::size_t ot_id, std::size_t number_of_ots, std::size_t vector_size, OtExtensionSenderData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:418
bool AreChoicesSet() const
Definition: ot_flavors.h:65
GOtReceiver(std::size_t ot_id, std::size_t number_of_ots, std::size_t bitlength, OtExtensionReceiverData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:742
OtProtocol
Definition: ot_provider.h:50
const std::size_t bitlen_
Definition: ot_provider.h:94
void ComputeOutputs()
Definition: ot_flavors.cpp:222
Definition: ot_flavors.h:264
Definition: ot_extension_data.h:65
Definition: ot_flavors.h:153
BitVector corrections
Definition: ot_extension_data.h:159
Non-owning non-resizeable BitVector.
Definition: bit_vector.h:578
std::unique_ptr< FiberCondition > setup_finished_condition
Definition: ot_extension_data.h:170
void SetCorrelations(std::vector< T > &&correlations)
Definition: ot_flavors.h:365
std::span< const BitVector<> > GetCorrelations() const
Definition: ot_flavors.h:238
FixedXcOt128Receiver(std::size_t ot_id, std::size_t number_of_ots, OtExtensionReceiverData &data, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &send_function)
Definition: ot_flavors.cpp:302
void Append(bool bit) noexcept
Appends a bit to BitVector.
Definition: bit_vector.cpp:621
std::unique_ptr< FiberCondition > setup_finished_condition
Definition: ot_extension_data.h:126
void SetInputs(const BitVector<> &inputs)
Definition: ot_flavors.h:488
const BitVector & GetOutputs() const
Definition: ot_flavors.h:529
std::span< const BitVector<> > GetOutputs()
Definition: ot_flavors.h:277
void ComputeOutputs()
Definition: ot_flavors.cpp:518
void WaitSetup() const
Definition: ot_flavors.cpp:51
static const fe d
Definition: mycurve25519_tables.h:30
constexpr std::byte kSetBitMask[]
Definition: bit_vector.h:43
std::vector< BitVector<> > y0
Definition: ot_extension_data.h:164
std::vector< T > & GetOutputs()
Definition: ot_flavors.h:381
flatbuffers::FlatBufferBuilder BuildOtExtensionMessageReceiverCorrections(const std::byte *buffer, const std::size_t size, const std::size_t i)
Definition: ot_extension_message.cpp:55
BitVector & GetOutputs()
Definition: ot_flavors.h:311
Definition: ot_flavors.h:520
std::unordered_map< std::size_t, std::size_t > number_of_ots_in_batch
Definition: ot_extension_data.h:123
void SendCorrections()
Definition: ot_flavors.cpp:67
BasicOtReceiver(std::size_t ot_id, std::size_t number_of_ots, std::size_t bitlength, OtProtocol p, const std::function< void(flatbuffers::FlatBufferBuilder &&)> &Send, OtExtensionReceiverData &data)
Definition: ot_flavors.cpp:55
void ComputeOutputs()
Definition: ot_flavors.cpp:752
std::span< const BitVector<> > GetOutputs()
Definition: ot_flavors.h:338
std::byte * data()
Get a pointer to the beginning of this Block128.
Definition: block.h:148
std::vector< BitVector<> > outputs
Definition: ot_extension_data.h:86
std::mutex corrections_mutex
Definition: ot_extension_data.h:160
BitVector Subset(std::size_t from, std::size_t to) const
Returns a new BitVector containing the bits of this BitVector between positions from and to.
Definition: bit_vector.cpp:806
const BitVector & GetChoices()
Definition: ot_flavors.h:282
void SendMessages() const
@ kGOt
Definition: ot_provider.h:51
void SendMessages() const
Definition: ot_flavors.cpp:198
void SetInputs(const Block128Vector &inputs)
Definition: ot_flavors.h:444
Definition: ot_flavors.h:37
void SetInputs(Block128Vector &&inputs)
Definition: ot_flavors.h:443
void ComputeOutputs()
Definition: ot_flavors.cpp:132
Block128 & at(std::size_t index)
Access Block128 at index. Throws an exception if index is out of bounds.
Definition: block.h:215
void ComputeOutputs()
Definition: ot_flavors.cpp:251
void Resize(std::size_t number_of_bits, bool zero_fill=false) noexcept
Resize BitVector to size number_of_bits. New bits are uninitialized by default.
Definition: bit_vector.cpp:602
const BitVector & GetCorrelations() const
Definition: ot_flavors.h:195