ecdsa.h
1 /* ecdsa.h
2  *
3  * Copyright (C) 2006-2020 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 /* ecdsa.h for openssl */
23 
24 #ifndef WOLFSSL_ECDSA_H_
25 #define WOLFSSL_ECDSA_H_
26 
27 #include <wolfssl/openssl/bn.h>
28 #include <wolfssl/openssl/ec.h>
29 
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
35 #ifndef WOLFSSL_ECDSA_TYPE_DEFINED /* guard on redeclaration */
37 #define WOLFSSL_ECDSA_TYPE_DEFINED
38 #endif
39 
41 
43  WOLFSSL_BIGNUM *r;
44  WOLFSSL_BIGNUM *s;
45 };
46 
47 WOLFSSL_API void wolfSSL_ECDSA_SIG_free(WOLFSSL_ECDSA_SIG *sig);
48 WOLFSSL_API WOLFSSL_ECDSA_SIG *wolfSSL_ECDSA_SIG_new(void);
49 WOLFSSL_API WOLFSSL_ECDSA_SIG *wolfSSL_ECDSA_do_sign(const unsigned char *dgst,
50  int dgst_len,
51  WOLFSSL_EC_KEY *eckey);
52 WOLFSSL_API int wolfSSL_ECDSA_do_verify(const unsigned char *dgst,
53  int dgst_len,
54  const WOLFSSL_ECDSA_SIG *sig,
55  WOLFSSL_EC_KEY *eckey);
56 
57 WOLFSSL_API WOLFSSL_ECDSA_SIG *wolfSSL_d2i_ECDSA_SIG(WOLFSSL_ECDSA_SIG **sig,
58  const unsigned char **pp,
59  long len);
60 WOLFSSL_API int wolfSSL_i2d_ECDSA_SIG(const WOLFSSL_ECDSA_SIG *sig,
61  unsigned char **pp);
62 
63 #define ECDSA_SIG_free wolfSSL_ECDSA_SIG_free
64 #define ECDSA_SIG_new wolfSSL_ECDSA_SIG_new
65 #define ECDSA_do_sign wolfSSL_ECDSA_do_sign
66 #define ECDSA_do_verify wolfSSL_ECDSA_do_verify
67 #define d2i_ECDSA_SIG wolfSSL_d2i_ECDSA_SIG
68 #define i2d_ECDSA_SIG wolfSSL_i2d_ECDSA_SIG
69 
70 #ifdef __cplusplus
71 } /* extern "C" */
72 #endif
73 
74 #endif /* header */
75 
Definition: ecdsa.h:42
bn.h for openssl
Definition: ec.h:106