Lines Matching +full:4 +full:- +full:data

1 .\" -*- mode: troff; coding: utf-8 -*-
58 .TH EVP_ENCODEINIT 3ossl 2025-09-30 3.5.4 OpenSSL
67 EVP_DecodeBlock \- EVP base64 encode/decode routines
91 The EVP encode routines provide a high-level interface to base64 encoding and
93 Base64 encoding converts binary data into a printable form that uses
94 the characters A\-Z, a\-z, 0\-9, "+" and "/" to represent the data. For every 3
95 bytes of binary data provided 4 bytes of base64 encoded data will be produced
96 plus some occasional newlines (see below). If the input data length is not a
97 multiple of 3 then the output data will be padded at the end using the "="
106 Encoding of binary data is performed in blocks of 48 input bytes (or less for
108 For each 48 byte input block encoded 64 bytes of base64 data
110 final block (which may be less than 48 bytes) will output 4 bytes for every 3
111 bytes of input. If the data length is not divisible by 3 then a full 4 bytes is
117 \&\fBEVP_EncodeUpdate()\fR encode \fBinl\fR bytes of data found in the buffer pointed to by
120 buffer at \fBout\fR is sufficiently large to accommodate the output data. Only full
121 blocks of data (48 bytes) will be immediately processed and output by this
125 amount of unprocessed data held in \fBctx\fR and divide the result by 48 (ignore
126 any remainder). This gives the number of blocks of data that will be processed.
129 repeatedly to process large amounts of input data. In the event of an error
134 process any partial block of data remaining in the \fBctx\fR object. The output
135 data will be stored in \fBout\fR and the length of the data written will be stored
137 sufficiently large to accommodate the output data which will never be more than
146 \&\fBEVP_EncodeBlock()\fR encodes a full block of input data in \fBf\fR and of length
147 \&\fBn\fR and stores it in \fBt\fR. For every 3 bytes of input provided 4 bytes of
148 output data will be produced. If \fBn\fR is not divisible by 3 then the block is
149 encoded as a final block of data and the output is padded such that it is always
150 divisible by 4. Additionally a NUL terminator character will be added. For
151 example if 16 bytes of input data is provided then 24 bytes of encoded data is
153 the data generated \fIwithout\fR the NUL terminator is returned from the function.
157 \&\fBEVP_DecodeUpdate()\fR decodes \fBinl\fR characters of data found in the buffer
162 sufficiently large to accommodate the output data.
163 This function will attempt to decode as much data as possible in chunks of up
166 if its length is not a multiple of 4 (including any padding), to be processed
168 If the final chunk length is a multiple of 4, it is decoded immediately and
172 For compatibility with \fBPEM\fR, the \fB\-\fR (hyphen) character is treated as a soft
173 end-of-input, subsequent bytes are not buffered, and the return value will be
175 The soft end-of-input, if present, MUST occur after a multiple of 4 valid base64
177 The soft end-of-input condition is not remembered in \fBctx\fR, it is up to the
182 character (\fB=\fR) is encountered in the middle of the data then
183 \&\fBEVP_DecodeUpdate()\fR returns \-1 to indicate an error.
184 A return value of 0 or 1 indicates successful processing of the data.
185 A return value of 0 additionally indicates that the last 4 bytes processed
186 ended with base64 padding (\fB=\fR), or that the next 4 byte group starts with the
187 soft end-of-input (\fB\-\fR) character, and therefore no more input data is
190 For every 4 valid base64 bytes processed (ignoring whitespace, carriage returns
191 and line feeds), 3 bytes of binary output data will be produced (except at the
192 end of data terminated with one or two padding characters).
195 but it will never decode additional data. If there is no residual data
196 it will return 1 to indicate success. If there is residual data, its
197 length is not a multiple of 4, i.e. it was not properly padded, \-1 is
200 \&\fBEVP_DecodeBlock()\fR will decode the block of \fBn\fR characters of base64 data
205 After trimming the data in \fBf\fR MUST consist entirely of valid base64
207 divisible by 4.
208 For every 4 input bytes exactly 3 output bytes will be produced.
212 \&\fBEVP_DecodeBlock()\fR will return the length of the data decoded or \-1 on error.
226 \&\fBEVP_DecodeUpdate()\fR returns \-1 on error and 0 or 1 on success. If 0 is returned
227 then no more non-padding base64 characters are expected.
229 \&\fBEVP_DecodeFinal()\fR returns \-1 on error or 1 on success.
231 \&\fBEVP_DecodeBlock()\fR returns the length of the data decoded or \-1 on error.
242 Copyright 2016\-2025 The OpenSSL Project Authors. All Rights Reserved.