The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/libsodium/test/default/sodium_core.c

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 
    2 #define TEST_NAME "sodium_core"
    3 #include "cmptest.h"
    4 
    5 static void
    6 misuse_handler(void)
    7 {
    8     printf("misuse_handler()\n");
    9     exit(0);
   10 }
   11 
   12 int
   13 main(void)
   14 {
   15     sodium_set_misuse_handler(NULL);
   16     sodium_set_misuse_handler(misuse_handler);
   17     sodium_set_misuse_handler(NULL);
   18 
   19     assert(sodium_init() == 1);
   20 
   21     (void) sodium_runtime_has_neon();
   22     (void) sodium_runtime_has_sse2();
   23     (void) sodium_runtime_has_sse3();
   24     (void) sodium_runtime_has_ssse3();
   25     (void) sodium_runtime_has_sse41();
   26     (void) sodium_runtime_has_avx();
   27     (void) sodium_runtime_has_avx2();
   28     (void) sodium_runtime_has_avx512f();
   29     (void) sodium_runtime_has_pclmul();
   30     (void) sodium_runtime_has_aesni();
   31     (void) sodium_runtime_has_rdrand();
   32 
   33     sodium_set_misuse_handler(misuse_handler);
   34 #ifndef __EMSCRIPTEN__
   35     sodium_misuse();
   36     printf("Misuse handler returned\n");
   37 #else
   38     printf("misuse_handler()\n");
   39 #endif
   40 
   41     return 0;
   42 }

Cache object: 4fcd7d69ff4c28a7d6d855a14c8cbe75


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.