MCPcopy Create free account
hub / github.com/ElementsProject/elements / MyDestination

Method MyDestination

src/i2p.cpp:335–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

333}
334
335Binary Session::MyDestination() const
336{
337 // From https://geti2p.net/spec/common-structures#destination:
338 // "They are 387 bytes plus the certificate length specified at bytes 385-386, which may be
339 // non-zero"
340 static constexpr size_t DEST_LEN_BASE = 387;
341 static constexpr size_t CERT_LEN_POS = 385;
342
343 uint16_t cert_len;
344 memcpy(&cert_len, &m_private_key.at(CERT_LEN_POS), sizeof(cert_len));
345 cert_len = be16toh(cert_len);
346
347 const size_t dest_len = DEST_LEN_BASE + cert_len;
348
349 return Binary{m_private_key.begin(), m_private_key.begin() + dest_len};
350}
351
352void Session::CreateIfNotCreatedAlready()
353{

Callers

nothing calls this directly

Calls 2

be16tohFunction · 0.85
beginMethod · 0.45

Tested by

no test coverage detected