MOTION  0.01
Framework for mixed-protocol multi-party computation
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
encrypto::motion Namespace Reference

Namespaces

 communication
 
 curve25519
 
 detail
 
 primitives
 
 proto
 

Classes

class  AccumulatedCommunicationStatistics
 
class  AccumulatedRunTimeStatistics
 
class  AcOtReceiver
 
class  AcOtSender
 
class  Aes128CtrRng
 
struct  AlgorithmDescription
 
class  ArithmeticGmwToBmrGate
 
class  Backend
 
struct  BaseOtData
 
class  BaseOtMessageHandler
 
class  BaseOtProvider
 
struct  BaseOtReceiverData
 
struct  BaseOtSenderData
 
class  BaseProvider
 
class  BasicOtReceiver
 
class  BasicOtSender
 
class  BasicSynchronizedQueue
 
struct  BinaryMtVector
 
class  BitMatrix
 
class  BitSpan
 Non-owning non-resizeable BitVector. More...
 
class  BitVector
 Class representing a series of bits and providing single bit access. More...
 
struct  Block128
 Block of aligned 128 bit / 16 B. More...
 
struct  Block128Vector
 Vector of 128 bit / 16 B blocks. More...
 
class  BmrToBooleanGmwGate
 
class  BooleanGmwToBmrGate
 
class  BooleanShare
 
class  BooleanWire
 
class  Condition
 Wraps a std::condition_variable with a std::mutex and a condition checking function. More...
 
class  Configuration
 
class  FiberCondition
 Wraps a boost::fibers::condition_variable with a boost::fibers::mutex and a condition checking function. More...
 
class  FiberThreadPool
 
class  FixedXcOt128Receiver
 
class  FixedXcOt128Sender
 
class  Gate
 
class  GateExecutor
 
class  GmwToArithmeticGate
 
class  GOt128Receiver
 
class  GOt128Sender
 
class  GOtBitReceiver
 
class  GOtBitSender
 
class  GOtReceiver
 
class  GOtSender
 
struct  HelloMessageHandler
 
class  InputGate
 
struct  IntegerMtVector
 
struct  is_specialization
 
struct  is_specialization< Ref< Args... >, Ref >
 
class  LockedFiberQueue
 
class  LockedQueue
 
class  Logger
 
class  MtProvider
 
class  MtProviderFromOts
 
class  NInputGate
 
class  OneGate
 
class  OpenSslRng
 
class  Ot
 
struct  OtExtensionData
 
class  OtExtensionMessageHandler
 
struct  OtExtensionReceiverData
 
struct  OtExtensionSenderData
 
class  OtHL17
 
class  OtProvider
 
class  OtProviderFromBaseOTs
 
class  OtProviderFromFile
 
class  OtProviderFromMultipleThirdParties
 
class  OtProviderFromOtExtension
 
class  OtProviderFromThirdParty
 
class  OtProviderManager
 
class  OtProviderReceiver
 
class  OtProviderSender
 
class  OtVector
 
class  OutputGate
 
class  OutputMessageHandler
 
class  Party
 
struct  PrimitiveOperation
 
class  RandomOt
 
struct  ReceiverMessage
 
class  Register
 
class  ReusableFuture
 
class  ReusablePromise
 
class  Rng
 
class  ROtReceiver
 
class  ROtSender
 
struct  RunTimeStatistics
 
class  SbMessageHandler
 
class  SbProvider
 
class  SbProviderFromSps
 
class  SecureUnsignedInteger
 
struct  SenderMessage
 
class  Share
 
struct  SharedBitsData
 
class  ShareWrapper
 
class  SimdifyGate
 yields a share that constitutes a concatenation of the parent in terms of their SIMD values, e.g., if 3 parents contain 1, 3, and 2 SIMD values, respectively, the output will contain 1 share with 6 SIMD values and the same number of wires as parents. The output SIMD values will be ordered as [parent_0[simd_0], parent_1[simd_0, simd_1, simd_2], parent_2[simd_0, simd_1]]. More...
 
class  SpProvider
 
class  SpProviderFromOts
 
struct  SpVector
 
class  SubsetGate
 obtains a subset of SIMD values of a share at provided position ids. Repeated position ids are allowed, meaning that the number of SIMD values of the output share may be greater than the number of SIMD values of the parent share. Each of the position ids must be smaller than the number of SIMD values of the parent share. More...
 
class  ThreeGate
 
class  TwoGate
 
class  UnsimdifyGate
 yields a set of shares that correspond to single "SIMD layers" of the parent, e.g., if parent contains 10 SIMD values, the output will contain 10 shares with 1 SIMD value and the same number of wires as parent. More...
 
class  Wire
 
class  XcOtBitReceiver
 
class  XcOtBitSender
 
class  XcOtReceiver
 
class  XcOtSender
 

Typedefs

using GatePointer = std::shared_ptr< Gate >
 
using InputGatePointer = std::shared_ptr< InputGate >
 
using LoggerPointer = std::shared_ptr< Logger >
 
using ConfigurationPointer = std::shared_ptr< Configuration >
 
using RegisterPointer = std::shared_ptr< Register >
 
using BackendPointer = std::shared_ptr< Backend >
 
using PartyPointer = std::unique_ptr< Party >
 
using WirePointer = std::shared_ptr< Wire >
 
using BaseOtMessages = std::array< std::array< std::byte, 16 >, kKappa >
 
using Blake2bCtx = std::unique_ptr< EVP_MD_CTX, std::function< void(EVP_MD_CTX *)> >
 
using DefaultRng = Aes128CtrRng
 
using SharePointer = std::shared_ptr< Share >
 
using OutputGatePointer = std::shared_ptr< OutputGate >
 
using BooleanSharePointer = std::shared_ptr< BooleanShare >
 
using BooleanWirePointer = std::shared_ptr< BooleanWire >
 
using StatId = RunTimeStatistics::StatisticsId
 
using StdAllocator = std::allocator< std::byte >
 
using AlignedAllocator = boost::alignment::aligned_allocator< std::byte, kAlignment >
 
using AlignedBitVector = BitVector< AlignedAllocator >
 
using LoggerType = boost::log::sources::severity_channel_logger< boost::log::trivial::severity_level, std::size_t >
 
template<template< typename > class Value, typename... Ts>
using TypeMap = decltype(detail::MakeTypeMap< Value, Ts... >())
 
template<typename R >
using ReusableFiberFuture = ReusableFuture< R, boost::fibers::mutex, boost::fibers::condition_variable >
 
template<typename R >
using ReusableFiberPromise = ReusablePromise< R, boost::fibers::mutex, boost::fibers::condition_variable >
 
template<typename T >
using SynchronizedQueue = BasicSynchronizedQueue< T, std::mutex, std::condition_variable >
 
template<typename T >
using SynchronizedFiberQueue = BasicSynchronizedQueue< T, boost::fibers::mutex, boost::fibers::condition_variable >
 
template<typename T >
using IsUnsignedInt = std::enable_if_t< std::conjunction_v< std::is_integral< T >, std::is_unsigned< T >, std::negation< std::is_same< T, bool > >> >
 

Enumerations

enum  BaseOtDataType : unsigned int { kHL17R = 0, kHL17S = 1, kBaseOtInvalidDataType = 2 }
 
enum  OtExtensionDataType : unsigned int { kReceptionMask = 0, kReceptionCorrection = 1, kSendMessage = 2, kOtExtensionInvalidDataType = 3 }
 
enum  OtMessageType {
  OtMessageType::kGenericBoolean, OtMessageType::kBit, OtMessageType::kBlock128, OtMessageType::kUint8,
  OtMessageType::kUint16, OtMessageType::kUint32, OtMessageType::kUint64, OtMessageType::kUint128
}
 
enum  SharedBitsMessageType : std::uint8_t { kMaskMessage = 2, kReconstructMessage = 1 }
 
enum  OtProtocol : unsigned int {
  kGOt = 0, kROt = 1, kXcOt = 2, kAcOt = 3,
  kFixedXcOt128 = 4, kXcOtBit = 5, kGOt128 = 6, kInvalidOt = 7
}
 
enum  FiberStackAllocator { FiberStackAllocator::kFixedSize, FiberStackAllocator::kPooledFixedSize, FiberStackAllocator::kProtectedFixedSize }
 
enum  PrimitiveOperationType : std::uint8_t {
  PrimitiveOperationType::kIn, PrimitiveOperationType::kOut, PrimitiveOperationType::kXor, PrimitiveOperationType::kAnd,
  PrimitiveOperationType::kMux, PrimitiveOperationType::kInv, PrimitiveOperationType::kOr, PrimitiveOperationType::kAdd,
  PrimitiveOperationType::kMul, PrimitiveOperationType::kSqr, PrimitiveOperationType::kA2B, PrimitiveOperationType::kA2Y,
  PrimitiveOperationType::kB2A, PrimitiveOperationType::kB2Y, PrimitiveOperationType::kY2A, PrimitiveOperationType::kY2B,
  PrimitiveOperationType::kInvalid
}
 
enum  IntegerOperationType : unsigned int {
  IntegerOperationType::kAdd, IntegerOperationType::kDiv, IntegerOperationType::kGt, IntegerOperationType::kEq,
  IntegerOperationType::kMul, IntegerOperationType::kSub, IntegerOperationType::kInvalid
}
 
enum  MpcProtocol : unsigned int {
  MpcProtocol::kArithmeticGmw, MpcProtocol::kBooleanGmw, MpcProtocol::kBmr, MpcProtocol::kArithmeticConstant,
  MpcProtocol::kBooleanConstant, MpcProtocol::kInvalid
}
 
enum  CircuitType : unsigned int { CircuitType::kArithmetic, CircuitType::kBoolean, CircuitType::kInvalid }
 
enum  Role : unsigned int { Role::kServer, Role::kClient, Role::kInvalid }
 
enum  GateType : unsigned int { GateType::kInput = 0, GateType::kInteractive = 1, GateType::kNonInteractive = 2, GateType::kInvalid = 3 }
 

Functions

std::vector< std::unique_ptr< Party > > MakeLocallyConnectedParties (const std::size_t number_of_parties, std::uint16_t port, const bool logging=false)
 constructs number_of_parties motion::Party's locally connected via TCP. More...
 
static void GenerateRandomTriplesBool (BinaryMtVector &bit_mts, std::size_t number_of_bit_mts)
 
template<typename T >
static void GenerateRandomTriples (IntegerMtVector< T > &mts, std::size_t number_of_mts)
 
static void RegisterHelperBool (OtProvider &ot_provider, std::unique_ptr< XcOtBitSender > &ots_sender, std::unique_ptr< XcOtBitReceiver > &ots_receiver, const BinaryMtVector &bit_mts, std::size_t number_of_bit_mts)
 
template<typename T >
static void RegisterHelper (OtProvider &ot_provider, std::list< std::unique_ptr< AcOtSender< T >>> &ots_sender, std::list< std::unique_ptr< AcOtReceiver< T >>> &ots_receiver, std::size_t max_batch_size, const IntegerMtVector< T > &mts, std::size_t number_of_mts)
 
static void ParseHelperBool (std::unique_ptr< XcOtBitSender > &ots_sender, std::unique_ptr< XcOtBitReceiver > &ots_receiver, BinaryMtVector &bit_mts)
 
template<typename T >
static void ParseHelper (std::list< std::unique_ptr< AcOtSender< T >>> &ots_sender, std::list< std::unique_ptr< AcOtReceiver< T >>> &ots_receiver, std::size_t max_batch_size, IntegerMtVector< T > &mts, std::size_t number_of_mts)
 
template<typename T >
static constexpr auto GetByteSize (const std::vector< T > &v)
 
static std::vector< std::uint8_t > Gather (const std::vector< std::uint16_t > &ds_8, const std::vector< std::uint32_t > &ds_16, const std::vector< std::uint64_t > &ds_32, const std::vector< __uint128_t > &ds_64)
 
static std::vector< std::uint8_t > Scatter (std::vector< std::uint16_t > &ds_8, std::vector< std::uint32_t > &ds_16, std::vector< std::uint64_t > &ds_32, std::vector< __uint128_t > &ds_64, const std::vector< std::uint8_t > &buffer)
 
static void ReconstructionHelper (std::vector< std::uint16_t > &xs_8, std::vector< std::uint32_t > &xs_16, std::vector< std::uint64_t > &xs_32, std::vector< __uint128_t > &xs_64, std::size_t number_of_parties, std::function< void(const std::vector< uint8_t > &)> broadcast_function, std::vector< ReusableFuture< std::vector< std::uint8_t >>> &futures)
 
template<typename T >
static void GenerateRandomPairs (SpVector< T > &sps, std::size_t number_of_sps)
 
template<typename T >
static void RegisterHelperSend (OtProvider &ot_provider, std::list< std::unique_ptr< AcOtSender< T >>> &ots_sender, std::size_t max_batch_size, const SpVector< T > &sps, std::size_t number_of_sps)
 
template<typename T >
static void RegisterHelperReceptor (OtProvider &ot_provider, std::list< std::unique_ptr< AcOtReceiver< T >>> &ots_receiver, std::size_t max_batch_size, const SpVector< T > &sps, std::size_t number_of_sps)
 
template<typename T >
static void ParseHelperSend (std::list< std::unique_ptr< AcOtSender< T >>> &ots_sender, std::size_t max_batch_size, SpVector< T > &sps, std::size_t number_of_sps)
 
template<typename T >
static void ParseHelperReceive (std::list< std::unique_ptr< AcOtReceiver< T >>> &ots_receiver, std::size_t max_batch_size, SpVector< T > &sps, std::size_t number_of_sps)
 
void HashPoint (curve25519::ge_p3 &output, const curve25519::ge_p3 &input)
 
Blake2bCtx NewBlakeCtx ()
 
void Blake2b (std::uint8_t *message, std::uint8_t digest[64], std::size_t length, EVP_MD_CTX *context)
 
void Blake2b (std::uint8_t *message, std::uint8_t digest[64], std::size_t length, Blake2bCtx &b)
 
template<typename WireType >
void ArithmeticSimdifyOnlineImplementation (std::span< WirePointer > parent_wires, WirePointer output_wire)
 
template<typename T >
void ArithmeticGmwSimdifyOnline (std::span< WirePointer > parent_wires, WirePointer output_wire)
 
template<typename T >
void ArithmeticConstantSimdifyOnline (std::span< WirePointer > parent_wires, WirePointer output_wire)
 
template<typename Allocator >
void BitVectorSubsetImplementation (const BitVector< Allocator > &in, BitVector< Allocator > &out, std::span< const std::size_t > position_ids)
 
template<typename WireType >
void ArithmeticSubsetOnlineImplementation (WirePointer parent_wire, WirePointer output_wire, std::span< const std::size_t > position_ids)
 
template<typename T >
void ArithmeticGmwSubsetOnline (WirePointer parent_wire, WirePointer output_wire, std::span< const std::size_t > position_ids)
 
template<typename T >
void ArithmeticConstantSubsetOnline (WirePointer parent_wire, WirePointer output_wire, std::span< const std::size_t > position_ids)
 
template<typename WireType >
void ArithmeticUnsimdifyOnlineImplementation (WirePointer parent_wire, std::span< WirePointer > output_wires)
 
template<typename T >
void ArithmeticGmwUnsimdifyOnline (WirePointer parent_wire, std::span< WirePointer > output_wires)
 
template<typename T >
void ArithmeticConstantUnsimdifyOnline (WirePointer parent_wire, std::span< WirePointer > output_wires)
 
template ShareWrapper ShareWrapper::Convert< MpcProtocol::kArithmeticGmw > () const
 
template ShareWrapper ShareWrapper::Convert< MpcProtocol::kBooleanGmw > () const
 
template ShareWrapper ShareWrapper::Convert< MpcProtocol::kBmr > () const
 
template ShareWrapper ShareWrapper::Add< std::uint8_t > (SharePointer share, SharePointer other) const
 
template ShareWrapper ShareWrapper::Add< std::uint16_t > (SharePointer share, SharePointer other) const
 
template ShareWrapper ShareWrapper::Add< std::uint32_t > (SharePointer share, SharePointer other) const
 
template ShareWrapper ShareWrapper::Add< std::uint64_t > (SharePointer share, SharePointer other) const
 
template ShareWrapper ShareWrapper::Sub< std::uint8_t > (SharePointer share, SharePointer other) const
 
template ShareWrapper ShareWrapper::Sub< std::uint16_t > (SharePointer share, SharePointer other) const
 
template ShareWrapper ShareWrapper::Sub< std::uint32_t > (SharePointer share, SharePointer other) const
 
template ShareWrapper ShareWrapper::Sub< std::uint64_t > (SharePointer share, SharePointer other) const
 
template ShareWrapper ShareWrapper::Mul< std::uint8_t > (SharePointer share, SharePointer other) const
 
template ShareWrapper ShareWrapper::Mul< std::uint16_t > (SharePointer share, SharePointer other) const
 
template ShareWrapper ShareWrapper::Mul< std::uint32_t > (SharePointer share, SharePointer other) const
 
template ShareWrapper ShareWrapper::Mul< std::uint64_t > (SharePointer share, SharePointer other) const
 
static double ComputeDuration (const RunTimeStatistics::TimePointPair &tpp)
 
template<typename C >
static C::value_type At (const C &container, RunTimeStatistics::StatisticsId id)
 
static std::string FormatLine (std::string name, std::string unit, AccumulatedRunTimeStatistics::AccumulatorType accumulator, std::size_t field_width)
 
std::string PrintMotionInfo ()
 
std::string PrintStatistics (const std::string &experiment_name, const AccumulatedRunTimeStatistics &execution_statistics, const AccumulatedCommunicationStatistics &communication_statistics)
 
static double ToMilliseconds (const RunTimeStatistics::TimePointPair &tpp)
 
template<typename C >
C::value_type At (const C &container, RunTimeStatistics::StatisticsId id)
 
constexpr auto NumberOfBitsToNumberOfBytes (std::size_t number_of_bits)
 
void TruncateToFitImplementation (std::byte *pointer, const std::size_t bit_size)
 
void SetImplementation (std::byte *pointer, const bool value, const std::size_t bit_size) noexcept
 
void SetAtImplementation (std::byte *pointer, const bool value, const std::size_t position) noexcept
 
bool GetImplementation (const std::byte *pointer, const std::size_t position) noexcept
 
template<typename T , typename U >
bool EqualImplementation (const T *pointer1, const U *pointer2, const std::size_t byte_size)
 
template<typename T , typename U >
bool AlignedEqualImplementation (const T *pointer1, const U *pointer2, const std::size_t byte_size)
 
template<typename T , typename U >
void XorImplementation (const T *input, U *result, const std::size_t byte_size)
 
template<typename T , typename U >
void AlignedXorImplementation (const T *input, U *result, const std::size_t byte_size)
 
template<typename T , typename U >
void AndImplementation (const T *input, U *result, const std::size_t byte_size)
 
template<typename T , typename U >
void AlignedAndImplementation (const T *input, U *result, const std::size_t byte_size)
 
template<typename T , typename U >
void OrImplementation (const T *input, U *result, const std::size_t byte_size)
 
template<typename T , typename U >
void AlignedOrImplementation (const T *input, U *result, const std::size_t byte_size)
 
void CopyImplementation (const std::size_t from, const std::size_t to, std::byte *source, std::byte *destination)
 
template<>
std::vector< BitVector< StdAllocator > > ToInput< float, std::true_type, StdAllocator > (float t)
 
template<>
std::vector< BitVector< StdAllocator > > ToInput< double, std::true_type, StdAllocator > (double t)
 
template<>
std::vector< BitVector< StdAllocator > > ToInput< float, std::true_type, StdAllocator > (const std::vector< float > &vector_of_floats)
 
template<>
std::vector< BitVector< StdAllocator > > ToInput< double, std::true_type, StdAllocator > (const std::vector< double > &vector_of_doubles)
 
template<typename IntegralType , typename , typename Allocator >
std::vector< BitVector< Allocator > > ToInput (IntegralType integral_value)
 
template std::vector< BitVector< StdAllocator > > ToInput (std::uint8_t)
 
template std::vector< BitVector< StdAllocator > > ToInput (std::uint16_t)
 
template std::vector< BitVector< StdAllocator > > ToInput (std::uint32_t)
 
template std::vector< BitVector< StdAllocator > > ToInput (std::uint64_t)
 
template<typename IntegralType , typename , typename Allocator >
std::vector< BitVector< Allocator > > ToInput (const std::vector< IntegralType > &input_vector)
 
template std::vector< BitVector< StdAllocator > > ToInput (const std::vector< std::uint8_t > &)
 
template std::vector< BitVector< StdAllocator > > ToInput (const std::vector< std::uint16_t > &)
 
template std::vector< BitVector< StdAllocator > > ToInput (const std::vector< std::uint32_t > &)
 
template std::vector< BitVector< StdAllocator > > ToInput (const std::vector< std::uint64_t > &)
 
std::ostream & operator<< (std::ostream &os, const BitSpan &bit_span)
 Output string representation of BitVector to std::ostream. More...
 
template<typename Allocator >
std::ostream & operator<< (std::ostream &os, const BitVector< Allocator > &bit_vector)
 Output string representation of BitVector to std::ostream. More...
 
template<typename T , typename = std::enable_if_t<std::is_floating_point_v<T> || std::is_unsigned_v<T>>, typename Allocator = std::allocator<std::byte>>
std::vector< BitVector< Allocator > > ToInput (const std::vector< T > &vector)
 Converts a vector of an unsigned integer type or a floating point type to a vector of BitVector. More...
 
template<typename UnsignedIntegralType , typename = std::enable_if_t<std::is_unsigned_v<UnsignedIntegralType>>, typename Allocator = std::allocator<std::byte>>
UnsignedIntegralType ToOutput (std::vector< BitVector< Allocator >> bit_vectors)
 Converts a vector of BitVectors to a value of UnsignedIntegralType. More...
 
template<typename StackAllocator >
static void worker_fctn (std::shared_ptr< pool_ctx > pool_ctx, boost::fibers::buffered_channel< FiberThreadPool::task_t > &task_queue, boost::fibers::barrier &barrier)
 
std::size_t DivideAndCeil (std::size_t dividend, std::size_t divisor)
 Divides two size_t and returns the ceiled quotient. More...
 
template<typename UnsignedIntegralType , typename = std::enable_if_t<std::is_unsigned_v<UnsignedIntegralType>>>
std::vector< UnsignedIntegralType > RandomVector (std::size_t length)
 Returns a vector of length random unsigned integral values. More...
 
template<typename UnsignedIntegralType , typename = std::enable_if_t<std::is_unsigned_v<UnsignedIntegralType>>>
std::vector< std::uint8_t > ToByteVector (const std::vector< UnsignedIntegralType > &values)
 Converts a vector of unsigned integral values to a vector of uint8_t. More...
 
template<typename UnsignedIntegralType , typename = std::enable_if_t<std::is_unsigned_v<UnsignedIntegralType>>>
std::vector< UnsignedIntegralType > FromByteVector (const std::vector< std::uint8_t > &buffer)
 Converts a vector of uint8_t to a vector of unsigned integral values. More...
 
template<typename UnsignedIntegralType , typename = std::enable_if_t<std::is_unsigned_v<UnsignedIntegralType>>>
std::vector< UnsignedIntegralType > FromByteVector (const flatbuffers::Vector< std::uint8_t > &buffer)
 Converts a flatbuffer vector of uint8_t to a vector of unsigned integral values. More...
 
template<typename T >
std::vector< T > AddVectors (const std::vector< T > &a, const std::vector< T > &b)
 Adds each element in a and b and returns the result. More...
 
template<typename T >
std::vector< T > SubVectors (const std::vector< T > &a, const std::vector< T > &b)
 Subtracts each element in a and b and returns the result. More...
 
template<typename T >
std::vector< T > MultiplyVectors (std::vector< T > a, std::vector< T > b)
 Multiplies each element in a and b and returns the result. More...
 
template<typename T >
std::vector< T > AddVectors (std::vector< std::vector< T >> &vectors)
 Performs the AddVectors operation on an arbitrary number of vectors. More...
 
template<typename T >
std::vector< T > AddVectors (std::vector< std::vector< T >> &&vectors)
 Performs the AddVectors operation on an arbitrary number of vectors. More...
 
template<typename T >
std::vector< T > RestrictAddVectors (const std::vector< T > &a, const std::vector< T > &b)
 Adds each element in a and b and returns the result. It is assumed that the vectors do not overlap. More...
 
template<typename T >
std::vector< T > RestrictSubVectors (const std::vector< T > &a, const std::vector< T > &b)
 Subtracts each element in a and b and returns the result. It is assumed that the vectors do not overlap. More...
 
template<typename T >
std::vector< T > RestrictMulVectors (const std::vector< T > &a, const std::vector< T > &b)
 Mulitiplies each element in a and b and returns the result. It is assumed that the vectors do not overlap. More...
 
template<typename T >
SumReduction (const std::vector< T > &values)
 Returns the sum of each element in values. More...
 
template<typename T >
SubReduction (const std::vector< T > &values)
 Returns the difference of each element in values. More...
 
template<typename T >
MulReduction (const std::vector< T > &values)
 Returns the product of each element in values. More...
 
template<typename T >
std::vector< T > RowSumReduction (const std::vector< std::vector< T >> &values)
 Returns the sum of each row in a matrix. More...
 
template<typename T >
std::vector< T > RowSubReduction (const std::vector< std::vector< T >> &values)
 Returns the difference of each row in a matrix. More...
 
template<typename T >
std::vector< T > RowMulReduction (const std::vector< std::vector< T >> &values)
 Returns the product of each row in a matrix. More...
 
template<typename UnsignedIntegralType , typename = std::enable_if_t<std::is_unsigned_v<UnsignedIntegralType>>>
bool IsPowerOfTwo (UnsignedIntegralType x)
 Check if unisgned integral value is a power of two. More...
 
std::string Hex (const std::uint8_t *values, std::size_t n)
 Returns a hexadecimal string representation of the bytes stored in values. More...
 
std::string Hex (const std::byte *values, std::size_t n)
 Returns a hexadecimal string representation of the bytes stored in values. More...
 
template<std::size_t N>
std::string Hex (const std::array< std::byte, N > &values)
 Returns a hexadecimal string representation of the bytes stored in values. More...
 
template<std::size_t N>
std::string Hex (const std::array< std::uint8_t, N > &values)
 Returns a hexadecimal string representation of the bytes stored in values. More...
 
std::string Hex (const std::vector< std::uint8_t > &values)
 Returns a hexadecimal string representation of the bytes stored in values. More...
 
std::string Hex (const std::vector< std::byte > &values)
 Returns a hexadecimal string representation of the bytes stored in values. More...
 
std::string Hex (const std::vector< std::uint8_t > &&values)
 Returns a hexadecimal string representation of the bytes stored in values. More...
 
template<typename T >
std::string to_string (std::vector< T > values)
 Returns a string representation of the std::vector values. More...
 
template<typename T >
bool Vectors (const std::vector< T > &a, const std::vector< T > &b)
 XXX the std library implements operators for vector comparisions. More...
 
template<typename T >
bool Dimensions (const std::vector< std::vector< T >> &values)
 Checks if all the vectors have the same size. More...
 
constexpr std::size_t BitsToBytes (const std::size_t bits)
 Returns the number of bytes necessary to store bits bits. More...
 
template<typename R , typename MutexType , typename ConditionVariableType >
void swap (ReusablePromise< R, MutexType, ConditionVariableType > &lhs, ReusablePromise< R, MutexType, ConditionVariableType > &rhs) noexcept
 
std::string GetCmdLine ()
 
std::size_t GetPid ()
 
std::string GetHostname ()
 
std::string GetUsername ()
 
void ThreadSetName (std::thread &thread, const std::string &name)
 
std::string to_string (PrimitiveOperationType t)
 
std::string to_string (IntegerOperationType p)
 
std::string to_string (MpcProtocol p)
 
const char * GetGitVersion ()
 
const char * GetGitCommit ()
 
const char * GetGitBranch ()
 

Variables

constexpr std::byte kSetBitMask []
 
constexpr std::byte kUnsetBitMask []
 
constexpr std::byte TruncationBitMask []
 
constexpr bool kDebug {false}
 
constexpr float kVersion {0.01}
 
constexpr std::string_view kRootDir {"/root/MOTION"}
 
constexpr std::size_t kAlignment {16}
 
constexpr std::string_view kFrameworkName {"MOTION"}
 
constexpr std::size_t kMb {1024 * 1024}
 
constexpr bool kVerboseDebugWish {false}
 
constexpr bool kVerboseDebug {kDebug && kVerboseDebugWish}
 
constexpr std::size_t kAesKeySize {16}
 
constexpr std::size_t kAesBlockSize {16}
 
constexpr std::size_t kAesIvSize {kAesBlockSize / 2}
 
constexpr std::size_t kMessageSizeBytelen {sizeof(std::uint32_t)}
 
constexpr std::uint32_t kMaxMessageSize {std::numeric_limits<std::uint32_t>::max() / 2}
 
constexpr std::size_t kKappa {128}
 
constexpr std::size_t kFiberStackSize = kDebug ? 32 * 1024 : 14 * 1024
 
constexpr FiberStackAllocator kFiberStackAllocator {FiberStackAllocator::kFixedSize}
 

Typedef Documentation

◆ AlignedAllocator

using encrypto::motion::AlignedAllocator = typedef boost::alignment::aligned_allocator<std::byte, kAlignment>

◆ AlignedBitVector

◆ BackendPointer

typedef std::shared_ptr< Backend > encrypto::motion::BackendPointer

◆ BaseOtMessages

using encrypto::motion::BaseOtMessages = typedef std::array<std::array<std::byte, 16>, kKappa>

◆ Blake2bCtx

using encrypto::motion::Blake2bCtx = typedef std::unique_ptr<EVP_MD_CTX, std::function<void(EVP_MD_CTX*)> >

◆ BooleanSharePointer

using encrypto::motion::BooleanSharePointer = typedef std::shared_ptr<BooleanShare>

◆ BooleanWirePointer

using encrypto::motion::BooleanWirePointer = typedef std::shared_ptr<BooleanWire>

◆ ConfigurationPointer

◆ DefaultRng

◆ GatePointer

typedef std::shared_ptr< Gate > encrypto::motion::GatePointer

◆ InputGatePointer

typedef std::shared_ptr< InputGate > encrypto::motion::InputGatePointer

◆ IsUnsignedInt

template<typename T >
using encrypto::motion::IsUnsignedInt = typedef std::enable_if_t<std::conjunction_v<std::is_integral<T>, std::is_unsigned<T>, std::negation<std::is_same<T, bool> >> >

◆ LoggerPointer

typedef std::shared_ptr< Logger > encrypto::motion::LoggerPointer

◆ LoggerType

using encrypto::motion::LoggerType = typedef boost::log::sources::severity_channel_logger<boost::log::trivial::severity_level, std::size_t>

◆ OutputGatePointer

using encrypto::motion::OutputGatePointer = typedef std::shared_ptr<OutputGate>

◆ PartyPointer

using encrypto::motion::PartyPointer = typedef std::unique_ptr<Party>

◆ RegisterPointer

typedef std::shared_ptr< Register > encrypto::motion::RegisterPointer

◆ ReusableFiberFuture

template<typename R >
using encrypto::motion::ReusableFiberFuture = typedef ReusableFuture<R, boost::fibers::mutex, boost::fibers::condition_variable>

◆ ReusableFiberPromise

template<typename R >
using encrypto::motion::ReusableFiberPromise = typedef ReusablePromise<R, boost::fibers::mutex, boost::fibers::condition_variable>

◆ SharePointer

typedef std::shared_ptr< Share > encrypto::motion::SharePointer

◆ StatId

◆ StdAllocator

using encrypto::motion::StdAllocator = typedef std::allocator<std::byte>

◆ SynchronizedFiberQueue

template<typename T >
using encrypto::motion::SynchronizedFiberQueue = typedef BasicSynchronizedQueue<T, boost::fibers::mutex, boost::fibers::condition_variable>

◆ SynchronizedQueue

template<typename T >
using encrypto::motion::SynchronizedQueue = typedef BasicSynchronizedQueue<T, std::mutex, std::condition_variable>

◆ TypeMap

template<template< typename > class Value, typename... Ts>
using encrypto::motion::TypeMap = typedef decltype(detail::MakeTypeMap<Value, Ts...>())

◆ WirePointer

typedef std::shared_ptr< Wire > encrypto::motion::WirePointer

Enumeration Type Documentation

◆ BaseOtDataType

enum encrypto::motion::BaseOtDataType : unsigned int
Enumerator
kHL17R 
kHL17S 
kBaseOtInvalidDataType 

◆ CircuitType

enum encrypto::motion::CircuitType : unsigned int
strong
Enumerator
kArithmetic 
kBoolean 
kInvalid 

◆ FiberStackAllocator

Enumerator
kFixedSize 
kPooledFixedSize 
kProtectedFixedSize 

◆ GateType

enum encrypto::motion::GateType : unsigned int
strong
Enumerator
kInput 
kInteractive 
kNonInteractive 
kInvalid 

◆ IntegerOperationType

enum encrypto::motion::IntegerOperationType : unsigned int
strong
Enumerator
kAdd 
kDiv 
kGt 
kEq 
kMul 
kSub 
kInvalid 

◆ MpcProtocol

enum encrypto::motion::MpcProtocol : unsigned int
strong
Enumerator
kArithmeticGmw 
kBooleanGmw 
kBmr 
kArithmeticConstant 
kBooleanConstant 
kInvalid 

◆ OtExtensionDataType

Enumerator
kReceptionMask 
kReceptionCorrection 
kSendMessage 
kOtExtensionInvalidDataType 

◆ OtMessageType

Enumerator
kGenericBoolean 
kBit 
kBlock128 
kUint8 
kUint16 
kUint32 
kUint64 
kUint128 

◆ OtProtocol

enum encrypto::motion::OtProtocol : unsigned int
Enumerator
kGOt 
kROt 
kXcOt 
kAcOt 
kFixedXcOt128 
kXcOtBit 
kGOt128 
kInvalidOt 

◆ PrimitiveOperationType

enum encrypto::motion::PrimitiveOperationType : std::uint8_t
strong
Enumerator
kIn 
kOut 
kXor 
kAnd 
kMux 
kInv 
kOr 
kAdd 
kMul 
kSqr 
kA2B 
kA2Y 
kB2A 
kB2Y 
kY2A 
kY2B 
kInvalid 

◆ Role

enum encrypto::motion::Role : unsigned int
strong
Enumerator
kServer 
kClient 
kInvalid 

◆ SharedBitsMessageType

Enumerator
kMaskMessage 
kReconstructMessage 

Function Documentation

◆ AddVectors() [1/3]

template<typename T >
std::vector<T> encrypto::motion::AddVectors ( const std::vector< T > &  a,
const std::vector< T > &  b 
)
inline

Adds each element in a and b and returns the result.

Template Parameters
Ttype of the elements in the vectors. T must provide the += operator.
Parameters
a
b
Returns
A vector containing at position i the sum the ith element in a and b.
Precondition
a and b must be of equal size.
Here is the caller graph for this function:

◆ AddVectors() [2/3]

template<typename T >
std::vector<T> encrypto::motion::AddVectors ( std::vector< std::vector< T >> &&  vectors)
inline

Performs the AddVectors operation on an arbitrary number of vectors.

Template Parameters
Ttype of the elements in the vectors. T must provide the += operator.
Parameters
vectorsA vector of vectors.
Returns
A vector containing at position i the sum of each element at position i of the input vectors.
Precondition
All vectors in vectors must be of equal size.
Here is the call graph for this function:

◆ AddVectors() [3/3]

template<typename T >
std::vector<T> encrypto::motion::AddVectors ( std::vector< std::vector< T >> &  vectors)
inline

Performs the AddVectors operation on an arbitrary number of vectors.

Template Parameters
Ttype of the elements in the vectors. T must provide the += operator.
Parameters
vectorsA vector of vectors.
Returns
A vector containing at position i the sum of each element at position i of the input vectors.
Precondition
All vectors in vectors must be of equal size.

◆ AlignedAndImplementation()

template<typename T , typename U >
void encrypto::motion::AlignedAndImplementation ( const T *  input,
U *  result,
const std::size_t  byte_size 
)
inline
Here is the caller graph for this function:

◆ AlignedEqualImplementation()

template<typename T , typename U >
bool encrypto::motion::AlignedEqualImplementation ( const T *  pointer1,
const U *  pointer2,
const std::size_t  byte_size 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AlignedOrImplementation()

template<typename T , typename U >
void encrypto::motion::AlignedOrImplementation ( const T *  input,
U *  result,
const std::size_t  byte_size 
)
inline
Here is the caller graph for this function:

◆ AlignedXorImplementation()

template<typename T , typename U >
void encrypto::motion::AlignedXorImplementation ( const T *  input,
U *  result,
const std::size_t  byte_size 
)
inline
Here is the caller graph for this function:

◆ AndImplementation()

template<typename T , typename U >
void encrypto::motion::AndImplementation ( const T *  input,
U *  result,
const std::size_t  byte_size 
)
inline
Here is the caller graph for this function:

◆ ArithmeticConstantSimdifyOnline()

template<typename T >
void encrypto::motion::ArithmeticConstantSimdifyOnline ( std::span< WirePointer parent_wires,
WirePointer  output_wire 
)

◆ ArithmeticConstantSubsetOnline()

template<typename T >
void encrypto::motion::ArithmeticConstantSubsetOnline ( WirePointer  parent_wire,
WirePointer  output_wire,
std::span< const std::size_t >  position_ids 
)

◆ ArithmeticConstantUnsimdifyOnline()

template<typename T >
void encrypto::motion::ArithmeticConstantUnsimdifyOnline ( WirePointer  parent_wire,
std::span< WirePointer output_wires 
)

◆ ArithmeticGmwSimdifyOnline()

template<typename T >
void encrypto::motion::ArithmeticGmwSimdifyOnline ( std::span< WirePointer parent_wires,
WirePointer  output_wire 
)

◆ ArithmeticGmwSubsetOnline()

template<typename T >
void encrypto::motion::ArithmeticGmwSubsetOnline ( WirePointer  parent_wire,
WirePointer  output_wire,
std::span< const std::size_t >  position_ids 
)

◆ ArithmeticGmwUnsimdifyOnline()

template<typename T >
void encrypto::motion::ArithmeticGmwUnsimdifyOnline ( WirePointer  parent_wire,
std::span< WirePointer output_wires 
)

◆ ArithmeticSimdifyOnlineImplementation()

template<typename WireType >
void encrypto::motion::ArithmeticSimdifyOnlineImplementation ( std::span< WirePointer parent_wires,
WirePointer  output_wire 
)

◆ ArithmeticSubsetOnlineImplementation()

template<typename WireType >
void encrypto::motion::ArithmeticSubsetOnlineImplementation ( WirePointer  parent_wire,
WirePointer  output_wire,
std::span< const std::size_t >  position_ids 
)

◆ ArithmeticUnsimdifyOnlineImplementation()

template<typename WireType >
void encrypto::motion::ArithmeticUnsimdifyOnlineImplementation ( WirePointer  parent_wire,
std::span< WirePointer output_wires 
)

◆ At() [1/2]

template<typename C >
C::value_type encrypto::motion::At ( const C &  container,
RunTimeStatistics::StatisticsId  id 
)

◆ At() [2/2]

template<typename C >
static C::value_type encrypto::motion::At ( const C &  container,
RunTimeStatistics::StatisticsId  id 
)
static
Here is the caller graph for this function:

◆ BitsToBytes()

constexpr std::size_t encrypto::motion::BitsToBytes ( const std::size_t  bits)
constexpr

Returns the number of bytes necessary to store bits bits.

Parameters
bits
Here is the caller graph for this function:

◆ BitVectorSubsetImplementation()

template<typename Allocator >
void encrypto::motion::BitVectorSubsetImplementation ( const BitVector< Allocator > &  in,
BitVector< Allocator > &  out,
std::span< const std::size_t >  position_ids 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Blake2b() [1/2]

void encrypto::motion::Blake2b ( std::uint8_t *  message,
std::uint8_t  digest[64],
std::size_t  length,
Blake2bCtx b 
)
Here is the call graph for this function:

◆ Blake2b() [2/2]

void encrypto::motion::Blake2b ( std::uint8_t *  message,
std::uint8_t  digest[64],
std::size_t  length,
EVP_MD_CTX *  context 
)
Here is the caller graph for this function:

◆ ComputeDuration()

static double encrypto::motion::ComputeDuration ( const RunTimeStatistics::TimePointPair tpp)
static
Here is the caller graph for this function:

◆ CopyImplementation()

void encrypto::motion::CopyImplementation ( const std::size_t  from,
const std::size_t  to,
std::byte *  source,
std::byte *  destination 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Dimensions()

template<typename T >
bool encrypto::motion::Dimensions ( const std::vector< std::vector< T >> &  values)
inline

Checks if all the vectors have the same size.

Parameters
valuesA vector of vectors.

◆ DivideAndCeil()

std::size_t encrypto::motion::DivideAndCeil ( std::size_t  dividend,
std::size_t  divisor 
)

Divides two size_t and returns the ceiled quotient.

Parameters
dividend
divisor
Precondition
Divisor is not 0.

◆ EqualImplementation()

template<typename T , typename U >
bool encrypto::motion::EqualImplementation ( const T *  pointer1,
const U *  pointer2,
const std::size_t  byte_size 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FormatLine()

static std::string encrypto::motion::FormatLine ( std::string  name,
std::string  unit,
AccumulatedRunTimeStatistics::AccumulatorType  accumulator,
std::size_t  field_width 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromByteVector() [1/2]

template<typename UnsignedIntegralType , typename = std::enable_if_t<std::is_unsigned_v<UnsignedIntegralType>>>
std::vector<UnsignedIntegralType> encrypto::motion::FromByteVector ( const flatbuffers::Vector< std::uint8_t > &  buffer)
inline

Converts a flatbuffer vector of uint8_t to a vector of unsigned integral values.

Template Parameters
UnsignedIntegralType
Parameters
buffer

◆ FromByteVector() [2/2]

template<typename UnsignedIntegralType , typename = std::enable_if_t<std::is_unsigned_v<UnsignedIntegralType>>>
std::vector<UnsignedIntegralType> encrypto::motion::FromByteVector ( const std::vector< std::uint8_t > &  buffer)
inline

Converts a vector of uint8_t to a vector of unsigned integral values.

Template Parameters
UnsignedIntegralType
Parameters
buffer

◆ Gather()

static std::vector<std::uint8_t> encrypto::motion::Gather ( const std::vector< std::uint16_t > &  ds_8,
const std::vector< std::uint32_t > &  ds_16,
const std::vector< std::uint64_t > &  ds_32,
const std::vector< __uint128_t > &  ds_64 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GenerateRandomPairs()

template<typename T >
static void encrypto::motion::GenerateRandomPairs ( SpVector< T > &  sps,
std::size_t  number_of_sps 
)
static

◆ GenerateRandomTriples()

template<typename T >
static void encrypto::motion::GenerateRandomTriples ( IntegerMtVector< T > &  mts,
std::size_t  number_of_mts 
)
static

◆ GenerateRandomTriplesBool()

static void encrypto::motion::GenerateRandomTriplesBool ( BinaryMtVector bit_mts,
std::size_t  number_of_bit_mts 
)
static
Here is the call graph for this function:

◆ GetByteSize()

template<typename T >
static constexpr auto encrypto::motion::GetByteSize ( const std::vector< T > &  v)
staticconstexpr
Here is the caller graph for this function:

◆ GetCmdLine()

std::string encrypto::motion::GetCmdLine ( )
Here is the caller graph for this function:

◆ GetGitBranch()

const char* encrypto::motion::GetGitBranch ( )
Here is the caller graph for this function:

◆ GetGitCommit()

const char* encrypto::motion::GetGitCommit ( )

◆ GetGitVersion()

const char* encrypto::motion::GetGitVersion ( )
Here is the caller graph for this function:

◆ GetHostname()

std::string encrypto::motion::GetHostname ( )
Here is the caller graph for this function:

◆ GetImplementation()

bool encrypto::motion::GetImplementation ( const std::byte *  pointer,
const std::size_t  position 
)
inlinenoexcept
Here is the caller graph for this function:

◆ GetPid()

std::size_t encrypto::motion::GetPid ( )
Here is the caller graph for this function:

◆ GetUsername()

std::string encrypto::motion::GetUsername ( )
Here is the caller graph for this function:

◆ HashPoint()

void encrypto::motion::HashPoint ( curve25519::ge_p3 &  output,
const curve25519::ge_p3 &  input 
)
Here is the call graph for this function:

◆ Hex() [1/7]

template<std::size_t N>
std::string encrypto::motion::Hex ( const std::array< std::byte, N > &  values)
inline

Returns a hexadecimal string representation of the bytes stored in values.

Parameters
values
Here is the call graph for this function:

◆ Hex() [2/7]

template<std::size_t N>
std::string encrypto::motion::Hex ( const std::array< std::uint8_t, N > &  values)
inline

Returns a hexadecimal string representation of the bytes stored in values.

Parameters
values
Here is the call graph for this function:

◆ Hex() [3/7]

std::string encrypto::motion::Hex ( const std::byte *  values,
std::size_t  n 
)
inline

Returns a hexadecimal string representation of the bytes stored in values.

Parameters
values
nNumber of bytes.
Here is the call graph for this function:

◆ Hex() [4/7]

std::string encrypto::motion::Hex ( const std::uint8_t *  values,
std::size_t  n 
)
inline

Returns a hexadecimal string representation of the bytes stored in values.

Parameters
values
nNumber of bytes.
Here is the caller graph for this function:

◆ Hex() [5/7]

std::string encrypto::motion::Hex ( const std::vector< std::byte > &  values)
inline

Returns a hexadecimal string representation of the bytes stored in values.

Parameters
values
Here is the call graph for this function:

◆ Hex() [6/7]

std::string encrypto::motion::Hex ( const std::vector< std::uint8_t > &&  values)
inline

Returns a hexadecimal string representation of the bytes stored in values.

Parameters
values
Here is the call graph for this function:

◆ Hex() [7/7]

std::string encrypto::motion::Hex ( const std::vector< std::uint8_t > &  values)
inline

Returns a hexadecimal string representation of the bytes stored in values.

Parameters
values
Here is the call graph for this function:

◆ IsPowerOfTwo()

template<typename UnsignedIntegralType , typename = std::enable_if_t<std::is_unsigned_v<UnsignedIntegralType>>>
bool encrypto::motion::IsPowerOfTwo ( UnsignedIntegralType  x)

Check if unisgned integral value is a power of two.

Template Parameters
UnsignedIntegralType
Parameters
x
Here is the caller graph for this function:

◆ MakeLocallyConnectedParties()

std::vector< std::unique_ptr< Party > > encrypto::motion::MakeLocallyConnectedParties ( const std::size_t  number_of_parties,
std::uint16_t  port,
const bool  logging = false 
)

constructs number_of_parties motion::Party's locally connected via TCP.

Parameters
number_of_partiesNumber of motion::Party's to construct.
portTCP port offset.
loggingEnables/disables logging completely.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MulReduction()

template<typename T >
T encrypto::motion::MulReduction ( const std::vector< T > &  values)
inline

Returns the product of each element in values.

Template Parameters
Ttype of the elements in the vectors. T must provide the *= operator.
Parameters
values
Here is the caller graph for this function:

◆ MultiplyVectors()

template<typename T >
std::vector<T> encrypto::motion::MultiplyVectors ( std::vector< T >  a,
std::vector< T >  b 
)
inline

Multiplies each element in a and b and returns the result.

Template Parameters
Ttype of the elements in the vectors. T must provide the *= operator.
Parameters
a
b
Returns
A vector containing at position i the product the ith element in a and b.
Precondition
a and b must be of equal size.
Here is the caller graph for this function:

◆ NewBlakeCtx()

Blake2bCtx encrypto::motion::NewBlakeCtx ( )

◆ NumberOfBitsToNumberOfBytes()

constexpr auto encrypto::motion::NumberOfBitsToNumberOfBytes ( std::size_t  number_of_bits)
constexpr
Here is the caller graph for this function:

◆ operator<<() [1/2]

std::ostream & encrypto::motion::operator<< ( std::ostream &  os,
const BitSpan bit_span 
)

Output string representation of BitVector to std::ostream.

Here is the call graph for this function:

◆ operator<<() [2/2]

template<typename Allocator >
std::ostream& encrypto::motion::operator<< ( std::ostream &  os,
const BitVector< Allocator > &  bit_vector 
)

Output string representation of BitVector to std::ostream.

◆ OrImplementation()

template<typename T , typename U >
void encrypto::motion::OrImplementation ( const T *  input,
U *  result,
const std::size_t  byte_size 
)
inline
Here is the caller graph for this function:

◆ ParseHelper()

template<typename T >
static void encrypto::motion::ParseHelper ( std::list< std::unique_ptr< AcOtSender< T >>> &  ots_sender,
std::list< std::unique_ptr< AcOtReceiver< T >>> &  ots_receiver,
std::size_t  max_batch_size,
IntegerMtVector< T > &  mts,
std::size_t  number_of_mts 
)
static

◆ ParseHelperBool()

static void encrypto::motion::ParseHelperBool ( std::unique_ptr< XcOtBitSender > &  ots_sender,
std::unique_ptr< XcOtBitReceiver > &  ots_receiver,
BinaryMtVector bit_mts 
)
static
Here is the call graph for this function:

◆ ParseHelperReceive()

template<typename T >
static void encrypto::motion::ParseHelperReceive ( std::list< std::unique_ptr< AcOtReceiver< T >>> &  ots_receiver,
std::size_t  max_batch_size,
SpVector< T > &  sps,
std::size_t  number_of_sps 
)
static

◆ ParseHelperSend()

template<typename T >
static void encrypto::motion::ParseHelperSend ( std::list< std::unique_ptr< AcOtSender< T >>> &  ots_sender,
std::size_t  max_batch_size,
SpVector< T > &  sps,
std::size_t  number_of_sps 
)
static

◆ PrintMotionInfo()

std::string encrypto::motion::PrintMotionInfo ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintStatistics()

std::string encrypto::motion::PrintStatistics ( const std::string &  experiment_name,
const AccumulatedRunTimeStatistics execution_statistics,
const AccumulatedCommunicationStatistics communication_statistics 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RandomVector()

template<typename UnsignedIntegralType , typename = std::enable_if_t<std::is_unsigned_v<UnsignedIntegralType>>>
std::vector< std::uint8_t > encrypto::motion::RandomVector ( std::size_t  length)
inline

Returns a vector of length random unsigned integral values.

Template Parameters
UnsignedIntegralType
Parameters
length
Here is the call graph for this function:

◆ ReconstructionHelper()

static void encrypto::motion::ReconstructionHelper ( std::vector< std::uint16_t > &  xs_8,
std::vector< std::uint32_t > &  xs_16,
std::vector< std::uint64_t > &  xs_32,
std::vector< __uint128_t > &  xs_64,
std::size_t  number_of_parties,
std::function< void(const std::vector< uint8_t > &)>  broadcast_function,
std::vector< ReusableFuture< std::vector< std::uint8_t >>> &  futures 
)
static
Here is the call graph for this function:

◆ RegisterHelper()

template<typename T >
static void encrypto::motion::RegisterHelper ( OtProvider ot_provider,
std::list< std::unique_ptr< AcOtSender< T >>> &  ots_sender,
std::list< std::unique_ptr< AcOtReceiver< T >>> &  ots_receiver,
std::size_t  max_batch_size,
const IntegerMtVector< T > &  mts,
std::size_t  number_of_mts 
)
static

◆ RegisterHelperBool()

static void encrypto::motion::RegisterHelperBool ( OtProvider ot_provider,
std::unique_ptr< XcOtBitSender > &  ots_sender,
std::unique_ptr< XcOtBitReceiver > &  ots_receiver,
const BinaryMtVector bit_mts,
std::size_t  number_of_bit_mts 
)
static
Here is the call graph for this function:

◆ RegisterHelperReceptor()

template<typename T >
static void encrypto::motion::RegisterHelperReceptor ( OtProvider ot_provider,
std::list< std::unique_ptr< AcOtReceiver< T >>> &  ots_receiver,
std::size_t  max_batch_size,
const SpVector< T > &  sps,
std::size_t  number_of_sps 
)
static
Here is the call graph for this function:

◆ RegisterHelperSend()

template<typename T >
static void encrypto::motion::RegisterHelperSend ( OtProvider ot_provider,
std::list< std::unique_ptr< AcOtSender< T >>> &  ots_sender,
std::size_t  max_batch_size,
const SpVector< T > &  sps,
std::size_t  number_of_sps 
)
static
Here is the call graph for this function:

◆ RestrictAddVectors()

template<typename T >
std::vector<T> encrypto::motion::RestrictAddVectors ( const std::vector< T > &  a,
const std::vector< T > &  b 
)
inline

Adds each element in a and b and returns the result. It is assumed that the vectors do not overlap.

Template Parameters
Ttype of the elements in the vectors. T must provide the binary + operator.
Parameters
a
b
Returns
A vector containing at position i the sum the ith element in a and b.
Precondition
a and b must be of equal size.
Here is the caller graph for this function:

◆ RestrictMulVectors()

template<typename T >
std::vector<T> encrypto::motion::RestrictMulVectors ( const std::vector< T > &  a,
const std::vector< T > &  b 
)
inline

Mulitiplies each element in a and b and returns the result. It is assumed that the vectors do not overlap.

Template Parameters
Ttype of the elements in the vectors. T must provide the binary * operator.
Parameters
a
b
Returns
A vector containing at position i the product the ith element in a and b.
Precondition
a and b must be of equal size.
Here is the caller graph for this function:

◆ RestrictSubVectors()

template<typename T >
std::vector<T> encrypto::motion::RestrictSubVectors ( const std::vector< T > &  a,
const std::vector< T > &  b 
)
inline

Subtracts each element in a and b and returns the result. It is assumed that the vectors do not overlap.

Template Parameters
Ttype of the elements in the vectors. T must provide the binary - operator.
Parameters
a
b
Returns
A vector containing at position i the difference the ith element in a and b.
Precondition
a and b must be of equal size.

◆ RowMulReduction()

template<typename T >
std::vector<T> encrypto::motion::RowMulReduction ( const std::vector< std::vector< T >> &  values)
inline

Returns the product of each row in a matrix.

Template Parameters
Ttype of the elements in the vectors. T must provide the *= operator.
Parameters
valuesA vector of vectors.
Returns
The resulting vector can be represented by the following graphic: +--------—+-----------------------------------------------—+ | prod[0] = | values[0][0] * values[1][0] * ... * values[m][0] | | ... | ................................................ | | prod[n] = | values[0][n] * values[1][n] * ... * values[m][n] | +--------—+-----------------------------------------------—+
Precondition
All vectors in vectors must be of equal size.
Here is the caller graph for this function:

◆ RowSubReduction()

template<typename T >
std::vector<T> encrypto::motion::RowSubReduction ( const std::vector< std::vector< T >> &  values)
inline

Returns the difference of each row in a matrix.

Template Parameters
Ttype of the elements in the vectors. T must provide the -= operator.
Parameters
valuesA vector of vectors.
Returns
The resulting vector can be represented by the following graphic: +--------—+-----------------------------------------------—+ | diff[0] = | values[0][0] - values[1][0] - ... - values[m][0] | | ... | ................................................ | | diff[n] = | values[0][n] - values[1][n] - ... - values[m][n] | +--------—+-----------------------------------------------—+
Precondition
All vectors in vectors must be of equal size.
Here is the caller graph for this function:

◆ RowSumReduction()

template<typename T >
std::vector<T> encrypto::motion::RowSumReduction ( const std::vector< std::vector< T >> &  values)
inline

Returns the sum of each row in a matrix.

Template Parameters
Ttype of the elements in the vectors. T must provide the += operator.
Parameters
valuesA vector of vectors.
Returns
The resulting vector can be represented by the following graphic: +-------—+-----------------------------------------------—+ | sum[0] = | values[0][0] + values[1][0] + ... + values[m][0] | | ... | ................................................ | | sum[n] = | values[0][n] + values[1][n] + ... + values[m][n] | +-------—+-----------------------------------------------—+
Precondition
All vectors in vectors must be of equal size.
Here is the caller graph for this function:

◆ Scatter()

static std::vector<std::uint8_t> encrypto::motion::Scatter ( std::vector< std::uint16_t > &  ds_8,
std::vector< std::uint32_t > &  ds_16,
std::vector< std::uint64_t > &  ds_32,
std::vector< __uint128_t > &  ds_64,
const std::vector< std::uint8_t > &  buffer 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetAtImplementation()

void encrypto::motion::SetAtImplementation ( std::byte *  pointer,
const bool  value,
const std::size_t  position 
)
inlinenoexcept
Here is the caller graph for this function:

◆ SetImplementation()

void encrypto::motion::SetImplementation ( std::byte *  pointer,
const bool  value,
const std::size_t  bit_size 
)
inlinenoexcept
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShareWrapper::Add< std::uint16_t >()

template ShareWrapper encrypto::motion::ShareWrapper::Add< std::uint16_t > ( SharePointer  share,
SharePointer  other 
) const

◆ ShareWrapper::Add< std::uint32_t >()

template ShareWrapper encrypto::motion::ShareWrapper::Add< std::uint32_t > ( SharePointer  share,
SharePointer  other 
) const

◆ ShareWrapper::Add< std::uint64_t >()

template ShareWrapper encrypto::motion::ShareWrapper::Add< std::uint64_t > ( SharePointer  share,
SharePointer  other 
) const

◆ ShareWrapper::Add< std::uint8_t >()

template ShareWrapper encrypto::motion::ShareWrapper::Add< std::uint8_t > ( SharePointer  share,
SharePointer  other 
) const

◆ ShareWrapper::Convert< MpcProtocol::kArithmeticGmw >()

◆ ShareWrapper::Convert< MpcProtocol::kBmr >()

◆ ShareWrapper::Convert< MpcProtocol::kBooleanGmw >()

◆ ShareWrapper::Mul< std::uint16_t >()

template ShareWrapper encrypto::motion::ShareWrapper::Mul< std::uint16_t > ( SharePointer  share,
SharePointer  other 
) const

◆ ShareWrapper::Mul< std::uint32_t >()

template ShareWrapper encrypto::motion::ShareWrapper::Mul< std::uint32_t > ( SharePointer  share,
SharePointer  other 
) const

◆ ShareWrapper::Mul< std::uint64_t >()

template ShareWrapper encrypto::motion::ShareWrapper::Mul< std::uint64_t > ( SharePointer  share,
SharePointer  other 
) const

◆ ShareWrapper::Mul< std::uint8_t >()

template ShareWrapper encrypto::motion::ShareWrapper::Mul< std::uint8_t > ( SharePointer  share,
SharePointer  other 
) const

◆ ShareWrapper::Sub< std::uint16_t >()

template ShareWrapper encrypto::motion::ShareWrapper::Sub< std::uint16_t > ( SharePointer  share,
SharePointer  other 
) const

◆ ShareWrapper::Sub< std::uint32_t >()

template ShareWrapper encrypto::motion::ShareWrapper::Sub< std::uint32_t > ( SharePointer  share,
SharePointer  other 
) const

◆ ShareWrapper::Sub< std::uint64_t >()

template ShareWrapper encrypto::motion::ShareWrapper::Sub< std::uint64_t > ( SharePointer  share,
SharePointer  other 
) const

◆ ShareWrapper::Sub< std::uint8_t >()

template ShareWrapper encrypto::motion::ShareWrapper::Sub< std::uint8_t > ( SharePointer  share,
SharePointer  other 
) const

◆ SubReduction()

template<typename T >
T encrypto::motion::SubReduction ( const std::vector< T > &  values)
inline

Returns the difference of each element in values.

Template Parameters
Ttype of the elements in the vectors. T must provide the -= operator.
Parameters
values
Here is the caller graph for this function:

◆ SubVectors()

template<typename T >
std::vector<T> encrypto::motion::SubVectors ( const std::vector< T > &  a,
const std::vector< T > &  b 
)
inline

Subtracts each element in a and b and returns the result.

Template Parameters
Ttype of the elements in the vectors. T must provide the -= operator.
Parameters
a
b
Returns
A vector containing at position i the difference the ith element in a and b.
Precondition
a and b must be of equal size.
Here is the caller graph for this function:

◆ SumReduction()

template<typename T >
T encrypto::motion::SumReduction ( const std::vector< T > &  values)
inline

Returns the sum of each element in values.

Template Parameters
Ttype of the elements in the vectors. T must provide the += operator.
Parameters
values
Here is the caller graph for this function:

◆ swap()

template<typename R , typename MutexType , typename ConditionVariableType >
void encrypto::motion::swap ( ReusablePromise< R, MutexType, ConditionVariableType > &  lhs,
ReusablePromise< R, MutexType, ConditionVariableType > &  rhs 
)
noexcept
Here is the caller graph for this function:

◆ ThreadSetName()

void encrypto::motion::ThreadSetName ( std::thread &  thread,
const std::string &  name 
)
Here is the caller graph for this function:

◆ to_string() [1/4]

std::string encrypto::motion::to_string ( IntegerOperationType  p)
inline

◆ to_string() [2/4]

std::string encrypto::motion::to_string ( MpcProtocol  p)
inline

◆ to_string() [3/4]

std::string encrypto::motion::to_string ( PrimitiveOperationType  t)
inline

◆ to_string() [4/4]

template<typename T >
std::string encrypto::motion::to_string ( std::vector< T >  values)
inline

Returns a string representation of the std::vector values.

Template Parameters
TType of the element in the std::vector. Must provide an overload of to_string.
Parameters
values
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ToByteVector()

template<typename UnsignedIntegralType , typename = std::enable_if_t<std::is_unsigned_v<UnsignedIntegralType>>>
std::vector<std::uint8_t> encrypto::motion::ToByteVector ( const std::vector< UnsignedIntegralType > &  values)
inline

Converts a vector of unsigned integral values to a vector of uint8_t.

Template Parameters
UnsignedIntegralType
Parameters
values
Here is the caller graph for this function:

◆ ToInput() [1/11]

template<typename IntegralType , typename , typename Allocator >
std::vector<BitVector<Allocator> > encrypto::motion::ToInput ( const std::vector< IntegralType > &  input_vector)

◆ ToInput() [2/11]

template std::vector<BitVector<StdAllocator> > encrypto::motion::ToInput ( const std::vector< std::uint16_t > &  )

◆ ToInput() [3/11]

template std::vector<BitVector<StdAllocator> > encrypto::motion::ToInput ( const std::vector< std::uint32_t > &  )

◆ ToInput() [4/11]

template std::vector<BitVector<StdAllocator> > encrypto::motion::ToInput ( const std::vector< std::uint64_t > &  )

◆ ToInput() [5/11]

template std::vector<BitVector<StdAllocator> > encrypto::motion::ToInput ( const std::vector< std::uint8_t > &  )

◆ ToInput() [6/11]

template<typename T , typename = std::enable_if_t<std::is_floating_point_v<T> || std::is_unsigned_v<T>>, typename Allocator = std::allocator<std::byte>>
std::vector<BitVector<Allocator> > encrypto::motion::ToInput ( const std::vector< T > &  vector)

Converts a vector of an unsigned integer type or a floating point type to a vector of BitVector.

A vector of BitVectors allows to interleave multiple arithmetic values intended to be used in a SIMD way. Let x be an arithmetic value, with x0,...,xn being its little-endian bit representation. This value is then represented by a value v of type std::vector<BitVector> with v[j][0] == xj. Now, if we interleave x with y and z of the same bit representation, then: v[j][0] == xj, v[j][1] == yj, v[j][2] == zj.

Postcondition
- All BitVectors in the vector returned will have size equal to unsigned_integral_vector.size().
  • The returned vector will have size equal to number of bits in UnsignedIntegralType.
Template Parameters
T
Parameters
vector

◆ ToInput() [7/11]

template<typename IntegralType , typename , typename Allocator >
std::vector<BitVector<Allocator> > encrypto::motion::ToInput ( IntegralType  integral_value)
Here is the caller graph for this function:

◆ ToInput() [8/11]

template std::vector<BitVector<StdAllocator> > encrypto::motion::ToInput ( std::uint16_t  )

◆ ToInput() [9/11]

template std::vector<BitVector<StdAllocator> > encrypto::motion::ToInput ( std::uint32_t  )

◆ ToInput() [10/11]

template std::vector<BitVector<StdAllocator> > encrypto::motion::ToInput ( std::uint64_t  )

◆ ToInput() [11/11]

template std::vector<BitVector<StdAllocator> > encrypto::motion::ToInput ( std::uint8_t  )

◆ ToInput< double, std::true_type, StdAllocator >() [1/2]

template<>
std::vector<BitVector<StdAllocator> > encrypto::motion::ToInput< double, std::true_type, StdAllocator > ( const std::vector< double > &  vector_of_doubles)
Here is the call graph for this function:

◆ ToInput< double, std::true_type, StdAllocator >() [2/2]

template<>
std::vector<BitVector<StdAllocator> > encrypto::motion::ToInput< double, std::true_type, StdAllocator > ( double  t)
Here is the call graph for this function:

◆ ToInput< float, std::true_type, StdAllocator >() [1/2]

template<>
std::vector<BitVector<StdAllocator> > encrypto::motion::ToInput< float, std::true_type, StdAllocator > ( const std::vector< float > &  vector_of_floats)
Here is the call graph for this function:

◆ ToInput< float, std::true_type, StdAllocator >() [2/2]

template<>
std::vector<BitVector<StdAllocator> > encrypto::motion::ToInput< float, std::true_type, StdAllocator > ( float  t)
Here is the call graph for this function:

◆ ToMilliseconds()

static double encrypto::motion::ToMilliseconds ( const RunTimeStatistics::TimePointPair tpp)
static
Here is the caller graph for this function:

◆ ToOutput()

template<typename UnsignedIntegralType , typename = std::enable_if_t<std::is_unsigned_v<UnsignedIntegralType>>, typename Allocator = std::allocator<std::byte>>
UnsignedIntegralType encrypto::motion::ToOutput ( std::vector< BitVector< Allocator >>  bit_vectors)

Converts a vector of BitVectors to a value of UnsignedIntegralType.

A vector of BitVectors allows to interleave multiple arithmetic values intended to be used in a SIMD way. Let x be an arithmetic value, with x0,...,xn being its little-endian bit representation. This value is then represented by a value v of type std::vector<BitVector> with v[j][0] == xj. Now, if we interleave x with y and z of the same bit representation, then: v[j][0] == xj, v[j][1] == yj, v[j][2] == zj.

Precondition
- Size of bit_vectors is equal to number of bits in UnsignedIntegralType.
  • Each BitVector in bit_vectors has size equal 1.
Template Parameters
UnsignedIntegralType
Parameters
bit_vectors

◆ TruncateToFitImplementation()

void encrypto::motion::TruncateToFitImplementation ( std::byte *  pointer,
const std::size_t  bit_size 
)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Vectors()

template<typename T >
bool encrypto::motion::Vectors ( const std::vector< T > &  a,
const std::vector< T > &  b 
)
inline

XXX the std library implements operators for vector comparisions.

◆ worker_fctn()

template<typename StackAllocator >
static void encrypto::motion::worker_fctn ( std::shared_ptr< pool_ctx pool_ctx,
boost::fibers::buffered_channel< FiberThreadPool::task_t > &  task_queue,
boost::fibers::barrier &  barrier 
)
static
Here is the call graph for this function:

◆ XorImplementation()

template<typename T , typename U >
void encrypto::motion::XorImplementation ( const T *  input,
U *  result,
const std::size_t  byte_size 
)
inline
Here is the caller graph for this function:

Variable Documentation

◆ kAesBlockSize

constexpr std::size_t encrypto::motion::kAesBlockSize {16}
constexpr

◆ kAesIvSize

constexpr std::size_t encrypto::motion::kAesIvSize {kAesBlockSize / 2}
constexpr

◆ kAesKeySize

constexpr std::size_t encrypto::motion::kAesKeySize {16}
constexpr

◆ kAlignment

constexpr std::size_t encrypto::motion::kAlignment {16}
constexpr

◆ kDebug

constexpr bool encrypto::motion::kDebug {false}
constexpr

◆ kFiberStackAllocator

constexpr FiberStackAllocator encrypto::motion::kFiberStackAllocator {FiberStackAllocator::kFixedSize}
constexpr

◆ kFiberStackSize

constexpr std::size_t encrypto::motion::kFiberStackSize = kDebug ? 32 * 1024 : 14 * 1024
constexpr

◆ kFrameworkName

constexpr std::string_view encrypto::motion::kFrameworkName {"MOTION"}
constexpr

◆ kKappa

constexpr std::size_t encrypto::motion::kKappa {128}
constexpr

◆ kMaxMessageSize

constexpr std::uint32_t encrypto::motion::kMaxMessageSize {std::numeric_limits<std::uint32_t>::max() / 2}
constexpr

◆ kMb

constexpr std::size_t encrypto::motion::kMb {1024 * 1024}
constexpr

◆ kMessageSizeBytelen

constexpr std::size_t encrypto::motion::kMessageSizeBytelen {sizeof(std::uint32_t)}
constexpr

◆ kRootDir

constexpr std::string_view encrypto::motion::kRootDir {"/root/MOTION"}
constexpr

◆ kSetBitMask

constexpr std::byte encrypto::motion::kSetBitMask[]
constexpr
Initial value:
= {
std::byte(0b10000000), std::byte(0b01000000), std::byte(0b00100000), std::byte(0b00010000),
std::byte(0b00001000), std::byte(0b00000100), std::byte(0b00000010), std::byte(0b00000001)}

◆ kUnsetBitMask

constexpr std::byte encrypto::motion::kUnsetBitMask[]
constexpr
Initial value:
= {
std::byte(0b01111111), std::byte(0b10111111), std::byte(0b11011111), std::byte(0b11101111),
std::byte(0b11110111), std::byte(0b11111011), std::byte(0b11111101), std::byte(0b11111110)}

◆ kVerboseDebug

constexpr bool encrypto::motion::kVerboseDebug {kDebug && kVerboseDebugWish}
constexpr

◆ kVerboseDebugWish

constexpr bool encrypto::motion::kVerboseDebugWish {false}
constexpr

◆ kVersion

constexpr float encrypto::motion::kVersion {0.01}
constexpr

◆ TruncationBitMask

constexpr std::byte encrypto::motion::TruncationBitMask[]
constexpr
Initial value:
= {
std::byte(0b10000000), std::byte(0b11000000), std::byte(0b11100000), std::byte(0b111110000),
std::byte(0b11111000), std::byte(0b11111100), std::byte(0b11111110), std::byte(0b11111111)}