49 lines
1.0 KiB
C
49 lines
1.0 KiB
C
//#pragma once
|
|
#ifndef BS_DefineH
|
|
#define BS_DefineH
|
|
|
|
#include "time.h"
|
|
|
|
#define CONST const
|
|
|
|
typedef wchar_t WCHAR;
|
|
|
|
typedef WCHAR* PWCHAR, * LPWCH, * PWCH;
|
|
typedef CONST WCHAR* LPCWCH, * PCWCH;
|
|
|
|
typedef __int64 LONGLONG;
|
|
typedef unsigned char BYTE;
|
|
typedef unsigned int DWORD;
|
|
|
|
#define BUF_SIZE 65536
|
|
#define SHA256_BLOCK_SIZE 32 // SHA256 outputs a 32 byte digest. in sha256.h
|
|
#define ENC_SIG "ToCSG"
|
|
#define PASS_HEAD "BSCrypto@230320H"
|
|
|
|
#define BS_SUCCESS 0x0001
|
|
#define BS_ERROR_CRYPTO_SELFTEST_FAILED 0x0002
|
|
#define BS_ERROR_STATE_IN_ERROR 0x0003
|
|
#define BS_ERROR_OPEN_FILE 0x0004
|
|
#define BS_ERROR_CREATE_FILE 0x0005
|
|
#define BS_ERROR_INVALID_ENC_FILE 0x0006
|
|
#define BS_ERROR_DECRYPT_FILE 0x0007
|
|
#define BS_ERROR_INIT 0x0008
|
|
|
|
#define BS_STATE_NONE 0
|
|
#define BS_STATE_INIT 0x0001
|
|
#define BS_STATE_ENC 0x0002
|
|
#define BS_STATE_DEC 0x0003
|
|
|
|
#define DLL_EXPORT __declspec(dllexport)
|
|
|
|
typedef struct _BSCryptoHead
|
|
{
|
|
int nHeadLen;
|
|
LONGLONG llSize;
|
|
time_t tTime;
|
|
char sReserve[232];
|
|
BYTE pOrgHash[SHA256_BLOCK_SIZE];
|
|
} BSCryptoHead, *PBSCryptoHead;
|
|
|
|
#endif
|