os/security/cryptoplugins/cryptospiplugins/test/dummyecchwplugin/src/dummyeccimpl.h
Update contrib.
2 * Copyright (c) 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.
24 #ifndef CDUMMYECCIMPL_H
25 #define CDUMMYECCIMPL_H
29 #include <cryptospi/cryptospidef.h>
31 #include "asymmetriccipherplugin.h"
33 namespace DummyEccHwCrypto
35 using namespace CryptoSpi;
38 * Implements the MAsymmetricCipher interface.
40 * This should be used to create the cipher object to perform
41 * encryption / decryption using ECC.
43 NONSHARABLE_CLASS(CDummyECCCipherImpl) : public CBase, public MAsymmetricCipher
46 static CDummyECCCipherImpl* NewL(const CKey& aKey, TUid aCryptoMode, TUid aPaddingMode);
47 static CDummyECCCipherImpl* NewLC(const CKey& aKey, TUid aCryptoMode, TUid aPaddingMode);
52 void GetCharacteristicsL(const TCharacteristics*& aPluginCharacteristics);
53 const CExtendedCharacteristics* GetExtendedCharacteristicsL();
54 TAny* GetExtension(TUid aExtensionId);
55 // End of MPlugin Interface
57 // MAsymmetricCipherBase Interface
58 void SetKeyL(const CKey& aKey);
59 void SetCryptoModeL(TUid aCryptoMode);
60 void SetPaddingModeL(TUid aPaddingMode);
61 TInt GetMaximumInputLengthL() const;
62 TInt GetMaximumOutputLengthL() const;
63 // End of MAsymmetricCipherBase Interface
65 // MAsymmetricCipher Interface
66 void ProcessL(const TDesC8& aInput, TDes8& aOutput);
68 TUid ImplementationUid() const;
70 ~CDummyECCCipherImpl();
73 CDummyECCCipherImpl(TUid aCryptoMode, TUid aPaddingMode);
74 void ConstructL(const CKey& aKey);
75 void DecryptL(const TDesC8& aInput, TDes8& aOutput);
76 void EncryptL(const TDesC8& aInput, TDes8& aOutput);
79 /* The key extracted from a CKey object. This would just have
80 * a handle to the key stored in hardware. Hence the actual key
81 * would not be available to the user of this cryptoSPI plugin.
85 /// encryption or decryption
88 /* The current padding scheme. This is not being used in the
89 * reference implementation.
97 #endif // CDUMMYECCIMPL_H