Ejemplo n.º 1
0
int
main()
{
	test_sha256("e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
	            "");
	test_sha256("ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad",
	            "abc");
	test_sha256("5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5",
	            "12345");

	test_sha384("38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b",
	            "");
	test_sha384("cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7",
	            "abc");
	test_sha384("0fa76955abfa9dafd83facca8343a92aa09497f98101086611b0bfa95dbc0dcc661d62e9568a5a032ba81960f3e55d4a",
	            "12345");

	test_sha512("cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e",
	            "");
	test_sha512("ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f",
	            "abc");
	test_sha512("3627909a29c31381a071ec27f7c9ca97726182aed29a7ddd2e54353322cfb30abb9e3a6df2ac2c20fe23436311d678564d0c8d305930575f60e2d3d048184d79",
	            "12345");

	return 0;
}
Ejemplo n.º 2
0
int main() {
	test_sha1();
	test_sha224();
	test_sha256();
	test_sha384();
	test_sha512();
	test_sha512_224();
	test_sha512_256();
	exit(0);
}
Ejemplo n.º 3
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;
}
Ejemplo n.º 4
0
Archivo: main.cpp Proyecto: louiz/botan
int main(int argc, char* argv[])
   {
   std::vector<std::string> files = read_dir("data");
   std::string test_arg;
   if(argc < 2) 
      {
      test_arg = "";
      }
   else 
      {
      test_arg = argv[1];
      }
   for (auto const& file : files) 
      {
      std::vector<std::string> inputs = read_vectors(file);

      if (executeEvaluationWithFile("bleichenbacher", file, test_arg)) 
         {
         std::string result_folder = "results/bleichenbacher";
         std::unique_ptr<BleichenbacherTest> test(new BleichenbacherTest(inputs, result_folder, 2048));
         test->execute_evaluation();
         } 
      else if (executeEvaluationWithFile("manger", file, test_arg)) 
         {
         std::string result_folder = "results/manger";
         std::unique_ptr<MangerTest> test(new MangerTest(inputs, result_folder, 2048));
         test->execute_evaluation();
         } 
      else if (executeEvaluationWithFile("lucky13sec3", file, test_arg)) 
         {
         std::string result_folder_sha1 = "results/lucky13sha1sec3";
         std::unique_ptr<Lucky13Test> test_sha1(new Lucky13Test(inputs, result_folder_sha1, "SHA-1", 20));
         test_sha1->execute_evaluation();
         std::string result_folder_sha256 = "results/lucky13sha256sec3";
         std::unique_ptr<Lucky13Test> test_sha256(new Lucky13Test(inputs, result_folder_sha256, "SHA-256", 32));
         test_sha256->execute_evaluation();
         }
      else if (executeEvaluationWithFile("lucky13sec4sha1", file, test_arg)) 
         {
         std::string result_folder_sha1 = "results/lucky13sha1sec4";
         std::unique_ptr<Lucky13Test> test_sha1(new Lucky13Test(inputs, result_folder_sha1, "SHA-1", 20));
         test_sha1->execute_evaluation();
         }
      else if (executeEvaluationWithFile("lucky13sec4sha256", file, test_arg)) 
         {
         std::string result_folder_sha256 = "results/lucky13sha256sec4";
         std::unique_ptr<Lucky13Test> test_sha256(new Lucky13Test(inputs, result_folder_sha256, "SHA-256", 32));
         test_sha256->execute_evaluation();
         } 
      else if (executeEvaluationWithFile("lucky13sha384", file, test_arg)) 
         {
         std::string result_folder_sha384 = "results/lucky13sha384";
         std::unique_ptr<Lucky13Test> test_sha384(new Lucky13Test(inputs, result_folder_sha384, "SHA-384", 48));
         test_sha384->execute_evaluation();
         } 
      else 
         {
         std::cout << "\nSkipping the following test: " << file;
         }
      }

   return 1;
   }