sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
* ** IMPORTANT ** PublishedPartner API's in this file are published to 3rd party developers via the
|
sl@0
|
16 |
* Symbian website. Changes to these API's should be treated as PublishedAll API changes and the Security TA should be consulted.
|
sl@0
|
17 |
* CBlockTransformation class implementation
|
sl@0
|
18 |
*
|
sl@0
|
19 |
*/
|
sl@0
|
20 |
|
sl@0
|
21 |
|
sl@0
|
22 |
/**
|
sl@0
|
23 |
@file
|
sl@0
|
24 |
@publishedPartner
|
sl@0
|
25 |
* @released
|
sl@0
|
26 |
*/
|
sl@0
|
27 |
|
sl@0
|
28 |
#ifndef __BLOCKTRANSFORMATION_H__
|
sl@0
|
29 |
#define __BLOCKTRANSFORMATION_H__
|
sl@0
|
30 |
|
sl@0
|
31 |
#include <e32base.h>
|
sl@0
|
32 |
|
sl@0
|
33 |
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
|
sl@0
|
34 |
/** The maximum block size supported (in bytes) */
|
sl@0
|
35 |
const TUint KMaxBlockSizeSupported = 32;
|
sl@0
|
36 |
#endif
|
sl@0
|
37 |
|
sl@0
|
38 |
/**
|
sl@0
|
39 |
* Abstract base class defining the interface to block transformation schemes.
|
sl@0
|
40 |
*
|
sl@0
|
41 |
* Block transformation schemes process a fixed-size block of input to return a
|
sl@0
|
42 |
* block of output the same size.
|
sl@0
|
43 |
*
|
sl@0
|
44 |
*/
|
sl@0
|
45 |
class CBlockTransformation : public CBase
|
sl@0
|
46 |
{
|
sl@0
|
47 |
public:
|
sl@0
|
48 |
/**
|
sl@0
|
49 |
* Transforms the supplied block, returning the new value using the same
|
sl@0
|
50 |
* parameter. aBlock.Size() must be the same length as BlockSize().
|
sl@0
|
51 |
*
|
sl@0
|
52 |
* @param aBlock On input, the data to be transformed;
|
sl@0
|
53 |
* on return, the data after transformation.
|
sl@0
|
54 |
*/
|
sl@0
|
55 |
virtual void Transform(TDes8& aBlock) = 0;
|
sl@0
|
56 |
|
sl@0
|
57 |
/**
|
sl@0
|
58 |
* Resets the transformation back to its original state. Clears all its buffers.
|
sl@0
|
59 |
*/
|
sl@0
|
60 |
virtual void Reset() = 0;
|
sl@0
|
61 |
|
sl@0
|
62 |
/**
|
sl@0
|
63 |
* Gets the block size in bytes.
|
sl@0
|
64 |
*
|
sl@0
|
65 |
* @return Block size in bytes.
|
sl@0
|
66 |
*/
|
sl@0
|
67 |
virtual TInt BlockSize() const = 0;
|
sl@0
|
68 |
|
sl@0
|
69 |
/**
|
sl@0
|
70 |
* Gets the key size in bits.
|
sl@0
|
71 |
*
|
sl@0
|
72 |
* @return Key size in bits.
|
sl@0
|
73 |
*/
|
sl@0
|
74 |
virtual TInt KeySize() const = 0;
|
sl@0
|
75 |
|
sl@0
|
76 |
/**
|
sl@0
|
77 |
@internalComponent
|
sl@0
|
78 |
Used to retrieve the extended interfaces by id. For Crypto
|
sl@0
|
79 |
SPI internal use only.
|
sl@0
|
80 |
*/
|
sl@0
|
81 |
TInt GetExtension(TUint aExtensionId, TAny*& a0, TAny* a1);
|
sl@0
|
82 |
};
|
sl@0
|
83 |
|
sl@0
|
84 |
#endif // __BLOCKTRANSFORMATION_H__
|