📄 contman.h
字号:
// first parameter of the call. The function checks in the
// registry to see if an offload module has been registered.
// If a module is registered then it loads the module
// and gets the OffloadModExpo function pointer.
//
BOOL InitExpOffloadInfo(
IN OUT PEXPO_OFFLOAD_STRUCT *ppExpoOffloadInfo
);
//
// Function : ModularExpOffload
//
// Description : This function does the offloading of modular exponentiation.
// The function takes a pointer to Offload Information as the
// first parameter of the call. If this pointer is not NULL
// then the function will use this module and call the function.
// The exponentiation with MOD function will implement
// Y^X MOD P where Y is the buffer pbBase, X is the buffer
// pbExpo and P is the buffer pbModulus. The length of the
// buffer pbExpo is cbExpo and the length of pbBase and
// pbModulus is cbModulus. The resulting value is output
// in the pbResult buffer and has length cbModulus.
// The pReserved and dwFlags parameters are currently ignored.
// If any of these functions fail then the function fails and
// returns FALSE. If successful then the function returns
// TRUE. If the function fails then most likely the caller
// should fall back to using hard linked modular exponentiation.
//
BOOL ModularExpOffload(
IN PEXPO_OFFLOAD_STRUCT pOffloadInfo,
IN BYTE *pbBase,
IN BYTE *pbExpo,
IN DWORD cbExpo,
IN BYTE *pbModulus,
IN DWORD cbModulus,
OUT BYTE *pbResult,
IN VOID *pReserved,
IN DWORD dwFlags
);
#ifdef USE_HW_RNG
#ifdef _M_IX86
// stuff for INTEL RNG usage
//
// Function : GetRNGDriverHandle
//
// Description : Gets the handle to the INTEL RNG driver if available, then
// checks if the chipset supports the hardware RNG. If so
// the previous driver handle is closed if necessary and the
// new handle is assigned to the passed in parameter.
//
BOOL GetRNGDriverHandle(
IN OUT HANDLE *phDriver
);
//
// Function : CheckIfRNGAvailable
//
// Description : Checks if the INTEL RNG driver is available, if so then
// checks if the chipset supports the hardware RNG.
//
BOOL CheckIfRNGAvailable();
//
// Function : HWRNGGenRandom
//
// Description : Uses the passed in handle to the INTEL RNG driver
// to fill the buffer with random bits. Actually uses
// XOR to fill the buffer so that the passed in buffer
// is also mixed in.
//
unsigned int
HWRNGGenRandom(
IN HANDLE hRNGDriver,
IN OUT BYTE *pbBuffer,
IN DWORD dwLen
);
#ifdef TEST_HW_RNG
//
// Function : SetupHWRNGIfRegistered
//
// Description : Checks if there is a registry setting indicating the HW RNG
// is to be used. If the registry entry is there then it attempts
// to get the HW RNG driver handle.
//
BOOL SetupHWRNGIfRegistered(
OUT HANDLE *phRNGDriver
);
#endif // TEST_HW_RNG
#endif // _M_IX86
#endif // USE_HW_RNG
#if DBG // NOTE: This section not compiled for retail builds
void CSPDebugOutputAcqCtxt(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV *phProv,
IN CHAR *pUserID,
IN DWORD dwFlags,
IN PVTableProvStruc pVTable
);
void CSPDebugOutputReleaseCtxt(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN DWORD dwFlags
);
void CSPDebugOutputSetProvParam(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN DWORD dwParam,
IN BYTE *pbData,
IN DWORD dwFlags
);
void CSPDebugOutputGetProvParam(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN DWORD dwParam,
IN BYTE *pbData,
IN DWORD *pdwDataLen,
IN DWORD dwFlags
);
void CSPDebugOutputDeriveKey(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN ALG_ID Algid,
IN HCRYPTHASH hHash,
IN DWORD dwFlags,
IN HCRYPTKEY *phKey
);
void CSPDebugOutputDestroyKey(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTKEY hProv,
IN HCRYPTKEY hKey
);
void CSPDebugOutputGenKey(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTKEY hProv,
IN ALG_ID Algid,
IN DWORD dwFlags,
IN HCRYPTKEY *phKey
);
void CSPDebugOutputGetKeyParam(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN HCRYPTKEY hKey,
IN DWORD dwParam,
IN BYTE *pbData,
IN DWORD *pdwDataLen,
IN DWORD dwFlags
);
void CSPDebugOutputGetUserKey(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN DWORD dwKeySpec,
IN HCRYPTKEY *phKey
);
void CSPDebugOutputSetKeyParam(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN HCRYPTKEY hKey,
IN DWORD dwParam,
IN BYTE *pbData,
IN DWORD dwFlags
);
void CSPDebugOutputGenRandom(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN DWORD dwLen,
IN BYTE *pbBuffer
);
void CSPDebugOutputExportKey(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN HCRYPTKEY hKey,
IN HCRYPTKEY hExpKey,
IN DWORD dwBlobType,
IN DWORD dwFlags,
IN BYTE *pbData,
IN DWORD *pdwDataLen
);
void CSPDebugOutputImportKey(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN BYTE *pbData,
IN DWORD dwDataLen,
IN HCRYPTKEY hImpKey,
IN DWORD dwFlags,
IN HCRYPTKEY *phKey
);
void CSPDebugOutputDuplicateKey(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN HCRYPTKEY hKey,
IN DWORD *pdwReserved,
IN DWORD dwFlags,
IN HCRYPTKEY *phKey
);
void CSPDebugOutputGetHashParam(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN HCRYPTHASH hHash,
IN DWORD dwParam,
IN BYTE *pbData,
IN DWORD *pdwDataLen,
IN DWORD dwFlags
);
void CSPDebugOutputSetHashParam(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN HCRYPTHASH hHash,
IN DWORD dwParam,
IN BYTE *pbData,
IN DWORD dwFlags
);
void CSPDebugOutputEncrypt(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN HCRYPTHASH hKey,
IN HCRYPTHASH hHash,
IN BOOL Final,
IN DWORD dwFlags,
IN BYTE *pbData,
IN DWORD *pdwDataLen,
IN DWORD dwBufLen
);
void CSPDebugOutputDecrypt(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN HCRYPTHASH hKey,
IN HCRYPTHASH hHash,
IN BOOL Final,
IN DWORD dwFlags,
IN BYTE *pbData,
IN DWORD *pdwDataLen
);
void CSPDebugOutputSignHash(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN HCRYPTHASH hHash,
IN DWORD dwKeySpec,
IN LPCWSTR pszDescription,
IN DWORD dwFlags,
IN BYTE *pbSignature,
IN DWORD *pdwSigLen
);
void CSPDebugOutputVerifySignature(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN HCRYPTHASH hHash,
IN BYTE *pbSignature,
IN DWORD dwSigLen,
IN HCRYPTKEY hPubKey,
IN LPCWSTR pszDescription,
IN DWORD dwFlags
);
void CSPDebugOutputCreateHash(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN ALG_ID Algid,
IN HCRYPTKEY hKey,
IN DWORD dwFlags,
IN HCRYPTHASH *phHash
);
void CSPDebugOutputDestroyHash(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN HCRYPTHASH hHash
);
void CSPDebugOutputHashData(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN HCRYPTHASH hHash,
IN BYTE *pbData,
IN DWORD dwDataLen,
IN DWORD dwFlags
);
void CSPDebugOutputHashSessionKey(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN HCRYPTHASH hHash,
IN HCRYPTKEY hKey,
IN DWORD dwFlags
);
void CSPDebugOutputDuplicateHash(
IN BOOL fEnter,
IN BOOL fReturn,
IN HCRYPTPROV hProv,
IN HCRYPTHASH hHash,
IN DWORD *pdwReserved,
IN DWORD dwFlags,
IN HCRYPTHASH *phHash
);
#endif // DBG -- NOTE: This section not compiled for retail builds
#ifdef __cplusplus
}
#endif
#endif // __CONTMAN_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -