genlib: add crc (wip: untested, need simulation)