| 34 | static constexpr auto* IV_SEED = "chat_key"; |
| 35 | |
| 36 | static std::string toHexString(const uint8_t* data, size_t length) { |
| 37 | std::stringstream stream; |
| 38 | stream << std::hex; |
| 39 | for (size_t i = 0; i < length; ++i) { |
| 40 | stream << std::setw(2) << std::setfill('0') << static_cast<int>(data[i]); |
| 41 | } |
| 42 | return stream.str(); |
| 43 | } |
| 44 | |
| 45 | static bool readHex(const std::string& input, uint8_t* buffer, size_t length) { |
| 46 | if (input.size() != length * 2) { |