comparison libtomcrypt/src/mac/omac/omac_memory.c @ 382:0cbe8f6dbf9e

propagate from branch 'au.asn.ucc.matt.ltc.dropbear' (head 2af22fb4e878750b88f80f90d439b316d229796f) to branch 'au.asn.ucc.matt.dropbear' (head 02c413252c90e9de8e03d91e9939dde3029f5c0a)
author Matt Johnston <matt@ucc.asn.au>
date Thu, 11 Jan 2007 02:41:05 +0000
parents 1b9e69c058d2
children f849a5ca2efc
comparison
equal deleted inserted replaced
379:b66a00272a90 382:0cbe8f6dbf9e
4 * algorithms in a highly modular and flexible manner. 4 * algorithms in a highly modular and flexible manner.
5 * 5 *
6 * The library is free for all purposes without any express 6 * The library is free for all purposes without any express
7 * guarantee it works. 7 * guarantee it works.
8 * 8 *
9 * Tom St Denis, [email protected], http://libtomcrypt.org 9 * Tom St Denis, [email protected], http://libtomcrypt.com
10 */ 10 */
11 #include "tomcrypt.h" 11 #include "tomcrypt.h"
12 12
13 /** 13 /**
14 @file omac_memory.c 14 @file omac_memory.c
15 OMAC1 support, process a block of memory, Tom St Denis 15 OMAC1 support, process a block of memory, Tom St Denis
16 */ 16 */
17 17
18 #ifdef OMAC 18 #ifdef LTC_OMAC
19 19
20 /** 20 /**
21 OMAC a block of memory 21 OMAC a block of memory
22 @param cipher The index of the desired cipher 22 @param cipher The index of the desired cipher
23 @param key The secret key 23 @param key The secret key
38 38
39 LTC_ARGCHK(key != NULL); 39 LTC_ARGCHK(key != NULL);
40 LTC_ARGCHK(in != NULL); 40 LTC_ARGCHK(in != NULL);
41 LTC_ARGCHK(out != NULL); 41 LTC_ARGCHK(out != NULL);
42 LTC_ARGCHK(outlen != NULL); 42 LTC_ARGCHK(outlen != NULL);
43
44 /* is the cipher valid? */
45 if ((err = cipher_is_valid(cipher)) != CRYPT_OK) {
46 return err;
47 }
48
49 /* Use accelerator if found */
50 if (cipher_descriptor[cipher].omac_memory != NULL) {
51 return cipher_descriptor[cipher].omac_memory(key, keylen, in, inlen, out, outlen);
52 }
43 53
44 /* allocate ram for omac state */ 54 /* allocate ram for omac state */
45 omac = XMALLOC(sizeof(omac_state)); 55 omac = XMALLOC(sizeof(omac_state));
46 if (omac == NULL) { 56 if (omac == NULL) {
47 return CRYPT_MEM; 57 return CRYPT_MEM;
69 } 79 }
70 80
71 #endif 81 #endif
72 82
73 /* $Source: /cvs/libtom/libtomcrypt/src/mac/omac/omac_memory.c,v $ */ 83 /* $Source: /cvs/libtom/libtomcrypt/src/mac/omac/omac_memory.c,v $ */
74 /* $Revision: 1.3 $ */ 84 /* $Revision: 1.6 $ */
75 /* $Date: 2005/05/05 14:35:58 $ */ 85 /* $Date: 2006/11/08 23:01:06 $ */