| 259 | } |
| 260 | |
| 261 | static std::string encrypt_string(td::Slice S, td::Slice secret) { |
| 262 | auto enc_value = tde2e_core::MessageEncryption::encrypt_data(S, secret); |
| 263 | td::UniqueSlice buf(2 * enc_value.size() + 4); |
| 264 | auto t = buf.as_mutable_slice(); |
| 265 | t.copy_from("ENC_"); |
| 266 | t.remove_prefix(4); |
| 267 | t.copy_from(td::hex_encode(enc_value.as_slice())); |
| 268 | return buf.as_slice().str(); |
| 269 | } |
| 270 | |
| 271 | static td::Status decrypt_all_strings(nlohmann::json &b, td::Slice shared_secret) { |
| 272 | for (auto &[key, value] : b.items()) { |
no test coverage detected