Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.
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