MCPcopy Create free account
hub / github.com/cuberite/cuberite / ProcessData

Method ProcessData

src/Crypto.cpp:343–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341
342
343void cAESCFBDecryptor::ProcessData(Byte * a_DecryptedOut, const Byte * a_EncryptedIn, size_t a_Length)
344{
345 ASSERT(IsValid()); // Must Init() first
346
347 // PolarSSL doesn't support AES-CFB8, need to implement it manually:
348 for (size_t i = 0; i < a_Length; i++)
349 {
350 Byte Buffer[sizeof(m_IV)];
351 aes_crypt_ecb(&m_Aes, AES_ENCRYPT, m_IV, Buffer);
352 for (size_t idx = 0; idx < sizeof(m_IV) - 1; idx++)
353 {
354 m_IV[idx] = m_IV[idx + 1];
355 }
356 m_IV[sizeof(m_IV) - 1] = a_EncryptedIn[i];
357 a_DecryptedOut[i] = a_EncryptedIn[i] ^ Buffer[0];
358 }
359}
360
361
362

Callers 7

DataReceivedMethod · 0.80
SendDataMethod · 0.80
DataReceivedMethod · 0.80
FlushMethod · 0.80
RelayFromServerMethod · 0.80
RelayFromClientMethod · 0.80
SendEncryptedDataMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected