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

Method encode

ogsr_engine/xrCore/trivial_encryptor.cpp:79–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77}
78
79void 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
95void trivial_encryptor::decode(pcvoid source, const u32& source_size, pvoid destination, key_flag what)
96{

Callers 2

w_compressedMethod · 0.80
open_archive_chunkFunction · 0.80

Calls 3

initializeFunction · 0.50
typeFunction · 0.50
randomMethod · 0.45

Tested by

no test coverage detected