crypto/weakcrypto/inc/blocktransformation.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 * CBlockTransformation class implementation
       
    18 *
       
    19 */
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 /**
       
    25  @file 
       
    26  @internalAll
       
    27 */
       
    28  
       
    29 #ifndef	__BLOCKTRANSFORMATION_H__
       
    30 #define	__BLOCKTRANSFORMATION_H__
       
    31 
       
    32 #include <e32base.h>
       
    33 
       
    34 /** The maximum block size supported (in bytes) */
       
    35 const TUint KMaxBlockSizeSupported = 32;
       
    36 
       
    37 /**
       
    38 * Abstract base class defining the interface to block transformation schemes.
       
    39 *
       
    40 * Block transformation schemes process a fixed-size block of input to return a
       
    41 * block of output the same size.  
       
    42 *
       
    43 * @publishedPartner
       
    44 * @released
       
    45 */
       
    46 class CBlockTransformation : public CBase
       
    47 {
       
    48 public:
       
    49 	/**
       
    50 	* Transforms the supplied block, returning the new value using the same
       
    51 	* parameter. aBlock.Size() must be the same length as BlockSize().
       
    52 	*
       
    53 	* @param aBlock	On input, the data to be transformed;
       
    54 	*				on return, the data after transformation.
       
    55 	*/
       
    56 	virtual void Transform(TDes8& aBlock) = 0;
       
    57 	
       
    58 	/**
       
    59 	* Resets the transformation back to its original state. Clears all its buffers.
       
    60 	*/	
       
    61 	virtual void Reset() = 0;
       
    62 	
       
    63 	/**
       
    64 	* Gets the block size in bytes.
       
    65 	*
       
    66 	* @return	Block size in bytes.
       
    67 	*/
       
    68 	virtual TInt BlockSize() const = 0;
       
    69 	
       
    70 	/**
       
    71 	* Gets the key size in bits.	
       
    72 	* 
       
    73 	* @return	Key size in bits.
       
    74 	*/
       
    75 	virtual TInt KeySize() const = 0;
       
    76 };
       
    77 
       
    78 #endif	//	__BLOCKTRANSFORMATION_H__