#include //#include "./printf.h" //#include const int size_mesg=16; const int sleepTimeS = 10; const int h=2; const int h2=h*h; byte DK[64]; int rp=1; const int len=size_mesg/h2; typedef byte uchar; typedef unsigned int uint; int Pbox[len]; int PboxRM[h2]; uchar Sbox1[256]; uchar Sbox2[256]; uchar RM1_cpy[h2]; struct ulong2{ unsigned long int x, y; }; typedef struct ulong2 ulong2; typedef unsigned long int ulong; uint xorshift32(const uint t) { /* Algorithm "xor" from p. 4 of Marsaglia, "Xorshift RNGs" */ uint x = t; x ^= x << 13; x ^= x >> 17; x ^= x << 5; return x; } uint pcg32_random_r(ulong2* rng) { // pcg32_random_t *rng=(pcg32_random_t*)rng2; ulong oldstate = rng->x; // Advance internal state rng->x = oldstate * 6364136223846793005ULL + (rng->y|1); // Calculate output function (XSH RR), uses old state for max ILP uint xorshifted = ((oldstate >> 18u) ^ oldstate) >> 27u; uint rot = oldstate >> 59u; return (xorshifted >> rot) | (xorshifted << ((-rot) & 31)); } void inverse_tables(uchar *tab, int size_tab,uchar *inv_perm_tabs) { for(int i=0;i