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 * CMontgomeryStructure class implementation
31 /** A special representation of integers allowing efficient multiplication
32 * and exponentiation under special conditions.
35 class CMontgomeryStructure : public CBase
38 static CMontgomeryStructure* NewL(const TInteger& aModulus);
39 IMPORT_C static CMontgomeryStructure* NewLC(const TInteger& aModulus);
40 ~CMontgomeryStructure();
41 const TInteger& ReduceL(const TInteger& aInteger) const;
42 const TInteger& MultiplyL(const TInteger& aA, const TInteger& aB) const;
43 IMPORT_C const TInteger& ExponentiateL(const TInteger& aBase, const TInteger& aExponent) const;
44 const TInteger& SquareL(const TInteger& aA) const;
46 void DoMultiplyL(TInteger& aResult, const TInteger& aA, const TInteger& aB) const;
47 void DoSquareL(TInteger& aResult, const TInteger& aA) const;
48 TInteger& ConvertInL(TInteger& aInteger) const;
49 TInteger& ConvertOutL(TInteger& aInteger) const;
50 CMontgomeryStructure();
52 void ConstructL(const TInteger& aModulus);
56 mutable RInteger iResult;