20#ifndef _SRTP_CRYPTOGRAPHIC_CONTEXT_HH
21#define _SRTP_CRYPTOGRAPHIC_CONTEXT_HH
36 unsigned& outPacketSize);
38 unsigned& outPacketSize);
46 unsigned& outPacketSize);
48 unsigned& outPacketSize);
54#define SRTP_CIPHER_KEY_LENGTH (128/8)
55#define SRTP_CIPHER_SALT_LENGTH (112/8)
56#define SRTP_MKI_LENGTH 4
57#define SRTP_AUTH_KEY_LENGTH (160/8)
58#define SRTP_AUTH_TAG_LENGTH (80/8)
81 u_int8_t* resultAuthenticationTag);
84 u_int8_t* resultAuthenticationTag);
88 u_int32_t roc, u_int8_t
const* authenticationTag);
90 u_int8_t
const* authenticationTag);
92 void decryptSRTPPacket(u_int64_t index, u_int32_t ssrc, u_int8_t* data,
unsigned numDataBytes);
95 void encryptSRTPPacket(u_int64_t index, u_int32_t ssrc, u_int8_t* data,
unsigned numDataBytes);
99 u_int8_t
const* dataToAuthenticate,
unsigned numBytesToAuthenticate,
100 u_int8_t* resultAuthenticationTag);
104 u_int8_t
const* dataToAuthenticate,
unsigned numBytesToAuthenticate,
105 u_int8_t
const* authenticationTag);
108 u_int8_t* data,
unsigned numDataBytes);
117 unsigned resultKeyLength, u_int8_t* resultKey);
#define SRTP_AUTH_KEY_LENGTH
#define SRTP_CIPHER_KEY_LENGTH
#define SRTP_CIPHER_SALT_LENGTH
Boolean encryptSRTCP() const
Boolean encryptSRTP() const
Boolean useAuthentication() const
u_int8_t const * keyData() const
Boolean verifySRTCPAuthenticationTag(u_int8_t const *dataToAuthenticate, unsigned numBytesToAuthenticate, u_int8_t const *authenticationTag)
Boolean processIncomingSRTCPPacket(u_int8_t *buffer, unsigned inPacketSize, unsigned &outPacketSize)
Boolean verifyAuthenticationTag(derivedKeys &keysToUse, u_int8_t const *dataToAuthenticate, unsigned numBytesToAuthenticate, u_int8_t const *authenticationTag)
MIKEYState const & fMIKEYState
virtual ~SRTPCryptographicContext()
u_int16_t fPreviousHighRTPSeqNum
unsigned generateAuthenticationTag(derivedKeys &keysToUse, u_int8_t const *dataToAuthenticate, unsigned numBytesToAuthenticate, u_int8_t *resultAuthenticationTag)
void performKeyDerivation()
void cryptData(derivedKeys &keys, u_int64_t index, u_int32_t ssrc, u_int8_t *data, unsigned numDataBytes)
void deriveKeysFromMaster(u_int8_t const *masterKey, u_int8_t const *salt, allDerivedKeys &allKeysResult)
allDerivedKeys fDerivedKeys
Boolean processOutgoingSRTCPPacket(u_int8_t *buffer, unsigned inPacketSize, unsigned &outPacketSize)
u_int8_t const * masterKey() const
Boolean verifySRTPAuthenticationTag(u_int8_t *dataToAuthenticate, unsigned numBytesToAuthenticate, u_int32_t roc, u_int8_t const *authenticationTag)
void deriveSingleKey(u_int8_t const *masterKey, u_int8_t const *salt, SRTPKeyDerivationLabel label, unsigned resultKeyLength, u_int8_t *resultKey)
unsigned generateSRTCPAuthenticationTag(u_int8_t const *dataToAuthenticate, unsigned numBytesToAuthenticate, u_int8_t *resultAuthenticationTag)
Boolean processIncomingSRTPPacket(u_int8_t *buffer, unsigned inPacketSize, unsigned &outPacketSize)
Boolean weAuthenticate() const
u_int8_t const * masterSalt() const
void decryptSRTCPPacket(u_int32_t index, u_int32_t ssrc, u_int8_t *data, unsigned numDataBytes)
Boolean processOutgoingSRTPPacket(u_int8_t *buffer, unsigned inPacketSize, unsigned &outPacketSize)
Boolean fHaveSentSRTPPackets
unsigned generateSRTPAuthenticationTag(u_int8_t const *dataToAuthenticate, unsigned numBytesToAuthenticate, u_int8_t *resultAuthenticationTag)
Boolean weEncryptSRTCP() const
u_int8_t const * masterKeyPlusSalt() const
void encryptSRTCPPacket(u_int32_t index, u_int32_t ssrc, u_int8_t *data, unsigned numDataBytes)
Boolean fHaveReceivedSRTPPackets
Boolean weEncryptSRTP() const
void decryptSRTPPacket(u_int64_t index, u_int32_t ssrc, u_int8_t *data, unsigned numDataBytes)
SRTPCryptographicContext(MIKEYState const &mikeyState)
void encryptSRTPPacket(u_int64_t index, u_int32_t ssrc, u_int8_t *data, unsigned numDataBytes)
u_int8_t cipherKey[SRTP_CIPHER_KEY_LENGTH]
u_int8_t authKey[SRTP_AUTH_KEY_LENGTH]
u_int8_t salt[SRTP_CIPHER_SALT_LENGTH]