TAESMAC/TAESGCM "KeyLength incorrect, must be 32" in v5.0.9.5

Hello,

I'm encountering an issue with the following code example from your TMSCryptographyPack.pdf documentation (§ AES MAC):

var 
  aesmac: TAESMAC; 
  tag: string; 
begin 
  aesmac := TAESMAC.Create; 
  aesmac.KeyLength := kl256; 
  aesmac.Key := '12345678901234567890123456789012'; 
  aesmac.TagSizeBits := 128; 
  aesmac.OutputFormat := hexa; 
  aesmac.Unicode := noUni; 
  tag := aesmac.Generate('test'); 
  aesmac.Free; 
end; 

This code produces the following error:

"KeyLength incorrect, must be 32"

This occurs under Delphi 11.3 and Delphi 12.3 (32-bit or 64 bit VCL) with version v5.0.9.5 of the Cryptography Pack.
The exact same code worked without issue in version 4.x.

Could you please clarify if this is a regression or if there’s been a change in how the KeyLength or Key property should be handled in version 5.x?

Same problem for TAESGCM

Thank you.

Solution provided in another thread (Issue with Decryption in TMSCryptography v5.0.9.5 (Error -208) - #2 by Bernard).