1
/* LibTomCrypt, modular cryptographic library -- Tom St Denis
3
* LibTomCrypt is a library that provides various cryptographic
4
* algorithms in a highly modular and flexible manner.
6
* The library is free for all purposes without any express
9
* Tom St Denis, tomstdenis@iahu.ca, http://libtomcrypt.org
12
/* PMAC implementation by Tom St Denis */
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)
28
_ARGCHK(outlen != NULL);
30
/* allocate ram for pmac state */
31
pmac = XMALLOC(sizeof(pmac_state));
36
if ((err = pmac_init(pmac, cipher, key, keylen)) != CRYPT_OK) {
39
if ((err = pmac_process(pmac, msg, msglen)) != CRYPT_OK) {
42
if ((err = pmac_done(pmac, out, outlen)) != CRYPT_OK) {
49
zeromem(pmac, sizeof(pmac_state));