import json,math,itertools SLUG='oram-access-leakage' KIND='Constructed analytical model; not a measured benchmark' def run(): checks=[] path_cases=0 for L in range(7): for leaf in range(2**L): nodes=[(2**L-1)+leaf] while nodes[-1]: nodes.append((nodes[-1]-1)//2) nodes.reverse() for h in range(L+2): explicit=sum(2*5*4096 for _ in nodes[h:]) assert explicit==2*5*4096*(L+1-h) path_cases+=1 checks.append(dict(name='Explicit binary paths agree with byte accounting',passed=True,cases=path_cases,detail='Every leaf of heights 0..6 and all valid trusted-prefix depths.')) collision_cases=0 for k in range(7): m=2**k hits=sum(a==b for a in range(m) for b in range(m)) assert hits/(m*m)==2**(-k) collision_cases+=1 checks.append(dict(name='Independent-label collision enumeration',passed=True,cases=collision_cases,detail='Exact ordered-pair enumeration for 1..64 labels.')) equality_cases=0 for permutation in itertools.permutations(range(4)): for first,second in itertools.product(range(4),repeat=2): observed_trace=[permutation[first],permutation[second]] attacker_says_repeated=(observed_trace[0]==observed_trace[1]) logical_history_repeats=(first==second) assert attacker_says_repeated==logical_history_repeats equality_cases+=1 checks.append(dict(name='Fixed placement equality distinguisher',passed=True,cases=equality_cases,detail='All 24 secret permutations of four labels and all 16 ordered logical-access pairs preserve equality. This finite leakage counterexample is not an ORAM security proof.')) heights=list(range(8,25,2));bits=list(range(0,17,2)) figures=[dict(id='path-traffic',title='Full-path bytes versus tree height',x_label='Tree height L',y_label='Bytes per logical operation',series=[dict(name='No trusted prefix',x=heights,y=[2*5*4096*(L+1) for L in heights]),dict(name='Four trusted levels',x=heights,y=[2*5*4096*(L-3) for L in heights])],caption='Constructed complete-path transfer accounting with five 4096-byte slots per bucket. Position-map recursion and integrity traffic excluded.',assumptions=['Full read and rewrite of every uncached bucket','Top four complete levels are coherent trusted state','B includes every byte counted per slot'],kind=KIND),dict(id='label-equality',title='Equality leakage from reused labels',x_label='Label width k (bits)',y_label='Probability of equal observed labels',series=[dict(name='Same reused label',x=bits,y=[1 for _ in bits]),dict(name='Independent uniform labels',x=bits,y=[2**(-k) for k in bits])],caption='Ideal collision experiment contrasting fixed placement with independent labels; not an implementation of ORAM.',assumptions=['Independent labels uniform on 2^k possibilities','Equality only is observed','No cryptographic protocol is simulated'],kind=KIND)] return dict(slug=SLUG,checks=checks,figures=figures,result_summary=dict(full_path_bytes=860160,trusted_prefix_path_bytes=696320,trusted_prefix_storage_bytes=307200,saved_bytes=163840,independent_collision_k10=1/1024)) if __name__=='__main__': print(json.dumps(run(),indent=2))