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. */
| 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). */ |
no test coverage detected