summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/sm2/sm2_local.h
diff options
context:
space:
mode:
authortb <>2022-11-26 16:08:57 +0000
committertb <>2022-11-26 16:08:57 +0000
commitd0a21970fdc0fbbfc7ad31bc135f5a8fde1d3d49 (patch)
tree556ebf909e81599dc3d8da585217d1576eabe0e4 /src/lib/libcrypto/sm2/sm2_local.h
parentbcbac728558eebfaa4404c405e7dc22769585345 (diff)
downloadopenbsd-d0a21970fdc0fbbfc7ad31bc135f5a8fde1d3d49.tar.gz
openbsd-d0a21970fdc0fbbfc7ad31bc135f5a8fde1d3d49.tar.bz2
openbsd-d0a21970fdc0fbbfc7ad31bc135f5a8fde1d3d49.zip
Make internal header file names consistent
Libcrypto currently has a mess of *_lcl.h, *_locl.h, and *_local.h names used for internal headers. Move all these headers we inherited from OpenSSL to *_local.h, reserving the name *_internal.h for our own code. Similarly, move dtls_locl.h and ssl_locl.h to dtls_local and ssl_local.h. constant_time_locl.h is moved to constant_time.h since it's special. Adjust all .c files in libcrypto, libssl and regress. The diff is mechanical with the exception of tls13_quic.c, where #include <ssl_locl.h> was fixed manually. discussed with jsing, no objection bcook
Diffstat (limited to 'src/lib/libcrypto/sm2/sm2_local.h')
-rw-r--r--src/lib/libcrypto/sm2/sm2_local.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/lib/libcrypto/sm2/sm2_local.h b/src/lib/libcrypto/sm2/sm2_local.h
new file mode 100644
index 0000000000..c934263190
--- /dev/null
+++ b/src/lib/libcrypto/sm2/sm2_local.h
@@ -0,0 +1,43 @@
1/* $OpenBSD: sm2_local.h,v 1.1 2022/11/26 16:08:54 tb Exp $ */
2/*
3 * Copyright (c) 2017, 2019 Ribose Inc
4 *
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#ifndef HEADER_SM2_LOCL_H
19#define HEADER_SM2_LOCL_H
20
21#include <openssl/ec.h>
22#include <openssl/ecdsa.h>
23
24__BEGIN_HIDDEN_DECLS
25
26int sm2_compute_userid_digest(uint8_t *out, const EVP_MD *digest,
27 const uint8_t *uid, size_t uid_len, const EC_KEY *key);
28
29/*
30 * SM2 signature operation. Computes ZA (user id digest) and then signs
31 * H(ZA || msg) using SM2
32 */
33ECDSA_SIG *sm2_do_sign(const EC_KEY *key, const EVP_MD *digest,
34 const uint8_t *uid, size_t uid_len, const uint8_t *msg, size_t msg_len);
35
36int sm2_do_verify(const EC_KEY *key, const EVP_MD *digest,
37 const ECDSA_SIG *signature, const uint8_t *uid, size_t uid_len,
38 const uint8_t *msg, size_t msg_len);
39
40__END_HIDDEN_DECLS
41
42#endif
43