e86897102e5f58e7851c359aacc46d3710fde697
[platform/core/security/drm-service-core-tizen.git] / tadcore / include / TADC_IF.h
1 /*
2  * Copyright (c) 2000-2015 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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 #pragma once
18
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <string.h>
22 #include <memory.h>
23 #include <stdbool.h>
24
25 #include "TADC_Sub.h"
26 #include "drm-tizen-mid.h"
27
28 #define RO_ISSUER_ROOT_CERTS_DIR ISSUER_ROOT_CERTS_DIR
29
30 int TADC_IF_GetDUID(char *DUID);
31
32 int TADC_IF_GetDHKey(T_DH_INFO *t_dhinfo);
33 int TADC_IF_GetDHKey_K(T_DH_INFO *t_dhinfo);
34
35 int TADC_IF_AES_CTR(unsigned char *pKey, int ivLen, unsigned char *pIV, int inLen, unsigned char *in, int *pOutLen, unsigned char *out);
36 int TADC_IF_SHA1(unsigned char *in, int inLen, unsigned char *out);
37
38 size_t TADC_IF_StrLen(const char *string);
39 int TADC_IF_StrCmp(const char *string1, const char *string2);
40 int TADC_IF_StrNCmp(const char *string1, const char *string2, size_t count);
41 char *TADC_IF_StrNCpy(char *strDestination, const char *strSource, size_t count);
42
43 int TADC_IF_MemCmp(const void *buf1, const void *buf2, size_t count);
44 void TADC_IF_MemCpy(void *dest, const void *src, size_t count);
45 void TADC_IF_MemSet(void *dest, int c, size_t count);
46
47 void *TADC_IF_Malloc(size_t size);
48 void TADC_IF_Free(void *memblock);
49
50 int TADC_IF_AtoI(char *str);
51
52 void TADC_IF_Debug(const char *str);
53
54 int TADC_IF_VerifySignature( unsigned char* inData, int inLen,
55                                                          unsigned char* sigData, int sigLen,
56                                                          unsigned char* cert, int certLen );
57
58 int TADC_IF_VerifyCertChain( unsigned char* rica, int ricaLen,
59                                                          unsigned char* cert, int certLen );