author | Santosh Patil <santosh.v.patil@nokia.com> |
Wed, 08 Jul 2009 11:25:26 +0100 | |
changeset 0 | 2c201484c85f |
child 8 | 35751d3474b7 |
permissions | -rw-r--r-- |
0
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
1 |
/* |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies). |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
8 |
* |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
11 |
* |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
13 |
* |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
15 |
* Implementation for testing TInt encoding/decoding |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
16 |
* |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
17 |
*/ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
18 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
19 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
20 |
#include "testint.h" |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
21 |
#include "tasn1normaltest.h" |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
22 |
#include <asn1enc.h> |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
23 |
#include <asn1dec.h> |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
24 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
25 |
#include <e32math.h> |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
26 |
#include <e32cons.h> |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
27 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
28 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
29 |
CTestInt* CTestInt::NewL(CASN1NormalTest &aASN1Action) |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
30 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
31 |
CTestInt* test = new (ELeave) CTestInt(aASN1Action); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
32 |
return test; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
33 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
34 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
35 |
CTestInt::CTestInt(CASN1NormalTest &aASN1Action) : CTestBase(aASN1Action) |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
36 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
37 |
}; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
38 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
39 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
40 |
void CTestInt::GetName(TDes& aBuf) |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
41 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
42 |
aBuf.Copy(_L("Test TInt")); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
43 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
44 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
45 |
void CTestInt::FillParameterArray(void) |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
46 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
47 |
iParameters->Append(CTestParameter::EInt); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
48 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
49 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
50 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
51 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
52 |
TBool CTestInt::PerformTest(CConsoleBase& aConsole, const TInt &aTest, const TInt &aTestNumber, const TInt &aTotalTests) |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
53 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
54 |
// Choose value to encode |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
55 |
TInt encodedValue; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
56 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
57 |
encodedValue = aTest; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
58 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
59 |
// Get encoder |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
60 |
CASN1EncInt* encoder = CASN1EncInt::NewLC(encodedValue); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
61 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
62 |
// Prepare a buffer |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
63 |
TUint length = encoder->LengthDER(); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
64 |
HBufC8* buf = HBufC8::NewMaxLC(length); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
65 |
TPtr8 tBuf = buf->Des(); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
66 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
67 |
// Write into the buffer |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
68 |
TUint writeLength = 0; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
69 |
encoder->WriteDERL(tBuf, writeLength); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
70 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
71 |
// Read it out again |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
72 |
TASN1DecInteger decoder; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
73 |
TInt readLength = 0; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
74 |
TInt decodedValue = decoder.DecodeDERShortL(tBuf, readLength); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
75 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
76 |
// Check lengths of reads + values |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
77 |
if ((writeLength != STATIC_CAST(TUint, readLength)) || (decodedValue != encodedValue)) |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
78 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
79 |
aConsole.Printf(_L("\nERROR! Problem integer: %d\n"), encodedValue); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
80 |
iASN1Action.ReportProgressL(KErrASN1EncodingError, aTestNumber, aTotalTests); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
81 |
CleanupStack::PopAndDestroy(2); // buf, encoder |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
82 |
return(EFalse); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
83 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
84 |
else |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
85 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
86 |
iASN1Action.ReportProgressL(KErrNone, aTestNumber, aTotalTests); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
87 |
CleanupStack::PopAndDestroy(2); // buf, encoder |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
88 |
return(ETrue); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
89 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
90 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
91 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
92 |
TBool CTestInt::PerformTestsL(CConsoleBase& aConsole) |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
93 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
94 |
TInt nLow = Math::Random(); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
95 |
TInt64 nHigh((TInt)Math::Random()); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
96 |
TInt64 seed((nHigh << 32) + nLow); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
97 |
CTestParameter* test; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
98 |
TInt totalTests, currentTest=0; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
99 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
100 |
if(!CountTests(totalTests)) return(EFalse); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
101 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
102 |
for(TInt pos = 0; pos < iValues->Count(); pos++) |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
103 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
104 |
test = (*iValues)[pos]; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
105 |
switch(test->GetType()) |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
106 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
107 |
case CTestParameter::EInt : |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
108 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
109 |
CIntTestParameter *rangeInt = REINTERPRET_CAST(CIntTestParameter*, test); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
110 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
111 |
if(!PerformTest(aConsole, rangeInt->Value(), currentTest, totalTests)) |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
112 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
113 |
return(EFalse); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
114 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
115 |
currentTest++; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
116 |
break; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
117 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
118 |
case CTestParameter::EIntRange : |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
119 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
120 |
CIntRangeTestParameter *rangeInt = REINTERPRET_CAST(CIntRangeTestParameter*, test); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
121 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
122 |
for(TInt test = rangeInt->Start(); test <= rangeInt->Finish(); test++) |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
123 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
124 |
if(!PerformTest(aConsole, test, currentTest, totalTests)) |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
125 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
126 |
return(EFalse); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
127 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
128 |
currentTest++; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
129 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
130 |
break; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
131 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
132 |
case CTestParameter::ERandom : |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
133 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
134 |
CRandomTestParameter *randomInt = REINTERPRET_CAST(CRandomTestParameter*, test); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
135 |
TInt encodedValue; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
136 |
|
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
137 |
for(TInt test = 0; test <= randomInt->Interations(); test++) |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
138 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
139 |
encodedValue = Math::Rand(seed) >> (8 * (test % 4)); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
140 |
if(!PerformTest(aConsole, encodedValue, currentTest, totalTests)) |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
141 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
142 |
return(EFalse); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
143 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
144 |
currentTest++; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
145 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
146 |
break; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
147 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
148 |
default: |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
149 |
{ |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
150 |
return EFalse; |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
151 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
152 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
153 |
} |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
154 |
iASN1Action.ReportProgressL(KErrNone, totalTests, totalTests); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
155 |
return(ETrue); |
2c201484c85f
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff
changeset
|
156 |
} |