mirror of https://github.com/ipxe/ipxe.git
[crypto] Add parentheses around len argument in blocksize assert
This fixes an issue where passing a length as a compound expression (e.g. using `hdrlen + datalen') would trigger compiler warnings and potentially precedence-related errors. Signed-off-by: Marty Connor <mdc@etherboot.org>pull/1/head
parent
59b7d00c06
commit
ff4d61de96
|
@ -129,7 +129,7 @@ static inline void cipher_encrypt ( struct cipher_algorithm *cipher,
|
|||
cipher->encrypt ( ctx, src, dst, len );
|
||||
}
|
||||
#define cipher_encrypt( cipher, ctx, src, dst, len ) do { \
|
||||
assert ( ( len & ( (cipher)->blocksize - 1 ) ) == 0 ); \
|
||||
assert ( ( (len) & ( (cipher)->blocksize - 1 ) ) == 0 ); \
|
||||
cipher_encrypt ( (cipher), (ctx), (src), (dst), (len) ); \
|
||||
} while ( 0 )
|
||||
|
||||
|
@ -139,7 +139,7 @@ static inline void cipher_decrypt ( struct cipher_algorithm *cipher,
|
|||
cipher->decrypt ( ctx, src, dst, len );
|
||||
}
|
||||
#define cipher_decrypt( cipher, ctx, src, dst, len ) do { \
|
||||
assert ( ( len & ( (cipher)->blocksize - 1 ) ) == 0 ); \
|
||||
assert ( ( (len) & ( (cipher)->blocksize - 1 ) ) == 0 ); \
|
||||
cipher_decrypt ( (cipher), (ctx), (src), (dst), (len) ); \
|
||||
} while ( 0 )
|
||||
|
||||
|
|
Loading…
Reference in New Issue