You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the machine based on "malicious-shamir-party reading" and trying to read a file with approx 100M numbers. After reading each element I am storing in an array of sint type. Further for a query, I am searching the count of elements equal to search query using a==b command. This setup work up to 1k element but after that program gets killed.
def equality_test():
for i in range(len(numbers)):
count.iadd(numbers[i] == search_query)
equality_test()
print_ln('Count for %s is %s',search_query.reveal(), count.reveal())
I even tried the below version of the code:
program.use_edabit(True)
def read_numbers():
numbers=sint.get_input_from(0, size=1000000)
b = sint.get_input_from(1)
eq_bits = [x == b for x in numbers]
b_in_a = sum(eq_bits)
print_ln("Count of %s is %s",b.reveal(), b_in_a.reveal())
read_numbers()
Party 0 has 1M numbers in Input_P0_0 file under Player_Data folder
Party 1 has 1 number in Input_P1_0 file under Player_Data folder
The text was updated successfully, but these errors were encountered:
I am using the machine based on "malicious-shamir-party reading" and trying to read a file with approx 100M numbers. After reading each element I am storing in an array of sint type. Further for a query, I am searching the count of elements equal to search query using a==b command. This setup work up to 1k element but after that program gets killed.
[1]+ Killed Scripts/compile-run.py -E mal-shamir python_test -- -N 3
I am using docker images to run the system. Could you please help?
The underlying code:
def read_numbers_from_file(filename):
with open(filename, 'r') as file:
num_rows = 1000
numbers = Array(num_rows, sint)
count = 0
while count < num_rows:
line = file.readline()
if line:
numbers[count] = sint(int(line.strip()))
count += 1 # Increment the counter
else:
break
return numbers
filename = 'data_1M.csv'
numbers = read_numbers_from_file(filename)
search_query=sint(1)
count = sint(0)
length=len(numbers)
def equality_test():
for i in range(len(numbers)):
count.iadd(numbers[i] == search_query)
equality_test()
print_ln('Count for %s is %s',search_query.reveal(), count.reveal())
I even tried the below version of the code:
program.use_edabit(True)
def read_numbers():
numbers=sint.get_input_from(0, size=1000000)
b = sint.get_input_from(1)
eq_bits = [x == b for x in numbers]
b_in_a = sum(eq_bits)
print_ln("Count of %s is %s",b.reveal(), b_in_a.reveal())
read_numbers()
Party 0 has 1M numbers in Input_P0_0 file under Player_Data folder
Party 1 has 1 number in Input_P1_0 file under Player_Data folder
The text was updated successfully, but these errors were encountered: