Mercurial > dropbear
comparison pmac_memory.c @ 3:7faae8f46238 libtomcrypt-orig
Branch renaming
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Mon, 31 May 2004 18:25:41 +0000 |
parents | |
children | 5d99163f7e32 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 3:7faae8f46238 |
---|---|
1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis | |
2 * | |
3 * LibTomCrypt is a library that provides various cryptographic | |
4 * algorithms in a highly modular and flexible manner. | |
5 * | |
6 * The library is free for all purposes without any express | |
7 * guarantee it works. | |
8 * | |
9 * Tom St Denis, [email protected], http://libtomcrypt.org | |
10 */ | |
11 | |
12 /* PMAC implementation by Tom St Denis */ | |
13 #include "mycrypt.h" | |
14 | |
15 #ifdef PMAC | |
16 | |
17 int pmac_memory(int cipher, | |
18 const unsigned char *key, unsigned long keylen, | |
19 const unsigned char *msg, unsigned long msglen, | |
20 unsigned char *out, unsigned long *outlen) | |
21 { | |
22 int err; | |
23 pmac_state pmac; | |
24 | |
25 _ARGCHK(key != NULL); | |
26 _ARGCHK(msg != NULL); | |
27 _ARGCHK(out != NULL); | |
28 _ARGCHK(outlen != NULL); | |
29 | |
30 | |
31 if ((err = pmac_init(&pmac, cipher, key, keylen)) != CRYPT_OK) { | |
32 return err; | |
33 } | |
34 if ((err = pmac_process(&pmac, msg, msglen)) != CRYPT_OK) { | |
35 return err; | |
36 } | |
37 if ((err = pmac_done(&pmac, out, outlen)) != CRYPT_OK) { | |
38 return err; | |
39 } | |
40 | |
41 return CRYPT_OK; | |
42 } | |
43 | |
44 #endif |