program LEA256Test; {$APPTYPE CONSOLE} uses System.SysUtils, System.Variants, System.Classes, LEA256; procedure Main(); var Keys: TLEA256Keys; var Block: TLEA256Block; var Context: TLEA256Context; begin Keys[0] := $3C2D1E0F; Keys[1] := $78695A4B; Keys[2] := $B4A59687; Keys[3] := $F0E1D2C3; Keys[4] := $C3D2E1F0; Keys[5] := $8796A5B4; Keys[6] := $4B5A6978; Keys[7] := $0F1E2D3C; Block[0] := $33323130; Block[1] := $37363534; Block[2] := $3B3A3938; Block[3] := $3F3E3D3C; LEA256_Initialize(Context, Keys); LEA256_Encrypt(Context, Block); if (Block[0] = $F6AF51D6) and (Block[1] = $C189B147) and (Block[2] = $CA00893A) and (Block[3] = $97E1F927) then begin WriteLn('Encrypt = OK.'); end else begin WriteLn('Encrypt = N/A.'); end; LEA256_Decrypt(Context, Block); if (Block[0] = $33323130) and (Block[1] = $37363534) and (Block[2] = $3B3A3938) and (Block[3] = $3F3E3D3C) then begin WriteLn('Decrypt = OK.'); end else begin WriteLn('Decrypt = N/A.'); end; LEA256_Burn(Context); ReadLn; end; begin Main; end.