ipappsrv_plat/media_control_api/inc/mmccsrtpcryptoparams.h
changeset 0 1bce908db942
child 9 5d1d815214a5
equal deleted inserted replaced
-1:000000000000 0:1bce908db942
       
     1 /*
       
     2 * Copyright (c) 2006 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:    Class is used for configuring mcc srtp crypto params
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef MMCCSRTPCRYPTOPARAMS_H
       
    22 #define MMCCSRTPCRYPTOPARAMS_H
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32base.h>
       
    26 
       
    27 
       
    28 // CONSTANTS
       
    29 // The default bit length of the HMAC-SHA1 authentication tag
       
    30 const TUint KMccSRTPAuthTagDefaultLength = 80;
       
    31 
       
    32 // default SRTP key derivation rate: 0
       
    33 const TUint16 KMccSRTPDefaultKeyDerivationRate = 0x00;
       
    34 
       
    35 // The default length of the SRTP prefix
       
    36 const TUint KMccSRTPPrefixLength = 0;
       
    37 
       
    38 const TInt KMccReplayWindowSize = 64;
       
    39 
       
    40 // default SRTP ROC Transmission rate: 1
       
    41 const TUint16 KMccSRTPDefaultROCTransRate = 0x01;
       
    42 
       
    43 // The 80 bit length of the HMAC-SHA1 authentication tag (n_tag)
       
    44 const TUint KMccSRTPAuthTagLength80 = 80;
       
    45 
       
    46 // The 32 bit length of the HMAC-SHA1 authentication tag (n_tag)
       
    47 // Also recommending in RCCm3 as 4 octects
       
    48 const TUint KMccSRTPAuthTagLength32 = 32;
       
    49 
       
    50 //recommending to use in RCCm1 or RCCm2 as 14 octets
       
    51 const TUint KMccSRTPAuthTagLength112 = 112;
       
    52 
       
    53 /**
       
    54  * Encyption algorithms.
       
    55  */
       
    56 enum TMccSRTPEncAlg
       
    57     {
       
    58     ESrtpNullAlg = 0,
       
    59     ESrtpEncAES_CM
       
    60     };
       
    61 
       
    62 /**
       
    63  * Authentication algorithms.
       
    64  * With RCCm1, RCCm2 and RCCm3, ROC will be synchronized if SEQ%R==0
       
    65  */
       
    66 enum TMccSRTPAuthAlg
       
    67     {
       
    68     ESrtpAuthNull = 0,
       
    69     ESrtpAuthHMAC_SHA1,
       
    70     ESrtpAuthRCCm1,
       
    71     ESrtpAuthRCCm2,
       
    72     ESrtpAuthRCCm3
       
    73     };
       
    74 
       
    75 /**
       
    76  * The TMccSrtpCryptoParams captures the MCC SRTP crypto params
       
    77  * into one class
       
    78  *
       
    79  * @lib N/A
       
    80  * @since Series 60 3.2
       
    81  */    
       
    82 class TMccSrtpCryptoParams
       
    83 	{
       
    84 
       
    85 public:
       
    86  
       
    87     //IF any of the following param changes it will cause the caculation changes.
       
    88     inline TMccSrtpCryptoParams::TMccSrtpCryptoParams() : 
       
    89       	iSrtpEncAlg( ESrtpEncAES_CM ), 
       
    90        	iSrtcpEncAlg( ESrtpEncAES_CM ), 
       
    91         iSrtpAuthAlg( ESrtpAuthHMAC_SHA1 ), 
       
    92         iSrtcpAuthAlg(ESrtpAuthHMAC_SHA1 ), 
       
    93         iSrtpAuthTagLen( KMccSRTPAuthTagDefaultLength ),
       
    94         iSrtcpAuthTagLen(KMccSRTPAuthTagDefaultLength ),
       
    95         iSrtpKeyDervRate( KMccSRTPDefaultKeyDerivationRate ),
       
    96         iSrtcpKeyDervRate( KMccSRTPDefaultKeyDerivationRate ),
       
    97         iPrefixLen( KMccSRTPPrefixLength ), 
       
    98         iSrtpReplayProtection( ETrue ), 
       
    99         iSrtcpReplayProtection( ETrue),
       
   100         iROCTransRate( KMccSRTPDefaultROCTransRate ), 
       
   101         iMasterKeysLifeTime ( 0 ),
       
   102         iReplayWindowSizeHint ( KMccReplayWindowSize ),
       
   103         iIsRCCm3Sync( EFalse )                 
       
   104     	{
       
   105     	};
       
   106 
       
   107     TMccSRTPEncAlg iSrtpEncAlg;     //encoding algorithm
       
   108     TMccSRTPEncAlg iSrtcpEncAlg;                
       
   109     TMccSRTPAuthAlg iSrtpAuthAlg;   // authentication algorithm
       
   110     TMccSRTPAuthAlg iSrtcpAuthAlg; 
       
   111     TUint iSrtpAuthTagLen;
       
   112     TUint iSrtcpAuthTagLen;             
       
   113     TUint iSrtpKeyDervRate;         //The key derivation rate
       
   114     TUint iSrtcpKeyDervRate;    
       
   115     TUint iPrefixLen;               // prefix length	 must be 0
       
   116     TBool iSrtpReplayProtection;    // replay protection on/off
       
   117     TBool iSrtcpReplayProtection;   
       
   118     TUint16 iROCTransRate;          // Integrity transform parameter
       
   119     TUint64 iMasterKeysLifeTime;    //Set both for SRTP/SRTCP otherwise use default
       
   120     TInt iReplayWindowSizeHint;     //Set both for SRTP/SRTCP otherwise use default
       
   121     TBool iIsRCCm3Sync;             // using in RCCm3 only defined in RFC srtp-rcc04 Section 4	
       
   122 	};
       
   123 
       
   124 		
       
   125 typedef TPckgBuf<TMccSrtpCryptoParams> TMccSrtpCryptoParamsPckg;
       
   126 
       
   127 #endif /* MMCCSRTPCRYPTOPARAMS_H */
       
   128             
       
   129 // End of File