ipappprotocols_plat/srtp_api/inc/srtpcryptoparams.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    Contains a default cryptographic context for SRTP/SRTCP streams.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __SRTP_CRYPTOPARAMS_H__
       
    22 #define __SRTP_CRYPTOPARAMS_H__
       
    23 
       
    24 #include <e32base.h>
       
    25 #include "srtpcryptocontext.h"
       
    26 
       
    27 /**
       
    28 *  SRTP/SRTCP crypto context param 
       
    29 *  RFC 3711, 4568
       
    30 *
       
    31 *  @lib srtp.dll
       
    32 */
       
    33 
       
    34 /**
       
    35 * Encyption algorithms.
       
    36 */
       
    37 enum TSRTPEncAlg
       
    38     {
       
    39     ENullAlg = 0,
       
    40     EEncAES_CM
       
    41     };
       
    42 
       
    43 /**
       
    44 * Authentication algorithms.
       
    45 * With RCCm1, RCCm2 and RCCm3, ROC will be synchronized if SEQ%R==0
       
    46 */
       
    47 enum TSRTPAuthAlg
       
    48     {
       
    49     EAuthNull = 0,
       
    50     EAuthHMAC_SHA1,
       
    51     EAuthRCCm1,
       
    52     EAuthRCCm2,
       
    53     EAuthRCCm3
       
    54     };
       
    55     
       
    56 
       
    57 class TSrtpCryptoParams
       
    58 	{
       
    59 	public: 
       
    60 	TSrtpCryptoParams();
       
    61 	
       
    62 	TSRTPEncAlg iSrtpEncAlg; 
       
    63 	TSRTPEncAlg iSrtcpEncAlg;                
       
    64 	TSRTPAuthAlg iSrtpAuthAlg; 
       
    65 	TSRTPAuthAlg iSrtcpAuthAlg; 
       
    66 	TUint iSrtpAuthTagLen;
       
    67 	TUint iSrtcpAuthTagLen;             
       
    68 	TUint iSrtpKeyDervRate; //The key derivation rate
       
    69 	TUint iSrtcpKeyDervRate;    
       
    70 	TUint iPrefixLen;   
       
    71 	TBool iSrtpReplayProtection;
       
    72 	TBool iSrtcpReplayProtection;   
       
    73 	TUint16 iROCTransRate;   
       
    74 	TUint64 iMasterKeysLifeTime; //Set both for SRTP/SRTCP otherwise use default
       
    75 	TInt iReplayWindowSizeHint; //Set both for SRTP/SRTCP otherwise use default
       
    76 	TBool iIsRCCm3Sync;
       
    77 
       
    78 	};
       
    79 
       
    80 //IF any of the following param changes it will cause the caculation changes.
       
    81 inline TSrtpCryptoParams::TSrtpCryptoParams() : 
       
    82 	  	iSrtpEncAlg( EEncAES_CM ), //encoding algorithm
       
    83        	iSrtcpEncAlg( EEncAES_CM ), 
       
    84         iSrtpAuthAlg( EAuthHMAC_SHA1 ), // authentication algorithm
       
    85         iSrtcpAuthAlg(EAuthHMAC_SHA1 ), 
       
    86         iSrtpAuthTagLen(KSRTPAuthTagDefaultLength),
       
    87         iSrtcpAuthTagLen(KSRTPAuthTagDefaultLength),
       
    88         iSrtpKeyDervRate( KSRTPDefaultKeyDerivationRate ),
       
    89         iSrtcpKeyDervRate( KSRTPDefaultKeyDerivationRate ),
       
    90         iPrefixLen( KSRTPPrefixLength ), // prefix length	 must be 0
       
    91         iSrtpReplayProtection( ETrue ), // replay protection on/off
       
    92         iSrtcpReplayProtection( ETrue),
       
    93         iROCTransRate(KSRTPDefaultROCTransRate), // Integrity transform parameter
       
    94         iMasterKeysLifeTime (0),
       
    95         iReplayWindowSizeHint (KReplayWindowSize),
       
    96         iIsRCCm3Sync(EFalse) // using in RCCm3 only defined in RFC srtp-rcc04 Section 4	
       
    97                   
       
    98 	{
       
    99 	};       
       
   100 
       
   101 
       
   102 	
       
   103 #endif // __SRTP_CRYPTOPARAMS_H__