blob: 6e1e1dcb24d1146d1f507863aa692a757c7035c5 [file] [log] [blame]
yuezonghe824eb0c2024-06-27 02:32:26 -07001/* ecc.h
2 *
3 * Copyright (C) 2006-2021 wolfSSL Inc.
4 *
5 * This file is part of wolfSSL.
6 *
7 * wolfSSL is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * wolfSSL is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
20 */
21
22
23#ifdef HAVE_ECC
24
25#ifndef CTAO_CRYPT_ECC_H
26#define CTAO_CRYPT_ECC_H
27
28#include <wolfssl/wolfcrypt/ecc.h>
29
30/* includes for compatibility */
31#include <cyassl/ctaocrypt/types.h>
32#include <cyassl/ctaocrypt/integer.h>
33#include <cyassl/ctaocrypt/random.h>
34
35/* for ecc reverse compatibility */
36#ifdef HAVE_ECC
37 #define ecc_make_key wc_ecc_make_key
38 #define ecc_shared_secret wc_ecc_shared_secret
39 #define ecc_sign_hash wc_ecc_sign_hash
40 #define ecc_verify_hash wc_ecc_verify_hash
41 #define ecc_init wc_ecc_init
42 #define ecc_free wc_ecc_free
43 #define ecc_fp_free wc_ecc_fp_free
44 #define ecc_export_x963 wc_ecc_export_x963
45 #define ecc_size wc_ecc_size
46 #define ecc_sig_size wc_ecc_sig_size
47 #define ecc_export_x963_ex wc_ecc_export_x963_ex
48 #define ecc_import_x963 wc_ecc_import_x963
49 #define ecc_import_private_key wc_ecc_import_private_key
50 #define ecc_rs_to_sig wc_ecc_rs_to_sig
51 #define ecc_import_raw wc_ecc_import_raw
52 #define ecc_export_private_only wc_ecc_export_private_only
53
54#ifdef HAVE_ECC_ENCRYPT
55 /* ecc encrypt */
56 #define ecc_ctx_new wc_ecc_ctx_new
57 #define ecc_ctx_free wc_ecc_ctx_free
58 #define ecc_ctx_reset wc_ecc_ctx_reset
59 #define ecc_ctx_get_own_salt wc_ecc_ctx_get_own_salt
60 #define ecc_ctx_set_peer_salt wc_ecc_ctx_set_peer_salt
61 #define ecc_ctx_set_info wc_ecc_ctx_set_info
62 #define ecc_encrypt wc_ecc_encrypt
63 #define ecc_decrypt wc_ecc_decrypt
64#endif /* HAVE_ECC_ENCRYPT */
65#endif
66
67#endif /* CTAO_CRYPT_ECC_H */
68#endif /* HAVE_ECC */
69