Go to the documentation of this file.
20 #ifndef CRYPTOCONTEXT_H
21 #define CRYPTOCONTEXT_H
23 #include <commoncpp/config.h>
28 #define REPLAY_WINDOW_SIZE 64
40 #ifndef CRYPTOCONTEXTCTRL_H
45 #include <ccrtp/crypto/SrtpSymCrypto.h>
174 int32 masterKeyLength,
176 int32 masterSaltLength,
365 int64 key_deriv_rate;
368 uint64 replay_window;
371 uint32 master_key_length;
372 uint32 master_key_srtp_use_nb;
373 uint32 master_key_srtcp_use_nb;
375 uint32 master_salt_length;
396 SrtpSymCrypto* cipher;
397 SrtpSymCrypto* f8Cipher;
void srtpEncrypt(RTPPacket *rtp, uint64 index, uint32 ssrc)
Perform SRTP encryption.
uint32 getRoc() const
Get the Roll-Over-Counter.
Definition: CryptoContext.h:210
const int SrtpAuthenticationSkeinHmac
Definition: CryptoContext.h:32
uint64 guessIndex(uint16 newSeqNumber)
Compute (guess) the new SRTP index based on the sequence number of a received RTP packet.
The implementation for a SRTP cryptographic context.
Definition: CryptoContext.h:82
const int SrtpEncryptionAESCM
Definition: CryptoContext.h:35
void setRoc(uint32 r)
Set the Roll-Over-Counter.
Definition: CryptoContext.h:198
CryptoContext(uint32 ssrc)
Constructor for empty SRTP cryptographic context.
const int SrtpEncryptionTWOCM
Definition: CryptoContext.h:37
void update(uint16 newSeqNumber)
Update the SRTP packet index.
const int SrtpAuthenticationSha1Hmac
Definition: CryptoContext.h:31
int32 getTagLength() const
Get the length of the SRTP authentication tag in bytes.
Definition: CryptoContext.h:310
uint32 getSsrc() const
Get the SSRC of this SRTP Cryptograhic context.
Definition: CryptoContext.h:329
const int SrtpEncryptionTWOF8
Definition: CryptoContext.h:38
CryptoContext(uint32 ssrc, int32 roc, int64 keyDerivRate, const int32 ealg, const int32 aalg, uint8 *masterKey, int32 masterKeyLength, uint8 *masterSalt, int32 masterSaltLength, int32 ekeyl, int32 akeyl, int32 skeyl, int32 tagLength)
Constructor for an active SRTP cryptographic context.
CryptoContext * newCryptoContextForSSRC(uint32 ssrc, int roc, int64 keyDerivRate)
Derive a new Crypto Context for use with a new SSRC.
~CryptoContext()
Destructor.
const int SrtpEncryptionNull
Definition: CryptoContext.h:34
int32 getMkiLength() const
Get the length of the MKI in bytes.
Definition: CryptoContext.h:320
const int SrtpEncryptionAESF8
Definition: CryptoContext.h:36
bool checkReplay(uint16 newSeqNumber)
Check for packet replay.
A base class for both IncomingRTPPkt and OutgoingRTPPkt.
Definition: rtppkt.h:73
void deriveSrtpKeys(uint64 index)
Perform key derivation according to SRTP specification.
const int SrtpAuthenticationNull
Definition: CryptoContext.h:30
void srtpAuthenticate(RTPPacket *rtp, uint32 roc, uint8 *tag)
Compute the authentication tag.