summaryrefslogtreecommitdiffhomepage
path: root/libtomcrypt/src/mac/omac
diff options
context:
space:
mode:
Diffstat (limited to 'libtomcrypt/src/mac/omac')
-rw-r--r--libtomcrypt/src/mac/omac/omac_done.c14
-rw-r--r--libtomcrypt/src/mac/omac/omac_file.c14
-rw-r--r--libtomcrypt/src/mac/omac/omac_init.c14
-rw-r--r--libtomcrypt/src/mac/omac/omac_memory.c16
-rw-r--r--libtomcrypt/src/mac/omac/omac_memory_multi.c18
-rw-r--r--libtomcrypt/src/mac/omac/omac_process.c29
-rw-r--r--libtomcrypt/src/mac/omac/omac_test.c12
7 files changed, 59 insertions, 58 deletions
diff --git a/libtomcrypt/src/mac/omac/omac_done.c b/libtomcrypt/src/mac/omac/omac_done.c
index 7a0453b..796bdf9 100644
--- a/libtomcrypt/src/mac/omac/omac_done.c
+++ b/libtomcrypt/src/mac/omac/omac_done.c
@@ -6,20 +6,20 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
/**
@file omac_done.c
- OMAC1 support, terminate a stream, Tom St Denis
+ LTC_OMAC1 support, terminate a stream, Tom St Denis
*/
#ifdef LTC_OMAC
/**
- Terminate an OMAC stream
- @param omac The OMAC state
+ Terminate an LTC_OMAC stream
+ @param omac The LTC_OMAC state
@param out [out] Destination for the authentication tag
@param outlen [in/out] The max size and resulting size of the authentication tag
@return CRYPT_OK if successful
@@ -81,6 +81,6 @@ int omac_done(omac_state *omac, unsigned char *out, unsigned long *outlen)
#endif
-/* $Source: /cvs/libtom/libtomcrypt/src/mac/omac/omac_done.c,v $ */
-/* $Revision: 1.7 $ */
-/* $Date: 2006/11/03 00:39:49 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
diff --git a/libtomcrypt/src/mac/omac/omac_file.c b/libtomcrypt/src/mac/omac/omac_file.c
index 7117ae3..54871e0 100644
--- a/libtomcrypt/src/mac/omac/omac_file.c
+++ b/libtomcrypt/src/mac/omac/omac_file.c
@@ -6,23 +6,23 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
/**
@file omac_file.c
- OMAC1 support, process a file, Tom St Denis
+ LTC_OMAC1 support, process a file, Tom St Denis
*/
#ifdef LTC_OMAC
/**
- OMAC a file
+ LTC_OMAC a file
@param cipher The index of the cipher desired
@param key The secret key
@param keylen The length of the secret key (octets)
- @param filename The name of the file you wish to OMAC
+ @param filename The name of the file you wish to LTC_OMAC
@param out [out] Where the authentication tag is to be stored
@param outlen [in/out] The max size and resulting size of the authentication tag
@return CRYPT_OK if successful, CRYPT_NOP if file support has been disabled
@@ -78,6 +78,6 @@ int omac_file(int cipher,
#endif
-/* $Source: /cvs/libtom/libtomcrypt/src/mac/omac/omac_file.c,v $ */
-/* $Revision: 1.5 $ */
-/* $Date: 2006/11/03 00:39:49 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
diff --git a/libtomcrypt/src/mac/omac/omac_init.c b/libtomcrypt/src/mac/omac/omac_init.c
index cbf26a2..36a4a3d 100644
--- a/libtomcrypt/src/mac/omac/omac_init.c
+++ b/libtomcrypt/src/mac/omac/omac_init.c
@@ -6,21 +6,21 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
/**
@file omac_init.c
- OMAC1 support, initialize state, by Tom St Denis
+ LTC_OMAC1 support, initialize state, by Tom St Denis
*/
#ifdef LTC_OMAC
/**
- Initialize an OMAC state
- @param omac The OMAC state to initialize
+ Initialize an LTC_OMAC state
+ @param omac The LTC_OMAC state to initialize
@param cipher The index of the desired cipher
@param key The secret key
@param keylen The length of the secret key (octets)
@@ -96,6 +96,6 @@ int omac_init(omac_state *omac, int cipher, const unsigned char *key, unsigned l
#endif
-/* $Source: /cvs/libtom/libtomcrypt/src/mac/omac/omac_init.c,v $ */
-/* $Revision: 1.10 $ */
-/* $Date: 2006/11/03 00:39:49 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
diff --git a/libtomcrypt/src/mac/omac/omac_memory.c b/libtomcrypt/src/mac/omac/omac_memory.c
index 50b2db0..c9f3392 100644
--- a/libtomcrypt/src/mac/omac/omac_memory.c
+++ b/libtomcrypt/src/mac/omac/omac_memory.c
@@ -6,24 +6,24 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
/**
@file omac_memory.c
- OMAC1 support, process a block of memory, Tom St Denis
+ LTC_OMAC1 support, process a block of memory, Tom St Denis
*/
#ifdef LTC_OMAC
/**
- OMAC a block of memory
+ LTC_OMAC a block of memory
@param cipher The index of the desired cipher
@param key The secret key
@param keylen The length of the secret key (octets)
- @param in The data to send through OMAC
- @param inlen The length of the data to send through OMAC (octets)
+ @param in The data to send through LTC_OMAC
+ @param inlen The length of the data to send through LTC_OMAC (octets)
@param out [out] The destination of the authentication tag
@param outlen [in/out] The max size and resulting size of the authentication tag (octets)
@return CRYPT_OK if successful
@@ -80,6 +80,6 @@ LBL_ERR:
#endif
-/* $Source: /cvs/libtom/libtomcrypt/src/mac/omac/omac_memory.c,v $ */
-/* $Revision: 1.6 $ */
-/* $Date: 2006/11/08 23:01:06 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
diff --git a/libtomcrypt/src/mac/omac/omac_memory_multi.c b/libtomcrypt/src/mac/omac/omac_memory_multi.c
index 4445ca2..3db8270 100644
--- a/libtomcrypt/src/mac/omac/omac_memory_multi.c
+++ b/libtomcrypt/src/mac/omac/omac_memory_multi.c
@@ -6,28 +6,28 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
#include <stdarg.h>
/**
@file omac_memory_multi.c
- OMAC1 support, process multiple blocks of memory, Tom St Denis
+ LTC_OMAC1 support, process multiple blocks of memory, Tom St Denis
*/
#ifdef LTC_OMAC
/**
- OMAC multiple blocks of memory
+ LTC_OMAC multiple blocks of memory
@param cipher The index of the desired cipher
@param key The secret key
@param keylen The length of the secret key (octets)
@param out [out] The destination of the authentication tag
@param outlen [in/out] The max size and resulting size of the authentication tag (octets)
- @param in The data to send through OMAC
- @param inlen The length of the data to send through OMAC (octets)
- @param ... tuples of (data,len) pairs to OMAC, terminated with a (NULL,x) (x=don't care)
+ @param in The data to send through LTC_OMAC
+ @param inlen The length of the data to send through LTC_OMAC (octets)
+ @param ... tuples of (data,len) pairs to LTC_OMAC, terminated with a (NULL,x) (x=don't care)
@return CRYPT_OK if successful
*/
int omac_memory_multi(int cipher,
@@ -85,6 +85,6 @@ LBL_ERR:
#endif
-/* $Source: /cvs/libtom/libtomcrypt/src/mac/omac/omac_memory_multi.c,v $ */
-/* $Revision: 1.5 $ */
-/* $Date: 2006/11/03 00:39:49 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
diff --git a/libtomcrypt/src/mac/omac/omac_process.c b/libtomcrypt/src/mac/omac/omac_process.c
index f4b96f5..a70b179 100644
--- a/libtomcrypt/src/mac/omac/omac_process.c
+++ b/libtomcrypt/src/mac/omac/omac_process.c
@@ -6,28 +6,28 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
/**
@file omac_process.c
- OMAC1 support, process data, Tom St Denis
+ LTC_OMAC1 support, process data, Tom St Denis
*/
#ifdef LTC_OMAC
/**
- Process data through OMAC
- @param omac The OMAC state
- @param in The input data to send through OMAC
+ Process data through LTC_OMAC
+ @param omac The LTC_OMAC state
+ @param in The input data to send through LTC_OMAC
@param inlen The length of the input (octets)
@return CRYPT_OK if successful
*/
int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen)
{
- unsigned long n, x;
+ unsigned long n, x, blklen;
int err;
LTC_ARGCHK(omac != NULL);
@@ -42,13 +42,14 @@ int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen)
}
#ifdef LTC_FAST
- if (omac->buflen == 0 && inlen > 16) {
- int y;
- for (x = 0; x < (inlen - 16); x += 16) {
- for (y = 0; y < 16; y += sizeof(LTC_FAST_TYPE)) {
+ blklen = cipher_descriptor[omac->cipher_idx].block_length;
+ if (omac->buflen == 0 && inlen > blklen) {
+ unsigned long y;
+ for (x = 0; x < (inlen - blklen); x += blklen) {
+ for (y = 0; y < blklen; y += sizeof(LTC_FAST_TYPE)) {
*((LTC_FAST_TYPE*)(&omac->prev[y])) ^= *((LTC_FAST_TYPE*)(&in[y]));
}
- in += 16;
+ in += blklen;
if ((err = cipher_descriptor[omac->cipher_idx].ecb_encrypt(omac->prev, omac->prev, &omac->key)) != CRYPT_OK) {
return err;
}
@@ -83,6 +84,6 @@ int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen)
#endif
-/* $Source: /cvs/libtom/libtomcrypt/src/mac/omac/omac_process.c,v $ */
-/* $Revision: 1.9 $ */
-/* $Date: 2006/11/03 00:39:49 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */
diff --git a/libtomcrypt/src/mac/omac/omac_test.c b/libtomcrypt/src/mac/omac/omac_test.c
index 3230a8c..10f5725 100644
--- a/libtomcrypt/src/mac/omac/omac_test.c
+++ b/libtomcrypt/src/mac/omac/omac_test.c
@@ -6,19 +6,19 @@
* The library is free for all purposes without any express
* guarantee it works.
*
- * Tom St Denis, tomstdenis@gmail.com, http://libtomcrypt.com
+ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org
*/
#include "tomcrypt.h"
/**
@file omac_test.c
- OMAC1 support, self-test, by Tom St Denis
+ LTC_OMAC1 support, self-test, by Tom St Denis
*/
#ifdef LTC_OMAC
/**
- Test the OMAC setup
+ Test the LTC_OMAC setup
@return CRYPT_OK if successful, CRYPT_NOP if tests have been disabled
*/
int omac_test(void)
@@ -105,6 +105,6 @@ int omac_test(void)
#endif
-/* $Source: /cvs/libtom/libtomcrypt/src/mac/omac/omac_test.c,v $ */
-/* $Revision: 1.6 $ */
-/* $Date: 2006/11/03 00:39:49 $ */
+/* $Source$ */
+/* $Revision$ */
+/* $Date$ */