Line | Count | Source |
1 | | #include <qpdf/RC4.hh> |
2 | | |
3 | | #include <qpdf/QPDFCryptoProvider.hh> |
4 | | |
5 | | RC4::RC4(unsigned char const* key_data, int key_len) : |
6 | 34.5k | crypto(QPDFCryptoProvider::getImpl()) |
7 | 34.5k | { |
8 | 34.5k | crypto->RC4_init(key_data, key_len); |
9 | 34.5k | } |
10 | | |
11 | | void |
12 | | RC4::process(unsigned char const* in_data, size_t len, unsigned char* out_data) |
13 | 34.6k | { |
14 | 34.6k | crypto->RC4_process(in_data, len, out_data); |
15 | 34.6k | } |
16 | | |
17 | | void |
18 | | RC4::process(std::string_view key, std::string& data) |
19 | 22.9k | { |
20 | 22.9k | RC4 rc4(reinterpret_cast<unsigned char const*>(key.data()), static_cast<int>(key.size())); |
21 | 22.9k | rc4.process( |
22 | 22.9k | reinterpret_cast<unsigned char const*>(data.data()), |
23 | 22.9k | data.size(), |
24 | 22.9k | reinterpret_cast<unsigned char*>(data.data())); |
25 | 22.9k | } |