fix *DH code and reduce DH param generation to avoid loonnngggg checks