MHumm / DelphiEncryptionCompendium

Cryptographic library for Embarcadero Delphi and potentially for FPC as well
Apache License 2.0
255 stars 66 forks source link

Fix Result value initialization #55

Closed fperana closed 7 months ago

fperana commented 1 year ago

Added Result value initialization to TDECHashAuthentication.PBKDF2 and deleted workaround previously added to fix https://github.com/MHumm/DelphiEncryptionCompendium/issues/46

fperana commented 1 year ago

Sorry I didn't realize that the development branch already has the initialization of Result variable at the beginning. So the only mod that can be applied to streamline the code is removing of:

      if (I = 1) then
        Result := Copy(T)
      else

which is no longer needed.

MHumm commented 1 year ago

I just tried to remove these three lines, but rerunning the existing unit tests shows, that the Test_THashPBKDF2.TestBug46 one fails then. So I shouldn't do this I guess.

MHumm commented 9 months ago

I will close this pull request, as the initialization has been implemented (in a different way though) and the removal of the code proposed to get removed cannot be done as otherwise the unit test for this report fails: https://github.com/MHumm/DelphiEncryptionCompendium/issues/46

So that branch of the if is actually needed.

MHumm commented 7 months ago

Closed as already implemented in some way and the proposed improvement fails the existing unit tests.