-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate OramEncoder library with pc_translator. (#2269)
Summary: Pull Request resolved: #2269 # Context As per PC Translator design, we need a runtime library will be called during PC run. This library will be called at the beginning of PC run to encode specified fields in publisher side input into a encoded breakdown (aggregation) Ids based on active PC instruction sets for the run. The library will filter the active PC Instruction sets for the run based on parsing the pcs_features i.e. gatekeepers for the particular run. # Product decisions In this stack we would focus solely on functionality required for private lift runs. We would focus on the MVP implementation of the library and its integration with fbpcf ORAM encoder library in this stack. # Stack 1. Create runtime pc_translator library. 2. Add logic to retrieve and parse PC instruction set, filtered based on the active gatekeepers for the run. 3. Integrate pc_translator library with fbpcf ORAM encoder. 4. Add logic to generate transformed publisher output with encoded breakdown ID and write the output. # In this diff Integrate pc_translator library with fbpcf ORAM encoder. Differential Revision: D44634384 Privacy Context Container: L416713 fbshipit-source-id: 2115e522beae68e195beecfb0a1bbdba612af435
- Loading branch information
1 parent
f2aff03
commit 199d781
Showing
6 changed files
with
122 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#include <gtest/gtest.h> | ||
#include "../../emp_games/common/TestUtil.h" | ||
#include "fbpcs/pc_translator/PCTranslator.h" | ||
|
||
namespace pc_translator { | ||
class TestPCTranslator : public ::testing::Test { | ||
public: | ||
protected: | ||
std::string pcs_features_; | ||
std::string test_instruction_set_base_path_; | ||
std::string test_publisher_input_path_; | ||
|
||
void SetUp() override { | ||
pcs_features_ = | ||
"'num_mpc_container_mutation', 'private_lift_unified_data_process', 'pc_instr_test_instruction_set'"; | ||
std::string baseDir = | ||
private_measurement::test_util::getBaseDirFromPath(__FILE__); | ||
test_instruction_set_base_path_ = baseDir + "input_processing/"; | ||
test_publisher_input_path_ = baseDir + "publisher_unittest.csv"; | ||
} | ||
}; | ||
|
||
TEST_F(TestPCTranslator, TestEncode) { | ||
auto pcTranslator = std::make_shared<PCTranslator>( | ||
pcs_features_, test_instruction_set_base_path_); | ||
auto outputPath = pcTranslator->encode(test_publisher_input_path_); | ||
EXPECT_EQ(outputPath, ""); | ||
} | ||
} // namespace pc_translator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,10 +30,6 @@ | |
{ | ||
"constraint_type": "EQ", | ||
"value": "0" | ||
}, | ||
{ | ||
"constraint_type": "EQ", | ||
"value": "1" | ||
} | ||
] | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
id_,opportunity,test_flag,opportunity_timestamp, age, gender | ||
cfcd208495d565ef66e7dff9f98764da,1,0,1600000430, 25, 0 | ||
c4ca4238a0b923820dcc509a6f75849b,1,1,1600000401, 26, 1 | ||
c81e728d9d4c2f636f067f89cc14862c,0,0,0, 44, 0 | ||
eccbc87e4b5ce2fe28308fd9f2a7baf3,0,0,0, 23, 0 | ||
a87ff679a2f3e71d9181a67b7542122c,0,0,0, 25, 0 | ||
e4da3b7fbbce2345d7772b0674a318d5,1,1,1600000461, 24, 1 | ||
1679091c5a880faf6fb5e6087eb1b2dc,1,0,1600000052, 25, 1 | ||
8f14e45fceea167a5a36dedd4bea2543,1,0,1600000831, 26, 0 | ||
c9f0f895fb98ab9159f51fd0297e236d,1,0,1600000530, 50, 0 | ||
45c48cce2e2d7fbdea1afc51c7c6ad26,1,0,1600000972, 25, 1 | ||
d3d9446802a44259755d38e6d163e820,0,0,0, 25, 0 | ||
6512bd43d9caa6e02c990b0a82652dca,0,0,0, 25, 0 |