diff options
Diffstat (limited to 'libqpdf/rijndael.cc')
-rw-r--r-- | libqpdf/rijndael.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libqpdf/rijndael.cc b/libqpdf/rijndael.cc index 7f711df7..c60c2288 100644 --- a/libqpdf/rijndael.cc +++ b/libqpdf/rijndael.cc @@ -710,7 +710,7 @@ static const u32 rcon[] = * * @return the number of rounds for the given cipher key size. */ -int rijndaelSetupEncrypt(u32 *rk, const u8 *key, int keybits) +unsigned int rijndaelSetupEncrypt(u32 *rk, const u8 *key, size_t keybits) { int i = 0; u32 temp; @@ -799,9 +799,9 @@ int rijndaelSetupEncrypt(u32 *rk, const u8 *key, int keybits) * * @return the number of rounds for the given cipher key size. */ -int rijndaelSetupDecrypt(u32 *rk, const u8 *key, int keybits) +unsigned int rijndaelSetupDecrypt(u32 *rk, const u8 *key, size_t keybits) { - int nrounds, i, j; + unsigned int nrounds, i, j; u32 temp; /* expand the cipher key: */ @@ -842,7 +842,8 @@ int rijndaelSetupDecrypt(u32 *rk, const u8 *key, int keybits) return nrounds; } -void rijndaelEncrypt(const u32 *rk, int nrounds, const u8 plaintext[16], +void rijndaelEncrypt(const u32 *rk, unsigned int nrounds, + const u8 plaintext[16], u8 ciphertext[16]) { u32 s0, s1, s2, s3, t0, t1, t2, t3; @@ -1024,7 +1025,8 @@ void rijndaelEncrypt(const u32 *rk, int nrounds, const u8 plaintext[16], PUTU32(ciphertext + 12, s3); } -void rijndaelDecrypt(const u32 *rk, int nrounds, const u8 ciphertext[16], +void rijndaelDecrypt(const u32 *rk, unsigned int nrounds, + const u8 ciphertext[16], u8 plaintext[16]) { u32 s0, s1, s2, s3, t0, t1, t2, t3; |