-namespace tut
-{
- struct crypto_data {
- };
-
- typedef test_group<crypto_data> tg;
- tg crypto_test_group("Crypto tests group");
-
- typedef tg::object testobject;
-
- template<>
- template<>
- void testobject::test<1>()
- {
- set_test_name("Check context creation");
-
- BLOWFISH_CTX ctx;
- InitContext("pr7Hhen", 7, &ctx);
- ensure("ctx == testCtx", equalCtx(ctx, testCtx));
- }
-
- template<>
- template<>
- void testobject::test<2>()
- {
- set_test_name("Check encryption");
-
- BLOWFISH_CTX ctx;
- InitContext("pr7Hhen", 7, &ctx);
- uint32_t a = 0x12345678;
- uint32_t b = 0x87654321;
- Blowfish_Encrypt(&ctx, &a, &b);
-
- ensure_equals("a == 0xd3988cd", a, 0xd3988cd);
- ensure_equals("b == 0x7996c6d6", b, 0x7996c6d6);
- }
-
- template<>
- template<>
- void testobject::test<3>()
- {
- set_test_name("Check decryption");
-
- BLOWFISH_CTX ctx;
- InitContext("pr7Hhen", 7, &ctx);
- uint32_t a = 0xd3988cd;
- uint32_t b = 0x7996c6d6;
- Blowfish_Decrypt(&ctx, &a, &b);
-
- ensure_equals("a == 0x12345678", a, 0x12345678);
- ensure_equals("b == 0x87654321", b, 0x87654321);
- }
-
- template<>
- template<>
- void testobject::test<4>()
- {
- set_test_name("Check block encryption");