freeotfecypherimpl.h

来自「文件驱动加密,功能强大,可产生加密分区,支持AES,MD2,MD4,MD5MD2」· C头文件 代码 · 共 88 行

H
88
字号
// Description: 
// By Sarah Dean
// Email: sdean12@sdean12.org
// WWW:   http://www.FreeOTFE.org/
//
// -----------------------------------------------------------------------------
//


// This file details the functions that the encryption algorithm MUST implement

#ifndef _FreeOTFECypherImpl_H
#define _FreeOTFECypherImpl_H   1

#include <ntstatus.h>  // Required for NTSTATUS
#include "FreeOTFECypherAPICommon.h"

#ifndef WINCE
#include <ntddk.h>
#include <ntverp.h>  // Needed for VER_PRODUCTBUILD
#endif
//xxx - junk - #include "FreeOTFECypherAPI.h"
//xxx - junk - #include "FreeOTFECypherDriver.h"

#if (VER_PRODUCTBUILD < 2600)
// Windows XP and later only had STATUS_CRYPTO_SYSTEM_INVALID
// If building for a previous OS, assume it's just an invalid parameter
#define STATUS_CRYPTO_SYSTEM_INVALID STATUS_INVALID_PARAMETER
#endif

// Cypher driver init function
// devExt - The device extension to have it's "Driver identification and
//          cyphers supported" members initialized
NTSTATUS
ImpCypherDriverExtDetailsInit(
    IN OUT  CYPHER_DRIVER_INFO* devExt
);


// Cypher driver cleardown function
// devExt - The device extension to have it's "Driver identification and
//          cyphers supported" members cleared down
NTSTATUS
ImpCypherDriverExtDetailsCleardown(
    IN OUT  CYPHER_DRIVER_INFO* devExt
);


// Encryption function
// Note: CyphertextLength must be set to the size of the CyphertextData buffer on
//       entry; on exit, this will be set to the size of the buffer used.
NTSTATUS
ImpCypherEncryptData(
    IN      GUID* CypherGUID,
    IN      int KeyLength,  // In bits
    IN      char *Key,
    IN      char *KeyASCII,  // ASCII representation of "Key"
    IN      int IVLength,  // In bits
    IN      char *IV,
    IN      int PlaintextLength,  // In bytes
    IN      char *PlaintextData,
    OUT     char *CyphertextData
);


// Decryption function
// Note: PlaintextLength must be set to the size of the PlaintextData buffer on
//       entry; on exit, this will be set to the size of the buffer used.
NTSTATUS
ImpCypherDecryptData(
    IN      GUID* CypherGUID,
    IN      int KeyLength,  // In bits
    IN      char *Key,
    IN      char *KeyASCII,  // ASCII representation of "Key"
    IN      int IVLength,  // In bits
    IN      char *IV,
    IN      int CyphertextLength,  // In bytes
    IN      char *CyphertextData,
    OUT     char *PlaintextData
);


// =========================================================================
// =========================================================================

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?