ipappprotocols_plat/srtp_api/inc/srtpdef.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 SRTP definitions and constants.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __SRTP_DEF_H__
       
    22 #define __SRTP_DEF_H__
       
    23 
       
    24 // INCLUDES
       
    25 #include <e32def.h>
       
    26 #include <e32des8.h>
       
    27 
       
    28 // CONSTANTS
       
    29 //Block size of the 128 bit AES-CM in bytes
       
    30 const TInt KAESCM128BlockSizeInBytes = 0x10;
       
    31 
       
    32 const TInt KMinSizeRtpHeader = 12; // 96 bits in header, 96/8 = 12
       
    33 const TInt KMinSizeRtcpHeader = 8; // 96 bits in header, 96/8 = 12
       
    34 
       
    35 // The 80 bit length of the HMAC-SHA1 authentication tag (n_tag)
       
    36 const TUint KSRTPAuthTagLength80 = 80;
       
    37 
       
    38 //recommending to use in RCCm1 or RCCm2 as 14 octets
       
    39 const TUint KSRTPAuthTagLength112 = 112;
       
    40 // 4 octets32 bits
       
    41 const TUint KSRTPROCLength4 = 4; 
       
    42 
       
    43 // The 32 bit length of the HMAC-SHA1 authentication tag (n_tag)
       
    44 // Also recommending in RCCm3 as 4 octects
       
    45 const TUint KSRTPAuthTagLength32 = 32;
       
    46 
       
    47 // The default bit length of the HMAC-SHA1 authentication tag (n_tag)
       
    48 const TUint KSRTPAuthTagDefaultLength = KSRTPAuthTagLength80;
       
    49 
       
    50 // The default length of the SRTP prefix
       
    51 const TUint KSRTPPrefixLength = 0;
       
    52 
       
    53 // default SRTP key derivation rate: 0
       
    54 const TUint16 KSRTPDefaultKeyDerivationRate = 0x00;
       
    55 
       
    56 // default SRTP ROC Transmission rate: 1
       
    57 const TUint16 KSRTPDefaultROCTransRate = 0x01;
       
    58 
       
    59 const TUint KSRTCPPacketIndexLength4 = 4; 
       
    60 // default label values
       
    61 const TUint KSRTPEncryptionLabel = 0x00;
       
    62 const TUint KSRTPAuthenticationLabel = 0x01;
       
    63 const TUint KSRTPSaltingLabel = 0x02;
       
    64 const TUint KSRTCPEncryptionLabel = 0x03;
       
    65 const TUint KSRTCPAuthenticationLabel = 0x04;
       
    66 const TUint KSRTCPSaltingLabel = 0x05;
       
    67 
       
    68 // default SRTP SESSION key lengths:
       
    69 // default bit length (n_e) for session encryption key (k_e):
       
    70 // 128 bits (16 octets)
       
    71 const TUint KSRTPDefSessionEncryptionKeyLength = 0x80;
       
    72 // default bit length (n_s) for session salt key (k_s):
       
    73 // 112 bits (14 octets)
       
    74 const TUint KSRTPDefSessionSaltingKeyLength = 0x70;
       
    75 // default bit length (n_a) for session authentication key (k_a):
       
    76 // 160 bits (20 octets)
       
    77 const TUint KSRTPDefSessionAuthenticationKeyLength = 0xa0;
       
    78 
       
    79 // default SRTP MASTER key lengths:
       
    80 // default bit length for SRTP master key (128-bit AES):
       
    81 // 128 bits (16 octets)
       
    82 const TUint16 KSRTPDefaultMasterKeyLength = 0x80;
       
    83 // default bit length for SRTP master salt 
       
    84 // 112 bits (14 octets)
       
    85 const TUint16 KSRTPDefaultMasterSaltLength = 0x70;
       
    86 
       
    87 // SRTP limit values
       
    88 // max SRTP plain/cipher text length is 2^23 == 0x80000
       
    89 // since we use 8 bit descriptors, divide this with 2
       
    90 const TUint KSRTPMaxTextLength = 0x40000;
       
    91 // max SRTP keystream 128 bit blocks is 2^16 == 0x10000
       
    92 // for an IV value we can not create more keystream blocks
       
    93 // KSRTPMaxKeyStreamBlocks * 128 equals KSRTPMaxTextLength * 2 
       
    94 const TUint KSRTPMaxKeyStreamBlocks = 0x10000;
       
    95 
       
    96 const TInt KReplayWindowSize = 64;
       
    97 //2^48 -1 for SRTP
       
    98 const TUint64 KSRTPMasterKeysLifeTime = 0xFFFFFFFFFFFF;
       
    99 const TUint32 KLeftNumOfPacketBeforeReKey = 0x64;
       
   100 //2^31 -1 for SRTCP
       
   101 const TUint64 KSRTCPMaterKeysLifeTime = 0x7FFFFFFF;
       
   102 #endif // __SRTP_DEF_H__