First public contribution.
2 * Copyright (c) 2006-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.
15 * RC2 shim classes definition
34 class CSymmetricCipher;
38 NONSHARABLE_CLASS(CRC2EncryptorShim) : public CRC2Encryptor
42 Creates an CRC2EncryptorShim object which has the same interface
43 as RC2 Encryptor but delegates all work to a Crypto SPI plug-in.
45 @param aKey The encryption key
46 @return A pointer to a CRC2EncryptorShim instance
48 static CRC2EncryptorShim* NewL(const TDesC8& aKey, TInt aEffectiveKeyLenBits);
51 Creates an CRC2EncryptorShim object which has the same interface
52 as RC2 Encryptor but delegates all work to a Crypto SPI plug-in.
54 A pointer to the new object is placed on the cleanup stack
56 @param aKey The encryption key
57 @return A pointer to a CRC2EncryptorShim instance
59 static CRC2EncryptorShim* NewLC(const TDesC8& aKey, TInt aEffectiveKeyLenBits);
61 // From CBlockTransform
62 TInt BlockSize() const;
63 void Transform(TDes8& aBlock);
65 TInt KeySize(void) const;
73 void ConstructL(const TDesC8& aKey, TInt aEffectiveKeyLenBits);
76 TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
80 CryptoSpi::CSymmetricCipher* iSymmetricCipherImpl;
82 /// SPI requires all key to passed as key-objects
83 CryptoSpi::CKey* iKey;
85 /// Temporary output block, SPI does not overwrite input
86 /// RC2 uses 64bit blocks
87 TBuf8<16> iOutputBlock;
89 /// The effective key length is passed as an algorithm
90 /// parameter. This allows it to be externalised.
91 CryptoSpi::CCryptoParams* iAlgorithmParams;
94 NONSHARABLE_CLASS(CRC2DecryptorShim) : public CRC2Decryptor
98 Creates an CRC2DecryptorShim object which has the same interface
99 as RC2 Decryptor but delegates all work to a Crypto SPI plug-in.
101 @param aKey The decryption key
102 @return A pointer to a CRC2DecryptorShim instance
104 static CRC2DecryptorShim* NewL(const TDesC8& aKey, TInt aEffectiveKeyLenBits);
107 Creates an CRC2DecryptorShim object which has the same interface
108 as RC2 Decryptor but delegates all work to a Crypto SPI plug-in.
110 A pointer to the new object is placed on the cleanup stack
112 @param aKey The decryption key
113 @return A pointer to a CRC2DecryptorShim instance
115 static CRC2DecryptorShim* NewLC(const TDesC8& aKey, TInt aEffectiveKeyLenBits);
117 // From CBlockTransform
118 TInt BlockSize() const;
119 void Transform(TDes8& aBlock);
121 TInt KeySize(void) const;
124 ~CRC2DecryptorShim();
129 void ConstructL(const TDesC8& aKey, TInt aEffectiveKeyLenBits);
132 From CBase, to allow CBufferedTransform & CBlockChainingMode
133 to determine whether the functionality may be delegated to
136 TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
140 CryptoSpi::CSymmetricCipher* iSymmetricCipherImpl;
142 /// SPI requires all key to passed as key-objects
143 CryptoSpi::CKey* iKey;
145 /// Temporary output block, SPI does not overwrite input
146 /// RC2 uses 64bit blocks
147 TBuf8<16> iOutputBlock;
149 /// The effective key length is passed as an algorithm
150 /// parameter. This allows it to be externalised.
151 CryptoSpi::CCryptoParams* iAlgorithmParams;
154 #endif // __RC2SHIM_H__