crypto/weakcrypto/inc/streamcipher.h
changeset 0 2c201484c85f
child 8 35751d3474b7
equal deleted inserted replaced
-1:000000000000 0:2c201484c85f
       
     1 /*
       
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    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.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 /**
       
    24  @file
       
    25  @publishedPartner
       
    26  @released
       
    27 */
       
    28 
       
    29 #ifndef __STREAMCIPHER_H__
       
    30 #define __STREAMCIPHER_H__
       
    31 
       
    32 #include "msymmetriccipher.h"
       
    33 
       
    34 /**
       
    35 *	Abstract interface class to be implemented by Stream Ciphers.
       
    36 */
       
    37 class CStreamCipher : public CSymmetricCipher
       
    38 {
       
    39 public:	//	From CSymmetricCipher
       
    40 	/**	
       
    41 	*	Implemented by calling the DoProcess() pure virtual function, 
       
    42 	*	to be implemented by subclasses.
       
    43 	*
       
    44 	*	@param aInput	Input text.
       
    45 	*	@param aOutput	Text after processing.
       
    46 	*/
       
    47 	IMPORT_C virtual void ProcessFinalL(const TDesC8& aInput, TDes8& aOutput);
       
    48 
       
    49 	/**	
       
    50 	*	Implemented by calling the DoProcess() pure virtual function, 
       
    51 	*	to be implemented by subclasses.
       
    52 	*
       
    53 	*	@param aInput	Input text.
       
    54 	*	@param aOutput	Text after processing.
       
    55 	*/
       
    56 	IMPORT_C virtual void Process(const TDesC8& aInput, TDes8& aOutput);	
       
    57 
       
    58 	/**
       
    59 	*	Gets the block size in bytes (always = 1 for stream ciphers).
       
    60 	*
       
    61 	*	@return	Cipher block size (in bytes).
       
    62 	*/
       
    63 	IMPORT_C virtual TInt BlockSize(void) const;
       
    64 	IMPORT_C virtual TInt MaxOutputLength(TInt aInputLength) const;
       
    65 	IMPORT_C virtual TInt MaxFinalOutputLength(TInt aInputLength) const;
       
    66 protected:
       
    67 	/**	
       
    68 	*	DoProcess() pure virtual function, 
       
    69 	*	to be implemented by subclasses.
       
    70 	*
       
    71 	*	@param aData	On input, text to be processed; on return, processed text.
       
    72 	*/
       
    73 	IMPORT_C virtual void DoProcess(TDes8& aData) = 0;
       
    74 };
       
    75 
       
    76 #endif	//	__STREAMCIPHER_H__