summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/crypto_tests/aes-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/crypto/crypto_tests/aes-test.c')
-rw-r--r--src/lib/crypto/crypto_tests/aes-test.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/src/lib/crypto/crypto_tests/aes-test.c b/src/lib/crypto/crypto_tests/aes-test.c
index 3ccacd858..e8f7cfb9c 100644
--- a/src/lib/crypto/crypto_tests/aes-test.c
+++ b/src/lib/crypto/crypto_tests/aes-test.c
@@ -1,3 +1,4 @@
+/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* lib/crypto/aes/aes-test.c
*
@@ -83,12 +84,12 @@ static void vk_test_1(int len)
memset(plain, 0, sizeof(plain));
hexdump("PT", plain, 16);
for (i = 0; i < len * 8; i++) {
- memset(key, 0, len);
- set_bit(key, i);
- printf("\nI=%d\n", i+1);
- hexdump("KEY", key, len);
- enc();
- hexdump("CT", cipher, 16);
+ memset(key, 0, len);
+ set_bit(key, i);
+ printf("\nI=%d\n", i+1);
+ hexdump("KEY", key, len);
+ enc();
+ hexdump("CT", cipher, 16);
}
printf("\n==========\n");
}
@@ -108,12 +109,12 @@ static void vt_test_1(int len)
memset(key, 0, len);
hexdump("KEY", key, len);
for (i = 0; i < 16 * 8; i++) {
- memset(plain, 0, sizeof(plain));
- set_bit(plain, i);
- printf("\nI=%d\n", i+1);
- hexdump("PT", plain, 16);
- enc();
- hexdump("CT", cipher, 16);
+ memset(plain, 0, sizeof(plain));
+ set_bit(plain, i);
+ printf("\nI=%d\n", i+1);
+ hexdump("PT", plain, 16);
+ enc();
+ hexdump("CT", cipher, 16);
}
printf("\n==========\n");
}
@@ -127,16 +128,16 @@ static void vt_test()
int main (int argc, char *argv[])
{
if (argc > 2 || (argc == 2 && strcmp(argv[1], "-k"))) {
- fprintf(stderr,
- "usage:\t%s -k\tfor variable-key tests\n"
- " or:\t%s \tfor variable-plaintext tests\n",
- argv[0], argv[0]);
- return 1;
+ fprintf(stderr,
+ "usage:\t%s -k\tfor variable-key tests\n"
+ " or:\t%s \tfor variable-plaintext tests\n",
+ argv[0], argv[0]);
+ return 1;
}
init();
if (argc == 2)
- vk_test();
+ vk_test();
else
- vt_test();
+ vt_test();
return 0;
}