Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning for truncpr #526

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crypten/mpc/primitives/arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ def mul_(self, y):
return self._arithmetic_function_(y, "mul")

def div(self, y):
print("WARNING: Probabilistic truncation leaks some information, see https://eprint.iacr.org/2024/1127 for discussion. ")
"""Divide by a given tensor"""
result = self.clone()
if isinstance(y, CrypTensor):
Expand All @@ -444,6 +445,7 @@ def div(self, y):
return result.div_(y)

def div_(self, y):
print("WARNING: Probabilistic truncation leaks some information, see https://eprint.iacr.org/2024/1127 for discussion. ")
"""Divide two tensors element-wise"""
# TODO: Add test coverage for this code path (next 4 lines)
if isinstance(y, float) and int(y) == y:
Expand Down
2 changes: 2 additions & 0 deletions crypten/mpc/primitives/replicated.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ def square(x):


def truncate(x, y):
print("WARNING: Probabilistic truncation leaks some information, see https://eprint.iacr.org/2024/1127 for discussion. ")

"""Protocol to divide an ArithmeticSharedTensor `x` by a constant integer `y`
using RSS (see ABY3 Figure 2: https://eprint.iacr.org/2018/403.pdf).

Expand Down