shachain: allow overriding of number of bits, add cmdline tool.