var
AES: TCipher_Rijndael;
var
key128 :
array[0..15]
of byte = ($2b,$7e,$15,$16,$28,$ae,$d2,$a6,
$ab,$f7,$15,$88,$09,$cf,$4f,$3c);
IV :
array[0..15]
of byte = ($00,$01,$02,$03,$04,$05,$06,$07,
$08,$09,$0a,$0b,$0c,$0d,$0e,$0f);
plain :
array[0..63]
of byte = ($6b,$c1,$be,$e2,$2e,$40,$9f,$96,
$e9,$3d,$7e,$11,$73,$93,$17,$2a,
$ae,$2d,$8a,$57,$1e,$03,$ac,$9c,
$9e,$b7,$6f,$ac,$45,$af,$8e,$51,
$30,$c8,$1c,$46,$a3,$5c,$e4,$11,
$e5,$
fb,$c1,$19,$1a,$0a,$52,$ef,
$f6,$9f,$24,$45,$
df,$4f,$9b,$17,
$ad,$2b,$41,$7b,$e6,$6c,$37,$10);
ct_cbc :
array[0..63]
of byte = ($76,$49,$ab,$ac,$81,$19,$b2,$46,
$ce,$e9,$8e,$9b,$12,$e9,$19,$7d,
$50,$86,$cb,$9b,$50,$72,$19,$ee,
$95,$
db,$11,$3a,$91,$76,$78,$b2,
$73,$be,$d6,$b8,$e3,$c1,$74,$3b,
$71,$16,$e6,$9e,$22,$22,$95,$16,
$3f,$f1,$ca,$a1,$68,$1f,$ac,$09,
$12,$0e,$ca,$30,$75,$86,$e1,$a7);
var
ct:
array[0..63]
of byte;
procedure TestCBC;
begin
AES.Mode := cmCBC;
AES.Init(key128,16,@IV);
AES.EncodeBuffer(plain,ct,sizeof(plain));
end;