#!/usr/bin/env python3 # copied from https://eprint.iacr.org/2020/1493 # see proofs there def permutation(c): m = 1 while (2*m-1)<<(m-1) < len(c): m += 1 assert (2*m-1)<<(m-1) == len(c) n = 1<