diff omac_done.c @ 143:5d99163f7e32 libtomcrypt-orig

import of libtomcrypt 0.99
author Matt Johnston <matt@ucc.asn.au>
date Sun, 19 Dec 2004 11:34:45 +0000
parents 7faae8f46238
children
line wrap: on
line diff
--- a/omac_done.c	Tue Jun 15 14:07:21 2004 +0000
+++ b/omac_done.c	Sun Dec 19 11:34:45 2004 +0000
@@ -15,10 +15,12 @@
 
 int omac_done(omac_state *state, unsigned char *out, unsigned long *outlen)
 {
-   int err, mode, x;
+   int       err, mode;
+   unsigned  x;
 
-   _ARGCHK(state != NULL);
-   _ARGCHK(out   != NULL);
+   _ARGCHK(state  != NULL);
+   _ARGCHK(out    != NULL);
+   _ARGCHK(outlen != NULL);
    if ((err = cipher_is_valid(state->cipher_idx)) != CRYPT_OK) {
       return err;
    }
@@ -43,7 +45,7 @@
    }
 
    /* now xor prev + Lu[mode] */
-   for (x = 0; x < state->blklen; x++) {
+   for (x = 0; x < (unsigned)state->blklen; x++) {
        state->block[x] ^= state->prev[x] ^ state->Lu[mode][x];
    }
 
@@ -51,7 +53,7 @@
    cipher_descriptor[state->cipher_idx].ecb_encrypt(state->block, state->block, &state->key);
  
    /* output it */
-   for (x = 0; x < state->blklen && (unsigned long)x < *outlen; x++) {
+   for (x = 0; x < (unsigned)state->blklen && x < *outlen; x++) {
        out[x] = state->block[x];
    }
    *outlen = x;