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
11
/* OMAC1 Support by Tom St Denis (for 64 and 128 bit block ciphers only) */
16
int omac_memory(int cipher,
17
const unsigned char *key, unsigned long keylen,
18
const unsigned char *msg, unsigned long msglen,
19
unsigned char *out, unsigned long *outlen)
27
_ARGCHK(outlen != NULL);
29
/* allocate ram for omac state */
30
omac = XMALLOC(sizeof(omac_state));
35
/* omac process the message */
36
if ((err = omac_init(omac, cipher, key, keylen)) != CRYPT_OK) {
39
if ((err = omac_process(omac, msg, msglen)) != CRYPT_OK) {
42
if ((err = omac_done(omac, out, outlen)) != CRYPT_OK) {
49
zeromem(omac, sizeof(omac_state));