#include <stdint.h>
#include <stddef.h>
#include <stdlib.h>
#include "eolib/rng.h"
Go to the source code of this file.
◆ eo_decrypt_packet()
| void eo_decrypt_packet |
( |
uint8_t * | data, |
|
|
size_t | length, |
|
|
uint8_t | swap_multiple ) |
Decrypts a packet in place using the specified swap multiple.
- Parameters
-
| data | The packet data to decrypt. |
| length | Number of bytes in data. |
| swap_multiple | The swap multiple for the packet. |
Definition at line 114 of file encrypt.c.
◆ eo_encrypt_packet()
| void eo_encrypt_packet |
( |
uint8_t * | data, |
|
|
size_t | length, |
|
|
uint8_t | swap_multiple ) |
Encrypts a packet in place using the specified swap multiple.
- Parameters
-
| data | The packet data to encrypt. |
| length | Number of bytes in data. |
| swap_multiple | The swap multiple for the packet. |
Definition at line 58 of file encrypt.c.
◆ eo_generate_server_verification_challenge()
| int32_t eo_generate_server_verification_challenge |
( |
| ) |
|
|
inlinestatic |
Generates a server verification challenge value, which is a random integer used in the EO protocol's challenge-response authentication process. The client receives this challenge from the server and must compute the correct response using the eo_server_verification_hash function to authenticate itself to the server.
- Returns
- The generated server verification challenge value.
Definition at line 17 of file encrypt.h.
◆ eo_generate_swap_multiple()
| uint8_t eo_generate_swap_multiple |
( |
| ) |
|
Generates a cryptographically random swap multiple between 6 and 12 inclusive.
- Returns
- The generated swap multiple.
Definition at line 53 of file encrypt.c.
◆ eo_server_verification_hash()
| int32_t eo_server_verification_hash |
( |
int32_t | challenge | ) |
|
Calculates the server verification hash for the given challenge value.
- Parameters
-
| challenge | The server challenge value (from ServerInitInitServerPacket). |
- Returns
- The verification hash to be sent back to the server.
Definition at line 5 of file encrypt.c.
◆ eo_swap_multiples()
| void eo_swap_multiples |
( |
uint8_t * | data, |
|
|
size_t | length, |
|
|
uint8_t | multiple ) |
Reverses contiguous sequences of bytes where each value is a multiple of multiple.
- Parameters
-
| data | The packet data to mutate. |
| length | Number of bytes in data. |
| multiple | The divisor used to determine which bytes are in a sequence. |
Definition at line 12 of file encrypt.c.