rtp/srtpstack/inc/srtpauthentication_hmac_sha1.h
changeset 0 307788aac0a8
child 9 1e1cc61f56c3
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:    Provides class for authentication with HMAC-SHA1 algorithm.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __SRTP_AUTHENTICATION_HMAC_SHA1_H__
       
    22 #define __SRTP_AUTHENTICATION_HMAC_SHA1_H__
       
    23 
       
    24 #include "msrtpauthentication.h"
       
    25 
       
    26 class CSRTPAuthentication_HMAC_SHA1 : public CBase, public MSRTPAuthentication
       
    27     {
       
    28     public:
       
    29         /**
       
    30         * Constructor.
       
    31         * @leave KErrNone if success, system-wide error code otherwise
       
    32         */
       
    33 	    static CSRTPAuthentication_HMAC_SHA1* NewL();
       
    34 
       
    35         /**
       
    36         * Constructor.
       
    37         * @leave KErrNone if success, system-wide error code otherwise
       
    38         */
       
    39 	    static CSRTPAuthentication_HMAC_SHA1* NewLC();
       
    40     
       
    41         /**
       
    42         * Destructor.
       
    43         */
       
    44 	    ~CSRTPAuthentication_HMAC_SHA1();
       
    45 
       
    46         /**
       
    47         * This function is called by SRTP for authentication/integrity protection
       
    48         * with the default algorith, HMAC-SHA1.
       
    49         * Produces authentication tag based on input key and data M.
       
    50         * result IS truncated to n_tag leftmost bits
       
    51         * @param aBitLength  authentication tag length
       
    52         * @param aKey  authentication key (n_a)
       
    53         * @param aAuthPortion data to be integrity protected 
       
    54 	    * Returns HBufC8* authentication tag (n_tag truncated) 
       
    55         */
       
    56         HBufC8* AuthenticateL(TUint aBitLength,
       
    57                             const TDesC8& aKey, 
       
    58                             const TDesC8& aAuthPortion,
       
    59                             const TDesC8& aRoc);
       
    60                  
       
    61     private:         // methods
       
    62         /**
       
    63         * Default constructor.
       
    64         */
       
    65         CSRTPAuthentication_HMAC_SHA1();  
       
    66                 
       
    67         void ConstructL();          
       
    68     };
       
    69 
       
    70 #endif // __SRTP_AUTHENTICATION_HMAC_SHA1_H__
       
    71