mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
kirk_engine.h and amctrl.h guard their declarations, but AES.h and SHA1.h never did, and kirk_engine.h includes them from outside its own guard. So the AES_* and SHA1* functions got C++ linkage in any C++ file that reached them through there, and only linked for callers that happened to wrap the whole header in an extern "C" of their own. Nothing had called AES_* from C++ before, so it stayed hidden until something did. Guarding the two headers instead lets every caller include them plainly, and the wrappers scattered around the tree come out. Both are pure declarations over kirk_common.h's typedefs with no system headers behind them, so there's nothing in there that shouldn't be wrapped. kirk_engine.h also uses size_t without including anything that defines it, which only held together because its includers happened to have it already. Co-Authored-By: Claude Opus 5 <[email protected]>
45 lines
880 B
C
45 lines
880 B
C
#pragma once
|
|
|
|
#include "kirk_common.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* POINTER defines a generic pointer type */
|
|
typedef unsigned char *POINTER;
|
|
typedef const unsigned char *CONST_POINTER;
|
|
|
|
/* UINT4 defines a four byte word */
|
|
typedef unsigned int UINT4;
|
|
|
|
/* BYTE defines a unsigned character */
|
|
typedef unsigned char BYTE;
|
|
|
|
#ifndef TRUE
|
|
#define FALSE 0
|
|
#define TRUE ( !FALSE )
|
|
#endif /* TRUE */
|
|
|
|
/* The structure for storing SHS info */
|
|
|
|
typedef struct
|
|
{
|
|
UINT4 digest[ 5 ]; /* Message digest */
|
|
UINT4 countLo, countHi; /* 64-bit bit count */
|
|
UINT4 data[ 16 ]; /* SHS data buffer */
|
|
int Endianness;
|
|
} SHA_CTX;
|
|
|
|
/* Message digest functions */
|
|
|
|
void SHAInit(SHA_CTX *);
|
|
void SHAUpdate(SHA_CTX *, const BYTE *buffer, int count);
|
|
void SHAFinal(BYTE *output, SHA_CTX *);
|
|
|
|
void endianTest(int *endianness);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|