2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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
17 * @file crypto_service.h
18 * @author Dongsun Lee (ds73.lee@samsung.com)
20 * @brief provides encryption and decription operations.
22 #ifndef __WAE_CRYPTO_SERVICE_H
23 #define __WAE_CRYPTO_SERVICE_H
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);
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);
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);
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);
53 #endif /* __WAE_CRYPTO_SERVICE_H */