MCPcopy Create free account
hub / github.com/TelegramMessenger/cocoon / gen_deterministic_prefix

Method gen_deterministic_prefix

tdport/td/e2e/MessageEncryption.cpp:41–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41td::SecureString MessageEncryption::gen_deterministic_prefix(td::int64 data_size, td::int64 min_padding) {
42 td::SecureString buff(
43 td::narrow_cast<size_t>(((min_padding + 15 + data_size) & ~static_cast<td::int64>(15)) - data_size), '\0');
44 buff.as_mutable_slice().ubegin()[0] = td::narrow_cast<td::uint8>(buff.size());
45 CHECK((buff.size() + data_size) % 16 == 0);
46 return buff;
47}
48
49td::SecureString MessageEncryption::kdf(td::Slice secret, td::Slice password, int iterations) {
50 td::SecureString new_secret(64);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected