os/security/crypto/weakcryptospi/test/tcryptospi/src/symmetriccipherstepbase.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2007-2010 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 *
    16 */
    17 
    18 
    19 
    20 
    21 /**
    22  @file
    23  @internalTechnology
    24 */
    25 #ifndef SYMMETRICCIPHERSTEPBASE_H
    26 #define SYMMETRICCIPHERSTEPBASE_H
    27 
    28 #include <cryptospi/cryptosymmetriccipherapi.h>
    29 #include <cryptospi/keys.h>
    30 #include "te_cryptospistepbase.h"
    31 #include "filereader.h"
    32 
    33 using namespace CryptoSpi;
    34 
    35 class CSymmetricCipherStepBase : public CTe_CryptoSpiStepBase
    36 	{
    37 protected:
    38 	void SetupCipherL(TBool aArc4Check, TBool aRc2Check, TVariantPtrC& aOperationMode, CSymmetricCipher*& aCipher, CKey*& aKey);
    39 	HBufC8* ReadInPlaintextL();
    40 	HBufC8* ReadInCiphertextL();
    41 	HBufC8* ReadInIvL();
    42 	TInt CtrModeCalcBlockSizeL(CSymmetricCipher& aCipher);
    43 	HBufC8* CtrModeIncrementCounterL(TDesC8& aCounter);
    44 	HBufC8* ReadInHexCiphertextL();
    45 	HBufC8* ReadInHexPlaintextL();
    46 	HBufC8* ReadInHexPlainTextL(TPtrC aFile);
    47 	HBufC8* ReadInHexIvL();
    48 	HBufC8* ConvertFromHexFormatToRawL(TDesC8& aInput);
    49 	
    50 private:
    51 	HBufC8* ReadFileL(TPtrC aFile);
    52 	};
    53 
    54 #endif	//SYMMETRICCIPHERSTEPBASE_H