MCPcopy Create free account
hub / github.com/crossuo/crossuo / Encrypt

Function Encrypt

src/Crypt/CryptEntry.cpp:44–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44void Encrypt(bool is_login, uint8_t *src, uint8_t *dest, int size)
45{
46 if (g_Config.EncryptionType == ET_NOCRYPT)
47 {
48 memcpy(dest, src, size);
49 }
50 else if (is_login)
51 {
52 if (g_Config.EncryptionType == ET_OLD_BFISH)
53 {
54 g_LoginCrypt.Encrypt_Old(src, dest, size);
55 }
56 else if (g_Config.EncryptionType == ET_1_25_36)
57 {
58 g_LoginCrypt.Encrypt_1_25_36(src, dest, size);
59 }
60 else if (g_Config.EncryptionType != ET_NOCRYPT)
61 {
62 g_LoginCrypt.Encrypt(src, dest, size);
63 }
64 }
65 else if (g_Config.EncryptionType == ET_203)
66 {
67 g_BlowfishCrypt.Encrypt(src, dest, size);
68 g_TwofishCrypt.Encrypt(dest, dest, size);
69 }
70 else if (g_Config.EncryptionType == ET_TFISH)
71 {
72 g_TwofishCrypt.Encrypt(src, dest, size);
73 }
74 else
75 {
76 g_BlowfishCrypt.Encrypt(src, dest, size);
77 }
78}
79
80void Decrypt(uint8_t *src, uint8_t *dest, int size)
81{

Callers 2

EncryptMethod · 0.85
SendMethod · 0.85

Calls 4

memcpyFunction · 0.85
Encrypt_OldMethod · 0.80
Encrypt_1_25_36Method · 0.80
EncryptMethod · 0.45

Tested by

no test coverage detected