fix nonce for 32-bit systems

2^31 is too big for 32-bit systems, so just cap at 2^30 instead as a cheap fix.