]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man3/EVP_CIPHER_CTX_get_original_iv.pod
Rename EVP_CIPHER_CTX_get_iv and EVP_CIPHER_CTX_get_iv_state for clarity
[thirdparty/openssl.git] / doc / man3 / EVP_CIPHER_CTX_get_original_iv.pod
CommitLineData
c76ffc78
BK
1=pod
2
3=head1 NAME
4
0d83b7b9
TM
5EVP_CIPHER_CTX_get_original_iv, EVP_CIPHER_CTX_get_updated_iv,
6EVP_CIPHER_CTX_iv, EVP_CIPHER_CTX_original_iv,
7EVP_CIPHER_CTX_iv_noconst - Routines to inspect EVP_CIPHER_CTX IV data
c76ffc78
BK
8
9=head1 SYNOPSIS
10
11 #include <openssl/evp.h>
12
0d83b7b9
TM
13 int EVP_CIPHER_CTX_get_original_iv(EVP_CIPHER_CTX *ctx, void *buf, size_t len);
14 int EVP_CIPHER_CTX_get_updated_iv(EVP_CIPHER_CTX *ctx, void *buf, size_t len);
15
16Deprecated since OpenSSL 3.0, can be hidden entirely by defining
17B<OPENSSL_API_COMPAT> with a suitable version value, see
18L<openssl_user_macros(7)>:
19
c76ffc78
BK
20 const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx);
21 const unsigned char *EVP_CIPHER_CTX_original_iv(const EVP_CIPHER_CTX *ctx);
22 unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx);
23
24=head1 DESCRIPTION
25
0d83b7b9
TM
26EVP_CIPHER_CTX_get_original_iv() and EVP_CIPHER_CTX_get_updated_iv() copy
27initialization vector (IV) information from the B<EVP_CIPHER_CTX> into the
28caller-supplied buffer. L<EVP_CIPHER_CTX_iv_length(3)> can be used to determine
29an appropriate buffer size, and if the supplied buffer is too small, an error
30will be returned (and no data copied). EVP_CIPHER_CTX_get_original_iv()
31accesses the ("original") IV that was supplied when the B<EVP_CIPHER_CTX> was
32initialized, and EVP_CIPHER_CTX_get_updated_iv() accesses the current "IV state"
33of the cipher, which is updated during cipher operation for certain cipher modes
34(e.g., CBC and OFB).
c76ffc78
BK
35
36The functions EVP_CIPHER_CTX_iv(), EVP_CIPHER_CTX_original_iv(), and
37EVP_CIPHER_CTX_iv_noconst() are deprecated functions that provide similar (at
38a conceptual level) functionality. EVP_CIPHER_CTX_iv() returns a pointer to
39the beginning of the "IV state" as maintained internally in the
40B<EVP_CIPHER_CTX>; EVP_CIPHER_CTX_original_iv() returns a pointer to the
41beginning of the ("original") IV, as maintained by the B<EVP_CIPHER_CTX>, that
42was provided when the B<EVP_CIPHER_CTX> was initialized; and
43EVP_CIPHER_CTX_get_iv_noconst() is the same as EVP_CIPHER_CTX_iv() but has a
44different return type for the pointer.
45
46=head1 RETURN VALUES
47
0d83b7b9
TM
48EVP_CIPHER_CTX_get_original_iv() and EVP_CIPHER_CTX_get_updated_iv() return 1
49on success and 0 on failure.
c76ffc78
BK
50
51The functions EVP_CIPHER_CTX_iv(), EVP_CIPHER_CTX_original_iv(), and
52EVP_CIPHER_CTX_iv_noconst() return a pointer to an IV as an array of bytes on
53success, and NULL on failure.
54
55=head1 HISTORY
56
0d83b7b9
TM
57EVP_CIPHER_CTX_get_original_iv() and EVP_CIPHER_CTX_get_updated_iv() were added
58in OpenSSL 3.0.0.
c76ffc78
BK
59
60EVP_CIPHER_CTX_iv(), EVP_CIPHER_CTX_original_iv(), and
61EVP_CIPHER_CTX_iv_noconst() were added in OpenSSL 1.1.0, and were deprecated
62in OpenSSL 3.0.0.
63
64=head1 COPYRIGHT
65
0d83b7b9 66Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
c76ffc78
BK
67
68Licensed under the Apache License 2.0 (the "License"). You may not use
69this file except in compliance with the License. You can obtain a copy
70in the file LICENSE in the source distribution or at
71L<https://www.openssl.org/source/license.html>.
72
73=cut