Closed fperana closed 7 months 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.
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.
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.
Closed as already implemented in some way and the proposed improvement fails the existing unit tests.
Added Result value initialization to TDECHashAuthentication.PBKDF2 and deleted workaround previously added to fix https://github.com/MHumm/DelphiEncryptionCompendium/issues/46