added a ctr function from https://github.com/crooks/mixmaster4096/