First public contribution.
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.
22 inline void IPerm(TUint32& left, TUint32& right)
26 right = rotlFixed(right, 4U);
27 work = (left ^ right) & 0xf0f0f0f0;
29 right = rotrFixed(right^work, 20U);
30 work = (left ^ right) & 0xffff0000;
32 right = rotrFixed(right^work, 18U);
33 work = (left ^ right) & 0x33333333;
35 right = rotrFixed(right^work, 6U);
36 work = (left ^ right) & 0x00ff00ff;
38 right = rotlFixed(right^work, 9U);
39 work = (left ^ right) & 0xaaaaaaaa;
40 left = rotlFixed(left^work, 1U);
44 inline void FPerm(TUint32& left, TUint32& right)
48 right = rotrFixed(right, 1U);
49 work = (left ^ right) & 0xaaaaaaaa;
51 left = rotrFixed(left^work, 9U);
52 work = (left ^ right) & 0x00ff00ff;
54 left = rotlFixed(left^work, 6U);
55 work = (left ^ right) & 0x33333333;
57 left = rotlFixed(left^work, 18U);
58 work = (left ^ right) & 0xffff0000;
60 left = rotlFixed(left^work, 20U);
61 work = (left ^ right) & 0xf0f0f0f0;
63 left = rotrFixed(left^work, 4U);
66 inline void ReverseKeySchedule(TUint32* aKey)
71 TClassSwap((*(aKey+i)), (*(aKey+(32-2-i))));
72 TClassSwap((*(aKey+i+1)), (*(aKey+(32-1-i))));