Hi, I have been trying to use CryptoGenerateHash from the CmpCrypto Implementation library. My code is taken almost directly from the CryptoDemo.project example provided on Codesys Forge, yet the CryptoGenerateHash function does not write to the address listed in pHash. RTS_IEC_RESULT is OK, but I am getting nothing out of the function. No errors either, all my libraries are up to date.
Any help would be appreicated!
PROGRAMPLC_PRGVARsMessage:MESSAGE:='The red fox runs across the ice';abyHashCode:HASH_CODE:=[16#52,16#ED,16#87,16#9E,16#70,16#F7,16#1D,16#92,16#6E,16#B6,16#95,16#70,16#08,16#E0,16#3C,16#E4,16#CA,16#69,16#45,16#D3];xMessageOK:BOOL;END_VARxMessageOK:=CheckMessage(sMessage,abyHashCode);
looks like your _hHash handle is "empty" (00000) at the breakpoint! I don't know if CryptoGetAlgorithmById(...) call in the VAR section is possible? would be good to know.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Unfortunately I noticed that, and tried:
* using CryptoGeteAlgorithmByID within the function call
* inputting the raw byte pointer as a testByte
* instantiating the _hHash handle within the function body
* using a different cryptoID or the raw DINT values from the RtsCryptoID DUT
... to no avail.
The pReturn value is also set to 0, which would indicate that it is OK, right? This is odd given that the function is the same within the CryptoDemo example project here, just with a newer version.
Is it possible that there is something wrong with the way my bytestring is being set up? I use the following DUTs here:
Hi, I have been trying to use CryptoGenerateHash from the CmpCrypto Implementation library. My code is taken almost directly from the CryptoDemo.project example provided on Codesys Forge, yet the CryptoGenerateHash function does not write to the address listed in pHash. RTS_IEC_RESULT is OK, but I am getting nothing out of the function. No errors either, all my libraries are up to date.
Any help would be appreicated!
looks like your _hHash handle is "empty" (00000) at the breakpoint! I don't know if CryptoGetAlgorithmById(...) call in the VAR section is possible? would be good to know.
Unfortunately I noticed that, and tried:
* using CryptoGeteAlgorithmByID within the function call
* inputting the raw byte pointer as a testByte
* instantiating the _hHash handle within the function body
* using a different cryptoID or the raw DINT values from the RtsCryptoID DUT
... to no avail.
The pReturn value is also set to 0, which would indicate that it is OK, right? This is odd given that the function is the same within the CryptoDemo example project here, just with a newer version.
Is it possible that there is something wrong with the way my bytestring is being set up? I use the following DUTs here:
Still unable to fix this - is anyone able to help?