#include #include #include "agrippa-cipher.h" const unsigned cell_length = 3; const unsigned e_2 = 11; const unsigned p_q = 4097; // 17*241 appears to have been chosen due to its proximity to 2^12 for 3-char packing typedef unsigned (*bitmapper)(unsigned); // various maps of 0..7 -> 0..7 unsigned un_do_too_it(unsigned x) { return ((13 - x) * 5) % 8; } unsigned un_do_it(unsigned x) { return (((7 - x) * 3) + 5) % 8; } // byte scrambler helper unsigned bytemapper(bitmapper f, unsigned x) { byte ret = 0; for (unsigned bit = 0; bit < 8; bit++) if (x & (1<