1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-04-27 00:47:45 +00:00
kawari/src/blowfish/wrapper.h
Joshua Goins 942a64cd7b Fix encrypting/decrypting packets, vendor Sapphire Blowfish implementation
I ended up just stealing this from iolite, which in turn took it from Sapphire.
I tried for a few hours to get a Rust Blowfish implementation going, but the one
from Physis didn't work. I'll try again later.
2025-03-08 21:13:00 -05:00

21 lines
429 B
C++

#include <cstdint>
extern "C"
{
typedef void *BlowfishHandle;
#define DWORD uint32_t
#define WORD unsigned short
#define BYTE uint8_t
struct ExpandedKey
{
DWORD *PArray;
DWORD (*SBoxes)
[256];
};
BYTE *blowfish_encode(BYTE *key, uint32_t keybytes, BYTE *pInput, DWORD lSize);
BYTE *blowfish_decode(BYTE *key, uint32_t keybytes, BYTE *pInput, DWORD lSize);
//__declspec(dllexport) void destroy(BlowFish hanle);
}