java.lang.Object
net.i2p.router.transport.udp.SSU2Header.Scratch
Enclosing class:
SSU2Header

private static final class SSU2Header.Scratchextends Object
Thread-scoped scratch for the trial decrypts, which run 3-6 times per inbound datagram on the UDP handle threads.

Safe because a trial-decrypted Header never escapes the calling method: SSU2Header.acceptTrialDecrypt(UDPPacket, Header) copies the bytes into the packet, and no caller stores the Header. One scratch per header size, because SSU2Header.Header.toString() and SSU2Header.Header.getEphemeralKey() infer the header type from the array length, and because PacketHandler may hold a handshake header while falling back to a long-header decrypt of the same packet.