| 77 | } |
| 78 | |
| 79 | void trivial_encryptor::encode(pcvoid source, const u32& source_size, pvoid destination, key_flag what) |
| 80 | { |
| 81 | if (what != m_current_key) |
| 82 | { |
| 83 | initialize(what); |
| 84 | } |
| 85 | |
| 86 | random32 temp(m_key.m_encrypt_seed); |
| 87 | |
| 88 | const u8* I = (const u8*)source; |
| 89 | const u8* E = (const u8*)source + source_size; |
| 90 | u8* J = (u8*)destination; |
| 91 | for (; I != E; ++I, ++J) |
| 92 | *J = m_alphabet[*I] ^ type(temp.random(alphabet_size) & 0xff); |
| 93 | } |
| 94 | |
| 95 | void trivial_encryptor::decode(pcvoid source, const u32& source_size, pvoid destination, key_flag what) |
| 96 | { |
no test coverage detected