First public contribution.
2 * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
26 #ifndef __CRYPTOAPI_SOFTWAREHMACIMPL_H__
27 #define __CRYPTOAPI_SOFTWAREHMACIMPL_H__
29 #include "softwarehashbase.h"
30 #include <cryptospi/keys.h>
32 namespace SoftwareCrypto
34 using namespace CryptoSpi;
36 const TInt KHMacPad = 64;
38 NONSHARABLE_CLASS(CHMacImpl) : public CBase, public MSoftwareHash
42 static CHMacImpl* NewL(MSoftwareHash* aHash);
43 static CHMacImpl* NewLC(MSoftwareHash* aHash);
44 static CHMacImpl* NewL(const CKey& aKey, MSoftwareHash* aHash);
45 static CHMacImpl* NewLC(const CKey& aKey, MSoftwareHash* aHash);
50 void GetCharacteristicsL(const TCharacteristics*& aPluginCharacteristics);
51 const CExtendedCharacteristics* GetExtendedCharacteristicsL();
52 TAny* GetExtension(TUid aExtensionId);
55 TPtrC8 Hash(const TDesC8& aMessage);
56 void Update(const TDesC8& aMessage);
57 TPtrC8 Final(const TDesC8& aMessage);
58 void SetKeyL(const CKey& aKey);
59 void SetOperationModeL(TUid aOperationMode);
66 CHMacImpl(const CHMacImpl& aHMacImpl);
72 void ConstructL(const CKey& aKey, MSoftwareHash* aHash);
73 void ConstructL(MSoftwareHash* aHash);
74 void Initialise(const TDesC8& aKey);
77 TUid iImplementationUid;
78 MSoftwareHash* iDigest;
79 TBuf8<KHMacPad> iInnerPad;
80 TBuf8<KHMacPad> iOuterPad;
82 TBuf8<KHMacPad> iInnerPadCopy;
83 TBuf8<KHMacPad> iOuterPadCopy;
87 #endif // __CRYPTOAPI_SOFTWAREHMACIMPL_H__