| 30 | } |
| 31 | |
| 32 | td::SecureString MessageEncryption::gen_random_prefix(td::int64 data_size, td::int64 min_padding) { |
| 33 | td::SecureString buff( |
| 34 | td::narrow_cast<size_t>(((min_padding + 15 + data_size) & ~static_cast<td::int64>(15)) - data_size), '\0'); |
| 35 | td::Random::secure_bytes(buff.as_mutable_slice()); |
| 36 | buff.as_mutable_slice().ubegin()[0] = td::narrow_cast<td::uint8>(buff.size()); |
| 37 | CHECK((buff.size() + data_size) % 16 == 0); |
| 38 | return buff; |
| 39 | } |
| 40 | |
| 41 | td::SecureString MessageEncryption::gen_deterministic_prefix(td::int64 data_size, td::int64 min_padding) { |
| 42 | td::SecureString buff( |
nothing calls this directly
no outgoing calls
no test coverage detected