os/security/cryptoplugins/cryptospiplugins/source/softwarecrypto/sha224and256impl.h
First public contribution.
2 * Copyright (c) 2007-2009 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.
28 #ifndef __CRYPTOAPI_SOFTWARESHA224AND256IMPL_H_
29 #define __CRYPTOAPI_SOFTWARESHA224AND256IMPL_H_
32 #include "softwarehashbase.h"
33 #include "shacommon.h"
35 namespace SoftwareCrypto
37 using namespace CryptoSpi;
39 const TInt KSHA256BlockSize = 64;
40 const TInt KSHA224HashSize = 28;
41 const TInt KSHA256HashSize = 32;
43 NONSHARABLE_CLASS(CSHA224And256Impl) : public CBase, public MSHA2Impl
47 static CSHA224And256Impl* NewL();
48 CSHA224And256Impl(const CSHA224And256Impl& aSHA256Impl);
50 // Functions from MSHA2Impl
51 virtual void RestoreState();
52 virtual void StoreState();
53 virtual void Reset(const TAny*);
54 virtual void Update(const TUint8* aData,TUint aLength);
55 virtual const TDes8& Final(void);
60 inline void AddLength(const TUint aLength);
61 inline void CopyWordToHash(TUint aVal, TUint aIndex);
66 TBuf8<KSHA256HashSize> iHash;
75 TUint iData[KSHA256BlockSize];
87 TUint iDataCopy[KSHA256BlockSize];
94 #endif // __CRYPTOAPI_SOFTWARESHA224AND256IMPL_H_