File: auth6.c

package info (click to toggle)
libsodium 1.0.18-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,480 kB
  • sloc: ansic: 45,158; asm: 4,264; makefile: 870; sh: 640; python: 405; xml: 30; pascal: 11
file content (23 lines) | stat: -rw-r--r-- 449 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

#define TEST_NAME "auth6"
#include "cmptest.h"

/* "Test Case 2" from RFC 4231 */
static unsigned char key[32] = "Jefe";
static unsigned char c[]     = "what do ya want for nothing?";

static unsigned char a[64];

int
main(void)
{
    int i;

    crypto_auth_hmacsha512(a, c, sizeof c - 1U, key);
    for (i = 0; i < 64; ++i) {
        printf(",0x%02x", (unsigned int) a[i]);
        if (i % 8 == 7)
            printf("\n");
    }
    return 0;
}