]>
cvs.zerfleddert.de Git - proxmark3-svn/blob - client/emv/test/cryptotest.c
b778d25629748d16837fde06e4d060e6bedd97a3
1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2017 Merlok
4 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
5 // at your option, any later version. See the LICENSE.txt file for the text of
7 //-----------------------------------------------------------------------------
8 // Crypto algorithms testing
9 //-----------------------------------------------------------------------------
11 #include "cryptotest.h"
17 #include "aes_cmac128.h"
22 #include "crypto_test.h"
27 int ExecuteCryptoTests(bool verbose
) {
29 bool TestFail
= false;
31 res
= mpi_self_test(verbose
);
32 if (res
) TestFail
= true;
34 res
= aes_self_test(verbose
);
35 if (res
) TestFail
= true;
37 res
= aes_cmac_self_test(verbose
);
38 if (res
) TestFail
= true;
40 res
= des_self_test(verbose
);
41 if (res
) TestFail
= true;
43 res
= sha1_self_test(verbose
);
44 if (res
) TestFail
= true;
46 res
= rsa_self_test(verbose
);
47 if (res
) TestFail
= true;
49 res
= exec_sda_test(verbose
);
50 if (res
) TestFail
= true;
52 res
= exec_dda_test(verbose
);
53 if (res
) TestFail
= true;
55 res
= exec_cda_test(verbose
);
56 if (res
) TestFail
= true;
58 res
= exec_crypto_test(verbose
);
59 if (res
) TestFail
= true;
61 PrintAndLog("\n--------------------------");
63 PrintAndLog("Test(s) [ERROR].");
65 PrintAndLog("Tests [OK].");