random elements should be mod p not mod q
start of pvw implementation