OffloadModExpo function

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

Syntax

BOOL WINAPI OffloadModExpo(
  _In_  BYTE  *pbBase,
  _In_  BYTE  *pbExpo,
  _In_  DWORD cbExpo,
  _In_  BYTE  *pbMod,
  _In_  DWORD cbMod,
  _Out_ BYTE  *pbResult,
  _In_  void  *pReserved,
  _In_  DWORD dwFlags
);

Parameters

  • pbBase [in]
    A pointer to the base value to be raised by the exponent. 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 [in]
    A 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 [in]
    DWORD value representing the length of the exponent in bytes.

  • pbMod [in]
    A 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 [in]
    DWORD value representing the length of the modulus in bytes.

  • pbResult [out]
    A pointer to the calculated result.

  • pReserved [in]
    This parameter is reserved for future use and is set to NULL.

  • dwFlags [in]
    This parameter is reserved for future use and is set to NULL.

Return value

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 HKEY_LOCAL_MACHINE\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

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Wincrypt.h