INNER CODE UNIT · Python

str_iv

MPC-SoK/frameworks · cbmc-gc/source/geninput.py:11

def str_iv(player, val):
    return "INPUT_%s := %s;\n"%(player, val)

def gen_random_array(ll, bits=10):
    return [int(random.getrandbits(bits)) for _ in range(ll)]

# program input generation
def write_input(program, trials, gen_function):
    with open("%s/test.spec"%program, 'w') as fo:
        for t in range(trials):
            gen_function(fo)
            if t != trials-1:
                fo.write('---\n')

def gen_mult3_input(fo):
    p = 1
    for player in ["A","B","C"]:
        val = int(random.getrandbits(10))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…