Returns the error code after an unsuccessful call to
AES256_Init
or AES256_InitHex
.
Public Declare Function AES256_InitError Lib "diCryptoSys.dll"
() As Long
nRet = AES256_InitError()
long __stdcall AES256_InitError(void);
None
Returns the error code from the last call to
AES256_Init
or AES256_InitHex
.
Dim hContext As Long Dim nRet As Long ' Try to initialise with an invalid key hContext = AES256_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 = AES256_InitHex("000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", _ ENCRYPT, "XXX", "0123456789abcdef0123456789abcdef") If hContext = 0 Then nRet = AES192_InitError() Debug.Print "AES192_InitHex failed (" & apiErrorLookup(nRet) & ")" End If
This should produce the output
AES256_InitHex failed (Invalid key) AES256_InitHex failed (Invalid mode)