summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/EVP_CIPHER_nid.3
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/man/EVP_CIPHER_nid.3215
1 files changed, 215 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/EVP_CIPHER_nid.3 b/src/lib/libcrypto/man/EVP_CIPHER_nid.3
new file mode 100644
index 0000000000..3a3c42d0b4
--- /dev/null
+++ b/src/lib/libcrypto/man/EVP_CIPHER_nid.3
@@ -0,0 +1,215 @@
1.\" $OpenBSD: EVP_CIPHER_nid.3,v 1.1 2023/08/31 17:27:41 schwarze Exp $
2.\" full merge up to: OpenSSL 5211e094 Nov 11 14:39:11 2014 -0800
3.\"
4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license:
6.\"
7.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
8.\"
9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above
11.\" copyright notice and this permission notice appear in all copies.
12.\"
13.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20.\"
21.\" The original file was written by Dr. Stephen Henson <steve@openssl.org>.
22.\" Copyright (c) 2000 The OpenSSL Project. All rights reserved.
23.\"
24.\" Redistribution and use in source and binary forms, with or without
25.\" modification, are permitted provided that the following conditions
26.\" are met:
27.\"
28.\" 1. Redistributions of source code must retain the above copyright
29.\" notice, this list of conditions and the following disclaimer.
30.\"
31.\" 2. Redistributions in binary form must reproduce the above copyright
32.\" notice, this list of conditions and the following disclaimer in
33.\" the documentation and/or other materials provided with the
34.\" distribution.
35.\"
36.\" 3. All advertising materials mentioning features or use of this
37.\" software must display the following acknowledgment:
38.\" "This product includes software developed by the OpenSSL Project
39.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
40.\"
41.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
42.\" endorse or promote products derived from this software without
43.\" prior written permission. For written permission, please contact
44.\" openssl-core@openssl.org.
45.\"
46.\" 5. Products derived from this software may not be called "OpenSSL"
47.\" nor may "OpenSSL" appear in their names without prior written
48.\" permission of the OpenSSL Project.
49.\"
50.\" 6. Redistributions of any form whatsoever must retain the following
51.\" acknowledgment:
52.\" "This product includes software developed by the OpenSSL Project
53.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
54.\"
55.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
56.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
57.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
58.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
59.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
60.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
61.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
62.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
63.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
64.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
65.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
66.\" OF THE POSSIBILITY OF SUCH DAMAGE.
67.\"
68.Dd $Mdocdate: August 31 2023 $
69.Dt EVP_CIPHER_NID 3
70.Os
71.Sh NAME
72.Nm EVP_CIPHER_nid ,
73.Nm EVP_CIPHER_CTX_nid ,
74.Nm EVP_CIPHER_type ,
75.Nm EVP_CIPHER_CTX_type ,
76.Nm EVP_CIPHER_block_size ,
77.Nm EVP_CIPHER_CTX_block_size ,
78.Nm EVP_CIPHER_flags ,
79.Nm EVP_CIPHER_CTX_flags ,
80.Nm EVP_CIPHER_mode ,
81.Nm EVP_CIPHER_CTX_mode
82.Nd inspect EVP_CIPHER objects
83.Sh SYNOPSIS
84.In openssl/evp.h
85.Ft int
86.Fo EVP_CIPHER_nid
87.Fa "const EVP_CIPHER *e"
88.Fc
89.Ft int
90.Fo EVP_CIPHER_CTX_nid
91.Fa "const EVP_CIPHER_CTX *ctx"
92.Fc
93.Ft int
94.Fo EVP_CIPHER_type
95.Fa "const EVP_CIPHER *ctx"
96.Fc
97.Ft int
98.Fo EVP_CIPHER_CTX_type
99.Fa "const EVP_CIPHER_CTX *ctx"
100.Fc
101.Ft int
102.Fo EVP_CIPHER_block_size
103.Fa "const EVP_CIPHER *e"
104.Fc
105.Ft int
106.Fo EVP_CIPHER_CTX_block_size
107.Fa "const EVP_CIPHER_CTX *ctx"
108.Fc
109.Ft unsigned long
110.Fo EVP_CIPHER_flags
111.Fa "const EVP_CIPHER *e"
112.Fc
113.Ft unsigned long
114.Fo EVP_CIPHER_CTX_flags
115.Fa "const EVP_CIPHER_CTX *ctx"
116.Fc
117.Ft unsigned long
118.Fo EVP_CIPHER_mode
119.Fa "const EVP_CIPHER *e"
120.Fc
121.Ft unsigned long
122.Fo EVP_CIPHER_CTX_mode
123.Fa "const EVP_CIPHER_CTX *ctx"
124.Fc
125.Sh DESCRIPTION
126.Fn EVP_CIPHER_nid
127and
128.Fn EVP_CIPHER_CTX_nid
129return the NID of a cipher when passed an
130.Vt EVP_CIPHER
131or
132.Vt EVP_CIPHER_CTX
133structure.
134The actual NID value is an internal value which may not have a
135corresponding OBJECT IDENTIFIER.
136.Pp
137.Fn EVP_CIPHER_type
138and
139.Fn EVP_CIPHER_CTX_type
140return the type of the passed cipher or context.
141This "type" is the actual NID of the cipher OBJECT IDENTIFIER as such it
142ignores the cipher parameters and 40-bit RC2 and 128-bit RC2 have the
143same NID.
144If the cipher does not have an object identifier or does not
145have ASN.1 support, this function will return
146.Dv NID_undef .
147.Pp
148.Fn EVP_CIPHER_block_size
149and
150.Fn EVP_CIPHER_CTX_block_size
151return the block size of a cipher when passed an
152.Vt EVP_CIPHER
153or
154.Vt EVP_CIPHER_CTX
155structure.
156The constant
157.Dv EVP_MAX_BLOCK_LENGTH
158is also the maximum block length for all ciphers.
159.Pp
160.Fn EVP_CIPHER_mode
161and
162.Fn EVP_CIPHER_CTX_mode
163return the block cipher mode:
164.Dv EVP_CIPH_ECB_MODE ,
165.Dv EVP_CIPH_CBC_MODE ,
166.Dv EVP_CIPH_CFB_MODE ,
167.Dv EVP_CIPH_OFB_MODE ,
168.Dv EVP_CIPH_CTR_MODE ,
169or
170.Dv EVP_CIPH_XTS_MODE .
171If the cipher is a stream cipher then
172.Dv EVP_CIPH_STREAM_CIPHER
173is returned.
174.Sh RETURN VALUES
175.Fn EVP_CIPHER_nid
176and
177.Fn EVP_CIPHER_CTX_nid
178return a NID.
179.Pp
180.Fn EVP_CIPHER_type
181and
182.Fn EVP_CIPHER_CTX_type
183return the NID of the cipher's OBJECT IDENTIFIER or
184.Dv NID_undef
185if it has no defined OBJECT IDENTIFIER.
186.Pp
187.Fn EVP_CIPHER_block_size
188and
189.Fn EVP_CIPHER_CTX_block_size
190return the block size.
191.Sh SEE ALSO
192.Xr evp 3 ,
193.Xr EVP_CIPHER_CTX_ctrl 3 ,
194.Xr EVP_EncryptInit 3
195.Sh HISTORY
196.Fn EVP_CIPHER_type ,
197.Fn EVP_CIPHER_CTX_type ,
198.Fn EVP_CIPHER_block_size ,
199and
200.Fn EVP_CIPHER_CTX_block_size
201first appeared in SSLeay 0.6.5.
202.Fn EVP_CIPHER_nid
203and
204.Fn EVP_CIPHER_CTX_nid
205first appeared in SSLeay 0.8.0.
206All these functions have been available since
207.Ox 2.4 .
208.Pp
209.Fn EVP_CIPHER_flags ,
210.Fn EVP_CIPHER_CTX_flags ,
211.Fn EVP_CIPHER_mode ,
212and
213.Fn EVP_CIPHER_CTX_mode
214first appeared in OpenSSL 0.9.6 and have been available since
215.Ox 2.9 .