MOTION  0.01
Framework for mixed-protocol multi-party computation
Classes | Functions
test_low_depth_reduce.cpp File Reference
#include <gtest/gtest.h>
#include <random>
#include "algorithm/low_depth_reduce.h"
Include dependency graph for test_low_depth_reduce.cpp:

Classes

struct  CalculateDepth< T >
 
class  LowDepthReduceTest
 

Functions

 TEST_P (LowDepthReduceTest, OperationDepth)
 
 TEST_P (LowDepthReduceTest, BitwiseXor)
 
 TEST_P (LowDepthReduceTest, BitwiseOr)
 
 TEST_P (LowDepthReduceTest, BitwiseAnd)
 
 TEST_P (LowDepthReduceTest, BitwiseMul)
 
 TEST_P (LowDepthReduceTest, BitwiseAdd)
 
 INSTANTIATE_TEST_SUITE_P (LowDepthReduceTestParameters, LowDepthReduceTest, testing::Values(1, 2, 3, 4, 7, 8, 16, 17, 23, 32, 53, 64, 100, 999999))
 

Function Documentation

◆ INSTANTIATE_TEST_SUITE_P()

INSTANTIATE_TEST_SUITE_P ( LowDepthReduceTestParameters  ,
LowDepthReduceTest  ,
testing::Values(1, 2, 3, 4, 7, 8, 16, 17, 23, 32, 53, 64, 100, 999999)   
)

◆ TEST_P() [1/6]

TEST_P ( LowDepthReduceTest  ,
BitwiseAdd   
)
Here is the call graph for this function:

◆ TEST_P() [2/6]

TEST_P ( LowDepthReduceTest  ,
BitwiseAnd   
)
Here is the call graph for this function:

◆ TEST_P() [3/6]

TEST_P ( LowDepthReduceTest  ,
BitwiseMul   
)
Here is the call graph for this function:

◆ TEST_P() [4/6]

TEST_P ( LowDepthReduceTest  ,
BitwiseOr   
)
Here is the call graph for this function:

◆ TEST_P() [5/6]

TEST_P ( LowDepthReduceTest  ,
BitwiseXor   
)
Here is the call graph for this function:

◆ TEST_P() [6/6]

TEST_P ( LowDepthReduceTest  ,
OperationDepth   
)

This test-function calculates the total depth of the operation and compares it with the expected depth. The expected depth is defined as the ceiling of the logarithm to the basis 2 of the total leaves, which in this case is 'size'. The real depth itself will be calculated by defining a vector that contains only zeros with 'size' as the length. Using the function operator() in 'CalculateDepth' struct and given the vector = | 0 | 0 | 0 | 0 | 0 | with size = 5, the calculation will be shown as the following,

0 0 0 0 0 \ / \ / / 1 1 0 \ / / 2 0 \ / 3

Here is the call graph for this function: