Update contrib.
2 * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * TWindowSlider class implementation
25 #ifndef __WINDOWSLIDER_H__
26 #define __WINDOWSLIDER_H__
31 /** Utility class used by our fast exponentiation routines.\n\n
32 * See HAC 14.85 for an explanation of how window sliding helps speed things up.
39 * @param aExp The exponent you are using.
40 * @param aWindowSize The window size. Leave as default value for the
41 * constructor to pick a window size appropriate for the given aExp
44 TWindowSlider(const TInteger& aExp, TUint aWindowSize=0);
46 * Finds the next "window" as defined by HAC 14.85. The actual bitstring
47 * value is in iValue and it's length in iLength. These remain valid until
48 * the next call to FindNextWindow()
50 void FindNextWindow(TUint aBegin);
51 inline TUint WindowSize(void) {return iSize;}
52 inline TUint Value(void) {return iValue;}
53 inline TUint Length(void) {return iLength;}
56 const TInteger& iExp; ///the exponent all this is being calculated on
57 TUint iSize; ///The size of the sliding window
58 TUint iValue; ///the value found by the most recent FindNextWindow() call
59 TUint iLength;///the bit length of the iValue