aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFCrypto_native.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDFCrypto_native.cc')
-rw-r--r--libqpdf/QPDFCrypto_native.cc29
1 files changed, 16 insertions, 13 deletions
diff --git a/libqpdf/QPDFCrypto_native.cc b/libqpdf/QPDFCrypto_native.cc
index 22340648..5255ba30 100644
--- a/libqpdf/QPDFCrypto_native.cc
+++ b/libqpdf/QPDFCrypto_native.cc
@@ -7,7 +7,8 @@
#endif
#include <qpdf/SecureRandomDataProvider.hh>
-static RandomDataProvider* getRandomProvider()
+static RandomDataProvider*
+getRandomProvider()
{
#ifdef USE_INSECURE_RANDOM
static RandomDataProvider* insecure_random_data_provider =
@@ -18,13 +19,12 @@ static RandomDataProvider* getRandomProvider()
static RandomDataProvider* secure_random_data_provider =
SecureRandomDataProvider::getInstance();
- static RandomDataProvider* provider = (
- secure_random_data_provider ? secure_random_data_provider
- : insecure_random_data_provider ? insecure_random_data_provider
- : 0);
+ static RandomDataProvider* provider =
+ (secure_random_data_provider ? secure_random_data_provider
+ : insecure_random_data_provider ? insecure_random_data_provider
+ : 0);
- if (provider == 0)
- {
+ if (provider == 0) {
throw std::logic_error("QPDFCrypto_native has no random data provider");
}
@@ -68,8 +68,8 @@ QPDFCrypto_native::RC4_init(unsigned char const* key_data, int key_len)
}
void
-QPDFCrypto_native::RC4_process(unsigned char* in_data, size_t len,
- unsigned char* out_data)
+QPDFCrypto_native::RC4_process(
+ unsigned char* in_data, size_t len, unsigned char* out_data)
{
this->rc4->process(in_data, len, out_data);
}
@@ -105,8 +105,11 @@ QPDFCrypto_native::SHA2_digest()
void
QPDFCrypto_native::rijndael_init(
- bool encrypt, unsigned char const* key_data, size_t key_len,
- bool cbc_mode, unsigned char* cbc_block)
+ bool encrypt,
+ unsigned char const* key_data,
+ size_t key_len,
+ bool cbc_mode,
+ unsigned char* cbc_block)
{
this->aes_pdf = std::make_shared<AES_PDF_native>(
@@ -114,8 +117,8 @@ QPDFCrypto_native::rijndael_init(
}
void
-QPDFCrypto_native::rijndael_process(unsigned char* in_data,
- unsigned char* out_data)
+QPDFCrypto_native::rijndael_process(
+ unsigned char* in_data, unsigned char* out_data)
{
this->aes_pdf->update(in_data, out_data);
}