|
1 /* |
|
2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Provides class for AES CM 128 bit encryption/decryption. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __SRTP_CIPHER_AESCM128_H__ |
|
22 #define __SRTP_CIPHER_AESCM128_H__ |
|
23 |
|
24 #include "msrtpcipher.h" |
|
25 |
|
26 //FORWARD declarations |
|
27 class CSrtpAESCTRCrypto; |
|
28 |
|
29 class CSRTPCipherAESCM128: public CBase, public MSRTPCipher |
|
30 { |
|
31 public: |
|
32 /** |
|
33 * Constructor. |
|
34 * @leave KErrNone if success, system-wide error code otherwise |
|
35 */ |
|
36 static CSRTPCipherAESCM128* NewL(); |
|
37 |
|
38 /** |
|
39 * Constructor. |
|
40 * @leave KErrNone if success, system-wide error code otherwise |
|
41 */ |
|
42 static CSRTPCipherAESCM128* NewLC(); |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 ~CSRTPCipherAESCM128(); |
|
48 |
|
49 /** |
|
50 * Inherited from MSRTPCipher. |
|
51 * This function is called by SRTP for encryption/decryption with AESCM-128 |
|
52 * Produces key stream and performs an XOR operation for the plain text |
|
53 * @param aKey Input key. |
|
54 * @param aIV Integer Value (IV). |
|
55 * @param aSrc source data which will be transformed. |
|
56 * Returns HBufC8* decrypted/encrypted source |
|
57 */ |
|
58 HBufC8* TransformL(const TDesC8& aKey, |
|
59 const TDesC8& aIV, |
|
60 const TDesC8& aSrc ); |
|
61 |
|
62 private: // Data |
|
63 CSrtpAESCTRCrypto* iCipher; |
|
64 |
|
65 private: // methods |
|
66 /** |
|
67 * Default constructor. |
|
68 */ |
|
69 CSRTPCipherAESCM128(); |
|
70 |
|
71 void ConstructL(); |
|
72 }; |
|
73 |
|
74 #endif // __SRTP_CIPHER_AESCM128_H__ |