This repository has been archived by the owner on Apr 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
SelfTest.dpr
86 lines (81 loc) · 1.62 KB
/
SelfTest.dpr
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
program SelfTest;
{$apptype console}
uses
SysUtils, Classes,
DCPbase64,
DCPblockciphers,
DCPconst,
DCPcrypt2,
DCPblowfish,
DCPcast128,
DCPcast256,
DCPdes,
DCPgost,
DCPice,
DCPidea,
DCPmars,
DCPmisty1,
DCPrc2,
DCPrc4,
DCPrc5,
DCPrc6,
DCPrijndael,
DCPtea,
DCPtwofish,
DCPhaval,
DCPmd4,
DCPmd5,
DCPripemd128,
DCPripemd160,
DCPsha1,
DCPtiger,
DCPreg,
DCPserpent,
DCPsha256,
DCPsha512;
type
TDCPHashClass = class of TDCP_hash;
TDCPCipherClass = class of TDCP_cipher;
procedure TestHash(HashClass: TDCPHashClass);
begin
if not HashClass.SelfTest then
Writeln(Format('Self-test failed: %s', [HashClass.GetAlgorithm]));
end;
procedure TestCipher(CipherClass: TDCPCipherClass);
begin
if not CipherClass.SelfTest then
Writeln(Format('Self-test failed: %s', [CipherClass.GetAlgorithm]));
end;
begin
TestHash(TDCP_haval);
TestHash(TDCP_md4);
TestHash(TDCP_md5);
TestHash(TDCP_ripemd128);
TestHash(TDCP_ripemd160);
TestHash(TDCP_sha1);
TestHash(TDCP_sha256);
TestHash(TDCP_sha384);
TestHash(TDCP_sha512);
TestHash(TDCP_tiger);
TestCipher(TDCP_blowfish);
TestCipher(TDCP_cast128);
TestCipher(TDCP_cast256);
TestCipher(TDCP_des);
TestCipher(TDCP_3des);
TestCipher(TDCP_gost);
TestCipher(TDCP_ice);
TestCipher(TDCP_thinice);
TestCipher(TDCP_ice2);
TestCipher(TDCP_idea);
TestCipher(TDCP_mars);
TestCipher(TDCP_misty1);
TestCipher(TDCP_rc2);
TestCipher(TDCP_rc4);
TestCipher(TDCP_rc5);
TestCipher(TDCP_rc6);
TestCipher(TDCP_rijndael);
TestCipher(TDCP_serpent);
TestCipher(TDCP_tea);
TestCipher(TDCP_twofish);
Writeln('Done.');
end.