crypto/weakcrypto/test/tasymmetric/tbrokenrandom.h
changeset 0 2c201484c85f
equal deleted inserted replaced
-1:000000000000 0:2c201484c85f
       
     1 /*
       
     2 * Copyright (c) 2005-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 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 /**
       
    24  @file
       
    25 */
       
    26 
       
    27 #ifndef __CBROKENRANDOM_H__
       
    28 #define __CBROKENRANDOM_H__
       
    29 
       
    30 #include <e32base.h>
       
    31 #include <random.h>
       
    32 
       
    33 class CRandomSetSource : public CRandom
       
    34 	{
       
    35 public:
       
    36 	CRandomSetSource(const TDesC8& aSource);
       
    37 	virtual void GenerateBytesL(TDes8& aDest);
       
    38 	void SetSource(const TDesC8& aSource);
       
    39 
       
    40 private:
       
    41 	TPtrC8 iValue;
       
    42 	mutable TUint iCounter;
       
    43 	};
       
    44 
       
    45 class CRandomIncrementing : public CRandom
       
    46 	{
       
    47 public:
       
    48 	CRandomIncrementing(TUint aInitialValue);
       
    49 	virtual void GenerateBytesL(TDes8& aDest);
       
    50 
       
    51 private:
       
    52 	mutable TUint iValue;
       
    53 	};
       
    54 
       
    55 #endif	//	__CBROKENRANDOM_H__