| 992 | } // namespace |
| 993 | |
| 994 | void V2Transport::StartSendingHandshake() noexcept |
| 995 | { |
| 996 | AssertLockHeld(m_send_mutex); |
| 997 | Assume(m_send_state == SendState::AWAITING_KEY); |
| 998 | Assume(m_send_buffer.empty()); |
| 999 | // Initialize the send buffer with ellswift pubkey + provided garbage. |
| 1000 | m_send_buffer.resize(EllSwiftPubKey::size() + m_send_garbage.size()); |
| 1001 | std::copy(std::begin(m_cipher.GetOurPubKey()), std::end(m_cipher.GetOurPubKey()), MakeWritableByteSpan(m_send_buffer).begin()); |
| 1002 | std::copy(m_send_garbage.begin(), m_send_garbage.end(), m_send_buffer.begin() + EllSwiftPubKey::size()); |
| 1003 | // We cannot wipe m_send_garbage as it will still be used as AAD later in the handshake. |
| 1004 | } |
| 1005 | |
| 1006 | V2Transport::V2Transport(NodeId nodeid, bool initiating, const CKey& key, std::span<const std::byte> ent32, std::vector<uint8_t> garbage) noexcept |
| 1007 | : m_cipher{key, ent32}, |