INNER CODE UNIT · Python

gen_xtabs_input

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

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

    # parallel arrays (id, value)
    arA = [gen_random_array(LEN,bits), gen_random_array(LEN,bits)]
    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]
    

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…