Update contrib.
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.
15 * hash shim classes definition
26 #ifndef __HASHSHIM_H__
27 #define __HASHSHIM_H__
31 #include <cryptospi/cryptohashapi.h>
32 #include <cryptospi/keys.h>
34 #ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
35 #include <cryptospi/cryptomacapi.h>
41 NONSHARABLE_CLASS(CMD2Shim) : public CMD2
45 static CMD2Shim* NewL();
46 static CMD2Shim* NewLC();
48 CMessageDigest* CopyL();
51 void Update(const TDesC8& aMessage);
52 TPtrC8 Final(const TDesC8& aMessage);
55 TPtrC8 Hash(const TDesC8& aMessage);
56 CMessageDigest* ReplicateL();
60 virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
67 CryptoSpi::CHash* iHashImpl;
75 NONSHARABLE_CLASS(CMD5Shim) : public CMD5
78 static CMD5Shim* NewL();
79 static CMD5Shim* NewLC();
81 CMessageDigest* CopyL();
84 void Update(const TDesC8& aMessage);
85 TPtrC8 Final(const TDesC8& aMessage);
88 TPtrC8 Hash(const TDesC8& aMessage);
89 CMessageDigest* ReplicateL();
93 virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
100 CryptoSpi::CHash* iHashImpl;
109 NONSHARABLE_CLASS(CSHA1Shim) : public CSHA1
112 static CSHA1Shim* NewL();
113 static CSHA1Shim* NewLC();
115 CMessageDigest* CopyL();
118 void Update(const TDesC8& aMessage);
119 TPtrC8 Final(const TDesC8& aMessage);
122 TPtrC8 Hash(const TDesC8& aMessage);
123 CMessageDigest* ReplicateL();
127 virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
134 CryptoSpi::CHash* iHashImpl;
141 NONSHARABLE_CLASS(CSHA2Shim) : public CSHA2
144 static CSHA2Shim* NewL(TSH2Algo aAlgorithmId);
145 static CSHA2Shim* NewLC(TSH2Algo aAlgorithmId);
147 CMessageDigest* CopyL();
150 void Update(const TDesC8& aMessage);
151 TPtrC8 Final(const TDesC8& aMessage);
154 TPtrC8 Hash(const TDesC8& aMessage);
155 CMessageDigest* ReplicateL();
159 virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
163 void ConstructL(TSH2Algo aAlgorithmId);
166 CryptoSpi::CHash* iHashImpl;
175 NONSHARABLE_CLASS(CHMACShim) : public CHMAC
178 static CHMACShim* NewL(const TDesC8& aKey, CMessageDigest* aDigest);
179 static CHMACShim* NewLC(const TDesC8& aKey, CMessageDigest* aDigest);
181 CMessageDigest* CopyL();
184 void Update(const TDesC8& aMessage);
185 TPtrC8 Final(const TDesC8& aMessage);
188 TPtrC8 Hash(const TDesC8& aMessage);
189 CMessageDigest* ReplicateL();
193 #ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
194 CHMACShim(CryptoSpi::CMac* aImpl, CMessageDigest* aDigest, CryptoSpi::CKey* aKey, TUid aAlgorithmUid);
196 CHMACShim(CryptoSpi::CHash* aImpl, CMessageDigest* aDigest);
199 void ConstructL(const TDesC8& aKey, TUid aAlgorithmUid, CMessageDigest* aDigest);
203 #ifdef SYMBIAN_SDP_IPSEC_VOIP_SUPPORT
204 CryptoSpi::CMac* iMacImpl;
205 CryptoSpi::CKey* iKey;
208 CryptoSpi::CHash* iMacImpl;
216 NONSHARABLE_CLASS(CMD4Shim) : public CMD4
219 static CMD4Shim* NewL();
220 static CMD4Shim* NewLC();
222 CMessageDigest* CopyL();
225 void Update(const TDesC8& aMessage);
226 TPtrC8 Final(const TDesC8& aMessage);
229 TPtrC8 Hash(const TDesC8& aMessage);
230 CMessageDigest* ReplicateL();
234 virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
241 CryptoSpi::CHash* iHashImpl;
244 #endif // __HASHSHIM_H__