wavelength 1.0.0
Loading...
Searching...
No Matches
netcrypt.h File Reference

Go to the source code of this file.

Functions

void NetCryptInit ()
 Register Blowfish and start the shared CBC state with the default key and initial vector.
void NetCryptMakeKey (unsigned char pKey[kNetCryptKeySize])
 Draw a random key and initial vector for NetCryptSetKey().
void NetCryptSetKey (const unsigned char pKey[kNetCryptKeySize])
 Replace the stored key and initial vector.
void NetCryptEncrypt (void *pData, int nSize)
 Encrypt the whole eight-byte blocks of a buffer in place, from the stored initial vector.
void NetCryptDecrypt (void *pData, int nSize)
 Decrypt the whole eight-byte blocks of a buffer in place, from the stored initial vector.

Variables

constexpr int kNetCryptKeySize = 16
 Blowfish in CBC mode over the packets of an online session.
constexpr int kNetCryptKeyWords = 4
 The words NetCryptMakeKey() draws.

Function Documentation

◆ NetCryptInit()

void NetCryptInit ( )

Register Blowfish and start the shared CBC state with the default key and initial vector.

Ghidra address:
NTSC-U/C: 0x0026b4d0
Ghidra address:
PAL: 0x00275060

◆ NetCryptMakeKey()

void NetCryptMakeKey ( unsigned char pKey[kNetCryptKeySize])

Draw a random key and initial vector for NetCryptSetKey().

The routine stores kNetCryptKeyWords random words.

Parameters
pKeyReceives the bytes.
Ghidra address:
NTSC-U/C: 0x0026b578
Ghidra address:
PAL: 0x00275108

◆ NetCryptSetKey()

void NetCryptSetKey ( const unsigned char pKey[kNetCryptKeySize])

Replace the stored key and initial vector.

The cipher state keeps the key NetCryptInit() set up, and only the initial vector takes effect.

Parameters
pKeyThe eight bytes of the key followed by the eight bytes of the initial vector.
Ghidra address:
NTSC-U/C: 0x0026b5c0
Ghidra address:
PAL: 0x00275150

◆ NetCryptEncrypt()

void NetCryptEncrypt ( void * pData,
int nSize )

Encrypt the whole eight-byte blocks of a buffer in place, from the stored initial vector.

Parameters
pDataThe buffer.
nSizeThe size of the buffer in bytes.
Ghidra address:
NTSC-U/C: 0x0026b5f8
Ghidra address:
PAL: 0x00275188

◆ NetCryptDecrypt()

void NetCryptDecrypt ( void * pData,
int nSize )

Decrypt the whole eight-byte blocks of a buffer in place, from the stored initial vector.

Parameters
pDataThe buffer.
nSizeThe size of the buffer in bytes.
Ghidra address:
NTSC-U/C: 0x0026b688
Ghidra address:
PAL: 0x00275218

Variable Documentation

◆ kNetCryptKeySize

int kNetCryptKeySize = 16
constexpr

Blowfish in CBC mode over the packets of an online session.

The routines share one cipher state, keyed once by NetCryptInit(). The names are inferred. The bytes of the key and of the initial vector NetCryptSetKey() takes.

◆ kNetCryptKeyWords

int kNetCryptKeyWords = 4
constexpr

The words NetCryptMakeKey() draws.