linklayerprotocols/pppnif/SPPP/MD4.H
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @brief Header file for the implementation of the MD4 Message-Digest Algorithm - RFC 1320.
       
    19  @internalComponent 
       
    20 */
       
    21 
       
    22 #ifndef __MD4_H__
       
    23 #define __MD4_H__
       
    24 
       
    25 #include <e32base.h>
       
    26 
       
    27 // This implementation is fully derived (copied) from the former MD4
       
    28 // implementation provided by Symbian PPP in the release 7.0s of
       
    29 // Symbian OS.  This is a provisional solution until the Symbian
       
    30 // Security subsystem components will provide a MD4 implementation.
       
    31 
       
    32 /*final*/ class CMd4 : public CBase
       
    33 /**
       
    34    Class that implements the MD4 Message-Digest Algorithm - RFC 1320.
       
    35    @internalComponent
       
    36    @note This implementation is fully derived from the former MD4 implementation provided by Symbian PPP in the release 7.0s of Symbian OS.  This is a provisional solution until the Symbian Security components will provide a MD4 implementation.
       
    37 */
       
    38 	{
       
    39 public:
       
    40 	static CMd4* NewL();
       
    41 
       
    42 //functions moved from the former CDigestBase
       
    43 	TInt Input(const TDesC8& aInput);
       
    44 	TInt Output(TDes8& aOutput);
       
    45 	TInt OutputSize() const;
       
    46 
       
    47 private:
       
    48 	CMd4();
       
    49 	void Transform(const TUint8*);
       
    50 	void Update(const TUint8*, TInt);
       
    51 	void Final(TUint8*);
       
    52 	void Encode(TUint8*, const TUint32*, TInt);
       
    53 	void Decode(TUint32*, const TUint8*, TInt);
       
    54 
       
    55 private:
       
    56 	TUint32 iState[4];
       
    57 	TUint iCount[2];
       
    58 	TUint8 iBuffer[64];
       
    59 	};
       
    60 
       
    61 #endif