SHA-2 / SHA512 - tips anyone?

Forums for specific tips, techniques and example code
concord
Posts: 47
Joined: Wed Mar 23, 2011 2:07 pm

Re: SHA-2 / SHA512 - tips anyone?

Postby concord » Wed Mar 22, 2017 9:05 am

Oops, got it working on Jade7.0, then realised I shouldn't use an Integer64 parameter on Jade6.3 (32bit) system.

Thanks so much for all your help, with a bit of luck I'm hoping to be able to follow your tips and generate the HMAC function, then I'm away :D

murray
Posts: 144
Joined: Fri Aug 14, 2009 6:58 pm
Location: New Plymouth, New Zealand

Re: SHA-2 / SHA512 - tips anyone?

Postby murray » Wed Mar 22, 2017 7:07 pm

Good work! I was about to suggest that you check the length parameter. My short example had neither applicationServerExecution or presentationClientExecution, and was written on Jade 7.0 64-bit.

After a quick revision on HMAC it would seem that the block size is tied to the internal block size of the hash function. So SHA-512 has twice the block size of SHA-256. I would expect that everything gets scaled accordingly. Keys shorter than the block size are always padded to fill exactly one block with zeros. The inner padding #[36 36 36...36 36] and outer padding #[5C 5C 5C 5C...5C 5C] will have to be scaled to the bigger block size. However, you should check what specification you are writing to, in case there's any variation on that.
Murray (N.Z.)


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 11 guests