From cf8654fd353a60ef333e3a0b6eb96498c3a1aebd Mon Sep 17 00:00:00 2001 From: Kinan Dak Al Bab Date: Sat, 5 Jan 2019 20:54:17 -0500 Subject: [PATCH 1/9] Begin work on join/filter/count demo UI and client.js done. MPC implementation and test TODO --- demos/table-join-filter-count/TODO | 31 +++++ demos/table-join-filter-count/client.html | 45 +++++++ demos/table-join-filter-count/client.js | 152 ++++++++++++++++++++++ demos/table-join-filter-count/mpc.js | 38 ++++++ demos/table-join-filter-count/party.js | 43 ++++++ demos/table-join-filter-count/server.js | 20 +++ demos/table-join-filter-count/test.js | 131 +++++++++++++++++++ 7 files changed, 460 insertions(+) create mode 100644 demos/table-join-filter-count/TODO create mode 100644 demos/table-join-filter-count/client.html create mode 100644 demos/table-join-filter-count/client.js create mode 100644 demos/table-join-filter-count/mpc.js create mode 100644 demos/table-join-filter-count/party.js create mode 100644 demos/table-join-filter-count/server.js create mode 100644 demos/table-join-filter-count/test.js diff --git a/demos/table-join-filter-count/TODO b/demos/table-join-filter-count/TODO new file mode 100644 index 000000000..5e90b3cd5 --- /dev/null +++ b/demos/table-join-filter-count/TODO @@ -0,0 +1,31 @@ +1. Implement MPC algorithm: + * Data = []; + * // JOIN + * Loop over (SSN, Gender) in party 1 input: + + secret(flag), secret(INCOME) = modified binary search for SSN in party 2 input + + if i != -1 + - Data.add(Gender, Income) + + else + - Data.add(2, -1) // 2 in gender means invalid entry + * // JOIN COMPLETE --- n log n comparison, n^2 multiplications + * // FILTER + * Loop over (Gender, Income) in Data: + + if Income > SOME CONSTANT + - Data unchanged + + else + - Replace with (2, 0) + * // FILTER COMPLETE --- n comparison, n multiplication + * // COUNT + * Result = [ { gender: 'M', count: share(0) }, { gender: 'F', count: share(0) } ] + * Loop over (Gender, Income) in Data: + + cmp1 = Gender == 0 + + cmp2 = Gender == 1 + + Result[0].count += cmp1 + + Result[1].count += cmp2 + * // COUNT COMPLETE --- 2n equality checks, 2n multiplications + + + +2. party.js: parse input as CSV. + +3. test.js: parallel = 1, run for small random tables. diff --git a/demos/table-join-filter-count/client.html b/demos/table-join-filter-count/client.html new file mode 100644 index 000000000..a4277bddf --- /dev/null +++ b/demos/table-join-filter-count/client.html @@ -0,0 +1,45 @@ + + + + + Sum integers under MPC + + + + + + + + + + + + + +

Connect JIFF

+

+