Apply coding style of tizen by astyle
[platform/core/security/libwebappenc.git] / srcs / crypto_service.h
1 /*
2  *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Licensed under the Apache License, Version 2.0 (the "License");
5  *  you may not use this file except in compliance with the License.
6  *  You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *  Unless required by applicable law or agreed to in writing, software
11  *  distributed under the License is distributed on an "AS IS" BASIS,
12  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *  See the License for the specific language governing permissions and
14  *  limitations under the License
15  *
16  *
17  * @file        crypto_service.h
18  * @author      Dongsun Lee (ds73.lee@samsung.com)
19  * @version     1.0
20  * @brief       provides encryption and decription operations.
21  */
22 #ifndef __WAE_CRYPTO_SERVICE_H
23 #define __WAE_CRYPTO_SERVICE_H
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
29 #include <stddef.h>
30
31 int encrypt_app_dek(const unsigned char *rsaPublicKey, size_t pubKeyLen,
32                                         const unsigned char *dek, size_t dekLen,
33                                         unsigned char **encryptedDek, size_t *encryptedDekLen);
34
35 int decrypt_app_dek(const unsigned char *rsaPrivateKey, size_t priKeyLen,
36                                         const char *priKeyPassword,
37                                         const unsigned char *encryptedDek, size_t dencryptedDekLen,
38                                         unsigned char **decryptedDek, size_t *decryptedDekLen);
39
40
41 int encrypt_aes_cbc(const unsigned char *pKey, size_t keyLen,
42                                         const unsigned char *pData, size_t dataLen,
43                                         unsigned char **ppEncryptedData, size_t *pEncDataLen);
44
45 int decrypt_aes_cbc(const unsigned char *pKey, size_t keyLen,
46                                         const unsigned char *pData, size_t dataLen,
47                                         unsigned char **ppDecryptedData, size_t *pDecDataLen);
48
49 #ifdef __cplusplus
50 }
51 #endif
52
53 #endif /* __WAE_CRYPTO_SERVICE_H */