os/security/crypto/weakcryptospi/inc/streamcipher.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     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  @file
    23  @publishedPartner
    24  @released
    25 */
    26 
    27 #ifndef __STREAMCIPHER_H__
    28 #define __STREAMCIPHER_H__
    29 
    30 #include <msymmetriccipher.h>
    31 
    32 /**
    33 *	Abstract interface class to be implemented by Stream Ciphers.
    34 */
    35 class CStreamCipher : public CSymmetricCipher
    36 {
    37 public:	//	From CSymmetricCipher
    38 	/**	
    39 	*	Implemented by calling the DoProcess() pure virtual function, 
    40 	*	to be implemented by subclasses.
    41 	*
    42 	*	@param aInput	Input text.
    43 	*	@param aOutput	Text after processing.
    44 	*/
    45 	IMPORT_C virtual void ProcessFinalL(const TDesC8& aInput, TDes8& aOutput);
    46 
    47 	/**	
    48 	*	Implemented by calling the DoProcess() pure virtual function, 
    49 	*	to be implemented by subclasses.
    50 	*
    51 	*	@param aInput	Input text.
    52 	*	@param aOutput	Text after processing.
    53 	*/
    54 	IMPORT_C virtual void Process(const TDesC8& aInput, TDes8& aOutput);	
    55 
    56 	/**
    57 	*	Gets the block size in bytes (always = 1 for stream ciphers).
    58 	*
    59 	*	@return	Cipher block size (in bytes).
    60 	*/
    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;
    64 protected:
    65 	/**	
    66 	*	DoProcess() pure virtual function, 
    67 	*	to be implemented by subclasses.
    68 	*
    69 	*	@param aData	On input, text to be processed; on return, processed text.
    70 	*/
    71 	IMPORT_C virtual void DoProcess(TDes8& aData) = 0;
    72 };
    73 
    74 #endif	//	__STREAMCIPHER_H__