-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release V0.3.0 [1. Added PrivateTextLineDataset, PrivateInput, Secure…
…LogicalAnd, SecureLogicalOr, SecureLogicalXor, SecureLogicalNot secure operations; 2. Speedup some backend operations; 3. Uses related python classes such as PrivateTextLineDataset and iterators to load large data sets, thereby reducing memory usage; 4. Some known bugs are fixed.]
- Loading branch information
Showing
28 changed files
with
1,498 additions
and
42 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,4 +56,4 @@ core | |
!core/ | ||
*.log.* | ||
*.log | ||
|
||
*yyl* |
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
|
||
- [Release Notes](#release-notes) | ||
- [Introduction](#introduction) | ||
- [Rosetta v0.3.0](#rosetta-v030) | ||
- [Rosetta v0.2.1](#rosetta-v021) | ||
- [Rosetta v0.2.0](#rosetta-v020) | ||
- [Rosetta v0.1.1](#rosetta-v011) | ||
|
@@ -19,6 +20,18 @@ | |
|
||
This document will maintain and continually update the release notes of each version of Rosetta. If you have questions or comments, please contact us via [email protected]. | ||
|
||
## Rosetta v0.3.0 | ||
|
||
1. Added `PrivateTextLineDataset`, `PrivateInput` secure operations. | ||
|
||
2. Added `SecureLogicalAnd`, `SecureLogicalOr`, `SecureLogicalXor`, `SecureLogicalNot` secure operations. | ||
|
||
3. Speedup some backend operations. | ||
|
||
4. Uses related python classes such as PrivateTextLineDataset and iterators to load large data sets, thereby reducing memory usage. | ||
|
||
5. Some known bugs are fixed. | ||
|
||
## Rosetta v0.2.1 | ||
|
||
1. Support 128-bit integer data type, which enables big integer and high precision float-point operations. | ||
|
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
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,50 @@ | ||
#include "snn__test.h" | ||
|
||
void run(int partyid) { | ||
SNN_PROTOCOL_TEST_INIT(partyid); | ||
// mimic 8^3 * 8^2 | ||
vector<double> X(100000, 8.0 * 8.0 * 8.0); | ||
vector<double> Y(100000, 8.0 * 8.0); | ||
|
||
vector<double> EXPECT(100000, 32768.0); | ||
size_t size = X.size(); | ||
|
||
// vector<double> X = { 8.0, -8.0, 5, -5, 2, -2}; | ||
// vector<double> EXPECT = {0.9997, 0.00033, 0.9933, 0.00669, 0.8808, 0.1192}; | ||
// size_t size = X.size(); | ||
print_vec(X, 10, "X"); | ||
print_vec(Y, 10, "Y"); | ||
|
||
string msgid("Mul OP(s) (share,share)"); | ||
cout << __FUNCTION__ << " " << msgid << endl; | ||
|
||
vector<string> strX, strY, strZ; | ||
vector<string> zZ(strZ.size()); | ||
// In theory, the probability of this truncation error is about 1/(2^{64-(15+16+16)}, | ||
// i.e. 1/(2^17) = 0.000008 | ||
// we do this 10-timers to make this more likely to happen. | ||
int wrong_cnt = 0; | ||
int ITER = 10; | ||
for(int kkk = 0; kkk < ITER; ++kkk) { | ||
snn0.GetOps(msgid)->PrivateInput(0, X, strX); | ||
snn0.GetOps(msgid)->PrivateInput(0, Y, strY); | ||
snn0.GetOps(msgid)->Mul(strX, strY, strZ); | ||
snn0.GetOps(msgid)->Reveal(strZ, zZ); | ||
print_vec(zZ, 10, "SNN Mul plaintext:"); | ||
print_vec(EXPECT, 10, "Mul expected:"); | ||
for(int i = 0; i < size; ++i) { | ||
auto inner = stol(zZ[i]); | ||
auto expected = long(EXPECT[i]); | ||
if (inner != expected) { | ||
wrong_cnt++; | ||
cout << i << "-th item wrong in iter: " << kkk << "!!!" << endl; | ||
cout << "inner: " << inner << " <-> expected: " << expected << endl; | ||
} | ||
} | ||
} | ||
cout << "error num:" << wrong_cnt << endl; | ||
cout << "probability in this case:" << (wrong_cnt * 1.0) / (ITER * size) << endl; | ||
SNN_PROTOCOL_TEST_UNINIT(partyid); | ||
} | ||
|
||
RUN_MPC_TEST(run); |
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,35 @@ | ||
// ============================================================================== | ||
// Copyright 2020 The LatticeX Foundation | ||
// This file is part of the Rosetta library. | ||
// | ||
// The Rosetta library is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Lesser General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// The Rosetta library is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public License | ||
// along with the Rosetta library. If not, see <http://www.gnu.org/licenses/>. | ||
// ============================================================================== | ||
|
||
#include "tensorflow/core/framework/common_shape_fns.h" | ||
#include "tensorflow/core/framework/op.h" | ||
#include "tensorflow/core/framework/op_def_builder.h" | ||
#include "tensorflow/core/framework/shape_inference.h" | ||
|
||
namespace tensorflow { | ||
|
||
REGISTER_OP("PrivateTextLineDataset") | ||
.Input("filenames: string") | ||
.Input("compression_type: string") | ||
.Input("buffer_size: int64") | ||
.Input("data_owner: int64") | ||
.Output("handle: variant") | ||
.SetIsStateful(); | ||
// shape function will depressed at present !!!! | ||
|
||
} |
Oops, something went wrong.