diff options
author | Jay Berkenbilt <ejb@ql.org> | 2019-11-04 15:04:25 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2019-11-09 14:18:02 +0100 |
commit | 4287fcc002488327ddea203365410a2361ae1e0b (patch) | |
tree | 45009d3f5aad477c582c9fcecde3a126bf2eb8c4 /libqpdf/RC4.cc | |
parent | 0cdcd10228b1845a1c66ba97527e612eed1f5e2f (diff) | |
download | qpdf-4287fcc002488327ddea203365410a2361ae1e0b.tar.zst |
RC4: switch to pluggable crypto
Diffstat (limited to 'libqpdf/RC4.cc')
-rw-r--r-- | libqpdf/RC4.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libqpdf/RC4.cc b/libqpdf/RC4.cc new file mode 100644 index 00000000..ae16f7f0 --- /dev/null +++ b/libqpdf/RC4.cc @@ -0,0 +1,16 @@ +#include <qpdf/RC4.hh> +#include <qpdf/QPDFCryptoProvider.hh> + +#include <string.h> + +RC4::RC4(unsigned char const* key_data, int key_len) : + crypto(QPDFCryptoProvider::getImpl()) +{ + this->crypto->RC4_init(key_data, key_len); +} + +void +RC4::process(unsigned char *in_data, size_t len, unsigned char* out_data) +{ + this->crypto->RC4_process(in_data, len, out_data); +} |