Good Morning,
I have an error with TAESGCM in the function EncryptAndGenerateFromFile.
The error is:
The function generates only an empty output file but not the tag file.
Is there any report about this issue?
Thank you in advice for your help.
Best regards
Federico
Bernard
(Bernard)
July 24, 2026, 11:21am
2
Hello Federico,
Can you provide some code?
Regards,
bernard
Hello Bernard,
I provide the code:
UnicodeString UCS_PathUNSecureWP = L"C:\\test\\S26.txt";
UnicodeString UCS_PathSecureWP = L"C:\\test\\secS26.mac";
UnicodeString UCS_PDA = L"C:\\test\\aad\\aad.aad";
UnicodeString UCS_GAT = L"C:\\test\\sec.tag";
UnicodeString UCS_KEY = L"12345678901234567890123456789012";
try {
AESGCM1->keyLength = TAESKeyLength::kl256;
AESGCM1->inputFormat = raw;
AESGCM1->outputFormat = raw;
AESGCM1->key = UCS_KEY;
AESGCM1->EncryptAndGenerateFromFile(UCS_PathUNSecureWP,UCS_PathSecureWP,UCS_PDA,UCS_GAT);
}
Also I found a difference on the files AESObj.pas and AESModes.pas for the function GCM_EncryptBinaryBuffer on the order of input elements.
AESObj.pas
AESModes.pas
Bernard
(Bernard)
July 24, 2026, 4:33pm
4
Two issues:
incorrect parameter order in err := FAESM.GCM_EncryptBinaryBuffer(inputBuffer, addData, outputBuffer, gcmKey, IV, tagBuffer, FTagSizeBits); <== this one is correct
all FileClose(f) shall be moved to the 'finally' section
This will be fixed in the next release if you don't want to fix it manually.