diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-11 01:15:14 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2015-06-11 01:15:14 +0300 |
commit | 7c14e13c717c25818780ff4cc459d82a2ec0473a (patch) | |
tree | b03d3b5149c43334052c1a4e423df9025544bdd5 /test | |
parent | fix register usage in the asm implementation (diff) | |
download | aes-tools-7c14e13c717c25818780ff4cc459d82a2ec0473a.tar.gz aes-tools-7c14e13c717c25818780ff4cc459d82a2ec0473a.zip |
refactoring
Diffstat (limited to 'test')
30 files changed, 290 insertions, 290 deletions
diff --git a/test/aes128cbc_decrypt_block.c b/test/aes128cbc_decrypt_block.c index 3aacb83..b160cfa 100644 --- a/test/aes128cbc_decrypt_block.c +++ b/test/aes128cbc_decrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes128cbc_decrypt_block.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); + puts("Usage: aesni_decrypt_block_cbc128.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); exit(EXIT_FAILURE); } @@ -22,39 +22,39 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, key, cipher, iv; - Aes128KeySchedule key_schedule, inverted_schedule; + AesNI_Block128 plain, key, cipher, iv; + AesNI_KeySchedule128 key_schedule, inverted_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block128(&key, *argv) != 0) + if (aesni_parse_block128(&key, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes128_expand_key_schedule(key, &key_schedule); - aes128_invert_key_schedule(&key_schedule, &inverted_schedule); + aesni_expand_key_schedule128(key, &key_schedule); + aesni_invert_key_schedule128(&key_schedule, &inverted_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&cipher, *argv) != 0) + if (aesni_parse_block128(&cipher, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - plain = aes128cbc_decrypt_block(cipher, &inverted_schedule, iv, &iv); - print_aes_block128(&plain); + plain = aesni_decrypt_block_cbc128(cipher, &inverted_schedule, iv, &iv); + aesni_print_block128(&plain); } } diff --git a/test/aes128cbc_encrypt_block.c b/test/aes128cbc_encrypt_block.c index 2d831ad..73ec1e0 100644 --- a/test/aes128cbc_encrypt_block.c +++ b/test/aes128cbc_encrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes128cbc_encrypt_block.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); + puts("Usage: aesni_encrypt_block_cbc128.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); exit(EXIT_FAILURE); } @@ -22,38 +22,38 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, key, cipher, iv; - Aes128KeySchedule key_schedule; + AesNI_Block128 plain, key, cipher, iv; + AesNI_KeySchedule128 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block128(&key, *argv) != 0) + if (aesni_parse_block128(&key, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes128_expand_key_schedule(key, &key_schedule); + aesni_expand_key_schedule128(key, &key_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&plain, *argv) != 0) + if (aesni_parse_block128(&plain, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - cipher = aes128cbc_encrypt_block(plain, &key_schedule, iv, &iv); - print_aes_block128(&cipher); + cipher = aesni_encrypt_block_cbc128(plain, &key_schedule, iv, &iv); + aesni_print_block128(&cipher); } } diff --git a/test/aes128cfb_decrypt_block.c b/test/aes128cfb_decrypt_block.c index 7bffd4f..c556d3d 100644 --- a/test/aes128cfb_decrypt_block.c +++ b/test/aes128cfb_decrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes128cfb_decrypt_block.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); + puts("Usage: aesni_decrypt_block_cfb128.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); exit(EXIT_FAILURE); } @@ -22,38 +22,38 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, key, cipher, iv; - Aes128KeySchedule key_schedule; + AesNI_Block128 plain, key, cipher, iv; + AesNI_KeySchedule128 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block128(&key, *argv) != 0) + if (aesni_parse_block128(&key, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes128_expand_key_schedule(key, &key_schedule); + aesni_expand_key_schedule128(key, &key_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&cipher, *argv) != 0) + if (aesni_parse_block128(&cipher, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - plain = aes128cfb_decrypt_block(cipher, &key_schedule, iv, &iv); - print_aes_block128(&plain); + plain = aesni_decrypt_block_cfb128(cipher, &key_schedule, iv, &iv); + aesni_print_block128(&plain); } } diff --git a/test/aes128cfb_encrypt_block.c b/test/aes128cfb_encrypt_block.c index a991864..c1db28c 100644 --- a/test/aes128cfb_encrypt_block.c +++ b/test/aes128cfb_encrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes128cfb_encrypt_block.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); + puts("Usage: aesni_encrypt_block_cfb128.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); exit(EXIT_FAILURE); } @@ -22,38 +22,38 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, key, cipher, iv; - Aes128KeySchedule key_schedule; + AesNI_Block128 plain, key, cipher, iv; + AesNI_KeySchedule128 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block128(&key, *argv) != 0) + if (aesni_parse_block128(&key, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes128_expand_key_schedule(key, &key_schedule); + aesni_expand_key_schedule128(key, &key_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&plain, *argv) != 0) + if (aesni_parse_block128(&plain, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - cipher = aes128cfb_encrypt_block(plain, &key_schedule, iv, &iv); - print_aes_block128(&cipher); + cipher = aesni_encrypt_block_cfb128(plain, &key_schedule, iv, &iv); + aesni_print_block128(&cipher); } } diff --git a/test/aes128ctr_decrypt_block.c b/test/aes128ctr_decrypt_block.c index e6f9cee..61d9931 100644 --- a/test/aes128ctr_decrypt_block.c +++ b/test/aes128ctr_decrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes128ctr_decrypt_block.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); + puts("Usage: aesni_decrypt_block_ctr128.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); exit(EXIT_FAILURE); } @@ -22,25 +22,25 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, key, cipher, iv; - Aes128KeySchedule key_schedule; + AesNI_Block128 plain, key, cipher, iv; + AesNI_KeySchedule128 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block128(&key, *argv) != 0) + if (aesni_parse_block128(&key, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes128_expand_key_schedule(key, &key_schedule); + aesni_expand_key_schedule128(key, &key_schedule); int ctr = 0; @@ -49,13 +49,13 @@ int main(int argc, char** argv) if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&cipher, *argv) != 0) + if (aesni_parse_block128(&cipher, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - plain = aes128ctr_decrypt_block(cipher, &key_schedule, iv, ctr++); - print_aes_block128(&plain); + plain = aesni_decrypt_block_ctr128(cipher, &key_schedule, iv, ctr++); + aesni_print_block128(&plain); } } diff --git a/test/aes128ctr_encrypt_block.c b/test/aes128ctr_encrypt_block.c index 6baa266..8191172 100644 --- a/test/aes128ctr_encrypt_block.c +++ b/test/aes128ctr_encrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes128ctr_encrypt_block.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); + puts("Usage: aesni_encrypt_block_ctr128.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); exit(EXIT_FAILURE); } @@ -22,25 +22,25 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, key, cipher, iv; - Aes128KeySchedule key_schedule; + AesNI_Block128 plain, key, cipher, iv; + AesNI_KeySchedule128 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block128(&key, *argv) != 0) + if (aesni_parse_block128(&key, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes128_expand_key_schedule(key, &key_schedule); + aesni_expand_key_schedule128(key, &key_schedule); int ctr = 0; @@ -49,13 +49,13 @@ int main(int argc, char** argv) if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&plain, *argv) != 0) + if (aesni_parse_block128(&plain, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - cipher = aes128ctr_encrypt_block(plain, &key_schedule, iv, ctr++); - print_aes_block128(&cipher); + cipher = aesni_encrypt_block_ctr128(plain, &key_schedule, iv, ctr++); + aesni_print_block128(&cipher); } } diff --git a/test/aes128ecb_decrypt_block.c b/test/aes128ecb_decrypt_block.c index 54b890d..79f47ed 100644 --- a/test/aes128ecb_decrypt_block.c +++ b/test/aes128ecb_decrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes128ecb_decrypt_block.exe KEY0 [CIPHER0...] [-- KEY1 [CIPHER1...]...]"); + puts("Usage: aesni_decrypt_block_ecb128.exe KEY0 [CIPHER0...] [-- KEY1 [CIPHER1...]...]"); exit(EXIT_FAILURE); } @@ -22,33 +22,33 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, key, cipher; - Aes128KeySchedule key_schedule, inverted_schedule; + AesNI_Block128 plain, key, cipher; + AesNI_KeySchedule128 key_schedule, inverted_schedule; if (argc < 1) exit_with_usage(); - if (parse_aes_block128(&key, *argv) != 0) + if (aesni_parse_block128(&key, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); exit_with_usage(); } - aes128_expand_key_schedule(key, &key_schedule); - aes128_invert_key_schedule(&key_schedule, &inverted_schedule); + aesni_expand_key_schedule128(key, &key_schedule); + aesni_invert_key_schedule128(&key_schedule, &inverted_schedule); for (--argc, ++argv; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&cipher, *argv) != 0) + if (aesni_parse_block128(&cipher, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - plain = aes128ecb_decrypt_block(cipher, &inverted_schedule); - print_aes_block128(&plain); + plain = aesni_decrypt_block_ecb128(cipher, &inverted_schedule); + aesni_print_block128(&plain); } } diff --git a/test/aes128ecb_encrypt_block.c b/test/aes128ecb_encrypt_block.c index 43b1c1a..17ec89e 100644 --- a/test/aes128ecb_encrypt_block.c +++ b/test/aes128ecb_encrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes128ecb_encrypt_block.exe KEY0 [PLAIN0...] [-- KEY1 [PLAIN1...]...]"); + puts("Usage: aesni_encrypt_block_ecb128.exe KEY0 [PLAIN0...] [-- KEY1 [PLAIN1...]...]"); exit(EXIT_FAILURE); } @@ -22,32 +22,32 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, key, cipher; - Aes128KeySchedule key_schedule; + AesNI_Block128 plain, key, cipher; + AesNI_KeySchedule128 key_schedule; if (argc < 1) exit_with_usage(); - if (parse_aes_block128(&key, *argv) != 0) + if (aesni_parse_block128(&key, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); exit_with_usage(); } - aes128_expand_key_schedule(key, &key_schedule); + aesni_expand_key_schedule128(key, &key_schedule); for (--argc, ++argv; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&plain, *argv) != 0) + if (aesni_parse_block128(&plain, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - cipher = aes128ecb_encrypt_block(plain, &key_schedule); - print_aes_block128(&cipher); + cipher = aesni_encrypt_block_ecb128(plain, &key_schedule); + aesni_print_block128(&cipher); } } diff --git a/test/aes128ofb_decrypt_block.c b/test/aes128ofb_decrypt_block.c index edcbe77..84b220d 100644 --- a/test/aes128ofb_decrypt_block.c +++ b/test/aes128ofb_decrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes128ofb_decrypt_block.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); + puts("Usage: aesni_decrypt_block_ofb128.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); exit(EXIT_FAILURE); } @@ -22,38 +22,38 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, key, cipher, iv; - Aes128KeySchedule key_schedule; + AesNI_Block128 plain, key, cipher, iv; + AesNI_KeySchedule128 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block128(&key, *argv) != 0) + if (aesni_parse_block128(&key, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes128_expand_key_schedule(key, &key_schedule); + aesni_expand_key_schedule128(key, &key_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&cipher, *argv) != 0) + if (aesni_parse_block128(&cipher, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - plain = aes128ofb_decrypt_block(cipher, &key_schedule, iv, &iv); - print_aes_block128(&plain); + plain = aesni_decrypt_block_ofb128(cipher, &key_schedule, iv, &iv); + aesni_print_block128(&plain); } } diff --git a/test/aes128ofb_encrypt_block.c b/test/aes128ofb_encrypt_block.c index d1ff412..f52affa 100644 --- a/test/aes128ofb_encrypt_block.c +++ b/test/aes128ofb_encrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes128ofb_encrypt_block.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); + puts("Usage: aesni_encrypt_block_ofb128.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); exit(EXIT_FAILURE); } @@ -22,38 +22,38 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, key, cipher, iv; - Aes128KeySchedule key_schedule; + AesNI_Block128 plain, key, cipher, iv; + AesNI_KeySchedule128 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block128(&key, *argv) != 0) + if (aesni_parse_block128(&key, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes128_expand_key_schedule(key, &key_schedule); + aesni_expand_key_schedule128(key, &key_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&plain, *argv) != 0) + if (aesni_parse_block128(&plain, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - cipher = aes128ofb_encrypt_block(plain, &key_schedule, iv, &iv); - print_aes_block128(&cipher); + cipher = aesni_encrypt_block_ofb128(plain, &key_schedule, iv, &iv); + aesni_print_block128(&cipher); } } diff --git a/test/aes192cbc_decrypt_block.c b/test/aes192cbc_decrypt_block.c index a714c2b..f7eb235 100644 --- a/test/aes192cbc_decrypt_block.c +++ b/test/aes192cbc_decrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes192cbc_decrypt_block.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); + puts("Usage: aesni_decrypt_block_cbc192.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); exit(EXIT_FAILURE); } @@ -22,40 +22,40 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock192 key; - Aes192KeySchedule key_schedule, inverted_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block192 key; + AesNI_KeySchedule192 key_schedule, inverted_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block192(&key, *argv) != 0) + if (aesni_parse_block192(&key, *argv) != 0) { fprintf(stderr, "Invalid 192-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes192_expand_key_schedule(&key, &key_schedule); - aes192_invert_key_schedule(&key_schedule, &inverted_schedule); + aesni_expand_key_schedule192(&key, &key_schedule); + aesni_invert_key_schedule192(&key_schedule, &inverted_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&cipher, *argv) != 0) + if (aesni_parse_block128(&cipher, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - plain = aes192cbc_decrypt_block(cipher, &inverted_schedule, iv, &iv); - print_aes_block128(&plain); + plain = aesni_decrypt_block_cbc192(cipher, &inverted_schedule, iv, &iv); + aesni_print_block128(&plain); } } diff --git a/test/aes192cbc_encrypt_block.c b/test/aes192cbc_encrypt_block.c index f0a23bc..ba04d9c 100644 --- a/test/aes192cbc_encrypt_block.c +++ b/test/aes192cbc_encrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes192cbc_encrypt_block.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); + puts("Usage: aesni_encrypt_block_cbc192.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); exit(EXIT_FAILURE); } @@ -22,39 +22,39 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock192 key; - Aes192KeySchedule key_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block192 key; + AesNI_KeySchedule192 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block192(&key, *argv) != 0) + if (aesni_parse_block192(&key, *argv) != 0) { fprintf(stderr, "Invalid 192-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes192_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule192(&key, &key_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&plain, *argv) != 0) + if (aesni_parse_block128(&plain, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - cipher = aes192cbc_encrypt_block(plain, &key_schedule, iv, &iv); - print_aes_block128(&cipher); + cipher = aesni_encrypt_block_cbc192(plain, &key_schedule, iv, &iv); + aesni_print_block128(&cipher); } } diff --git a/test/aes192cfb_decrypt_block.c b/test/aes192cfb_decrypt_block.c index d8096a5..5048804 100644 --- a/test/aes192cfb_decrypt_block.c +++ b/test/aes192cfb_decrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes192cfb_decrypt_block.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); + puts("Usage: aesni_decrypt_block_cfb192.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); exit(EXIT_FAILURE); } @@ -22,39 +22,39 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock192 key; - Aes192KeySchedule key_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block192 key; + AesNI_KeySchedule192 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block192(&key, *argv) != 0) + if (aesni_parse_block192(&key, *argv) != 0) { fprintf(stderr, "Invalid 192-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes192_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule192(&key, &key_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&cipher, *argv) != 0) + if (aesni_parse_block128(&cipher, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - plain = aes192cfb_decrypt_block(cipher, &key_schedule, iv, &iv); - print_aes_block128(&plain); + plain = aesni_decrypt_block_cfb192(cipher, &key_schedule, iv, &iv); + aesni_print_block128(&plain); } } diff --git a/test/aes192cfb_encrypt_block.c b/test/aes192cfb_encrypt_block.c index 9ee207f..4a81432 100644 --- a/test/aes192cfb_encrypt_block.c +++ b/test/aes192cfb_encrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes192cfb_encrypt_block.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); + puts("Usage: aesni_encrypt_block_cfb192.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); exit(EXIT_FAILURE); } @@ -22,39 +22,39 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock192 key; - Aes192KeySchedule key_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block192 key; + AesNI_KeySchedule192 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block192(&key, *argv) != 0) + if (aesni_parse_block192(&key, *argv) != 0) { fprintf(stderr, "Invalid 192-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes192_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule192(&key, &key_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&plain, *argv) != 0) + if (aesni_parse_block128(&plain, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - cipher = aes192cfb_encrypt_block(plain, &key_schedule, iv, &iv); - print_aes_block128(&cipher); + cipher = aesni_encrypt_block_cfb192(plain, &key_schedule, iv, &iv); + aesni_print_block128(&cipher); } } diff --git a/test/aes192ctr_decrypt_block.c b/test/aes192ctr_decrypt_block.c index 0c818cf..501c27a 100644 --- a/test/aes192ctr_decrypt_block.c +++ b/test/aes192ctr_decrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes192ctr_decrypt_block.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); + puts("Usage: aesni_decrypt_block_ctr192.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); exit(EXIT_FAILURE); } @@ -22,26 +22,26 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock192 key; - Aes192KeySchedule key_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block192 key; + AesNI_KeySchedule192 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block192(&key, *argv) != 0) + if (aesni_parse_block192(&key, *argv) != 0) { fprintf(stderr, "Invalid 192-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes192_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule192(&key, &key_schedule); int ctr = 0; @@ -50,13 +50,13 @@ int main(int argc, char** argv) if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&cipher, *argv) != 0) + if (aesni_parse_block128(&cipher, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - plain = aes192ctr_decrypt_block(cipher, &key_schedule, iv, ctr++); - print_aes_block128(&plain); + plain = aesni_decrypt_block_ctr192(cipher, &key_schedule, iv, ctr++); + aesni_print_block128(&plain); } } diff --git a/test/aes192ctr_encrypt_block.c b/test/aes192ctr_encrypt_block.c index 1a494c3..af73a98 100644 --- a/test/aes192ctr_encrypt_block.c +++ b/test/aes192ctr_encrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes192ctr_encrypt_block.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); + puts("Usage: aesni_encrypt_block_ctr192.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); exit(EXIT_FAILURE); } @@ -22,26 +22,26 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock192 key; - Aes192KeySchedule key_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block192 key; + AesNI_KeySchedule192 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block192(&key, *argv) != 0) + if (aesni_parse_block192(&key, *argv) != 0) { fprintf(stderr, "Invalid 192-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes192_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule192(&key, &key_schedule); int ctr = 0; @@ -50,13 +50,13 @@ int main(int argc, char** argv) if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&plain, *argv) != 0) + if (aesni_parse_block128(&plain, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - cipher = aes192ctr_encrypt_block(plain, &key_schedule, iv, ctr++); - print_aes_block128(&cipher); + cipher = aesni_encrypt_block_ctr192(plain, &key_schedule, iv, ctr++); + aesni_print_block128(&cipher); } } diff --git a/test/aes192ecb_decrypt_block.c b/test/aes192ecb_decrypt_block.c index c034236..be4eeee 100644 --- a/test/aes192ecb_decrypt_block.c +++ b/test/aes192ecb_decrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes192ecb_decrypt_block.exe KEY0 [CIPHER0...] [-- KEY1 [CIPHER1...]...]"); + puts("Usage: aesni_decrypt_block_ecb192.exe KEY0 [CIPHER0...] [-- KEY1 [CIPHER1...]...]"); exit(EXIT_FAILURE); } @@ -22,34 +22,34 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher; - AesBlock192 key; - Aes192KeySchedule key_schedule, inverted_schedule; + AesNI_Block128 plain, cipher; + AesNI_Block192 key; + AesNI_KeySchedule192 key_schedule, inverted_schedule; if (argc < 1) exit_with_usage(); - if (parse_aes_block192(&key, *argv) != 0) + if (aesni_parse_block192(&key, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); exit_with_usage(); } - aes192_expand_key_schedule(&key, &key_schedule); - aes192_invert_key_schedule(&key_schedule, &inverted_schedule); + aesni_expand_key_schedule192(&key, &key_schedule); + aesni_invert_key_schedule192(&key_schedule, &inverted_schedule); for (--argc, ++argv; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&cipher, *argv) != 0) + if (aesni_parse_block128(&cipher, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - plain = aes192ecb_decrypt_block(cipher, &inverted_schedule); - print_aes_block128(&plain); + plain = aesni_decrypt_block_ecb192(cipher, &inverted_schedule); + aesni_print_block128(&plain); } } diff --git a/test/aes192ecb_encrypt_block.c b/test/aes192ecb_encrypt_block.c index 9af1e3e..b652ee5 100644 --- a/test/aes192ecb_encrypt_block.c +++ b/test/aes192ecb_encrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes192ecb_encrypt_block.exe KEY0 [PLAIN0...] [-- KEY1 [PLAIN1...]...]"); + puts("Usage: aesni_encrypt_block_ecb192.exe KEY0 [PLAIN0...] [-- KEY1 [PLAIN1...]...]"); exit(EXIT_FAILURE); } @@ -22,33 +22,33 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher; - AesBlock192 key; - Aes192KeySchedule key_schedule; + AesNI_Block128 plain, cipher; + AesNI_Block192 key; + AesNI_KeySchedule192 key_schedule; if (argc < 1) exit_with_usage(); - if (parse_aes_block192(&key, *argv) != 0) + if (aesni_parse_block192(&key, *argv) != 0) { fprintf(stderr, "Invalid 192-bit AES block '%s'\n", *argv); exit_with_usage(); } - aes192_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule192(&key, &key_schedule); for (--argc, ++argv; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&plain, *argv) != 0) + if (aesni_parse_block128(&plain, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - cipher = aes192ecb_encrypt_block(plain, &key_schedule); - print_aes_block128(&cipher); + cipher = aesni_encrypt_block_ecb192(plain, &key_schedule); + aesni_print_block128(&cipher); } } diff --git a/test/aes192ofb_decrypt_block.c b/test/aes192ofb_decrypt_block.c index 4044435..2f830e1 100644 --- a/test/aes192ofb_decrypt_block.c +++ b/test/aes192ofb_decrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes192ofb_decrypt_block.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); + puts("Usage: aesni_decrypt_block_ofb192.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); exit(EXIT_FAILURE); } @@ -22,39 +22,39 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock192 key; - Aes192KeySchedule key_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block192 key; + AesNI_KeySchedule192 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block192(&key, *argv) != 0) + if (aesni_parse_block192(&key, *argv) != 0) { fprintf(stderr, "Invalid 192-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes192_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule192(&key, &key_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&cipher, *argv) != 0) + if (aesni_parse_block128(&cipher, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - plain = aes192ofb_decrypt_block(cipher, &key_schedule, iv, &iv); - print_aes_block128(&plain); + plain = aesni_decrypt_block_ofb192(cipher, &key_schedule, iv, &iv); + aesni_print_block128(&plain); } } diff --git a/test/aes192ofb_encrypt_block.c b/test/aes192ofb_encrypt_block.c index 8d57208..e541496 100644 --- a/test/aes192ofb_encrypt_block.c +++ b/test/aes192ofb_encrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes192ofb_encrypt_block.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); + puts("Usage: aesni_encrypt_block_ofb192.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); exit(EXIT_FAILURE); } @@ -22,39 +22,39 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock192 key; - Aes192KeySchedule key_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block192 key; + AesNI_KeySchedule192 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block192(&key, *argv) != 0) + if (aesni_parse_block192(&key, *argv) != 0) { fprintf(stderr, "Invalid 192-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes192_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule192(&key, &key_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&plain, *argv) != 0) + if (aesni_parse_block128(&plain, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - cipher = aes192ofb_encrypt_block(plain, &key_schedule, iv, &iv); - print_aes_block128(&cipher); + cipher = aesni_encrypt_block_ofb192(plain, &key_schedule, iv, &iv); + aesni_print_block128(&cipher); } } diff --git a/test/aes256cbc_decrypt_block.c b/test/aes256cbc_decrypt_block.c index 7a1defe..f58dfa7 100644 --- a/test/aes256cbc_decrypt_block.c +++ b/test/aes256cbc_decrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes256cbc_decrypt_block.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); + puts("Usage: aesni_decrypt_block_cbc256.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); exit(EXIT_FAILURE); } @@ -22,40 +22,40 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock256 key; - Aes256KeySchedule key_schedule, inverted_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block256 key; + AesNI_KeySchedule256 key_schedule, inverted_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block256(&key, *argv) != 0) + if (aesni_parse_block256(&key, *argv) != 0) { fprintf(stderr, "Invalid 256-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes256_expand_key_schedule(&key, &key_schedule); - aes256_invert_key_schedule(&key_schedule, &inverted_schedule); + aesni_expand_key_schedule256(&key, &key_schedule); + aesni_invert_key_schedule256(&key_schedule, &inverted_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&cipher, *argv) != 0) + if (aesni_parse_block128(&cipher, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - plain = aes256cbc_decrypt_block(cipher, &inverted_schedule, iv, &iv); - print_aes_block128(&plain); + plain = aesni_decrypt_block_cbc256(cipher, &inverted_schedule, iv, &iv); + aesni_print_block128(&plain); } } diff --git a/test/aes256cbc_encrypt_block.c b/test/aes256cbc_encrypt_block.c index 81ffcc8..5bc2af8 100644 --- a/test/aes256cbc_encrypt_block.c +++ b/test/aes256cbc_encrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes256cbc_encrypt_block.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); + puts("Usage: aesni_encrypt_block_cbc256.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); exit(EXIT_FAILURE); } @@ -22,39 +22,39 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock256 key; - Aes256KeySchedule key_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block256 key; + AesNI_KeySchedule256 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block256(&key, *argv) != 0) + if (aesni_parse_block256(&key, *argv) != 0) { fprintf(stderr, "Invalid 256-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes256_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule256(&key, &key_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&plain, *argv) != 0) + if (aesni_parse_block128(&plain, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - cipher = aes256cbc_encrypt_block(plain, &key_schedule, iv, &iv); - print_aes_block128(&cipher); + cipher = aesni_encrypt_block_cbc256(plain, &key_schedule, iv, &iv); + aesni_print_block128(&cipher); } } diff --git a/test/aes256cfb_decrypt_block.c b/test/aes256cfb_decrypt_block.c index ffa352a..5839a36 100644 --- a/test/aes256cfb_decrypt_block.c +++ b/test/aes256cfb_decrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes256cfb_decrypt_block.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); + puts("Usage: aesni_decrypt_block_cfb256.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); exit(EXIT_FAILURE); } @@ -22,39 +22,39 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock256 key; - Aes256KeySchedule key_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block256 key; + AesNI_KeySchedule256 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block256(&key, *argv) != 0) + if (aesni_parse_block256(&key, *argv) != 0) { fprintf(stderr, "Invalid 256-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes256_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule256(&key, &key_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&cipher, *argv) != 0) + if (aesni_parse_block128(&cipher, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - plain = aes256cfb_decrypt_block(cipher, &key_schedule, iv, &iv); - print_aes_block128(&plain); + plain = aesni_decrypt_block_cfb256(cipher, &key_schedule, iv, &iv); + aesni_print_block128(&plain); } } diff --git a/test/aes256cfb_encrypt_block.c b/test/aes256cfb_encrypt_block.c index 5afb7ab..acff8d7 100644 --- a/test/aes256cfb_encrypt_block.c +++ b/test/aes256cfb_encrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes256cfb_encrypt_block.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); + puts("Usage: aesni_encrypt_block_cfb256.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); exit(EXIT_FAILURE); } @@ -22,39 +22,39 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock256 key; - Aes256KeySchedule key_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block256 key; + AesNI_KeySchedule256 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block256(&key, *argv) != 0) + if (aesni_parse_block256(&key, *argv) != 0) { fprintf(stderr, "Invalid 256-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes256_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule256(&key, &key_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&plain, *argv) != 0) + if (aesni_parse_block128(&plain, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - cipher = aes256cfb_encrypt_block(plain, &key_schedule, iv, &iv); - print_aes_block128(&cipher); + cipher = aesni_encrypt_block_cfb256(plain, &key_schedule, iv, &iv); + aesni_print_block128(&cipher); } } diff --git a/test/aes256ctr_decrypt_block.c b/test/aes256ctr_decrypt_block.c index 79d60e4..0bf1545 100644 --- a/test/aes256ctr_decrypt_block.c +++ b/test/aes256ctr_decrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes256ctr_decrypt_block.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); + puts("Usage: aesni_decrypt_block_ctr256.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); exit(EXIT_FAILURE); } @@ -22,26 +22,26 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock256 key; - Aes256KeySchedule key_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block256 key; + AesNI_KeySchedule256 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block256(&key, *argv) != 0) + if (aesni_parse_block256(&key, *argv) != 0) { fprintf(stderr, "Invalid 256-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes256_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule256(&key, &key_schedule); int ctr = 0; @@ -50,13 +50,13 @@ int main(int argc, char** argv) if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&cipher, *argv) != 0) + if (aesni_parse_block128(&cipher, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - plain = aes256ctr_decrypt_block(cipher, &key_schedule, iv, ctr++); - print_aes_block128(&plain); + plain = aesni_decrypt_block_ctr256(cipher, &key_schedule, iv, ctr++); + aesni_print_block128(&plain); } } diff --git a/test/aes256ctr_encrypt_block.c b/test/aes256ctr_encrypt_block.c index 3b384dc..a8894ea 100644 --- a/test/aes256ctr_encrypt_block.c +++ b/test/aes256ctr_encrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes256ctr_encrypt_block.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); + puts("Usage: aesni_encrypt_block_ctr256.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); exit(EXIT_FAILURE); } @@ -22,26 +22,26 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock256 key; - Aes256KeySchedule key_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block256 key; + AesNI_KeySchedule256 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block256(&key, *argv) != 0) + if (aesni_parse_block256(&key, *argv) != 0) { fprintf(stderr, "Invalid 256-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes256_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule256(&key, &key_schedule); int ctr = 0; @@ -50,13 +50,13 @@ int main(int argc, char** argv) if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&plain, *argv) != 0) + if (aesni_parse_block128(&plain, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - cipher = aes256ctr_encrypt_block(plain, &key_schedule, iv, ctr++); - print_aes_block128(&cipher); + cipher = aesni_encrypt_block_ctr256(plain, &key_schedule, iv, ctr++); + aesni_print_block128(&cipher); } } diff --git a/test/aes256ecb_decrypt_block.c b/test/aes256ecb_decrypt_block.c index 106aa8b..203d1d5 100644 --- a/test/aes256ecb_decrypt_block.c +++ b/test/aes256ecb_decrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes256ecb_decrypt_block.exe KEY0 [CIPHER0...] [-- KEY1 [CIPHER1...]...]"); + puts("Usage: aesni_decrypt_block_ecb256.exe KEY0 [CIPHER0...] [-- KEY1 [CIPHER1...]...]"); exit(EXIT_FAILURE); } @@ -22,34 +22,34 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher; - AesBlock256 key; - Aes256KeySchedule key_schedule, inverted_schedule; + AesNI_Block128 plain, cipher; + AesNI_Block256 key; + AesNI_KeySchedule256 key_schedule, inverted_schedule; if (argc < 1) exit_with_usage(); - if (parse_aes_block256(&key, *argv) != 0) + if (aesni_parse_block256(&key, *argv) != 0) { fprintf(stderr, "Invalid 256-bit AES block '%s'\n", *argv); exit_with_usage(); } - aes256_expand_key_schedule(&key, &key_schedule); - aes256_invert_key_schedule(&key_schedule, &inverted_schedule); + aesni_expand_key_schedule256(&key, &key_schedule); + aesni_invert_key_schedule256(&key_schedule, &inverted_schedule); for (--argc, ++argv; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&cipher, *argv) != 0) + if (aesni_parse_block128(&cipher, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - plain = aes256ecb_decrypt_block(cipher, &inverted_schedule); - print_aes_block128(&plain); + plain = aesni_decrypt_block_ecb256(cipher, &inverted_schedule); + aesni_print_block128(&plain); } } diff --git a/test/aes256ecb_encrypt_block.c b/test/aes256ecb_encrypt_block.c index 4f550b6..ff11ce7 100644 --- a/test/aes256ecb_encrypt_block.c +++ b/test/aes256ecb_encrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes256ecb_encrypt_block.exe KEY0 [PLAIN0...] [-- KEY1 [PLAIN1...]...]"); + puts("Usage: aesni_encrypt_block_ecb256.exe KEY0 [PLAIN0...] [-- KEY1 [PLAIN1...]...]"); exit(EXIT_FAILURE); } @@ -22,33 +22,33 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher; - AesBlock256 key; - Aes256KeySchedule key_schedule; + AesNI_Block128 plain, cipher; + AesNI_Block256 key; + AesNI_KeySchedule256 key_schedule; if (argc < 1) exit_with_usage(); - if (parse_aes_block256(&key, *argv) != 0) + if (aesni_parse_block256(&key, *argv) != 0) { fprintf(stderr, "Invalid 256-bit AES block '%s'\n", *argv); exit_with_usage(); } - aes256_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule256(&key, &key_schedule); for (--argc, ++argv; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&plain, *argv) != 0) + if (aesni_parse_block128(&plain, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - cipher = aes256ecb_encrypt_block(plain, &key_schedule); - print_aes_block128(&cipher); + cipher = aesni_encrypt_block_ecb256(plain, &key_schedule); + aesni_print_block128(&cipher); } } diff --git a/test/aes256ofb_decrypt_block.c b/test/aes256ofb_decrypt_block.c index 7b4c614..ddc0024 100644 --- a/test/aes256ofb_decrypt_block.c +++ b/test/aes256ofb_decrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes256ofb_decrypt_block.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); + puts("Usage: aesni_decrypt_block_ofb256.exe KEY0 IV0 [CIPHER0...] [-- KEY1 IV1 [CIPHER1...]...]"); exit(EXIT_FAILURE); } @@ -22,39 +22,39 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock256 key; - Aes256KeySchedule key_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block256 key; + AesNI_KeySchedule256 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block256(&key, *argv) != 0) + if (aesni_parse_block256(&key, *argv) != 0) { fprintf(stderr, "Invalid 256-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes256_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule256(&key, &key_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&cipher, *argv) != 0) + if (aesni_parse_block128(&cipher, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - plain = aes256ofb_decrypt_block(cipher, &key_schedule, iv, &iv); - print_aes_block128(&plain); + plain = aesni_decrypt_block_ofb256(cipher, &key_schedule, iv, &iv); + aesni_print_block128(&plain); } } diff --git a/test/aes256ofb_encrypt_block.c b/test/aes256ofb_encrypt_block.c index 09d2edb..94138ca 100644 --- a/test/aes256ofb_encrypt_block.c +++ b/test/aes256ofb_encrypt_block.c @@ -14,7 +14,7 @@ static void exit_with_usage() { - puts("Usage: aes256ofb_encrypt_block.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); + puts("Usage: aesni_encrypt_block_ofb256.exe KEY0 IV0 [PLAIN0...] [-- KEY1 IV1 [PLAIN1...]...]"); exit(EXIT_FAILURE); } @@ -22,39 +22,39 @@ int main(int argc, char** argv) { for (--argc, ++argv; argc > -1; --argc, ++argv) { - AesBlock128 plain, cipher, iv; - AesBlock256 key; - Aes256KeySchedule key_schedule; + AesNI_Block128 plain, cipher, iv; + AesNI_Block256 key; + AesNI_KeySchedule256 key_schedule; if (argc < 2) exit_with_usage(); - if (parse_aes_block256(&key, *argv) != 0) + if (aesni_parse_block256(&key, *argv) != 0) { fprintf(stderr, "Invalid 256-bit AES block '%s'\n", *argv); exit_with_usage(); } - if (parse_aes_block128(&iv, argv[1]) != 0) + if (aesni_parse_block128(&iv, argv[1]) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", argv[1]); exit_with_usage(); } - aes256_expand_key_schedule(&key, &key_schedule); + aesni_expand_key_schedule256(&key, &key_schedule); for (argc -= 2, argv += 2; argc > 0; --argc, ++argv) { if (strcmp("--", *argv) == 0) break; - if (parse_aes_block128(&plain, *argv) != 0) + if (aesni_parse_block128(&plain, *argv) != 0) { fprintf(stderr, "Invalid 128-bit AES block '%s'\n", *argv); continue; } - cipher = aes256ofb_encrypt_block(plain, &key_schedule, iv, &iv); - print_aes_block128(&cipher); + cipher = aesni_encrypt_block_ofb256(plain, &key_schedule, iv, &iv); + aesni_print_block128(&cipher); } } |