modification to suppress compiler warning when LTC_FAST is not defined
This commit is contained in:
parent
fcd5faf947
commit
6816ac3f3f
@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen)
|
int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen)
|
||||||
{
|
{
|
||||||
unsigned long n, x, blklen;
|
unsigned long n, x;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
LTC_ARGCHK(omac != NULL);
|
LTC_ARGCHK(omac != NULL);
|
||||||
@ -42,20 +42,24 @@ int omac_process(omac_state *omac, const unsigned char *in, unsigned long inlen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LTC_FAST
|
#ifdef LTC_FAST
|
||||||
blklen = cipher_descriptor[omac->cipher_idx].block_length;
|
{
|
||||||
if (omac->buflen == 0 && inlen > blklen) {
|
unsigned long blklen;
|
||||||
unsigned long y;
|
|
||||||
for (x = 0; x < (inlen - blklen); x += blklen) {
|
blklen = cipher_descriptor[omac->cipher_idx].block_length;
|
||||||
for (y = 0; y < blklen; y += sizeof(LTC_FAST_TYPE)) {
|
if (omac->buflen == 0 && inlen > blklen) {
|
||||||
*((LTC_FAST_TYPE*)(&omac->prev[y])) ^= *((LTC_FAST_TYPE*)(&in[y]));
|
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 += blklen;
|
||||||
|
if ((err = cipher_descriptor[omac->cipher_idx].ecb_encrypt(omac->prev, omac->prev, &omac->key)) != CRYPT_OK) {
|
||||||
|
return err;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
in += blklen;
|
inlen -= x;
|
||||||
if ((err = cipher_descriptor[omac->cipher_idx].ecb_encrypt(omac->prev, omac->prev, &omac->key)) != CRYPT_OK) {
|
}
|
||||||
return err;
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
inlen -= x;
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (inlen != 0) {
|
while (inlen != 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user