sl@0: /* sl@0: * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @internalComponent sl@0: @released sl@0: */ sl@0: sl@0: sl@0: #ifndef __CRYPTOAPI_SOFTWARESHA2IMPL_H_ sl@0: #define __CRYPTOAPI_SOFTWARESHA2IMPL_H_ sl@0: sl@0: sl@0: #include "softwarehashbase.h" sl@0: sl@0: namespace SoftwareCrypto sl@0: { sl@0: using namespace CryptoSpi; sl@0: class MSHA2Impl; sl@0: sl@0: NONSHARABLE_CLASS(CSHA2Impl) : public CBase, public MSoftwareHash sl@0: { sl@0: public: sl@0: //NewL & NewLC sl@0: static CSHA2Impl* NewL(TInt32 aAlgorithmId); sl@0: static CSHA2Impl* NewLC(TInt32 aAlgorithmId); sl@0: sl@0: //From MPlugin sl@0: void Reset(); sl@0: void Close(); sl@0: void GetCharacteristicsL(const TCharacteristics*& aPluginCharacteristics); sl@0: static CExtendedCharacteristics* CreateExtendedCharacteristicsL(); sl@0: const CExtendedCharacteristics* GetExtendedCharacteristicsL(); sl@0: TAny* GetExtension(TUid aExtensionId); sl@0: sl@0: //From MHash sl@0: TPtrC8 Hash(const TDesC8& aMessage); sl@0: void Update(const TDesC8& aMessage); sl@0: TPtrC8 Final(const TDesC8& aMessage); sl@0: MHash* ReplicateL(); sl@0: MHash* CopyL(); sl@0: void SetKeyL(const CKey& aKey); sl@0: void SetOperationModeL(TUid aOperationMode); sl@0: sl@0: //From MSoftwareHash sl@0: void RestoreState(); sl@0: void StoreState(); sl@0: sl@0: private: sl@0: //Constructors sl@0: void ConstructL(TInt32 aAlgorithmId); sl@0: void ConstructL(const CSHA2Impl& aSHA512Impl); sl@0: sl@0: //Destructor sl@0: ~CSHA2Impl(); sl@0: sl@0: TUid ImplementationUid(); sl@0: sl@0: private: sl@0: MSHA2Impl* iImplementation; sl@0: const TAny* iInitValues; sl@0: TUid iImplementationUid; sl@0: TUint iHashSize; sl@0: }; sl@0: } sl@0: sl@0: #endif //__CRYPTOAPI_SOFTWARESHA2IMPL_H_