for i in xrange(rounds):

    for puzzle_size in puzzle_sizes:

        print "### Protocol v2 attack simulation / %s puzzles (Round %s)\n" % (puzzle_size, i)

        # Alice puzzles generation
        a = UserPuzzle(puzzle_size)
        start_time = datetime.now()
        alice_pre_puzzle_keys, alice_enc_secret_keys = a.gen_puzzles_v2()
        alice_time = datetime.now() - start_time

        # Bob receive puzzles generated by Alice and solve a random puzzle in the list
        b = UserPuzzle(puzzle_size)
        start_time = datetime.now()
        bob_key, bob_index = b.solve_random_puzzle_v2(alice_pre_puzzle_keys, alice_enc_secret_keys)
        bob_time = datetime.now() - start_time

        start_time = datetime.now()

        # Eve pre compute all puzzle keys
        puzzle_keys = []
        for ppk in alice_pre_puzzle_keys:
            p = Puzzle(None, ppk, None, None)
            puzzle_keys.append(p.pk)

        # Eve try to break each encrypted key she captured
        for key in alice_enc_secret_keys:
            e = UserPuzzle(puzzle_size)
            eve_key, eve_index = e.break_random_puzzle_v2(puzzle_keys, key)