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