Jump to content

Slow MD5


Recommended Posts

On 8/30/2024 at 7:44 PM, Rolf Kalbermatter said:

This function exists in LabVIEW since about at least 5.0 or thereabout and likely has never been looked at again since, other than use it.

For an odd reason I don't see such a function in LabVIEW 5.x, 6.x and 7.x. It appears only in 8.2, maybe it's available since 8.0 too, can't check right now. Well, I ran a quick binary search for "GetMD5Digest" word and found, that such a function was being used in ...\LabVIEW 8.2\vi.lib\imath\engines\lvmath\Utility\MD5.vi. That VI was password-protected, the password was calvinthegorilla (😁) and, of course, was removed like 1-2-3. Here's the VI to play:

MD5_8_2.vi

2024-09-01_1-25-31.jpg.5d6e3a55ff8cd6bf635258c776ee78f5.jpg

2024-09-01_1-25-43.jpg.f1317611b69b68709b029ac335faff01.jpg

As shown, the prototype is still correct, just some extra "secret" / key was applied. Works well in LV 2023 Q3 64-bit.

  • Thanks 1
Link to comment
6 hours ago, dadreamer said:

As shown, the prototype is still correct, just some extra "secret" / key was applied. Works well in LV 2023 Q3 64-bit.

You, Sir, are a hero!

I've seen that "super secret" string in the binary code, but didn't have a clue what that meant....

Anyhow, a quick benchmark shows an order of magnitude better performance compared to the G code for large block sizes! (Run several times, of course, with similar results, so it's not a fluke..)

image.png.7d8fb6d9b39f2e43b64100b582a5f9bc.png

The G code is exactly the vi.lib implementation but consolidated into a single VI and the output is a raw 16-byte string (not converting to a hex string, though it's irrelevant here because it's only called once).

For smaller block sizes, the performance is getting closer, but the function call is still several times faster (but have to properly benchmark it with with many calls in a loop for short blocks). So now it looks not completely unreasonable to poke around in the attic...

Edited by Novgorod
Link to comment

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.