1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/cryptoplugins/cryptospiplugins/source/softwarecrypto/sha2impl.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,85 @@
1.4 +/*
1.5 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +
1.23 +
1.24 +/**
1.25 + @file
1.26 + @internalComponent
1.27 + @released
1.28 +*/
1.29 +
1.30 +
1.31 +#ifndef __CRYPTOAPI_SOFTWARESHA2IMPL_H_
1.32 +#define __CRYPTOAPI_SOFTWARESHA2IMPL_H_
1.33 +
1.34 +
1.35 +#include "softwarehashbase.h"
1.36 +
1.37 +namespace SoftwareCrypto
1.38 + {
1.39 + using namespace CryptoSpi;
1.40 + class MSHA2Impl;
1.41 +
1.42 + NONSHARABLE_CLASS(CSHA2Impl) : public CBase, public MSoftwareHash
1.43 + {
1.44 + public:
1.45 + //NewL & NewLC
1.46 + static CSHA2Impl* NewL(TInt32 aAlgorithmId);
1.47 + static CSHA2Impl* NewLC(TInt32 aAlgorithmId);
1.48 +
1.49 + //From MPlugin
1.50 + void Reset();
1.51 + void Close();
1.52 + void GetCharacteristicsL(const TCharacteristics*& aPluginCharacteristics);
1.53 + static CExtendedCharacteristics* CreateExtendedCharacteristicsL();
1.54 + const CExtendedCharacteristics* GetExtendedCharacteristicsL();
1.55 + TAny* GetExtension(TUid aExtensionId);
1.56 +
1.57 + //From MHash
1.58 + TPtrC8 Hash(const TDesC8& aMessage);
1.59 + void Update(const TDesC8& aMessage);
1.60 + TPtrC8 Final(const TDesC8& aMessage);
1.61 + MHash* ReplicateL();
1.62 + MHash* CopyL();
1.63 + void SetKeyL(const CKey& aKey);
1.64 + void SetOperationModeL(TUid aOperationMode);
1.65 +
1.66 + //From MSoftwareHash
1.67 + void RestoreState();
1.68 + void StoreState();
1.69 +
1.70 + private:
1.71 + //Constructors
1.72 + void ConstructL(TInt32 aAlgorithmId);
1.73 + void ConstructL(const CSHA2Impl& aSHA512Impl);
1.74 +
1.75 + //Destructor
1.76 + ~CSHA2Impl();
1.77 +
1.78 + TUid ImplementationUid();
1.79 +
1.80 + private:
1.81 + MSHA2Impl* iImplementation;
1.82 + const TAny* iInitValues;
1.83 + TUid iImplementationUid;
1.84 + TUint iHashSize;
1.85 + };
1.86 + }
1.87 +
1.88 +#endif //__CRYPTOAPI_SOFTWARESHA2IMPL_H_