INNER CODE UNIT · Python

arB

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

    arB = [gen_random_array(LEN, bits), [b % BINS for b in gen_random_array(LEN)]]

    # calculate correct answer
    ID = 0
    VAL = 1
    expected_output = [0] * BINS
    for idA in range(LEN):
        for idB in range(LEN):
            if arA[ID][idA] == arB[ID][idB]:
                expected_output[ arB[VAL][idB] ] += arA[VAL][idA]
    
    # write values 
    for player,ar in [("A",arA),("B",arB)]:
        pl = str_iv(player, str_struct(["d"],[ar]))
        fo.write(pl)

    output = str_struct(["d"], [[eo % 256 for eo in expected_output]])
    fo.write("return_value == %s;\n"%(output))

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…