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/core1.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 "core1"
    3 #include "cmptest.h"
    4 
    5 static unsigned char shared[32] = { 0x4a, 0x5d, 0x9d, 0x5b, 0xa4, 0xce, 0x2d,
    6                                     0xe1, 0x72, 0x8e, 0x3b, 0xf4, 0x80, 0x35,
    7                                     0x0f, 0x25, 0xe0, 0x7e, 0x21, 0xc9, 0x47,
    8                                     0xd1, 0x9e, 0x33, 0x76, 0xf0, 0x9b, 0x3c,
    9                                     0x1e, 0x16, 0x17, 0x42 };
   10 
   11 static unsigned char zero[32];
   12 
   13 static unsigned char c[16] = { 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x20, 0x33,
   14                                0x32, 0x2d, 0x62, 0x79, 0x74, 0x65, 0x20, 0x6b };
   15 
   16 static unsigned char firstkey[32];
   17 
   18 int
   19 main(void)
   20 {
   21     int i;
   22 
   23     crypto_core_hsalsa20(firstkey, zero, shared, c);
   24     for (i = 0; i < 32; ++i) {
   25         if (i > 0) {
   26             printf(",");
   27         } else {
   28             printf(" ");
   29         }
   30         printf("0x%02x", (unsigned int) firstkey[i]);
   31         if (i % 8 == 7) {
   32             printf("\n");
   33         }
   34     }
   35     assert(crypto_core_hsalsa20_outputbytes() > 0U);
   36     assert(crypto_core_hsalsa20_inputbytes() > 0U);
   37     assert(crypto_core_hsalsa20_keybytes() > 0U);
   38     assert(crypto_core_hsalsa20_constbytes() > 0U);
   39 
   40     return 0;
   41 }

Cache object: 566af68bd8c3a0b23fdbc6079daecead


[ 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.