1EVP_CIPHER_CTX_GET_ORIGINAL_IV(3ossl)OpenSSELVP_CIPHER_CTX_GET_ORIGINAL_IV(3ossl)
2
3
4

NAME

6       EVP_CIPHER_CTX_get_original_iv, EVP_CIPHER_CTX_get_updated_iv,
7       EVP_CIPHER_CTX_iv, EVP_CIPHER_CTX_original_iv,
8       EVP_CIPHER_CTX_iv_noconst - Routines to inspect EVP_CIPHER_CTX IV data
9

SYNOPSIS

11        #include <openssl/evp.h>
12
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
16       The following functions have been deprecated since OpenSSL 3.0, and can
17       be hidden entirely by defining OPENSSL_API_COMPAT with a suitable
18       version value, see openssl_user_macros(7):
19
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

DESCRIPTION

25       EVP_CIPHER_CTX_get_original_iv() and EVP_CIPHER_CTX_get_updated_iv()
26       copy initialization vector (IV) information from the EVP_CIPHER_CTX
27       into the caller-supplied buffer. EVP_CIPHER_CTX_get_iv_length(3) can be
28       used to determine an appropriate buffer size, and if the supplied
29       buffer is too small, an error will be returned (and no data copied).
30       EVP_CIPHER_CTX_get_original_iv() accesses the ("original") IV that was
31       supplied when the EVP_CIPHER_CTX was initialized, and
32       EVP_CIPHER_CTX_get_updated_iv() accesses the current "IV state" of the
33       cipher, which is updated during cipher operation for certain cipher
34       modes (e.g., CBC and OFB).
35
36       The functions EVP_CIPHER_CTX_iv(), EVP_CIPHER_CTX_original_iv(), and
37       EVP_CIPHER_CTX_iv_noconst() are deprecated functions that provide
38       similar (at a conceptual level) functionality.  EVP_CIPHER_CTX_iv()
39       returns a pointer to the beginning of the "IV state" as maintained
40       internally in the EVP_CIPHER_CTX; EVP_CIPHER_CTX_original_iv() returns
41       a pointer to the beginning of the ("original") IV, as maintained by the
42       EVP_CIPHER_CTX, that was provided when the EVP_CIPHER_CTX was
43       initialized; and EVP_CIPHER_CTX_get_iv_noconst() is the same as
44       EVP_CIPHER_CTX_iv() but has a different return type for the pointer.
45

RETURN VALUES

47       EVP_CIPHER_CTX_get_original_iv() and EVP_CIPHER_CTX_get_updated_iv()
48       return 1 on success and 0 on failure.
49
50       The functions EVP_CIPHER_CTX_iv(), EVP_CIPHER_CTX_original_iv(), and
51       EVP_CIPHER_CTX_iv_noconst() return a pointer to an IV as an array of
52       bytes on success, and NULL on failure.
53

HISTORY

55       EVP_CIPHER_CTX_get_original_iv() and EVP_CIPHER_CTX_get_updated_iv()
56       were added in OpenSSL 3.0.0.
57
58       EVP_CIPHER_CTX_iv(), EVP_CIPHER_CTX_original_iv(), and
59       EVP_CIPHER_CTX_iv_noconst() were added in OpenSSL 1.1.0, and were
60       deprecated in OpenSSL 3.0.0.
61
63       Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
64
65       Licensed under the Apache License 2.0 (the "License").  You may not use
66       this file except in compliance with the License.  You can obtain a copy
67       in the file LICENSE in the source distribution or at
68       <https://www.openssl.org/source/license.html>.
69
70
71
723.0.9                             2023-07-E2V7P_CIPHER_CTX_GET_ORIGINAL_IV(3ossl)
Impressum