wolfSSL SSL/TLS library, support up to TLS1.3

Dependents:   OS

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ecdsa.h Source File

ecdsa.h

00001 /* ecdsa.h
00002  *
00003  * Copyright (C) 2006-2017 wolfSSL Inc.
00004  *
00005  * This file is part of wolfSSL.
00006  *
00007  * wolfSSL is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * wolfSSL is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
00020  */
00021 
00022 /* ecdsa.h for openssl */
00023 
00024 #ifndef WOLFSSL_ECDSA_H_
00025 #define WOLFSSL_ECDSA_H_
00026 
00027 #include <wolfssl/openssl/bn.h>
00028 
00029 
00030 #ifdef __cplusplus
00031 extern "C" {
00032 #endif
00033 
00034 #ifndef WOLFSSL_ECDSA_TYPE_DEFINED /* guard on redeclaration */
00035 typedef struct WOLFSSL_ECDSA_SIG      WOLFSSL_ECDSA_SIG;
00036 #define WOLFSSL_ECDSA_TYPE_DEFINED
00037 #endif
00038 
00039 typedef WOLFSSL_ECDSA_SIG             ECDSA_SIG;
00040 
00041 struct WOLFSSL_ECDSA_SIG {
00042     WOLFSSL_BIGNUM *r;
00043     WOLFSSL_BIGNUM *s;
00044 };
00045 
00046 WOLFSSL_API void wolfSSL_ECDSA_SIG_free(WOLFSSL_ECDSA_SIG *sig);
00047 WOLFSSL_API WOLFSSL_ECDSA_SIG *wolfSSL_ECDSA_SIG_new(void);
00048 WOLFSSL_API WOLFSSL_ECDSA_SIG *wolfSSL_ECDSA_do_sign(const unsigned char *dgst,
00049                                                      int dgst_len,
00050                                                      WOLFSSL_EC_KEY *eckey);
00051 WOLFSSL_API int wolfSSL_ECDSA_do_verify(const unsigned char *dgst,
00052                                         int dgst_len,
00053                                         const WOLFSSL_ECDSA_SIG *sig,
00054                                         WOLFSSL_EC_KEY *eckey);
00055 
00056 #define ECDSA_SIG_free wolfSSL_ECDSA_SIG_free
00057 #define ECDSA_SIG_new wolfSSL_ECDSA_SIG_new
00058 #define ECDSA_do_sign wolfSSL_ECDSA_do_sign
00059 #define ECDSA_do_verify wolfSSL_ECDSA_do_verify
00060 
00061 #ifdef __cplusplus
00062 }  /* extern "C" */
00063 #endif
00064 
00065 #endif /* header */
00066 
00067