7 unsigned char pt[48] = "the quick brown fox jumps over a lazy dog";
8 unsigned char key[16] = {
9 0x0f,0x65,0xd1,0x3a,0xfe,0xcb,0xc4,0xb9,0x52,0xb1,0x60,0xcf,0xe8,0x55,0x6a,0xdd
12 static void usage(const char const *cmd)
14 fprintf(stderr, "usage: %s\n", cmd);
17 #define printh(p,x) printh_f(p, x, sizeof(x))
18 void printh_f(char *p, unsigned char *x, size_t l)
22 for (i=0; i<l; i++) printf(" %02x", x[i]);
26 int main(int argc, char *argv[])
29 unsigned char ct1[48], re1[48];
30 unsigned char sha1[20], sha2[20];
31 unsigned char hmac1[20], hmac2[20];
33 printf("source: %s\n", pt);
36 if (select_crypto_if(0)) return 1;
37 if (err = encrypt(key, sizeof(key), pt, ct1, sizeof(pt)))
38 printf("encrypt error: %s\n", crypto_errstr(err));
40 if (err = decrypt(key, sizeof(key), ct1, re1, sizeof(re1)))
41 printf("decrypt error: %s\n", crypto_errstr(err));
43 if (select_crypto_if(1)) return 1;