/
githubmirror
/
gnutls
Обзор
Документация
Войти
/
githubmirror
/
gnutls
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
tests/slow/cipher-test.c
64 строки
1 KB
Daiki Ueno
devel: make local header inclusion consistent
09 окт 2023, 01:13
09 окт 2023, 01:13
a723409
Код
Авторство
О чём код?
#include "config.h" #include <stdint.h> #include <stdio.h> #include <string.h> #include "utils.h" #include <stdlib.h> #include <gnutls/gnutls.h> #include <gnutls/crypto.h> #include <gnutls/self-test.h> #include <signal.h> /* This does check the AES and SHA implementation against test vectors. * This should not run under valgrind in order to use the native * cpu instructions (AES-NI or padlock). */ #if defined(WIN32) int main(int argc, char **argv) { exit(77); } #else #include <unistd.h> static void handle_sigill(int sig) { _exit(0); } static void tls_log_func(int level, const char *str) { fprintf(stderr, "<%d>| %s", level, str); } int main(int argc, char **argv) { gnutls_global_set_log_function(tls_log_func); if (argc > 1) gnutls_global_set_log_level(4711); global_init(); signal(SIGILL, handle_sigill); /* ciphers */ if (gnutls_cipher_self_test(GNUTLS_SELF_TEST_FLAG_ALL, 0) < 0) return 1; /* message digests */ if (gnutls_digest_self_test(GNUTLS_SELF_TEST_FLAG_ALL, 0) < 0) return 1; /* MAC */ if (gnutls_mac_self_test(GNUTLS_SELF_TEST_FLAG_ALL, 0) < 0) return 1; /* PK */ if (gnutls_pk_self_test(GNUTLS_SELF_TEST_FLAG_ALL, 0) < 0) return 1; gnutls_global_deinit(); return 0; } #endif