• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Wrapper functions for crypto libraries
3  * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
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 
18 #ifndef CRYPTO_MBEDTLS_H
19 #define CRYPTO_MBEDTLS_H
20 
21 #include "library/common.h"
22 #include "mbedtls/ecp.h"
23 #include "mbedtls/bignum.h"
24 
25 struct crypto_ec {
26 	mbedtls_ecp_group ecp;
27 	mbedtls_mpi a;
28 };
29 
30 #define crypto_bignum mbedtls_mpi
31 #define crypto_ec_point mbedtls_ecp_point
32 #define AES_128_ALT_BLOCK_SIZE 16
33 #define AES_256_ALT_BLOCK_SIZE 32
34 #define AES_128_CRYPTO_LEN 128
35 #define DHM_PARM_MEM 2048
36 #define DHM_PARM_G_LEN 2
37 
38 #endif
39