INNER CODE UNIT · Python

gen_innerprod_input

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

def gen_innerprod_input(fo):
    LEN = 10
    bits = 14
    arA = gen_random_array(LEN,bits)
    arB = gen_random_array(LEN,bits)
    ip = sum([a*b for (a,b) in zip(arA,arB)])

    for player,ar in [("A",arA),("B",arB)]:
        pl = str_iv(player, str_struct(["xs"],[ar]))
        fo.write(pl)

    fo.write("return_value == %d;\n" % ip)

def gen_xtabs_input(fo):
    LEN = 50
    BINS = 5
    bits = 8

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…