Back to index

courier  0.68.2
Defines | Functions | Variables
md5hmactest.c File Reference
#include "../md5/md5.h"
#include "hmac.h"
#include <stdio.h>

Go to the source code of this file.

Defines

#define MD5_INTERNAL

Functions

int main ()

Variables

struct {
const char * key
const char * data
testcases []

Define Documentation

#define MD5_INTERNAL

Definition at line 10 of file md5hmactest.c.


Function Documentation

int main ( )

Definition at line 40 of file md5hmactest.c.

{
unsigned i, j;

       for (i=0; i<sizeof(testcases)/sizeof(testcases[0]); i++)
       {
       MD5_DIGEST ok, ik, hash;

              hmac_hashkey(&hmac_md5, testcases[i].key,
                     strlen(testcases[i].key), ok, ik);

              hmac_hashtext(&hmac_md5, testcases[i].data,
                     strlen(testcases[i].data), ok, ik, hash);

              printf("test_cases[%i].digest=0x", i+1);
              for (j=0; j<MD5_DIGEST_SIZE; j++)
                     printf("%02x", hash[j]);
              printf("\n");
       }
       return (0);
}

Here is the call graph for this function:


Variable Documentation

struct { ... } testcases[] [static]