doc: note that get_params and set_params calls should return true if the param array...
[openssl.git] / doc / man7 / provider-cipher.pod
1 =pod
2
3 =head1 NAME
4
5 provider-cipher - The cipher library E<lt>-E<gt> provider functions
6
7 =head1 SYNOPSIS
8
9 =for openssl multiple includes
10
11  #include <openssl/core_dispatch.h>
12  #include <openssl/core_names.h>
13
14  /*
15   * None of these are actual functions, but are displayed like this for
16   * the function signatures for functions that are offered as function
17   * pointers in OSSL_DISPATCH arrays.
18   */
19
20  /* Context management */
21  void *OSSL_FUNC_cipher_newctx(void *provctx);
22  void OSSL_FUNC_cipher_freectx(void *cctx);
23  void *OSSL_FUNC_cipher_dupctx(void *cctx);
24
25  /* Encryption/decryption */
26  int OSSL_FUNC_cipher_encrypt_init(void *cctx, const unsigned char *key,
27                                    size_t keylen, const unsigned char *iv,
28                                    size_t ivlen, const OSSL_PARAM params[]);
29  int OSSL_FUNC_cipher_decrypt_init(void *cctx, const unsigned char *key,
30                                    size_t keylen, const unsigned char *iv,
31                                    size_t ivlen, const OSSL_PARAM params[]);
32  int OSSL_FUNC_cipher_update(void *cctx, unsigned char *out, size_t *outl,
33                              size_t outsize, const unsigned char *in, size_t inl);
34  int OSSL_FUNC_cipher_final(void *cctx, unsigned char *out, size_t *outl,
35                             size_t outsize);
36  int OSSL_FUNC_cipher_cipher(void *cctx, unsigned char *out, size_t *outl,
37                              size_t outsize, const unsigned char *in, size_t inl);
38
39  /* Cipher parameter descriptors */
40  const OSSL_PARAM *OSSL_FUNC_cipher_gettable_params(void *provctx);
41
42  /* Cipher operation parameter descriptors */
43  const OSSL_PARAM *OSSL_FUNC_cipher_gettable_ctx_params(void *cctx,
44                                                         void *provctx);
45  const OSSL_PARAM *OSSL_FUNC_cipher_settable_ctx_params(void *cctx,
46                                                         void *provctx);
47
48  /* Cipher parameters */
49  int OSSL_FUNC_cipher_get_params(OSSL_PARAM params[]);
50
51  /* Cipher operation parameters */
52  int OSSL_FUNC_cipher_get_ctx_params(void *cctx, OSSL_PARAM params[]);
53  int OSSL_FUNC_cipher_set_ctx_params(void *cctx, const OSSL_PARAM params[]);
54
55 =head1 DESCRIPTION
56
57 This documentation is primarily aimed at provider authors. See L<provider(7)>
58 for further information.
59
60 The CIPHER operation enables providers to implement cipher algorithms and make
61 them available to applications via the API functions L<EVP_EncryptInit_ex(3)>,
62 L<EVP_EncryptUpdate(3)> and L<EVP_EncryptFinal(3)> (as well as the decrypt
63 equivalents and other related functions).
64
65 All "functions" mentioned here are passed as function pointers between
66 F<libcrypto> and the provider in B<OSSL_DISPATCH> arrays via
67 B<OSSL_ALGORITHM> arrays that are returned by the provider's
68 provider_query_operation() function
69 (see L<provider-base(7)/Provider Functions>).
70
71 All these "functions" have a corresponding function type definition
72 named B<OSSL_{name}_fn>, and a helper function to retrieve the
73 function pointer from an B<OSSL_DISPATCH> element named
74 B<OSSL_FUNC_{name}>.
75 For example, the "function" OSSL_FUNC_cipher_newctx() has these:
76
77  typedef void *(OSSL_OSSL_FUNC_cipher_newctx_fn)(void *provctx);
78  static ossl_inline OSSL_OSSL_FUNC_cipher_newctx_fn
79      OSSL_FUNC_cipher_newctx(const OSSL_DISPATCH *opf);
80
81 B<OSSL_DISPATCH> arrays are indexed by numbers that are provided as
82 macros in L<openssl-core_dispatch.h(7)>, as follows:
83
84  OSSL_FUNC_cipher_newctx               OSSL_FUNC_CIPHER_NEWCTX
85  OSSL_FUNC_cipher_freectx              OSSL_FUNC_CIPHER_FREECTX
86  OSSL_FUNC_cipher_dupctx               OSSL_FUNC_CIPHER_DUPCTX
87
88  OSSL_FUNC_cipher_encrypt_init         OSSL_FUNC_CIPHER_ENCRYPT_INIT
89  OSSL_FUNC_cipher_decrypt_init         OSSL_FUNC_CIPHER_DECRYPT_INIT
90  OSSL_FUNC_cipher_update               OSSL_FUNC_CIPHER_UPDATE
91  OSSL_FUNC_cipher_final                OSSL_FUNC_CIPHER_FINAL
92  OSSL_FUNC_cipher_cipher               OSSL_FUNC_CIPHER_CIPHER
93
94  OSSL_FUNC_cipher_get_params           OSSL_FUNC_CIPHER_GET_PARAMS
95  OSSL_FUNC_cipher_get_ctx_params       OSSL_FUNC_CIPHER_GET_CTX_PARAMS
96  OSSL_FUNC_cipher_set_ctx_params       OSSL_FUNC_CIPHER_SET_CTX_PARAMS
97
98  OSSL_FUNC_cipher_gettable_params      OSSL_FUNC_CIPHER_GETTABLE_PARAMS
99  OSSL_FUNC_cipher_gettable_ctx_params  OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS
100  OSSL_FUNC_cipher_settable_ctx_params  OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS
101
102 A cipher algorithm implementation may not implement all of these functions.
103 In order to be a consistent set of functions there must at least be a complete
104 set of "encrypt" functions, or a complete set of "decrypt" functions, or a
105 single "cipher" function.
106 In all cases both the OSSL_FUNC_cipher_newctx and OSSL_FUNC_cipher_freectx functions must be
107 present.
108 All other functions are optional.
109
110 =head2 Context Management Functions
111
112 OSSL_FUNC_cipher_newctx() should create and return a pointer to a provider side
113 structure for holding context information during a cipher operation.
114 A pointer to this context will be passed back in a number of the other cipher
115 operation function calls.
116 The parameter I<provctx> is the provider context generated during provider
117 initialisation (see L<provider(7)>).
118
119 OSSL_FUNC_cipher_freectx() is passed a pointer to the provider side cipher context in
120 the I<cctx> parameter.
121 This function should free any resources associated with that context.
122
123 OSSL_FUNC_cipher_dupctx() should duplicate the provider side cipher context in the
124 I<cctx> parameter and return the duplicate copy.
125
126 =head2 Encryption/Decryption Functions
127
128 OSSL_FUNC_cipher_encrypt_init() initialises a cipher operation for encryption given a
129 newly created provider side cipher context in the I<cctx> parameter.
130 The key to be used is given in I<key> which is I<keylen> bytes long.
131 The IV to be used is given in I<iv> which is I<ivlen> bytes long.
132 The I<params>, if not NULL, should be set on the context in a manner similar to
133 using OSSL_FUNC_cipher_set_ctx_params().
134
135 OSSL_FUNC_cipher_decrypt_init() is the same as OSSL_FUNC_cipher_encrypt_init() except that it
136 initialises the context for a decryption operation.
137
138 OSSL_FUNC_cipher_update() is called to supply data to be encrypted/decrypted as part of
139 a previously initialised cipher operation.
140 The I<cctx> parameter contains a pointer to a previously initialised provider
141 side context.
142 OSSL_FUNC_cipher_update() should encrypt/decrypt I<inl> bytes of data at the location
143 pointed to by I<in>.
144 The encrypted data should be stored in I<out> and the amount of data written to
145 I<*outl> which should not exceed I<outsize> bytes.
146 OSSL_FUNC_cipher_update() may be called multiple times for a single cipher operation.
147 It is the responsibility of the cipher implementation to handle input lengths
148 that are not multiples of the block length.
149 In such cases a cipher implementation will typically cache partial blocks of
150 input data until a complete block is obtained.
151 I<out> may be the same location as I<in> but it should not partially overlap.
152 The same expectations apply to I<outsize> as documented for
153 L<EVP_EncryptUpdate(3)> and L<EVP_DecryptUpdate(3)>.
154
155 OSSL_FUNC_cipher_final() completes an encryption or decryption started through previous
156 OSSL_FUNC_cipher_encrypt_init() or OSSL_FUNC_cipher_decrypt_init(), and OSSL_FUNC_cipher_update()
157 calls.
158 The I<cctx> parameter contains a pointer to the provider side context.
159 Any final encryption/decryption output should be written to I<out> and the
160 amount of data written to I<*outl> which should not exceed I<outsize> bytes.
161 The same expectations apply to I<outsize> as documented for
162 L<EVP_EncryptFinal(3)> and L<EVP_DecryptFinal(3)>.
163
164 OSSL_FUNC_cipher_cipher() performs encryption/decryption using the provider side cipher
165 context in the I<cctx> parameter that should have been previously initialised via
166 a call to OSSL_FUNC_cipher_encrypt_init() or OSSL_FUNC_cipher_decrypt_init().
167 This should call the raw underlying cipher function without any padding.
168 This will be invoked in the provider as a result of the application calling
169 L<EVP_Cipher(3)>.
170 The application is responsible for ensuring that the input is a multiple of the
171 block length.
172 The data to be encrypted/decrypted will be in I<in>, and it will be I<inl> bytes
173 in length.
174 The output from the encryption/decryption should be stored in I<out> and the
175 amount of data stored should be put in I<*outl> which should be no more than
176 I<outsize> bytes.
177
178 =head2 Cipher Parameters
179
180 See L<OSSL_PARAM(3)> for further details on the parameters structure used by
181 these functions.
182
183 OSSL_FUNC_cipher_get_params() gets details of the algorithm implementation
184 and stores them in I<params>.
185
186 OSSL_FUNC_cipher_set_ctx_params() sets cipher operation parameters for the
187 provider side cipher context I<cctx> to I<params>.
188 Any parameter settings are additional to any that were previously set.
189 Passing NULL for I<params> should return true.
190
191 OSSL_FUNC_cipher_get_ctx_params() gets cipher operation details details from
192 the given provider side cipher context I<cctx> and stores them in I<params>.
193 Passing NULL for I<params> should return true.
194
195 OSSL_FUNC_cipher_gettable_params(), OSSL_FUNC_cipher_gettable_ctx_params(),
196 and OSSL_FUNC_cipher_settable_ctx_params() all return constant B<OSSL_PARAM>
197 arrays as descriptors of the parameters that OSSL_FUNC_cipher_get_params(),
198 OSSL_FUNC_cipher_get_ctx_params(), and OSSL_FUNC_cipher_set_ctx_params()
199 can handle, respectively.  OSSL_FUNC_cipher_gettable_ctx_params() and
200 OSSL_FUNC_cipher_settable_ctx_params() will return the parameters associated
201 with the provider side context I<cctx> in its current state if it is
202 not NULL.  Otherwise, they return the parameters associated with the
203 provider side algorithm I<provctx>.
204
205 Parameters currently recognised by built-in ciphers are as follows. Not all
206 parameters are relevant to, or are understood by all ciphers:
207
208 =over 4
209
210 =item "padding" (B<OSSL_CIPHER_PARAM_PADDING>) <unsigned integer>
211
212 Sets the padding mode for the associated cipher ctx.
213 Setting a value of 1 will turn padding on.
214 Setting a value of 0 will turn padding off.
215
216 =item "mode" (B<OSSL_CIPHER_PARAM_MODE>) <unsigned integer>
217
218 Gets the mode for the associated cipher algorithm.
219 See L<EVP_CIPHER_mode(3)> for a list of valid modes.
220
221 =item "blocksize" (B<OSSL_CIPHER_PARAM_BLOCK_SIZE>) <unsigned integer>
222
223 Gets the block size for the associated cipher algorithm.
224 The block size should be 1 for stream ciphers.
225 Note that the block size for a cipher may be different to the block size for
226 the underlying encryption/decryption primitive.
227 For example AES in CTR mode has a block size of 1 (because it operates like a
228 stream cipher), even though AES has a block size of 16.
229 The length of the "blocksize" parameter should not exceed that of a B<size_t>.
230
231 =item "aead" (B<OSSL_CIPHER_PARAM_AEAD>) <integer>
232
233 Gets 1 if this is an AEAD cipher algorithm, otherwise it gets 0.
234
235 =item "custom-iv" (B<OSSL_CIPHER_PARAM_CUSTOM_IV>) <integer>
236
237 Gets 1 if the cipher algorithm has a custom IV, otherwise it gets 0.
238 Storing and initializing the IV is left entirely to the implementation, if a
239 custom IV is used.
240
241 =item "cts" (B<OSSL_CIPHER_PARAM_CTS>) <integer>
242
243 Gets 1 if the cipher algorithm uses ciphertext stealing, otherwise it gets 0.
244 This is currently used to indicate that the cipher is a one shot that only
245 allows a single call to EVP_CipherUpdate().
246
247 =item "tls-multi" (B<OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK>) <integer>
248
249 Gets 1 if the cipher algorithm supports interleaving of crypto blocks, otherwise
250 it gets 0. The interleaving is an optimization only applicable to certain
251 TLS ciphers.
252
253 =item "keylen" (B<OSSL_CIPHER_PARAM_KEYLEN>) <unsigned integer>
254
255 Gets the key length for the associated cipher algorithm.
256 This can also be used to get or set the key length for the associated cipher
257 ctx.
258 The length of the "keylen" parameter should not exceed that of a B<size_t>.
259
260 =item "ivlen" (B<OSSL_CIPHER_PARAM_IVLEN>) <unsigned integer>
261
262 Gets the IV length for the associated cipher algorithm.
263 The length of the "ivlen" parameter should not exceed that of a B<size_t>.
264
265 =item "iv" (B<OSSL_CIPHER_PARAM_IV>) <octet string OR octet ptr>
266
267 Gets the IV used to initialize the associated cipher ctx.
268
269 =item "updated-iv" (B<OSSL_CIPHER_PARAM_UPDATED_IV>) <octet string OR octet ptr>
270
271 Gets the updated pseudo-IV state for the associated cipher ctx, e.g.,
272 the previous ciphertext block for CBC mode or the iteratively encrypted IV
273 value for OFB mode.  Note that octet pointer access is deprecated and is
274 provided only for backwards compatibility with historical libcrypto APIs.
275
276 =item "num" (B<OSSL_CIPHER_PARAM_NUM>) <unsigned integer>
277
278 Gets or sets the cipher specific "num" parameter for the associated cipher ctx.
279 Built-in ciphers typically use this to track how much of the current underlying
280 block has been "used" already.
281
282 =item "tag" (B<OSSL_CIPHER_PARAM_AEAD_TAG>) <octet string>
283
284 Gets or sets the AEAD tag for the associated cipher ctx.
285 See L<EVP_EncryptInit(3)/AEAD Interface>.
286
287 =item "taglen" (B<OSSL_CIPHER_PARAM_AEAD_TAGLEN>) <unsigned integer>
288
289 Gets the tag length to be used for an AEAD cipher for the associated cipher ctx.
290 It gets a default value if it has not been set.
291 The length of the "taglen" parameter should not exceed that of a B<size_t>.
292
293 =item "tlsaad" (B<OSSL_CIPHER_PARAM_AEAD_TLS1_AAD>) <octet string>
294
295 =for comment TODO(3.0): Consider changing this interface so that all ciphers
296 use the standard AEAD interface - rather than having this special purpose
297 interface for TLS
298
299 Sets TLSv1.2 AAD information for the associated cipher ctx.
300 TLSv1.2 AAD information is always 13 bytes in length and is as defined for the
301 "additional_data" field described in section 6.2.3.3 of RFC5246.
302
303 =item "tlsaadpad" (B<OSSL_CIPHER_PARAM_AEAD_TLS1_AAD_PAD>) <unsigned integer>
304
305 Gets the length of the tag that will be added to a TLS record for the AEAD
306 tag for the associated cipher ctx.
307 The length of the "tlsaadpad" parameter should not exceed that of a B<size_t>.
308
309 =item "tlsivfixed" (B<OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED>) <octet string>
310
311 =for comment TODO(3.0): This interface needs completely redesigning!
312
313 Sets the fixed portion of an IV for an AEAD cipher used in a TLS record
314 encryption/ decryption for the associated cipher ctx.
315 TLS record encryption/decryption always occurs "in place" so that the input and
316 output buffers are always the same memory location.
317 AEAD IVs in TLSv1.2 consist of an implicit "fixed" part and an explicit part
318 that varies with every record.
319 Setting a TLS fixed IV changes a cipher to encrypt/decrypt TLS records.
320 TLS records are encrypted/decrypted using a single OSSL_FUNC_cipher_cipher call per
321 record.
322 For a record decryption the first bytes of the input buffer will be the explicit
323 part of the IV and the final bytes of the input buffer will be the AEAD tag.
324 The length of the explicit part of the IV and the tag length will depend on the
325 cipher in use and will be defined in the RFC for the relevant ciphersuite.
326 In order to allow for "in place" decryption the plaintext output should be
327 written to the same location in the output buffer that the ciphertext payload
328 was read from, i.e. immediately after the explicit IV.
329
330 When encrypting a record the first bytes of the input buffer will be empty to
331 allow space for the explicit IV, as will the final bytes where the tag will
332 be written.
333 The length of the input buffer will include the length of the explicit IV, the
334 payload, and the tag bytes.
335 The cipher implementation should generate the explicit IV and write it to the
336 beginning of the output buffer, do "in place" encryption of the payload and
337 write that to the output buffer, and finally add the tag onto the end of the
338 output buffer.
339
340 Whether encrypting or decrypting the value written to I<*outl> in the
341 OSSL_FUNC_cipher_cipher call should be the length of the payload excluding the explicit
342 IV length and the tag length.
343
344 =item "ivlen" (B<OSSL_CIPHER_PARAM_AEAD_IVLEN>) <unsigned integer>
345
346 Sets the IV length to be used for an AEAD cipher for the associated cipher ctx.
347 The length of the "ivlen" parameter should not exceed that of a B<size_t>.
348
349 =item "mackey" (B<OSSL_CIPHER_PARAM_AEAD_MAC_KEY>) <octet string>
350
351 Sets the MAC key used by composite AEAD ciphers such as AES-CBC-HMAC-SHA256.
352
353 =item "randkey" (B<OSSL_CIPHER_PARAM_RANDOM_KEY>) <octet string>
354
355 Gets a implementation specific randomly generated key for the associated
356 cipher ctx. This is currently only supported by 3DES (which sets the key to
357 odd parity).
358
359 =item "alg_id_param" (B<OSSL_CIPHER_PARAM_ALG_ID>) <octet string>
360
361 Used to pass the DER encoded AlgorithmIdentifier parameter to or from
362 the cipher implementation.  Functions like L<EVP_CIPHER_param_to_asn1(3)>
363 and L<EVP_CIPHER_asn1_to_param(3)> use this parameter for any implementation
364 that has the flag B<EVP_CIPH_FLAG_CUSTOM_ASN1> set.
365
366 =item "rounds" (B<OSSL_CIPHER_PARAM_ROUNDS>) <unsigned integer>
367
368 Sets or gets the number of rounds to be used for a cipher.
369 This is used by the RC5 cipher.
370
371 =item "keybits" (B<OSSL_CIPHER_PARAM_RC2_KEYBITS>) <unsigned integer>
372
373 Gets or sets the effective keybits used for a RC2 cipher.
374 The length of the "keybits" parameter should not exceed that of a B<size_t>.
375
376 =item "speed" (B<OSSL_CIPHER_PARAM_SPEED>) <unsigned integer>
377
378 Sets the speed option for the associated cipher ctx. This is only supported
379 by AES SIV ciphers which disallow multiple operations by default.
380 Setting "speed" to 1 allows another encrypt or decrypt operation to be
381 performed. This is used for performance testing.
382
383 =item "tlsivgen" (B<OSSL_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN>) <octet string>
384
385 Gets the invocation field generated for encryption.
386 Can only be called after "tlsivfixed" is set.
387 This is only used for GCM mode.
388
389 =item "tlsivinv" (B<OSSL_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV>) <octet string>
390
391 Sets the invocation field used for decryption.
392 Can only be called after "tlsivfixed" is set.
393 This is only used for GCM mode.
394
395 =item "tls1multi_enc" (B<OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC>) <octet string>
396
397 Triggers a multiblock tls1 encrypt operation for a tls1 aware cipher that supports
398 sending 4 or 8 records in one go.
399 The cipher performs both the MAC and encrypt stages and constructs the record
400 headers itself.
401 "tls1multi_enc" supplies the output buffer for the encrypt operation,
402 "tls1multi_encin" & "tls1multi_interleave" must also be set in order to supply
403 values to the encrypt operation.
404
405 =item "tls1multi_enclen" (B<OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_LEN>) <unsigned integer>
406
407 Get the total length of the record returned from the "tls1multi_enc" operation.
408
409 =item "tls1multi_interleave" (B<OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_INTERLEAVE>) <unsigned integer>
410
411 Sets or gets the number of records being sent in one go for a tls1 multiblock
412 cipher operation (either 4 or 8 records).
413
414 =item "tls1multi_encin" (B<OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_ENC_IN>) <octet string>
415
416 Supplies the data to encrypt for a tls1 multiblock cipher operation.
417
418 =item "tls1multi_maxsndfrag" (B<OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_SEND_FRAGMENT>) <unsigned integer>
419
420 Sets the maximum send fragment size for a tls1 multiblock cipher operation.
421 It must be set before using "tls1multi_maxbufsz".
422 The length of the "tls1multi_maxsndfrag" parameter should not exceed that of a B<size_t>.
423
424 =item "tls1multi_maxbufsz" (B<OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_MAX_BUFSIZE>) <unsigned integer>
425
426 Gets the maximum record length for a tls1 multiblock cipher operation.
427 The length of the "tls1multi_maxbufsz" parameter should not exceed that of a B<size_t>.
428
429 =item "tls1multi_aad" (B<OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD>) <octet string>
430
431 Sets the authenticated additional data used by a tls1 multiblock cipher operation.
432 The supplied data consists of 13 bytes of record data containing:
433 Bytes 0-7: The sequence number of the first record
434 Byte 8: The record type
435 Byte 9-10: The protocol version
436 Byte 11-12: Input length (Always 0)
437
438 "tls1multi_interleave" must also be set for this operation.
439
440 =item "tls1multi_aadpacklen" (B<OSSL_CIPHER_PARAM_TLS1_MULTIBLOCK_AAD_PACKLEN>) <unsigned integer>
441
442 Gets the result of running the "tls1multi_aad" operation.
443
444 =item "cts_mode" (B<OSSL_CIPHER_PARAM_CTS_MODE>) <utf8 string>
445
446 Sets the cipher text stealing mode. For all modes the output size is the same as
447 the input size.
448
449 Valid values for the mode are:
450
451 =over 4
452
453 =item "CS1"
454
455 The NIST variant of cipher text stealing.
456 For message lengths that are multiples of the block size it is equivalent to
457 using a "AES-CBC" cipher otherwise the second last cipher text block is a
458 partial block.
459
460 =item "CS2"
461
462 For message lengths that are multiples of the block size it is equivalent to
463 using a "AES-CBC" cipher, otherwise it is the same as "CS3".
464
465 =item "CS3"
466
467 The Kerberos5 variant of cipher text stealing which always swaps the last
468 cipher text block with the previous block (which may be a partial or full block
469 depending on the input length).
470
471 =back
472
473 The default is "CS1".
474 This is only supported for "AES-128-CBC-CTS", "AES-192-CBC-CTS" and "AES-256-CBC-CTS".
475
476 =back
477
478 =head1 RETURN VALUES
479
480 OSSL_FUNC_cipher_newctx() and OSSL_FUNC_cipher_dupctx() should return the newly created
481 provider side cipher context, or NULL on failure.
482
483 OSSL_FUNC_cipher_encrypt_init(), OSSL_FUNC_cipher_decrypt_init(), OSSL_FUNC_cipher_update(),
484 OSSL_FUNC_cipher_final(), OSSL_FUNC_cipher_cipher(), OSSL_FUNC_cipher_get_params(),
485 OSSL_FUNC_cipher_get_ctx_params() and OSSL_FUNC_cipher_set_ctx_params() should return 1 for
486 success or 0 on error.
487
488 OSSL_FUNC_cipher_gettable_params(), OSSL_FUNC_cipher_gettable_ctx_params() and
489 OSSL_FUNC_cipher_settable_ctx_params() should return a constant B<OSSL_PARAM>
490 array, or NULL if none is offered.
491
492 =head1 SEE ALSO
493
494 L<provider(7)>
495
496 =head1 HISTORY
497
498 The provider CIPHER interface was introduced in OpenSSL 3.0.
499
500 =head1 COPYRIGHT
501
502 Copyright 2019-2021 The OpenSSL Project Authors. All Rights Reserved.
503
504 Licensed under the Apache License 2.0 (the "License").  You may not use
505 this file except in compliance with the License.  You can obtain a copy
506 in the file LICENSE in the source distribution or at
507 L<https://www.openssl.org/source/license.html>.
508
509 =cut