fixed the generation of the "coprime" in the gen_key_pair function