MOTION  0.01
Framework for mixed-protocol multi-party computation
crosstabs.h
Go to the documentation of this file.
1 // MIT License
2 //
3 // Copyright (c) 2021 Arianne Roselina Prananto
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in all
13 // copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 // SOFTWARE.
22 
23 #pragma once
24 
25 #include <span>
26 #include "base/party.h"
29 
30 struct Attributes;
31 struct CrossTabsContext;
32 
34  encrypto::motion::PartyPointer& party, std::uint32_t number_of_bins,
35  std::span<const std::uint32_t> input_command_line, const std::string& input_file_path,
36  bool print_output);
37 
38 std::vector<encrypto::motion::SecureUnsignedInteger> CreateCrossTabsCircuit(
39  CrossTabsContext context);
40 
41 std::tuple<std::vector<std::uint32_t>, std::vector<std::uint32_t>, std::vector<std::uint32_t>>
42 GetFileInput(std::size_t party_id, const std::string& path, std::uint32_t number_of_bins);
encrypto::motion::ShareWrapper
Definition: share_wrapper.h:44
analysis.h
party.h
encrypto::motion::ShareWrapper::Get
SharePointer & Get()
Definition: share_wrapper.h:107
CrossTabsContext::categories
std::vector< encrypto::motion::SecureUnsignedInteger > categories
Definition: crosstabs.cpp:51
GetFileInput
std::tuple< std::vector< std::uint32_t >, std::vector< std::uint32_t >, std::vector< std::uint32_t > > GetFileInput(std::size_t party_id, const std::string &path, std::uint32_t number_of_bins)
Definition: crosstabs.cpp:185
Attributes::id
std::vector< encrypto::motion::SecureUnsignedInteger > id
Definition: crosstabs.cpp:43
CreateCrossTabsCircuit
std::vector< encrypto::motion::SecureUnsignedInteger > CreateCrossTabsCircuit(CrossTabsContext context)
Definition: crosstabs.cpp:147
encrypto::motion::PartyPointer
std::unique_ptr< Party > PartyPointer
Definition: party.h:387
config.h
Attributes
Definition: crosstabs.cpp:40
bit_vector.h
bmr_wire.h
CrossTabsContext::number_of_bins
std::uint32_t number_of_bins
Definition: crosstabs.cpp:53
encrypto::motion::BitVector<>
encrypto::motion::ShareWrapper::Concatenate
static ShareWrapper Concatenate(std::vector< ShareWrapper > &&input)
concatenates wires in multiple shares in one share.
Definition: share_wrapper.h:128
Attributes::cleartext_input
std::vector< std::uint32_t > cleartext_input
Definition: crosstabs.cpp:41
encrypto::motion::MpcProtocol::kBooleanGmw
@ kBooleanGmw
boolean_gmw_wire.h
GetFileInput
std::tuple< std::vector< std::uint32_t >, std::vector< std::uint32_t >, std::vector< std::uint32_t > > GetFileInput(std::size_t party_id, const std::string &path, std::uint32_t number_of_bins)
Definition: crosstabs.cpp:185
secure_unsigned_integer.h
CrossTabsContext::full_zero
encrypto::motion::ShareWrapper full_zero
Definition: crosstabs.cpp:52
share_wrapper.h
CrossTabsContext::party_0
Attributes party_0
Definition: crosstabs.cpp:50
crosstabs.h
encrypto::motion::ShareWrapper::Convert
ShareWrapper Convert() const
Definition: share_wrapper.cpp:322
CrossTabsContext
Definition: crosstabs.cpp:49
encrypto::motion::RunTimeStatistics
Definition: run_time_statistics.h:32
encrypto::motion::SecureUnsignedInteger
Definition: secure_unsigned_integer.h:33
CrossTabsContext::party_1
Attributes party_1
Definition: crosstabs.cpp:50
party_1
struct Attributes party_1
EvaluateProtocol
encrypto::motion::RunTimeStatistics EvaluateProtocol(encrypto::motion::PartyPointer &party, std::uint32_t number_of_bins, std::span< const std::uint32_t > input_command_line, const std::string &input_file_path, bool print_output)
Definition: crosstabs.cpp:56
CrossTabsContext::results
std::vector< encrypto::motion::SecureUnsignedInteger > results
Definition: crosstabs.cpp:51
EvaluateProtocol
encrypto::motion::RunTimeStatistics EvaluateProtocol(encrypto::motion::PartyPointer &party, std::uint32_t number_of_bins, std::span< const std::uint32_t > input_command_line, const std::string &input_file_path, bool print_output)
Definition: crosstabs.cpp:56
encrypto::motion::MpcProtocol::kArithmeticGmw
@ kArithmeticGmw
CreateCrossTabsCircuit
std::vector< encrypto::motion::SecureUnsignedInteger > CreateCrossTabsCircuit(CrossTabsContext context)
Definition: crosstabs.cpp:147
Attributes::shared_input
std::vector< encrypto::motion::SecureUnsignedInteger > shared_input
Definition: crosstabs.cpp:42
party_0
struct Attributes party_0
run_time_statistics.h
encrypto::motion::ToInput
std::vector< BitVector< Allocator > > ToInput(IntegralType integral_value)
Definition: bit_vector.cpp:1189
arithmetic_gmw_wire.h