MOTION  0.01
Framework for mixed-protocol multi-party computation
benchmark_providers.h
Go to the documentation of this file.
1 // MIT License
2 //
3 // Copyright (c) 2019 Oleksandr Tkachenko
4 // Cryptography and Privacy Engineering Group (ENCRYPTO)
5 // TU Darmstadt, Germany
6 //
7 // Permission is hereby granted, free of charge, to any person obtaining a copy
8 // of this software and associated documentation files (the "Software"), to deal
9 // in the Software without restriction, including without limitation the rights
10 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 // copies of the Software, and to permit persons to whom the Software is
12 // furnished to do so, subject to the following conditions:
13 //
14 // The above copyright notice and this permission notice shall be included in all
15 // copies or substantial portions of the Software.
16 //
17 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 // SOFTWARE.
24 
25 #pragma once
26 
27 #include "base/party.h"
29 #include "utility/typedefs.h"
30 
31 enum Provider : std::size_t {
32  kAmt = 0,
33  kBmt = 1,
34  kGOt = 2,
35  kXcOt = 3,
36  kAcOt = 4,
37  kROt = 5,
38  kSb = 6,
39  kSp = 7
40 };
41 
42 constexpr std::array kProviderName{"AMT", "BMT", "GOT", "XCOT", "ACOT", "ROT", "SB", "SP"};
43 
44 inline std::string to_string(Provider p) { return kProviderName[p]; }
45 
47  std::size_t batch_size, Provider provider,
48  std::size_t bit_size = 0);
CheckPartyArgumentSyntax
bool CheckPartyArgumentSyntax(const std::string &party_argument)
Definition: benchmark_integers_main.cpp:129
to_string
std::string to_string(Provider p)
Definition: benchmark_providers.h:44
kSb
@ kSb
Definition: benchmark_providers.h:38
encrypto::motion::AccumulatedCommunicationStatistics::Add
void Add(const communication::TransportStatistics &statistics)
Definition: analysis.cpp:125
kROt
@ kROt
Definition: benchmark_providers.h:37
analysis.h
kIllegalOperationType
constexpr std::size_t kIllegalOperationType
Definition: benchmark_integers_main.cpp:50
party.h
ParseProgramOptions
std::pair< program_options::variables_map, bool > ParseProgramOptions(int ac, char *av[])
Definition: benchmark_integers_main.cpp:145
encrypto::motion::AccumulatedRunTimeStatistics
Definition: analysis.h:43
Combination::bit_size
std::size_t bit_size
Definition: benchmark_main.cpp:60
main
int main(int ac, char *av[])
Definition: benchmark_main.cpp:112
benchmark_providers.h
Combination::bit_size_
std::size_t bit_size_
Definition: benchmark_integers_main.cpp:60
encrypto::motion::MpcProtocol::kBmr
@ kBmr
encrypto::motion::Block128::MakeZero
static Block128 MakeZero()
Create a zero-initialized Block128.
Definition: block.h:63
encrypto::motion::PartyPointer
std::unique_ptr< Party > PartyPointer
Definition: party.h:387
config.h
Combination::operation_type_
encrypto::motion::IntegerOperationType operation_type_
Definition: benchmark_integers_main.cpp:62
kBmt
@ kBmt
Definition: benchmark_providers.h:33
backend.h
Combination::protocol_
encrypto::motion::MpcProtocol protocol_
Definition: benchmark_integers_main.cpp:61
kAcOt
@ kAcOt
Definition: benchmark_providers.h:36
main
int main(int ac, char *av[])
Definition: benchmark_integers_main.cpp:88
encrypto::motion::IntegerOperationType
IntegerOperationType
Definition: typedefs.h:113
encrypto::motion::Block128Vector
Vector of 128 bit / 16 B blocks.
Definition: block.h:168
block.h
encrypto::motion::BitVector<>
ParseProgramOptions
std::pair< program_options::variables_map, bool > ParseProgramOptions(int ac, char *av[])
Definition: benchmark_main.cpp:166
encrypto::motion::RunTimeStatistics::StatisticsId::kEvaluate
@ kEvaluate
kIllegalProtocol
constexpr std::size_t kIllegalProtocol
Definition: benchmark_integers_main.cpp:50
Combination::protocol
encrypto::motion::MpcProtocol protocol
Definition: benchmark_main.cpp:61
Combination::number_of_simd_
std::size_t number_of_simd_
Definition: benchmark_integers_main.cpp:63
kProviderName
constexpr std::array kProviderName
Definition: benchmark_providers.h:42
encrypto::motion::MpcProtocol::kBooleanGmw
@ kBooleanGmw
encrypto::motion::communication::TcpSetupHelper
Definition: tcp_transport.h:69
kAmt
@ kAmt
Definition: benchmark_providers.h:32
Combination::Combination
Combination(std::size_t bit_size, encrypto::motion::MpcProtocol protocol, encrypto::motion::IntegerOperationType operation_type, std::size_t number_of_simd)
Definition: benchmark_integers_main.cpp:53
CreateParty
encrypto::motion::PartyPointer CreateParty(const program_options::variables_map &user_options)
Definition: benchmark_integers_main.cpp:212
communication_layer.h
CheckPartyArgumentSyntax
bool CheckPartyArgumentSyntax(const std::string &party_argument)
Definition: benchmark_main.cpp:150
Provider
Provider
Definition: benchmark_providers.h:31
ParsePartyArgument
std::tuple< std::size_t, std::string, std::uint16_t > ParsePartyArgument(const std::string &party_argument)
Definition: benchmark_integers_main.cpp:134
Combination::number_of_simd
std::size_t number_of_simd
Definition: benchmark_main.cpp:63
GenerateAllCombinations
std::vector< Combination > GenerateAllCombinations()
Definition: benchmark_integers_main.cpp:66
CreateParty
encrypto::motion::PartyPointer CreateParty(const program_options::variables_map &user_options)
Definition: benchmark_main.cpp:233
encrypto::motion::communication::TcpPartiesConfiguration
std::vector< TcpConnectionConfiguration > TcpPartiesConfiguration
Definition: tcp_transport.h:62
Combination
Definition: benchmark_main.cpp:52
mt_provider.h
kIllegalProtocol
constexpr std::size_t kIllegalProtocol
Definition: benchmark_main.cpp:50
encrypto::motion::PrimitiveOperationType
PrimitiveOperationType
Definition: typedefs.h:37
Combination::Combination
Combination(std::size_t bit_size, encrypto::motion::MpcProtocol protocol, encrypto::motion::PrimitiveOperationType operation_type, std::size_t number_of_simd)
Definition: benchmark_main.cpp:53
geninput.help
help
Definition: geninput.py:150
kGOt
@ kGOt
Definition: benchmark_providers.h:34
encrypto::motion::RunTimeStatistics
Definition: run_time_statistics.h:32
benchmark.h
encrypto::motion::PrintStatistics
std::string PrintStatistics(const std::string &experiment_name, const AccumulatedRunTimeStatistics &execution_statistics, const AccumulatedCommunicationStatistics &communication_statistics)
Definition: analysis.cpp:176
ot_flavors.h
EvaluateProtocol
encrypto::motion::RunTimeStatistics EvaluateProtocol(encrypto::motion::PartyPointer &party, std::size_t number_of_simd, encrypto::motion::MpcProtocol protocol, bool check)
Definition: aes128.cpp:56
kIllegalOperationType
constexpr std::size_t kIllegalOperationType
Definition: benchmark_main.cpp:50
typedefs.h
encrypto::motion::MpcProtocol
MpcProtocol
Definition: typedefs.h:140
sb_provider.h
kSp
@ kSp
Definition: benchmark_providers.h:39
kPartyArgumentRegex
const std::regex kPartyArgumentRegex("(\\d+),(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}),(\\d{1,5})")
benchmark_integers.h
kPartyArgumentRegex
const std::regex kPartyArgumentRegex("(\\d+),(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}),(\\d{1,5})")
encrypto::motion::MpcProtocol::kArithmeticGmw
@ kArithmeticGmw
encrypto::motion::Block128::MakeRandom
static Block128 MakeRandom()
Create a random-initialized Block128.
Definition: block.h:70
BenchmarkProvider
encrypto::motion::RunTimeStatistics BenchmarkProvider(encrypto::motion::PartyPointer &party, std::size_t batch_size, Provider provider, std::size_t bit_size)
Definition: benchmark_providers.cpp:37
tcp_transport.h
run_time_statistics.h
BenchmarkProvider
encrypto::motion::RunTimeStatistics BenchmarkProvider(encrypto::motion::PartyPointer &party, std::size_t batch_size, Provider provider, std::size_t bit_size=0)
Definition: benchmark_providers.cpp:37
encrypto::motion::to_string
std::string to_string(std::vector< T > values)
Returns a string representation of the std::vector values.
Definition: helpers.h:455
encrypto::motion::AccumulatedCommunicationStatistics
Definition: analysis.h:65
encrypto::motion::AccumulatedRunTimeStatistics::Add
void Add(const RunTimeStatistics &statistics)
Definition: analysis.cpp:43
Combination::operation_type
encrypto::motion::PrimitiveOperationType operation_type
Definition: benchmark_main.cpp:62
kXcOt
@ kXcOt
Definition: benchmark_providers.h:35
ParsePartyArgument
std::tuple< std::size_t, std::string, std::uint16_t > ParsePartyArgument(const std::string &party_argument)
Definition: benchmark_main.cpp:155
GenerateAllCombinations
std::vector< Combination > GenerateAllCombinations()
Definition: benchmark_main.cpp:66
encrypto::motion::communication::TcpSetupHelper::SetupConnections
std::vector< std::unique_ptr< Transport > > SetupConnections()
Definition: tcp_transport.cpp:203
sp_provider.h