Exemple #1
0
int TestApp::main()
{
	// Create a console window for text-output if not available
	ConsoleWindow console("Console");

	try
	{
		Console::write_line("ClanLib Test Suite:");
		Console::write_line("-------------------");
#ifdef WIN32
		Console::write_line("Target: WIN32");
#else
		Console::write_line("Target: LINUX");
#endif
		Console::write_line("Directory: API/Core/Math");

		test_md5();
		test_rsa();
		test_aes128();
		test_aes192();
		test_aes256();
		test_sha1();
		test_sha224();
		test_sha256();
		test_sha384();
		test_sha512();
		test_sha512_224();
		test_sha512_256();

		Console::write_line("All Tests Complete");
		console.display_close_message();
	}

	catch(Exception error)
	{
		Console::write_line("Exception caught:");
		Console::write_line(error.message);
		console.display_close_message();
		return -1;
	}

	return 0;
}
int wmain(int argc, wchar_t *argv[])
{
#if !defined(SMALL_CODE) || !defined(_M_X64)
	printf("VIA-Padlock support: %d\n", aes256_padlock_available());
#endif
#ifndef SMALL_CODE
	printf("AES-NI support: %d\n", xts_aes_ni_available());
	printf("SSE2 support: %d\n", xts_serpent_sse2_available());
	printf("AVX  support: %d\n", xts_serpent_avx_available());
	printf("crc32: %d\n", test_crc32());
#endif	
	printf("sha512: %d\n", test_sha512());
	printf("pkcs5: %d\n", test_pkcs5());
	printf("Aes-256: %d\n", test_aes256());
	printf("Twofish-256: %d\n", test_twofish256());
	printf("Seprent-256: %d\n", test_serpent256());
	printf("XTS: %d\n", test_xts_mode());

	_getch(); return 0;
}