rsa impl (partial)