move set_rand_bitmask to random.c