summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ecdsa
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ecdsa')
-rw-r--r--src/lib/libcrypto/ecdsa/ecdsa.h140
1 files changed, 2 insertions, 138 deletions
diff --git a/src/lib/libcrypto/ecdsa/ecdsa.h b/src/lib/libcrypto/ecdsa/ecdsa.h
index 4b4a10ced4..9f498eb4a2 100644
--- a/src/lib/libcrypto/ecdsa/ecdsa.h
+++ b/src/lib/libcrypto/ecdsa/ecdsa.h
@@ -1,142 +1,6 @@
1/* $OpenBSD: ecdsa.h,v 1.19 2023/07/28 09:08:31 tb Exp $ */ 1/* $OpenBSD: ecdsa.h,v 1.20 2023/07/28 09:16:17 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project 3 * Public domain.
4 */ 4 */
5/* ====================================================================
6 * Copyright (c) 2000-2005 The OpenSSL Project. All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
18 * distribution.
19 *
20 * 3. All advertising materials mentioning features or use of this
21 * software must display the following acknowledgment:
22 * "This product includes software developed by the OpenSSL Project
23 * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 *
25 * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 * endorse or promote products derived from this software without
27 * prior written permission. For written permission, please contact
28 * licensing@OpenSSL.org.
29 *
30 * 5. Products derived from this software may not be called "OpenSSL"
31 * nor may "OpenSSL" appear in their names without prior written
32 * permission of the OpenSSL Project.
33 *
34 * 6. Redistributions of any form whatsoever must retain the following
35 * acknowledgment:
36 * "This product includes software developed by the OpenSSL Project
37 * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 *
39 * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 * OF THE POSSIBILITY OF SUCH DAMAGE.
51 * ====================================================================
52 *
53 * This product includes cryptographic software written by Eric Young
54 * (eay@cryptsoft.com). This product includes software written by Tim
55 * Hudson (tjh@cryptsoft.com).
56 *
57 */
58#ifndef HEADER_ECDSA_H
59#define HEADER_ECDSA_H
60
61#include <openssl/opensslconf.h>
62
63#ifdef OPENSSL_NO_ECDSA
64#error ECDSA is disabled.
65#endif
66 5
67#include <openssl/bn.h>
68#include <openssl/ec.h> 6#include <openssl/ec.h>
69
70#include <openssl/ossl_typ.h>
71
72#ifdef __cplusplus
73extern "C" {
74#endif
75
76typedef struct ECDSA_SIG_st ECDSA_SIG;
77
78/*
79 * If this flag is set, the ECDSA method is FIPS compliant and can be used
80 * in FIPS mode. This is set in the validated module method. If an
81 * application sets this flag in its own methods it is its responsibility
82 * to ensure the result is compliant.
83 */
84
85#define ECDSA_FLAG_FIPS_METHOD 0x1
86
87ECDSA_SIG *ECDSA_SIG_new(void);
88void ECDSA_SIG_free(ECDSA_SIG *sig);
89int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp);
90ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len);
91void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps);
92
93const BIGNUM *ECDSA_SIG_get0_r(const ECDSA_SIG *sig);
94const BIGNUM *ECDSA_SIG_get0_s(const ECDSA_SIG *sig);
95int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s);
96
97ECDSA_SIG *ECDSA_do_sign(const unsigned char *dgst, int dgst_len,
98 EC_KEY *eckey);
99int ECDSA_do_verify(const unsigned char *dgst, int dgst_len,
100 const ECDSA_SIG *sig, EC_KEY* eckey);
101
102int ECDSA_size(const EC_KEY *eckey);
103
104int ECDSA_sign(int type, const unsigned char *dgst, int dgstlen,
105 unsigned char *sig, unsigned int *siglen, EC_KEY *eckey);
106int ECDSA_verify(int type, const unsigned char *dgst, int dgstlen,
107 const unsigned char *sig, int siglen, EC_KEY *eckey);
108
109/* XXX should be in ec.h, but needs ECDSA_SIG */
110void EC_KEY_METHOD_set_sign(EC_KEY_METHOD *meth,
111 int (*sign)(int type, const unsigned char *dgst,
112 int dlen, unsigned char *sig, unsigned int *siglen,
113 const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey),
114 int (*sign_setup)(EC_KEY *eckey, BN_CTX *ctx_in,
115 BIGNUM **kinvp, BIGNUM **rp),
116 ECDSA_SIG *(*sign_sig)(const unsigned char *dgst,
117 int dgst_len, const BIGNUM *in_kinv, const BIGNUM *in_r,
118 EC_KEY *eckey));
119void EC_KEY_METHOD_set_verify(EC_KEY_METHOD *meth,
120 int (*verify)(int type, const unsigned char *dgst, int dgst_len,
121 const unsigned char *sigbuf, int sig_len, EC_KEY *eckey),
122 int (*verify_sig)(const unsigned char *dgst, int dgst_len,
123 const ECDSA_SIG *sig, EC_KEY *eckey));
124void EC_KEY_METHOD_get_sign(const EC_KEY_METHOD *meth,
125 int (**psign)(int type, const unsigned char *dgst,
126 int dlen, unsigned char *sig, unsigned int *siglen,
127 const BIGNUM *kinv, const BIGNUM *r, EC_KEY *eckey),
128 int (**psign_setup)(EC_KEY *eckey, BN_CTX *ctx_in,
129 BIGNUM **kinvp, BIGNUM **rp),
130 ECDSA_SIG *(**psign_sig)(const unsigned char *dgst,
131 int dgst_len, const BIGNUM *in_kinv, const BIGNUM *in_r,
132 EC_KEY *eckey));
133void EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth,
134 int (**pverify)(int type, const unsigned char *dgst, int dgst_len,
135 const unsigned char *sigbuf, int sig_len, EC_KEY *eckey),
136 int (**pverify_sig)(const unsigned char *dgst, int dgst_len,
137 const ECDSA_SIG *sig, EC_KEY *eckey));
138
139#ifdef __cplusplus
140}
141#endif
142#endif