20#ifndef _SRTP_CRYPTOGRAPHIC_CONTEXT_HH 
   21#define _SRTP_CRYPTOGRAPHIC_CONTEXT_HH 
   36                                    unsigned& outPacketSize);
 
   38                                     unsigned& outPacketSize);
 
   46                                    unsigned& outPacketSize);
 
   48                                     unsigned& outPacketSize);
 
   56#define SRTP_CIPHER_KEY_LENGTH (128/8)  
   57#define SRTP_CIPHER_SALT_LENGTH (112/8)  
   58#define SRTP_MKI_LENGTH 4  
   59#define SRTP_AUTH_KEY_LENGTH (160/8)  
   60#define SRTP_AUTH_TAG_LENGTH (80/8)  
   83                                         u_int8_t* resultAuthenticationTag);
 
   86                                          u_int8_t* resultAuthenticationTag);
 
   90                                      u_int32_t roc, u_int8_t 
const* authenticationTag);
 
   92                                       u_int8_t 
const* authenticationTag);
 
   94  void decryptSRTPPacket(u_int64_t index, u_int32_t ssrc, u_int8_t* data, 
unsigned numDataBytes);
 
   97  void encryptSRTPPacket(u_int64_t index, u_int32_t ssrc, u_int8_t* data, 
unsigned numDataBytes);
 
  101                                     u_int8_t 
const* dataToAuthenticate, 
unsigned numBytesToAuthenticate,
 
  102                                     u_int8_t* resultAuthenticationTag);
 
  106                                  u_int8_t 
const* dataToAuthenticate, 
unsigned numBytesToAuthenticate,
 
  107                                  u_int8_t 
const* authenticationTag);
 
  110                 u_int8_t* data, 
unsigned numDataBytes);
 
  119                       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)
 
u_int32_t sendingROC() const
 
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]