|
| static void | Interleave (std::uint8_t *data, std::size_t length) |
| | Interleaves a sequence of bytes in place.
|
| static void | Interleave (std::vector< std::uint8_t > &data) |
| | Interleaves a sequence of bytes in place.
|
| static void | Interleave (std::string &data) |
| | Interleaves a sequence of bytes in place.
|
| static void | Deinterleave (std::uint8_t *data, std::size_t length) |
| | Deinterleaves a sequence of bytes in place.
|
| static void | Deinterleave (std::vector< std::uint8_t > &data) |
| | Deinterleaves a sequence of bytes in place.
|
| static void | Deinterleave (std::string &data) |
| | Deinterleaves a sequence of bytes in place.
|
| static void | FlipMsb (std::uint8_t *data, std::size_t length) noexcept |
| | Flips the most significant bits of each byte in a sequence of bytes in place.
|
| static void | FlipMsb (std::vector< std::uint8_t > &data) noexcept |
| | Flips the most significant bits of each byte in a sequence of bytes in place.
|
| static void | FlipMsb (std::string &data) noexcept |
| | Flips the most significant bits of each byte in a sequence of bytes in place.
|
| static void | SwapMultiples (std::uint8_t *data, std::size_t length, int multiple) |
| | Swaps the order of contiguous bytes in a sequence of bytes that are divisible by a given multiple value, in place.
|
| static void | SwapMultiples (std::vector< std::uint8_t > &data, int multiple) |
| | Swaps the order of contiguous bytes in a sequence of bytes that are divisible by a given multiple value, in place.
|
| static void | SwapMultiples (std::string &data, int multiple) |
| | Swaps the order of contiguous bytes in a sequence of bytes that are divisible by a given multiple value, in place.
|
Functions for encrypting and decrypting EO data.
Encryption is applied to packet data after the 2-byte packet ID and before the packet length is prepended. The data is encrypted with SwapMultiples, Interleave and then FlipMsb, and decrypted with FlipMsb, Deinterleave and then SwapMultiples.
All functions transform the data in place. To keep the original data, transform a copy.
| void eolib::encrypt::DataEncrypter::Interleave |
( |
std::uint8_t * | data, |
|
|
std::size_t | length ) |
|
static |
Interleaves a sequence of bytes in place.
When encrypting EO data, this function is called second.
Example: {0, 1, 2, 3, 4, 5} becomes {0, 5, 1, 4, 2, 3}.
- Parameters
-
| data | a pointer to the data to interleave. |
| length | the number of bytes to interleave. |
| void eolib::encrypt::DataEncrypter::Interleave |
( |
std::vector< std::uint8_t > & | data | ) |
|
|
inlinestatic |
Interleaves a sequence of bytes in place.
When encrypting EO data, this function is called second.
Example: {0, 1, 2, 3, 4, 5} becomes {0, 5, 1, 4, 2, 3}.
- Parameters
-
| data | the data to interleave. |
| void eolib::encrypt::DataEncrypter::Interleave |
( |
std::string & | data | ) |
|
|
inlinestatic |
Interleaves a sequence of bytes in place.
When encrypting EO data, this function is called second.
Example: {0, 1, 2, 3, 4, 5} becomes {0, 5, 1, 4, 2, 3}.
- Parameters
-
| data | the data to interleave. |
| void eolib::encrypt::DataEncrypter::Deinterleave |
( |
std::uint8_t * | data, |
|
|
std::size_t | length ) |
|
static |
Deinterleaves a sequence of bytes in place.
This is the reverse of Interleave. When decrypting EO data, this function is called second.
Example: {0, 1, 2, 3, 4, 5} becomes {0, 2, 4, 5, 3, 1}.
- Parameters
-
| data | a pointer to the data to deinterleave. |
| length | the number of bytes to deinterleave. |
| void eolib::encrypt::DataEncrypter::Deinterleave |
( |
std::vector< std::uint8_t > & | data | ) |
|
|
inlinestatic |
Deinterleaves a sequence of bytes in place.
This is the reverse of Interleave. When decrypting EO data, this function is called second.
Example: {0, 1, 2, 3, 4, 5} becomes {0, 2, 4, 5, 3, 1}.
- Parameters
-
| data | the data to deinterleave. |
| void eolib::encrypt::DataEncrypter::Deinterleave |
( |
std::string & | data | ) |
|
|
inlinestatic |
Deinterleaves a sequence of bytes in place.
This is the reverse of Interleave. When decrypting EO data, this function is called second.
Example: {0, 1, 2, 3, 4, 5} becomes {0, 2, 4, 5, 3, 1}.
- Parameters
-
| data | the data to deinterleave. |