Thank you for your post.
I am able to replicate the issue. I have sent your post, along with a sample file, to our Development and Testing departments for review. When I receive any feedback, I will let you know.
Development says the hex you are decoding is not valid UTF-8 text, so HexDecode is munging the results since it thinks it is UTF-8 text. Therefore, change the calculation to:
HexEncode ( HexDecode( "969fbb94feb542b71ede6f87fe4d5fa29c789342b0f407474670f0c2489e0a0d" ; "data.bin" ) )
Thanks for the prompt reply.
I had come to the conclusion about UTF-8 with my tests but I think it's good to clarify what I was trying to do:
the process to sign an Amazon Web Services request requires to generate some Hex keys and they are non UTF-8 on purpose. The process in FileMaker using the BaseElements plugin looks like
kDate = BE_HMAC ( dateStamp ; "AWS4"&key ; BE_MessageDigestAlgorithm_SHA256 ; BE_Encoding_Hex ) ;
kRegion = BE_HMAC ( StringToHex( regionName ); kDate; BE_MessageDigestAlgorithm_SHA256 ; BE_Encoding_Hex ; BE_Encoding_Hex ) ;
with the key generated at each step containing non-UTF8 characters
The new function CryptAuthCode is supposed to do HMAC in a similar way, but the following doesn't return the same result as above
kDate = HexEncode( CryptAuthCode ( dateStamp ; "SHA256" ; "AWS4"&key ));
kRegion = HexEncode(CryptAuthCode ( HexEncode( regionName ) ; "SHA256"; HexDecode( kDate ; "data.bin" ) ) ) ;
the test values provided by Amazon are
key = 'wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY'
dateStamp = '20120215'
regionName = 'us-east-1'
and the intermediate results for testing are
kDate = '969fbb94feb542b71ede6f87fe4d5fa29c789342b0f407474670f0c2489e0a0d'
kRegion = '69daa0209cd9c5ff5c8ced464a696fd4252e981430b10e3d3fd8e2f197d7a70c'