2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-06 04:10:52 +00:00
qpdf/libqpdf/qpdf/AES_PDF_native.hh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
676 B
C++
Raw Normal View History

2019-11-04 18:59:19 +00:00
#ifndef AES_PDF_NATIVE_HH
#define AES_PDF_NATIVE_HH
#include <cstdint>
#include <cstring>
#include <memory>
class AES_PDF_native
{
public:
// key should be a pointer to key_bytes bytes of data
AES_PDF_native(
bool encrypt,
unsigned char const* key,
size_t key_bytes,
bool cbc_mode,
unsigned char* cbc_block);
~AES_PDF_native() = default;
2019-11-04 18:59:19 +00:00
void update(unsigned char* in_data, unsigned char* out_data);
private:
bool encrypt;
bool cbc_mode;
unsigned char* cbc_block;
2019-11-04 18:59:19 +00:00
std::unique_ptr<unsigned char[]> key;
std::unique_ptr<uint32_t[]> rk;
unsigned int nrounds;
};
#endif // AES_PDF_NATIVE_HH