* it didn't really make sense to check that the _in_ pointer is NULL * instead we should check that _in_ and _out_ are not NULL when there's something to process
@@ -31,8 +31,10 @@ int ocb3_decrypt(ocb3_state *ocb, const unsigned char *ct, unsigned long ctlen,
LTC_ARGCHK(ocb != NULL);
if (ct == NULL) LTC_ARGCHK(ctlen == 0);
- if (ctlen == 0) LTC_ARGCHK(ct == NULL);
- else LTC_ARGCHK(pt != NULL);
+ if (ctlen != 0) {
+ LTC_ARGCHK(ct != NULL);
+ LTC_ARGCHK(pt != NULL);
+ }
if ((err = cipher_is_valid(ocb->cipher)) != CRYPT_OK) {
return err;
@@ -31,8 +31,10 @@ int ocb3_decrypt_last(ocb3_state *ocb, const unsigned char *ct, unsigned long ct
goto LBL_ERR;
@@ -31,8 +31,10 @@ int ocb3_encrypt(ocb3_state *ocb, const unsigned char *pt, unsigned long ptlen,
if (pt == NULL) LTC_ARGCHK(ptlen == 0);
- if (ptlen == 0) LTC_ARGCHK(pt == NULL);
- else LTC_ARGCHK(ct != NULL);
+ if (ptlen != 0) {
@@ -31,8 +31,10 @@ int ocb3_encrypt_last(ocb3_state *ocb, const unsigned char *pt, unsigned long pt