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 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
| Minimum supported client | Windows 2000 Professional |
| Minimum supported server | Windows 2000 Server |
| Header | Wincrypt.h |
Send comments about this topic to Microsoft
Build date: 10/2/2009