Skip to content

Commit

Permalink
fix: add SecretInteger test
Browse files Browse the repository at this point in the history
  • Loading branch information
manel1874 committed Sep 2, 2024
1 parent f208f2b commit df188f0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/nada-tests/src/shuffle.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,21 @@ def nada_main() -> List[Output]:
a = na.array([8], parties[0], "A", na.Rational)
b = na.array([8], parties[0], "B", na.SecretRational)
c = na.array([8], parties[0], "C", PublicInteger)
d = na.array([8], parties[0], "D", SecretInteger)

shuffled_a = shuffle(a)
shuffled_b = shuffle(b)
shuffled_c = shuffle(c)
shuffled_d = shuffle(d)

result_a = shuffled_a - shuffled_a
result_b = shuffled_b - shuffled_b
result_c = shuffled_c - shuffled_c
result_d = shuffled_d - shuffled_d

return (
na.output(result_a, parties[1], "my_output_a")
+ na.output(result_b, parties[1], "my_output_b")
+ na.output(result_c, parties[1], "my_output_c")
+ na.output(result_d, parties[1], "my_output_d")
)
16 changes: 16 additions & 0 deletions tests/nada-tests/tests/shuffle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ inputs:
A_6: 6
A_4: 4
B_5: 5
D_0: 0
D_1: 1
D_2: 2
D_3: 3
D_4: 4
D_5: 5
D_6: 6
D_7: 7
expected_outputs:
my_output_a_0: 0
my_output_b_2: 0
Expand All @@ -50,3 +58,11 @@ expected_outputs:
my_output_a_3: 0
my_output_b_1: 0
my_output_a_5: 0
my_output_d_0: 0
my_output_d_1: 0
my_output_d_2: 0
my_output_d_3: 0
my_output_d_4: 0
my_output_d_5: 0
my_output_d_6: 0
my_output_d_7: 0

0 comments on commit df188f0

Please sign in to comment.