licentivo-launch 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +35 -0
- data/ext/launch_native/extconf.rb +28 -0
- data/lib/licentivo_launch/vendor/licentivo.rb +262 -0
- data/lib/licentivo_launch.rb +352 -0
- data/vendor/LICENSE +21 -0
- data/vendor/NOTICE +17 -0
- data/vendor/VERSION +1 -0
- data/vendor/c/app.c +33 -0
- data/vendor/c/demo.c +77 -0
- data/vendor/c/feature_tasks.h +72 -0
- data/vendor/c/licentivo.c +382 -0
- data/vendor/c/licentivo.h +67 -0
- data/vendor/c/quickstart.c +51 -0
- data/vendor/c/test_vectors.c +4 -0
- data/vendor/c/vendor/Monocypher-LICENCE.md +173 -0
- data/vendor/c/vendor/cJSON-LICENSE +20 -0
- data/vendor/c/vendor/cJSON.c +3191 -0
- data/vendor/c/vendor/cJSON.h +306 -0
- data/vendor/c/vendor/monocypher-ed25519.c +500 -0
- data/vendor/c/vendor/monocypher-ed25519.h +140 -0
- data/vendor/c/vendor/monocypher.c +2956 -0
- data/vendor/c/vendor/monocypher.h +321 -0
- data/vendor/curl/COPYING.txt +22 -0
- data/vendor/curl/bin/libcurl-x64.dll +0 -0
- data/vendor/curl/include/brotli/decode.h +409 -0
- data/vendor/curl/include/brotli/encode.h +505 -0
- data/vendor/curl/include/brotli/port.h +302 -0
- data/vendor/curl/include/brotli/shared_dictionary.h +100 -0
- data/vendor/curl/include/brotli/types.h +83 -0
- data/vendor/curl/include/curl/curl.h +3374 -0
- data/vendor/curl/include/curl/curlver.h +77 -0
- data/vendor/curl/include/curl/easy.h +123 -0
- data/vendor/curl/include/curl/header.h +74 -0
- data/vendor/curl/include/curl/mprintf.h +85 -0
- data/vendor/curl/include/curl/multi.h +561 -0
- data/vendor/curl/include/curl/options.h +70 -0
- data/vendor/curl/include/curl/stdcheaders.h +35 -0
- data/vendor/curl/include/curl/system.h +399 -0
- data/vendor/curl/include/curl/typecheck-gcc.h +964 -0
- data/vendor/curl/include/curl/urlapi.h +156 -0
- data/vendor/curl/include/curl/websockets.h +98 -0
- data/vendor/curl/include/libpsl.h +207 -0
- data/vendor/curl/include/libssh2.h +1516 -0
- data/vendor/curl/include/libssh2_publickey.h +128 -0
- data/vendor/curl/include/libssh2_sftp.h +382 -0
- data/vendor/curl/include/nghttp2/nghttp2.h +6878 -0
- data/vendor/curl/include/nghttp2/nghttp2ver.h +42 -0
- data/vendor/curl/include/nghttp3/nghttp3.h +3704 -0
- data/vendor/curl/include/nghttp3/version.h +46 -0
- data/vendor/curl/include/ngtcp2/ngtcp2.h +7485 -0
- data/vendor/curl/include/ngtcp2/ngtcp2_crypto.h +1071 -0
- data/vendor/curl/include/ngtcp2/ngtcp2_crypto_quictls.h +147 -0
- data/vendor/curl/include/ngtcp2/version.h +51 -0
- data/vendor/curl/include/openssl/aes.h +120 -0
- data/vendor/curl/include/openssl/asn1.h +1121 -0
- data/vendor/curl/include/openssl/asn1t.h +996 -0
- data/vendor/curl/include/openssl/bio.h +716 -0
- data/vendor/curl/include/openssl/blowfish.h +106 -0
- data/vendor/curl/include/openssl/bn.h +480 -0
- data/vendor/curl/include/openssl/buffer.h +102 -0
- data/vendor/curl/include/openssl/camellia.h +121 -0
- data/vendor/curl/include/openssl/cast.h +99 -0
- data/vendor/curl/include/openssl/chacha.h +54 -0
- data/vendor/curl/include/openssl/cmac.h +81 -0
- data/vendor/curl/include/openssl/cms.h +541 -0
- data/vendor/curl/include/openssl/comp.h +7 -0
- data/vendor/curl/include/openssl/conf.h +189 -0
- data/vendor/curl/include/openssl/crypto.h +458 -0
- data/vendor/curl/include/openssl/ct.h +567 -0
- data/vendor/curl/include/openssl/curve25519.h +104 -0
- data/vendor/curl/include/openssl/des.h +215 -0
- data/vendor/curl/include/openssl/dh.h +245 -0
- data/vendor/curl/include/openssl/dsa.h +263 -0
- data/vendor/curl/include/openssl/dtls1.h +107 -0
- data/vendor/curl/include/openssl/ec.h +675 -0
- data/vendor/curl/include/openssl/ecdh.h +6 -0
- data/vendor/curl/include/openssl/ecdsa.h +6 -0
- data/vendor/curl/include/openssl/engine.h +215 -0
- data/vendor/curl/include/openssl/err.h +325 -0
- data/vendor/curl/include/openssl/evp.h +1288 -0
- data/vendor/curl/include/openssl/hkdf.h +65 -0
- data/vendor/curl/include/openssl/hmac.h +101 -0
- data/vendor/curl/include/openssl/idea.h +99 -0
- data/vendor/curl/include/openssl/kdf.h +137 -0
- data/vendor/curl/include/openssl/lhash.h +179 -0
- data/vendor/curl/include/openssl/md4.h +105 -0
- data/vendor/curl/include/openssl/md5.h +99 -0
- data/vendor/curl/include/openssl/mlkem.h +236 -0
- data/vendor/curl/include/openssl/modes.h +118 -0
- data/vendor/curl/include/openssl/obj_mac.h +4646 -0
- data/vendor/curl/include/openssl/objects.h +137 -0
- data/vendor/curl/include/openssl/ocsp.h +484 -0
- data/vendor/curl/include/openssl/opensslconf.h +16 -0
- data/vendor/curl/include/openssl/opensslfeatures.h +153 -0
- data/vendor/curl/include/openssl/opensslv.h +18 -0
- data/vendor/curl/include/openssl/ossl_typ.h +196 -0
- data/vendor/curl/include/openssl/pem.h +542 -0
- data/vendor/curl/include/openssl/pkcs12.h +284 -0
- data/vendor/curl/include/openssl/pkcs7.h +523 -0
- data/vendor/curl/include/openssl/poly1305.h +45 -0
- data/vendor/curl/include/openssl/posix_time.h +54 -0
- data/vendor/curl/include/openssl/rand.h +118 -0
- data/vendor/curl/include/openssl/rc2.h +101 -0
- data/vendor/curl/include/openssl/rc4.h +88 -0
- data/vendor/curl/include/openssl/ripemd.h +107 -0
- data/vendor/curl/include/openssl/rsa.h +603 -0
- data/vendor/curl/include/openssl/safestack.h +1739 -0
- data/vendor/curl/include/openssl/sha.h +190 -0
- data/vendor/curl/include/openssl/sm3.h +49 -0
- data/vendor/curl/include/openssl/sm4.h +47 -0
- data/vendor/curl/include/openssl/srtp.h +148 -0
- data/vendor/curl/include/openssl/ssl.h +2336 -0
- data/vendor/curl/include/openssl/ssl3.h +441 -0
- data/vendor/curl/include/openssl/stack.h +99 -0
- data/vendor/curl/include/openssl/tls1.h +764 -0
- data/vendor/curl/include/openssl/ts.h +660 -0
- data/vendor/curl/include/openssl/txt_db.h +112 -0
- data/vendor/curl/include/openssl/ui.h +397 -0
- data/vendor/curl/include/openssl/x509.h +1037 -0
- data/vendor/curl/include/openssl/x509_vfy.h +464 -0
- data/vendor/curl/include/openssl/x509v3.h +1039 -0
- data/vendor/curl/include/zconf.h +206 -0
- data/vendor/curl/include/zdict.h +481 -0
- data/vendor/curl/include/zlib.h +1859 -0
- data/vendor/curl/include/zlib_name_mangling.h +8 -0
- data/vendor/curl/include/zstd.h +3198 -0
- data/vendor/curl/include/zstd_errors.h +107 -0
- data/vendor/curl/lib/libcurl.dll.a +0 -0
- data/vendor/curl/licenses/brotli/LICENSE.txt +19 -0
- data/vendor/curl/licenses/certdata/LICENSE.url +2 -0
- data/vendor/curl/licenses/libpsl/COPYING.txt +20 -0
- data/vendor/curl/licenses/libressl/COPYING.txt +133 -0
- data/vendor/curl/licenses/libssh2/COPYING.txt +43 -0
- data/vendor/curl/licenses/nghttp2/COPYING.txt +23 -0
- data/vendor/curl/licenses/nghttp3/COPYING.txt +22 -0
- data/vendor/curl/licenses/ngtcp2/COPYING.txt +22 -0
- data/vendor/curl/licenses/psl/LICENSE.txt +373 -0
- data/vendor/curl/licenses/trurl/COPYING.txt +22 -0
- data/vendor/curl/licenses/zlibng/LICENSE.md +19 -0
- data/vendor/curl/licenses/zstd/LICENSE.txt +30 -0
- metadata +205 -0
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ngtcp2
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2019 ngtcp2 contributors
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
7
|
+
* a copy of this software and associated documentation files (the
|
|
8
|
+
* "Software"), to deal in the Software without restriction, including
|
|
9
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
10
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
11
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
12
|
+
* the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be
|
|
15
|
+
* included in all copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
18
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
19
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
21
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
22
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
23
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
#ifndef NGTCP2_CRYPTO_QUICTLS_H
|
|
26
|
+
#define NGTCP2_CRYPTO_QUICTLS_H
|
|
27
|
+
|
|
28
|
+
#include <ngtcp2/ngtcp2.h>
|
|
29
|
+
|
|
30
|
+
#include <openssl/ssl.h>
|
|
31
|
+
|
|
32
|
+
#ifdef __cplusplus
|
|
33
|
+
extern "C" {
|
|
34
|
+
#endif /* defined(__cplusplus) */
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* @macrosection
|
|
38
|
+
*
|
|
39
|
+
* quictls specific error codes
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @macro
|
|
44
|
+
*
|
|
45
|
+
* :macro:`NGTCP2_CRYPTO_QUICTLS_ERR_TLS_WANT_X509_LOOKUP` is the
|
|
46
|
+
* error code which indicates that TLS handshake routine is
|
|
47
|
+
* interrupted by X509 certificate lookup. See
|
|
48
|
+
* :macro:`SSL_ERROR_WANT_X509_LOOKUP` error description from
|
|
49
|
+
* `SSL_do_handshake`.
|
|
50
|
+
*/
|
|
51
|
+
#define NGTCP2_CRYPTO_QUICTLS_ERR_TLS_WANT_X509_LOOKUP -10001
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @macro
|
|
55
|
+
*
|
|
56
|
+
* :macro:`NGTCP2_CRYPTO_QUICTLS_ERR_TLS_WANT_CLIENT_HELLO_CB` is the
|
|
57
|
+
* error code which indicates that TLS handshake routine is
|
|
58
|
+
* interrupted by client hello callback. See
|
|
59
|
+
* :macro:`SSL_ERROR_WANT_CLIENT_HELLO_CB` error description from
|
|
60
|
+
* `SSL_do_handshake`.
|
|
61
|
+
*/
|
|
62
|
+
#define NGTCP2_CRYPTO_QUICTLS_ERR_TLS_WANT_CLIENT_HELLO_CB -10002
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @function
|
|
66
|
+
*
|
|
67
|
+
* `ngtcp2_crypto_quictls_from_ossl_encryption_level` translates
|
|
68
|
+
* |ossl_level| to :type:`ngtcp2_encryption_level`. This function is
|
|
69
|
+
* only available for quictls backend.
|
|
70
|
+
*/
|
|
71
|
+
NGTCP2_EXTERN ngtcp2_encryption_level
|
|
72
|
+
ngtcp2_crypto_quictls_from_ossl_encryption_level(
|
|
73
|
+
OSSL_ENCRYPTION_LEVEL ossl_level);
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @function
|
|
77
|
+
*
|
|
78
|
+
* `ngtcp2_crypto_quictls_from_ngtcp2_encryption_level` translates
|
|
79
|
+
* |encryption_level| to OSSL_ENCRYPTION_LEVEL. This function is only
|
|
80
|
+
* available for quictls backend.
|
|
81
|
+
*/
|
|
82
|
+
NGTCP2_EXTERN OSSL_ENCRYPTION_LEVEL
|
|
83
|
+
ngtcp2_crypto_quictls_from_ngtcp2_encryption_level(
|
|
84
|
+
ngtcp2_encryption_level encryption_level);
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @function
|
|
88
|
+
*
|
|
89
|
+
* `ngtcp2_crypto_quictls_configure_server_context` configures
|
|
90
|
+
* |ssl_ctx| for server side QUIC connection. It performs the
|
|
91
|
+
* following modifications:
|
|
92
|
+
*
|
|
93
|
+
* - Set minimum and maximum TLS version to TLSv1.3.
|
|
94
|
+
* - Set SSL_QUIC_METHOD by calling SSL_CTX_set_quic_method.
|
|
95
|
+
*
|
|
96
|
+
* Application must set a pointer to :type:`ngtcp2_crypto_conn_ref` to
|
|
97
|
+
* SSL object by calling SSL_set_app_data, and
|
|
98
|
+
* :type:`ngtcp2_crypto_conn_ref` object must have
|
|
99
|
+
* :member:`ngtcp2_crypto_conn_ref.get_conn` field assigned to get
|
|
100
|
+
* :type:`ngtcp2_conn`.
|
|
101
|
+
*
|
|
102
|
+
* It returns 0 if it succeeds, or -1.
|
|
103
|
+
*/
|
|
104
|
+
NGTCP2_EXTERN int
|
|
105
|
+
ngtcp2_crypto_quictls_configure_server_context(SSL_CTX *ssl_ctx);
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* @function
|
|
109
|
+
*
|
|
110
|
+
* `ngtcp2_crypto_quictls_configure_client_context` configures
|
|
111
|
+
* |ssl_ctx| for client side QUIC connection. It performs the
|
|
112
|
+
* following modifications:
|
|
113
|
+
*
|
|
114
|
+
* - Set minimum and maximum TLS version to TLSv1.3.
|
|
115
|
+
* - Set SSL_QUIC_METHOD by calling SSL_CTX_set_quic_method.
|
|
116
|
+
*
|
|
117
|
+
* Application must set a pointer to :type:`ngtcp2_crypto_conn_ref` to
|
|
118
|
+
* SSL object by calling SSL_set_app_data, and
|
|
119
|
+
* :type:`ngtcp2_crypto_conn_ref` object must have
|
|
120
|
+
* :member:`ngtcp2_crypto_conn_ref.get_conn` field assigned to get
|
|
121
|
+
* :type:`ngtcp2_conn`.
|
|
122
|
+
*
|
|
123
|
+
* It returns 0 if it succeeds, or -1.
|
|
124
|
+
*/
|
|
125
|
+
NGTCP2_EXTERN int
|
|
126
|
+
ngtcp2_crypto_quictls_configure_client_context(SSL_CTX *ssl_ctx);
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @function
|
|
130
|
+
*
|
|
131
|
+
* `ngtcp2_crypto_quictls_init` initializes libngtcp2_crypto_quictls
|
|
132
|
+
* library. This initialization is optional. For quictls >= 3.0, it
|
|
133
|
+
* is highly recommended to call this function before any use of
|
|
134
|
+
* libngtcp2_crypto library API to workaround the performance
|
|
135
|
+
* regression. Note that calling this function does not solve all
|
|
136
|
+
* performance issues introduced in 3.x. For quictls 1.1.1, this
|
|
137
|
+
* function does nothing, and always succeeds.
|
|
138
|
+
*
|
|
139
|
+
* This function returns 0 if it succeeds, or -1.
|
|
140
|
+
*/
|
|
141
|
+
NGTCP2_EXTERN int ngtcp2_crypto_quictls_init(void);
|
|
142
|
+
|
|
143
|
+
#ifdef __cplusplus
|
|
144
|
+
}
|
|
145
|
+
#endif /* defined(__cplusplus) */
|
|
146
|
+
|
|
147
|
+
#endif /* !defined(NGTCP2_CRYPTO_QUICTLS_H) */
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* ngtcp2
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2016 ngtcp2 contributors
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
7
|
+
* a copy of this software and associated documentation files (the
|
|
8
|
+
* "Software"), to deal in the Software without restriction, including
|
|
9
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
10
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
11
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
12
|
+
* the following conditions:
|
|
13
|
+
*
|
|
14
|
+
* The above copyright notice and this permission notice shall be
|
|
15
|
+
* included in all copies or substantial portions of the Software.
|
|
16
|
+
*
|
|
17
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
18
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
19
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
20
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
21
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
22
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
23
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
24
|
+
*/
|
|
25
|
+
#ifndef NGTCP2_VERSION_H
|
|
26
|
+
#define NGTCP2_VERSION_H
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @macrosection
|
|
30
|
+
*
|
|
31
|
+
* Library version macros
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @macro
|
|
36
|
+
*
|
|
37
|
+
* Version number of the ngtcp2 library release.
|
|
38
|
+
*/
|
|
39
|
+
#define NGTCP2_VERSION "1.25.0"
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @macro
|
|
43
|
+
*
|
|
44
|
+
* Numerical representation of the version number of the ngtcp2
|
|
45
|
+
* library release. This is a 24 bit number with 8 bits for major
|
|
46
|
+
* number, 8 bits for minor and 8 bits for patch. Version 1.2.3
|
|
47
|
+
* becomes 0x010203.
|
|
48
|
+
*/
|
|
49
|
+
#define NGTCP2_VERSION_NUM 0x011900
|
|
50
|
+
|
|
51
|
+
#endif /* !defined(NGTCP2_VERSION_H) */
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/* $OpenBSD: aes.h,v 1.16 2025/01/25 17:59:44 tb Exp $ */
|
|
2
|
+
/* ====================================================================
|
|
3
|
+
* Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* Redistribution and use in source and binary forms, with or without
|
|
6
|
+
* modification, are permitted provided that the following conditions
|
|
7
|
+
* are met:
|
|
8
|
+
*
|
|
9
|
+
* 1. Redistributions of source code must retain the above copyright
|
|
10
|
+
* notice, this list of conditions and the following disclaimer.
|
|
11
|
+
*
|
|
12
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
|
13
|
+
* notice, this list of conditions and the following disclaimer in
|
|
14
|
+
* the documentation and/or other materials provided with the
|
|
15
|
+
* distribution.
|
|
16
|
+
*
|
|
17
|
+
* 3. All advertising materials mentioning features or use of this
|
|
18
|
+
* software must display the following acknowledgment:
|
|
19
|
+
* "This product includes software developed by the OpenSSL Project
|
|
20
|
+
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
|
21
|
+
*
|
|
22
|
+
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
|
23
|
+
* endorse or promote products derived from this software without
|
|
24
|
+
* prior written permission. For written permission, please contact
|
|
25
|
+
* openssl-core@openssl.org.
|
|
26
|
+
*
|
|
27
|
+
* 5. Products derived from this software may not be called "OpenSSL"
|
|
28
|
+
* nor may "OpenSSL" appear in their names without prior written
|
|
29
|
+
* permission of the OpenSSL Project.
|
|
30
|
+
*
|
|
31
|
+
* 6. Redistributions of any form whatsoever must retain the following
|
|
32
|
+
* acknowledgment:
|
|
33
|
+
* "This product includes software developed by the OpenSSL Project
|
|
34
|
+
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
|
35
|
+
*
|
|
36
|
+
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
|
37
|
+
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
38
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
39
|
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
|
40
|
+
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
41
|
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
42
|
+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
43
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
44
|
+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
45
|
+
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
46
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
|
47
|
+
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
48
|
+
* ====================================================================
|
|
49
|
+
*
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
#ifndef HEADER_AES_H
|
|
53
|
+
#define HEADER_AES_H
|
|
54
|
+
|
|
55
|
+
#include <openssl/opensslconf.h>
|
|
56
|
+
|
|
57
|
+
#include <stddef.h>
|
|
58
|
+
|
|
59
|
+
#define AES_ENCRYPT 1
|
|
60
|
+
#define AES_DECRYPT 0
|
|
61
|
+
|
|
62
|
+
/* Because array size can't be a const in C, the following two are macros.
|
|
63
|
+
Both sizes are in bytes. */
|
|
64
|
+
#define AES_MAXNR 14
|
|
65
|
+
#define AES_BLOCK_SIZE 16
|
|
66
|
+
|
|
67
|
+
#ifdef __cplusplus
|
|
68
|
+
extern "C" {
|
|
69
|
+
#endif
|
|
70
|
+
|
|
71
|
+
/* This should be a hidden type, but EVP requires that the size be known */
|
|
72
|
+
struct aes_key_st {
|
|
73
|
+
unsigned int rd_key[4 *(AES_MAXNR + 1)];
|
|
74
|
+
int rounds;
|
|
75
|
+
};
|
|
76
|
+
typedef struct aes_key_st AES_KEY;
|
|
77
|
+
|
|
78
|
+
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
|
|
79
|
+
AES_KEY *key);
|
|
80
|
+
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
|
|
81
|
+
AES_KEY *key);
|
|
82
|
+
|
|
83
|
+
void AES_encrypt(const unsigned char *in, unsigned char *out,
|
|
84
|
+
const AES_KEY *key);
|
|
85
|
+
void AES_decrypt(const unsigned char *in, unsigned char *out,
|
|
86
|
+
const AES_KEY *key);
|
|
87
|
+
|
|
88
|
+
void AES_ecb_encrypt(const unsigned char *in, unsigned char *out,
|
|
89
|
+
const AES_KEY *key, const int enc);
|
|
90
|
+
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
|
|
91
|
+
size_t length, const AES_KEY *key, unsigned char *ivec, const int enc);
|
|
92
|
+
void AES_cfb128_encrypt(const unsigned char *in, unsigned char *out,
|
|
93
|
+
size_t length, const AES_KEY *key, unsigned char *ivec, int *num,
|
|
94
|
+
const int enc);
|
|
95
|
+
void AES_cfb1_encrypt(const unsigned char *in, unsigned char *out,
|
|
96
|
+
size_t length, const AES_KEY *key, unsigned char *ivec, int *num,
|
|
97
|
+
const int enc);
|
|
98
|
+
void AES_cfb8_encrypt(const unsigned char *in, unsigned char *out,
|
|
99
|
+
size_t length, const AES_KEY *key, unsigned char *ivec, int *num,
|
|
100
|
+
const int enc);
|
|
101
|
+
void AES_ofb128_encrypt(const unsigned char *in, unsigned char *out,
|
|
102
|
+
size_t length, const AES_KEY *key, unsigned char *ivec, int *num);
|
|
103
|
+
void AES_ctr128_encrypt(const unsigned char *in, unsigned char *out,
|
|
104
|
+
size_t length, const AES_KEY *key, unsigned char ivec[AES_BLOCK_SIZE],
|
|
105
|
+
unsigned char ecount_buf[AES_BLOCK_SIZE], unsigned int *num);
|
|
106
|
+
/* NB: the IV is _two_ blocks long */
|
|
107
|
+
void AES_ige_encrypt(const unsigned char *in, unsigned char *out,
|
|
108
|
+
size_t length, const AES_KEY *key, unsigned char *ivec, const int enc);
|
|
109
|
+
|
|
110
|
+
int AES_wrap_key(AES_KEY *key, const unsigned char *iv, unsigned char *out,
|
|
111
|
+
const unsigned char *in, unsigned int inlen);
|
|
112
|
+
int AES_unwrap_key(AES_KEY *key, const unsigned char *iv, unsigned char *out,
|
|
113
|
+
const unsigned char *in, unsigned int inlen);
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
#ifdef __cplusplus
|
|
117
|
+
}
|
|
118
|
+
#endif
|
|
119
|
+
|
|
120
|
+
#endif /* !HEADER_AES_H */
|