From f716a97c0ef6757b08c1695a2662fca8c5cb62e3 Mon Sep 17 00:00:00 2001 From: Markus Humm Date: Wed, 8 May 2024 20:17:23 +0200 Subject: [PATCH] Corrected wrong XMLDOC comment for IFiller parameter of Init method Part of issue #72 --- Source/DECCipherBase.pas | 37 +++++++++++++++-------------------- Source/DECCipherInterface.pas | 35 ++++++++++++++------------------- 2 files changed, 31 insertions(+), 41 deletions(-) diff --git a/Source/DECCipherBase.pas b/Source/DECCipherBase.pas index 72b864ed..417f1e23 100644 --- a/Source/DECCipherBase.pas +++ b/Source/DECCipherBase.pas @@ -480,10 +480,9 @@ TDECCipher = class(TDECObject) /// Size of the initialization vector in bytes /// /// - /// optional parameter defining the value with which the last block will - /// be filled up if the size of the data to be processed cannot be divided - /// by block size without reminder. Means: if the last block is not - /// completely filled with data. + /// Optional parameter defining the value with which the initialization + /// vector is prefilled. So it will contain something defined in any unused + /// bytes if a value shorter than the required IV size is given for the IV. /// procedure Init(const Key; Size: Integer; const IVector; IVectorSize: Integer; IFiller: Byte = $FF); overload; /// @@ -501,10 +500,9 @@ TDECCipher = class(TDECObject) /// Mode property /// /// - /// optional parameter defining the value with which the last block will - /// be filled up if the size of the data to be processed cannot be divided - /// by block size without reminder. Means: if the last block is not - /// completely filled with data. + /// Optional parameter defining the value with which the initialization + /// vector is prefilled. So it will contain something defined in any unused + /// bytes if a value shorter than the required IV size is given for the IV. /// procedure Init(const Key: TBytes; const IVector: TBytes; IFiller: Byte = $FF); overload; /// @@ -522,10 +520,9 @@ TDECCipher = class(TDECObject) /// Mode property /// /// - /// optional parameter defining the value with which the last block will - /// be filled up if the size of the data to be processed cannot be divided - /// by block size without reminder. Means: if the last block is not - /// completely filled with data. + /// Optional parameter defining the value with which the initialization + /// vector is prefilled. So it will contain something defined in any unused + /// bytes if a value shorter than the required IV size is given for the IV. /// procedure Init(const Key: RawByteString; const IVector: RawByteString = ''; IFiller: Byte = $FF); overload; {$IFDEF ANSISTRINGSUPPORTED} @@ -545,10 +542,9 @@ TDECCipher = class(TDECObject) /// Mode property /// /// - /// optional parameter defining the value with which the last block will - /// be filled up if the size of the data to be processed cannot be divided - /// by block size without reminder. Means: if the last block is not - /// completely filled with data. + /// Optional parameter defining the value with which the initialization + /// vector is prefilled. So it will contain something defined in any unused + /// bytes if a value shorter than the required IV size is given for the IV. /// procedure Init(const Key: AnsiString; const IVector: AnsiString = ''; IFiller: Byte = $FF); overload; {$ENDIF} @@ -569,10 +565,9 @@ TDECCipher = class(TDECObject) /// Mode property /// /// - /// optional parameter defining the value with which the last block will - /// be filled up if the size of the data to be processed cannot be divided - /// by block size without reminder. Means: if the last block is not - /// completely filled with data. + /// Optional parameter defining the value with which the initialization + /// vector is prefilled. So it will contain something defined in any unused + /// bytes if a value shorter than the required IV size is given for the IV. /// procedure Init(const Key: WideString; const IVector: WideString = ''; IFiller: Byte = $FF); overload; {$ENDIF} @@ -979,7 +974,7 @@ procedure TDECCipher.Init(const Key; Size: Integer; const IVector; IVectorSize: if (IVectorSize > 0) then Move(IVector, OriginalInitVector[0], IVectorSize); - // GCM needs same treatment as empty IV even if IV specified + // GCM needs same treatment of empty IV even if IV specified if (IVectorSize = 0) or (FMode = cmGCM) then begin DoEncode(FInitializationVector, FInitializationVector, FBufferSize); diff --git a/Source/DECCipherInterface.pas b/Source/DECCipherInterface.pas index bfb611de..5681581c 100644 --- a/Source/DECCipherInterface.pas +++ b/Source/DECCipherInterface.pas @@ -484,10 +484,9 @@ interface /// Size of the initialization vector in bytes /// /// - /// optional parameter defining the value with which the last block will - /// be filled up if the size of the data to be processed cannot be divided - /// by block size without reminder. Means: if the last block is not - /// completely filled with data. + /// Optional parameter defining the value with which the initialization + /// vector is prefilled. So it will contain something defined in any unused + /// bytes if a value shorter than the required IV size is given for the IV. /// procedure Init(const Key; Size: Integer; const IVector; IVectorSize: Integer; IFiller: Byte = $FF); overload; /// @@ -505,10 +504,9 @@ interface /// Mode property /// /// - /// optional parameter defining the value with which the last block will - /// be filled up if the size of the data to be processed cannot be divided - /// by block size without reminder. Means: if the last block is not - /// completely filled with data. + /// Optional parameter defining the value with which the initialization + /// vector is prefilled. So it will contain something defined in any unused + /// bytes if a value shorter than the required IV size is given for the IV. /// procedure Init(const Key: TBytes; const IVector: TBytes; IFiller: Byte = $FF); overload; /// @@ -526,10 +524,9 @@ interface /// Mode property /// /// - /// optional parameter defining the value with which the last block will - /// be filled up if the size of the data to be processed cannot be divided - /// by block size without reminder. Means: if the last block is not - /// completely filled with data. + /// Optional parameter defining the value with which the initialization + /// vector is prefilled. So it will contain something defined in any unused + /// bytes if a value shorter than the required IV size is given for the IV. /// procedure Init(const Key: RawByteString; const IVector: RawByteString = ''; IFiller: Byte = $FF); overload; {$IFDEF ANSISTRINGSUPPORTED} @@ -549,10 +546,9 @@ interface /// Mode property /// /// - /// optional parameter defining the value with which the last block will - /// be filled up if the size of the data to be processed cannot be divided - /// by block size without reminder. Means: if the last block is not - /// completely filled with data. + /// Optional parameter defining the value with which the initialization + /// vector is prefilled. So it will contain something defined in any unused + /// bytes if a value shorter than the required IV size is given for the IV. /// procedure Init(const Key: AnsiString; const IVector: AnsiString = ''; IFiller: Byte = $FF); overload; {$ENDIF} @@ -573,10 +569,9 @@ interface /// Mode property /// /// - /// optional parameter defining the value with which the last block will - /// be filled up if the size of the data to be processed cannot be divided - /// by block size without reminder. Means: if the last block is not - /// completely filled with data. + /// Optional parameter defining the value with which the initialization + /// vector is prefilled. So it will contain something defined in any unused + /// bytes if a value shorter than the required IV size is given for the IV. /// procedure Init(const Key: WideString; const IVector: WideString = ''; IFiller: Byte = $FF); overload; {$ENDIF}