def shuffling_case_fn(seed, count): yield 'mapping', 'data', { 'seed': '0x' + seed.hex(), 'count': count, 'mapping': [ int(spec.compute_shuffled_index(i, count, seed)) for i in range(count) ] }
def FuzzerRunOne(fuzzer_input): if len(fuzzer_input) < 2 + 32: return None count = spec.bytes_to_int(fuzzer_input[:2]) % 100 seed = fuzzer_input[2:34] res = [ spec.compute_shuffled_index(index=i, index_count=count, seed=seed) for i in range(count) ] ret = bytes() for r in res: ret += struct.pack("<Q", r) return ret
def shuffling_case(seed, count): yield 'seed', '0x' + seed.hex() yield 'count', count yield 'shuffled', [ int(spec.compute_shuffled_index(i, count, seed)) for i in range(count) ]