Release 0.1.65
[platform/core/security/key-manager.git] / common / test_common.h
1 /*
2  *  Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  *  Contact: Kyungwook Tak <k.tak@samsung.com>
5  *
6  *  Licensed under the Apache License, Version 2.0 (the "License");
7  *  you may not use this file except in compliance with the License.
8  *  You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License
17  *
18  * @file        test_common.h
19  * @author      Zofia Abramowska (z.abramowska@samsung.com)
20  * @version
21  * @brief
22  */
23 #pragma once
24 #include <string>
25 #include <ckm/ckm-type.h>
26
27 // mirrors the API-defined value
28 #ifndef AES_GCM_TAG_SIZE
29 #define AES_GCM_TAG_SIZE 16
30 #endif
31
32 CKM::RawBuffer createDefaultPass();
33 CKM::RawBuffer createPass(std::size_t from, std::size_t to);
34 CKM::RawBuffer createBigBlob(std::size_t size);
35 CKM::RawBuffer createRandom(std::size_t size);
36
37 const CKM::RawBuffer defaultPass = createDefaultPass();
38 const std::string pattern =
39         "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f";
40
41 const std::size_t RAW_PASS_SIZE = 32;
42 const std::size_t HEX_PASS_SIZE = RAW_PASS_SIZE * 2;
43
44
45 std::string rawToHexString(const CKM::RawBuffer &raw);