Adapting solveDKE to allow for other RHSmode