Search found 144 matches

Go to advanced search

by murray
Thu Jun 27, 2019 1:39 pm
Forum: Tips and Techniques
Topic: Anyone implemented a sha1 hash function?
Replies: 25
Views: 31620

Re: Anyone implemented a sha1 hash function?

Hi Stephen / @advaro, After a quick look at the openssl source it looks to me like EVP_MD is defined as 'struct ev_md_st'. By my count, there are 13 int s and 1 long in the struct. For 32-bit this would require 60 bytes. For 64-bit this would require 112 bytes. You have defined it as 72 bytes which,...
by murray
Thu Jun 27, 2019 9:13 am
Forum: Tips and Techniques
Topic: Anyone implemented a sha1 hash function?
Replies: 25
Views: 31620

Re: Anyone implemented a sha1 hash function?

Hi Stephen, Did you check and adjust the size of your evp_md variable to allow for 64 bit? Usually a structure will have some ints in it which need to be increased from 4 bytes to 8 bytes. I haven't dug down into the source files yet, but it would be important to find out what the size of the EVP_MD...
by murray
Fri Jun 21, 2019 8:40 pm
Forum: Tips and Techniques
Topic: Anyone implemented a sha1 hash function?
Replies: 25
Views: 31620

Re: Anyone implemented a sha1 hash function?

Hi Stephen, Sorry, I've been busy. You will see from this thread that I just used the SHA1 call and implemented the HMAC myself. There was a need for us to do it that way. There may be additional steps, such as initialising a keyblock, when you call the HMAC_SHA1. I know that is the case with the 3D...
by murray
Thu Jun 20, 2019 8:16 pm
Forum: Tips and Techniques
Topic: Anyone implemented a sha1 hash function?
Replies: 25
Views: 31620

Re: Anyone implemented a sha1 hash function?

Hi @advaro, To upgrade the 32-bit SHA1 library call to 64-bit simply requires changing the Integer parameter in the library call to Integer64. I think it is for the length, but I am at home and cannot access my code. The reason for this is that, for a 64-bit assembly, the libeay32 source is recompil...
by murray
Wed Mar 22, 2017 7:07 pm
Forum: Tips and Techniques
Topic: SHA-2 / SHA512 - tips anyone?
Replies: 11
Views: 16915

Re: SHA-2 / SHA512 - tips anyone?

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 th...
by murray
Mon Mar 20, 2017 7:24 pm
Forum: Tips and Techniques
Topic: SHA-2 / SHA512 - tips anyone?
Replies: 11
Views: 16915

Re: SHA-2 / SHA512 - tips anyone?

Murray I asked a similar question back in 2012 and you totally nailed it for me then too! I have one final hurdle, I'm almost certain the HMAC wrapper I have in Jade for sha1 was probably written by you back in 2012, I'm sure I need to tweak a new version of this for sha512, I assume the BLOCK_SIZE...
by murray
Mon Mar 20, 2017 7:06 pm
Forum: Tips and Techniques
Topic: SHA-2 / SHA512 - tips anyone?
Replies: 11
Views: 16915

Re: SHA-2 / SHA512 - tips anyone?

Make sure that your inputs are identical. I mean byte for byte. If you're sending strings to an online service it may use Unicode which is multiple bytes per character. Standard ANSI Jade is strictly one byte per character (as per ASCII coding). It only takes one bit difference to get a completely d...
by murray
Fri Mar 17, 2017 6:38 pm
Forum: Tips and Techniques
Topic: SHA-2 / SHA512 - tips anyone?
Replies: 11
Views: 16915

Re: SHA-2 / SHA512 - tips anyone?

Hi concord, I had a look at SHA-512, and did a trial implementation today. As I suspected, it's just a small change on SHA-256. Here's the external function definition: sha512(data: Binary; length: Integer64; digest: Binary[64] output) is "SHA512" in libeay32 applicationServerExecution; The 'applica...
by murray
Thu Mar 16, 2017 8:25 pm
Forum: Tips and Techniques
Topic: SHA-2 / SHA512 - tips anyone?
Replies: 11
Views: 16915

Re: SHA-2 / SHA512 - tips anyone?

@concord, I just found the definition for SHA256... sha256(data: Binary; length: Integer64; digest: Binary[32] output) is SHA256 in libeay32; I'm pretty sure I Haven't done SHA-512, but it should follow on from that. Just bear in mind that the output size of the SHA-512 hash digest is larger at 512 ...
by murray
Thu Mar 16, 2017 8:07 pm
Forum: Tips and Techniques
Topic: SHA-2 / SHA512 - tips anyone?
Replies: 11
Views: 16915

Re: SHA-2 / SHA512 - tips anyone?

I need to implement SHA512 within Jade. SHA1 was simple and has been working well for years... ExternalFunction sha1(data: Binary; length: Integer; digest: Binary[20] output) is SHA1 in libeay32; Any ideas for SHA-2 SHA512? Hi concord, I know I did the SHA-256 using libeay32 and that is working fin...

Go to advanced search