Platform SDK: Cryptography

OffloadModExpo

The OffloadModExpo function offloads modular exponentiation from a CSP to a hardware accelerator.

BOOL WINAPI OffloadModExpo(
  BYTE *pbBase,    // in
  BYTE *pbExpo,    // in
  DWORD cbExpo,    // in
  BYTE *pbMod,     // in
  DWORD cbMod,     // in
  BYTE *pbResult,  // out
  void *pReserved, // reserved
  DWORD dwFlags    // in
);

Parameters

pbBase
Pointer to the base value to be exponentiated. The value is in little-endian form and the length (number of bytes in the value) must be the length passed in cbMod. The value must be padded with 0x00 bytes if the most significant byte does not have a bit set. This value must be less than the value passed in the pbMod parameter.
pbExpo
Pointer to the exponent the base value is to be raised to. The value is in little-endian form and the length (number of bytes in the value) must be the length passed in cbMod. The value must be padded with 0x00 bytes if the most significant byte does not have a bit set. This value must be less than the value passed in the pbMod parameter.
cbExpo
DWORD value representing the length of the exponent in bytes.
pbMod
Pointer to the modulus. The value is in little-endian form and the length (number of bytes in the value) must be the length passed in cbMod. The most significant byte of the modulus value must not be a 0x00 byte.
cbMod
DWORD value representing the length of the modulus in bytes.
pbResult
Pointer to the calculated result.
pReserved
This parameter is reserved for future use and is set to NULL.
dwFlags
This parameter is reserved for future use and is set to NULL.

Return Values

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. To retrieve extended error information, call GetLastError.

Remarks

A CSP will check in the registry for the value HKLM\Software\Microsoft\Cryptography\Offload\ExpoOffload that can be the name of a DLL. The CSP uses LoadLibrary to load that DLL and calls GetProcAddress to get the OffloadModExpo entry point. The CSP uses the entry point to perform all modular exponentiations for both public and private key operations.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 OSR2 or later (or Windows 95 with Internet Explorer 3.02 or later).
  Header: Declared in Wincrypt.h.