fixes to the RSA stuff, still not quite passing unittests though