Support for g!=2 in DH
Additional checks in DH
Merge github.com:vysheng/tg