#define AES_N_BLOCK 16void copy_and_key(quint8 d[AES_N_BLOCK], const quint8 s[AES_N_BLOCK], const quint8 k[AES_N_BLOCK]){ ((quint64*)d)[0] = ((quint64*)s)[0] ^ ((quint64*)k)[0]; ((quint64*)d)[1] = ((quint64*)s)[1] ^ ((quint64*)k)[1];}
void aes_decrypt(const quint8 in[AES_N_BLOCK], quint8 out[AES_N_BLOCK]) { quint8 s1[AES_N_BLOCK], r; copy_and_key(s1, in, keySchedule + rnd * AES_N_BLOCK); // тут что-то делаем c s1}
C++ (Qt)#pragma pack(push, 1)struct Data { char ch; quint64 val;};#pragma pack(pop)
struct alignas(alignof(uint64_t)) AesBlock { uchar8_t data[16]; }
C++ (Qt)namespace ns_Dummy { quint64 Get( const quint8 * addr, size_t index ) { quint64 val; memmove(&val, addr + index * sizeof(quint64), sizeof(quin64)); return val; } void Set( quint8 * addr, size_t index, quint64 val ) { memmove(addr + index * sizeof(quint64), &val, sizeof(quin64)); } void copy_and_key( quint8 * dst, const quint8 * src1, quint8 * src2 ) { Set(dst, 0, Get(src1, 0) ^ Get(src2, 0)); Set(dst, 1, Get(src1, 1) ^ Get(src2, 1)); } } // namespace