@@ -510,7 +510,8 @@ TDECHashExtended = class(TDECHashAuthentication, IDECHashExtended)
510510 // / Number of bytes within the stream over which to calculate the hash value
511511 // / </param>
512512 // / <param name="HashResult">
513- // / In this byte array the calculated hash value will be returned
513+ // / In this byte array the calculated hash value will be returned. The
514+ // / array will be automatically sized suitably.
514515 // / </param>
515516 // / <param name="OnProgress">
516517 // / Optional callback routine. It can be used to display the progress of
@@ -1237,6 +1238,7 @@ class function TDECHashAuthentication.PBKDF2(const Password, Salt: TBytes; Itera
12371238 InnerKeyPad, OuterKeyPad: TBytes;
12381239 SaltEx, T, U, TrimmedKey: TBytes;
12391240begin
1241+ SetLength(Result, 0 );
12401242 Hash := TDECHashAuthenticationClass(self).Create;
12411243 try
12421244 // Setup needed parameters
@@ -1330,7 +1332,7 @@ class function TDECHashAuthentication.PBKDF2(const Password, Salt: TBytes; Itera
13301332
13311333class function TDECHashAuthentication.PBKDF2 (const Password, Salt: RawByteString; Iterations: Integer; KeyLength: Integer): TBytes;
13321334begin
1333- result := PBKDF2(BytesOf(Password), BytesOf(Salt), Iterations, KeyLength);
1335+ Result := PBKDF2(BytesOf(Password), BytesOf(Salt), Iterations, KeyLength);
13341336end ;
13351337
13361338{ TDECHashExtended }
0 commit comments