mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-30 01:48:54 +00:00
fddd7b6640
git subtree pull --squash --prefix libsodium git@github.com:jedisct1/libsodium.git 1.0.14
42 lines
896 B
C
42 lines
896 B
C
|
|
#define TEST_NAME "sodium_core"
|
|
#include "cmptest.h"
|
|
|
|
static void
|
|
misuse_handler(void)
|
|
{
|
|
printf("misuse_handler()\n");
|
|
exit(0);
|
|
}
|
|
|
|
int
|
|
main(void)
|
|
{
|
|
sodium_set_misuse_handler(NULL);
|
|
sodium_set_misuse_handler(misuse_handler);
|
|
sodium_set_misuse_handler(NULL);
|
|
|
|
assert(sodium_init() == 1);
|
|
|
|
(void) sodium_runtime_has_neon();
|
|
(void) sodium_runtime_has_sse2();
|
|
(void) sodium_runtime_has_sse3();
|
|
(void) sodium_runtime_has_ssse3();
|
|
(void) sodium_runtime_has_sse41();
|
|
(void) sodium_runtime_has_avx();
|
|
(void) sodium_runtime_has_avx2();
|
|
(void) sodium_runtime_has_avx512f();
|
|
(void) sodium_runtime_has_pclmul();
|
|
(void) sodium_runtime_has_aesni();
|
|
|
|
sodium_set_misuse_handler(misuse_handler);
|
|
#ifndef __EMSCRIPTEN__
|
|
sodium_misuse();
|
|
printf("Misuse handler returned\n");
|
|
#else
|
|
printf("misuse_handler()\n");
|
|
#endif
|
|
|
|
return 0;
|
|
}
|