Commit 1add6072 authored by Белов Никита Сергеевич's avatar Белов Никита Сергеевич
Browse files

Update test-belt-hash.c

parent 008c2047
No related merge requests found
Showing with 4 additions and 10 deletions
+4 -10
#include <stdio.h> #include <stdio.h>
#include <libakrypt.h> #include <libakrypt.h>
static int ak_function_my_audit(const char* message)
{
if (message != NULL) fprintf(stderr, "%s\n", message);
return ak_error_ok;
}
int main() int main()
{ {
int error = ak_error_ok;
/* Инициализация криптографической библиотеки */
int exitstatus = EXIT_FAILURE;
/* Контекст для вычисления хеширования */ /* Контекст для вычисления хеширования */
struct hash hctx; struct hash hctx;
struct bckey belt;
ak_uint8 input1[13] = ak_uint8 input1[13] =
{ {
...@@ -32,8 +24,9 @@ int main() ...@@ -32,8 +24,9 @@ int main()
ak_libakrypt_destroy(); ak_libakrypt_destroy();
return EXIT_FAILURE; return EXIT_FAILURE;
} }
ak_bckey_create_belt(&belt);
ak_hash_create_belt(&hctx); ak_hash_create_belt(&hctx, &belt);
ak_hash_ptr(&hctx, input1, 13, output, 32); ak_hash_ptr(&hctx, input1, 13, output, 32);
printf("Test 1\n"); printf("Test 1\n");
...@@ -76,6 +69,7 @@ int main() ...@@ -76,6 +69,7 @@ int main()
printf("2: %s\n", ak_ptr_to_hexstr(output, sizeof(output), ak_false)); printf("2: %s\n", ak_ptr_to_hexstr(output, sizeof(output), ak_false));
ak_hash_destroy(&hctx); ak_hash_destroy(&hctx);
ak_bckey_destroy(&belt);
return 0; return 0;
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment