provider-cipher.pod 20 KB

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