From https://github.com/indutny/tlsnappy/tree/master/deps/lring