Hi Everybody,
I was wondering if you could help me with something. I have encountered an unexpected behavior, while working with the dabit instruction. Imagine the following:
I have a function that does this 3 simple steps:
* Sample, some 64 bits randomness using the dabits instruction (some r in mod 2 and mod p, and their respective bit expansions).
* Use it for masking, mod p. e.g. (c = sint(1) + r_p)
* An opening e.g., c.reveal()
I can call the function 128 consecutive times, and it behaves as it should. However on the 129th call the opening would take several orders of magnitude more to be executed (although im not sure, it could be constant).
I was wondering if somebody else has noticed something similar, and if you might have any advice. Any help is appreciated.
Kr,
A.
For clarity you can also observe the following example of the above (mamba):
########## EXAMPLE ##########
def sampling():
'''
please use any custom implementation for
get_random_from_dabit_list, that you might have,
if not I could provide one. '''
r_p, R_p, r_2, R_2 = get_random_from_dabit_list(64)
c = sint(5) + r_p
c_open= c.reveal()
return c_open
limit =150
b = sint(-1)
d = sint(1)
#as advised to measure only the online time.
open_channel_with_return(0)
h = sint.get_private_input_from(0, 0)
f = b*d
start_timer(1)
counter = 0
for i in range(limit/10):
start_timer(2+i)
for j in range(10):
counter = counter + 1
if counter == 129:
start_timer(70+j)
sampling()
stop_timer(70+j)
else:
sampling()
stop_timer(2+i)
stop_timer(1)