First public contribution.
2 * Copyright (c) 2002-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 * ** IMPORTANT ** PublishedPartner API's in this file are published to 3rd party developers via the
16 * Symbian website. Changes to these API's should be treated as PublishedAll API changes and the Security TA should be consulted.
27 #ifndef __STREAMCIPHER_H__
28 #define __STREAMCIPHER_H__
30 #include "msymmetriccipher.h"
33 * Abstract interface class to be implemented by Stream Ciphers.
35 class CStreamCipher : public CSymmetricCipher
37 public: // From CSymmetricCipher
39 * Implemented by calling the DoProcess() pure virtual function,
40 * to be implemented by subclasses.
42 * @param aInput Input text.
43 * @param aOutput Text after processing.
45 IMPORT_C virtual void ProcessFinalL(const TDesC8& aInput, TDes8& aOutput);
48 * Implemented by calling the DoProcess() pure virtual function,
49 * to be implemented by subclasses.
51 * @param aInput Input text.
52 * @param aOutput Text after processing.
54 IMPORT_C virtual void Process(const TDesC8& aInput, TDes8& aOutput);
57 * Gets the block size in bytes (always = 1 for stream ciphers).
59 * @return Cipher block size (in bytes).
61 IMPORT_C virtual TInt BlockSize(void) const;
62 IMPORT_C virtual TInt MaxOutputLength(TInt aInputLength) const;
63 IMPORT_C virtual TInt MaxFinalOutputLength(TInt aInputLength) const;
66 * DoProcess() pure virtual function,
67 * to be implemented by subclasses.
69 * @param aData On input, text to be processed; on return, processed text.
71 IMPORT_C virtual void DoProcess(TDes8& aData) = 0;
74 #endif // __STREAMCIPHER_H__