OpenVPN 3 Core Library
|
Public Member Functions | |
Nonce () | |
void | set_tail (const StaticKey &sk) |
Nonce (const Nonce &ref, PacketIDDataSend &pid_send, const unsigned char *op32) | |
void | prepend_ad (Buffer &buf, const PacketIDDataSend &pid_send) const |
Nonce (const Nonce &ref, const PacketIDDataReceive &recv_pid, Buffer &buf, const unsigned char *op32) | |
bool | verify_packet_id (PacketIDDataReceive &pid_recv, const PacketIDControl::time_t now, const SessionStats::Ptr &stats_arg) |
const unsigned char * | iv () const |
const unsigned char * | ad () const |
size_t | ad_len (const PacketIDDataSend &pid_send) const |
size_t | ad_len (const PacketIDDataReceive &pid_recv) const |
Private Attributes | |
bool | ad_op32 |
unsigned char | data [16] |
Static Private Attributes | |
static constexpr std::size_t | data_offset_pkt_id = 4 |
static constexpr std::size_t | op32_size = 4 |
Definition at line 44 of file crypto_aead.hpp.
|
inline |
Definition at line 47 of file crypto_aead.hpp.
|
inline |
Copy op code and tail of packet ID
Definition at line 78 of file crypto_aead.hpp.
|
inline |
Definition at line 101 of file crypto_aead.hpp.
|
inline |
|
inline |
Definition at line 140 of file crypto_aead.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
Sets the IV tail for AEAD operations
The IV for AEAD ciphers (both AES-GCM and Chacha20-Poly1305) consists of 96 bits/12 bytes (It then gets concatenated with internal 32 bits for block counter to form a 128 bit counter for the encryption).
Since we only use 4 bytes (32 bit packet ID) on the wire, we fill out the rest of the IV with pseudorandom bytes that come from the negotiated key for the HMAC key (this key is not used by AEAD ciphers, so we reuse it for this purpose in AEAD mode).
Definition at line 66 of file crypto_aead.hpp.
|
inline |
|
private |
Definition at line 147 of file crypto_aead.hpp.
|
private |
Definition at line 152 of file crypto_aead.hpp.
|
staticconstexprprivate |
Definition at line 153 of file crypto_aead.hpp.
|
staticconstexprprivate |
Definition at line 154 of file crypto_aead.hpp.