Added more code for choosing q, hpwd, coeffs of polynomial. Also, some crypto
utility functions to support those code.