MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / decode

Method decode

ogsr_engine/xrCore/trivial_encryptor.cpp:95–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95void trivial_encryptor::decode(pcvoid source, const u32& source_size, pvoid destination, key_flag what)
96{
97 if (what != m_current_key)
98 {
99 initialize(what);
100 }
101
102 random32 temp(m_key.m_encrypt_seed);
103
104 const u8* I = (const u8*)source;
105 const u8* E = (const u8*)source + source_size;
106 u8* J = (u8*)destination;
107 for (; I != E; ++I, ++J)
108 *J = m_alphabet_back[(*I) ^ type(temp.random(alphabet_size) & 0xff)];
109}

Callers 1

open_archive_chunkFunction · 0.80

Calls 3

initializeFunction · 0.50
typeFunction · 0.50
randomMethod · 0.45

Tested by

no test coverage detected