Returns the error code after an unsuccessful call to
AES192_Init or AES192_InitHex.
Public Declare Function AES192_InitError Lib "diCryptoSys.dll"
() As Long
nRet = AES192_InitError()
long __stdcall AES192_InitError(void);
None
Returns the error code from the last call to
AES192_Init or AES192_InitHex.
Dim hContext As Long
Dim nRet As Long
' Try to initialise with an invalid key
hContext = AES192_InitHex("THIS IS NOT HEX!", ENCRYPT, _
"CBC", "0123456789abcdef0123456789abcdef")
If hContext = 0 Then
nRet = AES192_InitError()
Debug.Print "AES192_InitHex failed (" & apiErrorLookup(nRet) & ")"
End If
' Try with an invalid mode
hContext = AES192_InitHex("000102030405060708090a0b0c0d0e0f1011121314151617", _
ENCRYPT, "XXX", "0123456789abcdef0123456789abcdef")
If hContext = 0 Then
nRet = AES192_InitError()
Debug.Print "AES192_InitHex failed (" & apiErrorLookup(nRet) & ")"
End If
This should produce the output
AES192_InitHex failed (Invalid key) AES192_InitHex failed (Invalid mode)