generalize newRSA