|
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 key derivation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __SRTP_KEYDERIVATION_AESCM128_H__ |
|
22 #define __SRTP_KEYDERIVATION_AESCM128_H__ |
|
23 |
|
24 #include "msrtpkeyderivation.h" |
|
25 |
|
26 //FORWARD declarations |
|
27 class CSrtpAESCTRCrypto; |
|
28 |
|
29 class CSRTPKeyDerivation_AESCM128 : public CBase, public MSRTPKeyDerivation |
|
30 { |
|
31 public: |
|
32 /** |
|
33 * Constructor. |
|
34 * @leave KErrNone if success, system-wide error code otherwise |
|
35 */ |
|
36 static CSRTPKeyDerivation_AESCM128* NewL(); |
|
37 |
|
38 /** |
|
39 * Constructor. |
|
40 * @leave KErrNone if success, system-wide error code otherwise |
|
41 */ |
|
42 static CSRTPKeyDerivation_AESCM128* NewLC(); |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 ~CSRTPKeyDerivation_AESCM128(); |
|
48 |
|
49 /** |
|
50 * This function is called by SRTP for key derivation operation (PRF_n) |
|
51 * with the default algorithm AESCM-128 |
|
52 * Produces keystream based on input key and IV value. |
|
53 * PRF_n function is used to derive session key from desired master key. |
|
54 * @param aBitLength bit length of the key. |
|
55 * @param aKey Input key. |
|
56 * @param aIV Integer Value (IV). |
|
57 * Returns HBufC8* keystream |
|
58 */ |
|
59 HBufC8* PRF_128BitL(TUint aBitLength, |
|
60 const TDesC8& aKey, |
|
61 const TDesC8& aIV); |
|
62 |
|
63 |
|
64 private: // Data |
|
65 CSrtpAESCTRCrypto* iEncryptor; |
|
66 |
|
67 private: // methods |
|
68 /** |
|
69 * Default constructor. |
|
70 */ |
|
71 CSRTPKeyDerivation_AESCM128(); |
|
72 |
|
73 void ConstructL(); |
|
74 }; |
|
75 |
|
76 #endif // __SRTP_KEYDERIVATION_AESCM128_H__ |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |