Initialize g and p in create_dh factory method