comparison libtomcrypt/src/encauth/ocb/ocb_decrypt.c @ 1478:3a933956437e coverity

update coverity
author Matt Johnston <matt@ucc.asn.au>
date Fri, 09 Feb 2018 23:49:22 +0800
parents 6dba84798cd5
children
comparison
equal deleted inserted replaced
1439:8d24733026c5 1478:3a933956437e
3 * LibTomCrypt is a library that provides various cryptographic 3 * LibTomCrypt is a library that provides various cryptographic
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 *
9 * Tom St Denis, [email protected], http://libtom.org
10 */ 8 */
11 9
12 /** 10 /**
13 @file ocb_decrypt.c 11 @file ocb_decrypt.c
14 OCB implementation, decrypt data, by Tom St Denis 12 OCB implementation, decrypt data, by Tom St Denis
15 */ 13 */
16 #include "tomcrypt.h" 14 #include "tomcrypt.h"
17 15
18 #ifdef LTC_OCB_MODE 16 #ifdef LTC_OCB_MODE
19 17
36 /* check if valid cipher */ 34 /* check if valid cipher */
37 if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) { 35 if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) {
38 return err; 36 return err;
39 } 37 }
40 LTC_ARGCHK(cipher_descriptor[ocb->cipher].ecb_decrypt != NULL); 38 LTC_ARGCHK(cipher_descriptor[ocb->cipher].ecb_decrypt != NULL);
41 39
42 /* check length */ 40 /* check length */
43 if (ocb->block_len != cipher_descriptor[ocb->cipher].block_length) { 41 if (ocb->block_len != cipher_descriptor[ocb->cipher].block_length) {
44 return CRYPT_INVALID_ARG; 42 return CRYPT_INVALID_ARG;
45 } 43 }
46 44
72 } 70 }
73 71
74 #endif 72 #endif
75 73
76 74
77 /* $Source$ */ 75 /* ref: $Format:%D$ */
78 /* $Revision$ */ 76 /* git commit: $Format:%H$ */
79 /* $Date$ */ 77 /* commit time: $Format:%ai$ */