freeotfehashapicommon.h
来自「文件驱动加密,功能强大,可产生加密分区,支持AES,MD2,MD4,MD5MD2」· C头文件 代码 · 共 114 行
H
114 行
// Description: FreeOTFE Hash Device Driver API
// By Sarah Dean
// Email: sdean12@sdean12.org
// WWW: http://www.FreeOTFE.org/
//
// -----------------------------------------------------------------------------
//
#ifndef _FreeOTFEHashAPITypes_H
#define _FreeOTFEHashAPITypes_H 1
#ifdef WINCE
#include <WinDef.h> // Required for ULONG
#else
#include <ntdef.h> // Required for ULONG and GUID
#endif
// =========================================================================
// Const definitions
#define MAX_HASH_TITLE 256
// Maximum hash length
// This should be set to the MAXIMUM hash length that the any hash may generate.
// This const is used when generating sector IVs for volumes which use the hash
// of the sector ID as the sector IV. It is used then in order to allocate a suitably sized
// buffer before hashing the sector ID.
// Note: This value is in *bits*
#define FREEOTFE_MAX_HASH_LENGTH 1024
// =========================================================================
// Type definitions
typedef struct _HASH {
GUID HashGUID;
char Title[MAX_HASH_TITLE];
ULONG VersionID;
int Length; // In bits
int BlockSize; // In bits
} HASH, *PHASH;
typedef struct _HASH_DRIVER_INFO {
// Identification...
GUID DriverGUID;
char DriverTitle[MAX_HASH_TITLE];
ULONG DriverVersionID;
// Hashes supported...
unsigned int HashCount;
HASH* HashDetails; // This is a *pointer* to an *array* of "HashCount"
// HASH structures
} HASH_DRIVER_INFO, *PHASH_DRIVER_INFO;
typedef struct _DIOC_HASH_IDENTIFYDRIVER {
GUID DriverGUID;
char Title[MAX_HASH_TITLE];
ULONG VersionID;
unsigned int CountHashes;
} DIOC_HASH_IDENTIFYDRIVER, *PDIOC_HASH_IDENTIFYDRIVER;
typedef struct _DIOC_HASH_IDENTIFYSUPPORTED {
unsigned int BufCount; // The number of *elements* in the "Hashes" array
HASH Hashes[1]; // Variable length
} DIOC_HASH_IDENTIFYSUPPORTED, *PDIOC_HASH_IDENTIFYSUPPORTED;
typedef struct _DIOC_HASH_DATA_IN {
GUID HashGUID;
unsigned int DataLength; // In bits
unsigned char Data[1]; // Variable length
} DIOC_HASH_DATA_IN, *PDIOC_HASH_DATA_IN;
// IF THIS IS CHANGED - remember to change the definition of how
// "userBufferSizeBytes" is calculated
typedef struct _DIOC_HASH_DATA_OUT {
unsigned int HashLength; // In bits
unsigned char Hash[1]; // Variable length
} DIOC_HASH_DATA_OUT, *PDIOC_HASH_DATA_OUT;
// This definition must be kept in sync with "ImpHashHashData"
typedef NTSTATUS (* PDataHashFn)(
GUID*,
unsigned int,
unsigned char*,
unsigned int*,
unsigned char*
);
// This definition must be kept in sync with "GetHashDetails"
typedef NTSTATUS (* PHashDetailsFn)(
GUID*,
HASH*
);
typedef struct _DIOC_HASH_INTLDETAILS {
PHashDetailsFn FnHashDetails;
PDataHashFn FnHash;
} DIOC_HASH_INTLDETAILS, *PDIOC_HASH_INTLDETAILS;
// =========================================================================
// =========================================================================
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?