diff options
Diffstat (limited to 'libqpdf/rijndael.cc')
-rw-r--r-- | libqpdf/rijndael.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libqpdf/rijndael.cc b/libqpdf/rijndael.cc index 64748d82..7f711df7 100644 --- a/libqpdf/rijndael.cc +++ b/libqpdf/rijndael.cc @@ -693,15 +693,17 @@ static const u32 rcon[] = /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */ }; -#define GETU32(plaintext) (((u32)(plaintext)[0] << 24) ^ \ - ((u32)(plaintext)[1] << 16) ^ \ - ((u32)(plaintext)[2] << 8) ^ \ - ((u32)(plaintext)[3])) +#define GETU32(plaintext) \ + ((static_cast<u32>((plaintext)[0]) << 24) ^ \ + (static_cast<u32>((plaintext)[1]) << 16) ^ \ + (static_cast<u32>((plaintext)[2]) << 8) ^ \ + (static_cast<u32>((plaintext)[3]))) -#define PUTU32(ciphertext, st) { (ciphertext)[0] = (u8)((st) >> 24); \ - (ciphertext)[1] = (u8)((st) >> 16); \ - (ciphertext)[2] = (u8)((st) >> 8); \ - (ciphertext)[3] = (u8)(st); } +#define PUTU32(ciphertext, st) { \ + (ciphertext)[0] = static_cast<u8>((st) >> 24); \ + (ciphertext)[1] = static_cast<u8>((st) >> 16); \ + (ciphertext)[2] = static_cast<u8>((st) >> 8); \ + (ciphertext)[3] = static_cast<u8>(st); } /** * Expand the cipher key into the encryption key schedule. |