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 implemented a TOP-K protocol in a virtual machine by adding an topk instruction. However, after I ran the protocol and successfully obtained the result, the program reported an error and did not show the total communication overhead. It seems that this is caused by resource recycling, but I don't know where to fix this error.
Secure_top_k.mpc
batch_size=6
topk_rate=0.9
#k=int(topk_rate*batch_size)
k=4
v=sfix.get_input_from(0, size=6)
ans=cint(size=k)
secure_topk(ans,v.pre_mul(),k,batch_size)
print_ln("%s",ans)
print_ln("%s",ans)
print_ln("%s",ans)
ans1=cint(size=k)
secure_topk(ans1,v.pre_mul(),k,batch_size)
print_ln("%s",ans1)
print_ln("%s",ans1)
print_ln("%s",ans1)
The output:
P0:
Using security parameter 40
Trying to run 64-bit computation
[0, 3, 5, 4]
[0, 3, 5, 4]
[0, 3, 5, 4]
[0, 3, 5, 4]
[0, 3, 5, 4]
[0, 3, 5, 4]
free(): invalid next size (fast)
Aborted (core dumped)
P1:
Using security parameter 40
Trying to run 64-bit computation
The following benchmarks are including preprocessing (offline phase).
Time = 0.00978447 seconds
Data sent = 0.006804 MB in ~36 rounds (party 1)
terminate called after throwing an instance of 'boost::wrapexceptboost::system::system_error'
what(): read_some: stream truncated [asio.ssl.stream:1]
Aborted (core dumped)
P2:
Using security parameter 40
Trying to run 64-bit computation
The following benchmarks are including preprocessing (offline phase).
Time = 0.00951865 seconds
Data sent = 0.000216 MB in ~73 rounds (party 2)
terminate called after throwing an instance of 'boost::wrapexceptboost::system::system_error'
what(): read_some: stream truncated [asio.ssl.stream:1]
Aborted (core dumped)
The text was updated successfully, but these errors were encountered:
I implemented a TOP-K protocol in a virtual machine by adding an topk instruction. However, after I ran the protocol and successfully obtained the result, the program reported an error and did not show the total communication overhead. It seems that this is caused by resource recycling, but I don't know where to fix this error.
Secure_top_k.mpc
batch_size=6
topk_rate=0.9
#k=int(topk_rate*batch_size)
k=4
v=sfix.get_input_from(0, size=6)
ans=cint(size=k)
secure_topk(ans,v.pre_mul(),k,batch_size)
print_ln("%s",ans)
print_ln("%s",ans)
print_ln("%s",ans)
ans1=cint(size=k)
secure_topk(ans1,v.pre_mul(),k,batch_size)
print_ln("%s",ans1)
print_ln("%s",ans1)
print_ln("%s",ans1)
library.py
def secure_topk(ans,v,k,batch_size):
secure_top_k(ans,v,k,batch_size)
instruction.py
class secure_top_k(base.VarArgsInstruction):
slots = []
code = base.opcodes['TOPK']
arg_format = tools.cycle(['cw','s','int','int'])
Input-P0-0
10.1 3.2 2.3 10.4 4.5 6.6
The output:
P0:
Using security parameter 40
Trying to run 64-bit computation
[0, 3, 5, 4]
[0, 3, 5, 4]
[0, 3, 5, 4]
[0, 3, 5, 4]
[0, 3, 5, 4]
[0, 3, 5, 4]
free(): invalid next size (fast)
Aborted (core dumped)
P1:
Using security parameter 40
Trying to run 64-bit computation
The following benchmarks are including preprocessing (offline phase).
Time = 0.00978447 seconds
Data sent = 0.006804 MB in ~36 rounds (party 1)
terminate called after throwing an instance of 'boost::wrapexceptboost::system::system_error'
what(): read_some: stream truncated [asio.ssl.stream:1]
Aborted (core dumped)
P2:
Using security parameter 40
Trying to run 64-bit computation
The following benchmarks are including preprocessing (offline phase).
Time = 0.00951865 seconds
Data sent = 0.000216 MB in ~73 rounds (party 2)
terminate called after throwing an instance of 'boost::wrapexceptboost::system::system_error'
what(): read_some: stream truncated [asio.ssl.stream:1]
Aborted (core dumped)
The text was updated successfully, but these errors were encountered: