MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ReceiveKey

Method ReceiveKey

src/test/net_tests.cpp:1208–1216  ·  view source on GitHub ↗

Expect ellswift key to have been received from transport and process it. * * Many other V2TransportTester functions cannot be called until after ReceiveKey() has been * called, as no encryption keys are set up before that point. */

Source from the content-addressed store, hash-verified

1206 * called, as no encryption keys are set up before that point.
1207 */
1208 void ReceiveKey()
1209 {
1210 // When processing a key, enough bytes need to have been received already.
1211 BOOST_REQUIRE(m_received.size() >= EllSwiftPubKey::size());
1212 // Initialize the cipher using it (acting as the opposite side of the tested transport).
1213 m_cipher.Initialize(MakeByteSpan(m_received).first(EllSwiftPubKey::size()), !m_test_initiator);
1214 // Strip the processed bytes off the front of the receive buffer.
1215 m_received.erase(m_received.begin(), m_received.begin() + EllSwiftPubKey::size());
1216 }
1217
1218 /** Schedule an encrypted packet with specified content/aad/ignore to be sent to transport
1219 * (only after ReceiveKey). */

Callers 1

BOOST_AUTO_TEST_CASEFunction · 0.80

Calls 6

sizeFunction · 0.85
MakeByteSpanFunction · 0.85
sizeMethod · 0.45
InitializeMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected