aboutsummaryrefslogtreecommitdiff
path: root/share/man/man9/crypto_buffer.9
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-161-2/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Fix a slew of mdoc warnings/errors.Christian Brueffer2022-04-121-1/+1
|
* opencrypto: Add a routine to copy a crypto buffer cursorMark Johnston2022-02-161-1/+12
| | | | | | | | | | This was useful in converting armv8crypto to use buffer cursors. There are some cases where one wants to make two passes over data, and this provides a way to "reset" a cursor. Reviewed by: jhb MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D28949
* crypto: Remove now-unused crypto_cursor_seg{base,len}.John Baldwin2021-06-161-13/+1
| | | | | | | | Callers should use crypto_cursor_segment() instead. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30448
* crypto: Add crypto_cursor_segment() to fetch both base and length.John Baldwin2021-05-251-1/+10
| | | | | | | | | | | | | | | This function combines crypto_cursor_segbase() and crypto_cursor_seglen() into a single function. This is mostly beneficial in the unmapped mbuf case where back to back calls of these two functions have to iterate over the sub-components of unmapped mbufs twice. Bump __FreeBSD_version for crypto drivers in ports. Suggested by: markj Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30445
* crypto: Add a new type of crypto buffer for a single mbuf.John Baldwin2021-05-251-3/+8
| | | | | | | | | | | | | This is intended for use in KTLS transmit where each TLS record is described by a single mbuf that is itself queued in the socket buffer. Using the existing CRYPTO_BUF_MBUF would result in bus_dmamap_load_crp() walking additional mbufs in the socket buffer that are not relevant, but generating a S/G list that potentially exceeds the limit of the tag (while also wasting CPU cycles). Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30136
* crypto_buffer(9): Add a HISTORY and a AUTHORS sectionGordon Bergling2020-09-241-1/+11
| | | | | | | | | Reviewed by: jhb Approved by: jhb Differential Revision: https://reviews.freebsd.org/D26487 Notes: svn path=/head/; revision=366123
* crypto_buffer(9): Bring back the reference for bus_dma(9)Gordon Bergling2020-09-181-0/+1
| | | | | | | | | | The reference was accidentally deleted in r365855. Reported by: jhb Pointy hat to: gbe Notes: svn path=/head/; revision=365875
* crypto_buffer(9): Sort the SEE ALSO sectionGordon Bergling2020-09-171-4/+3
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=365855
* crypto(9): add CRYPTO_BUF_VMPAGEAlan Somers2020-08-261-2/+22
| | | | | | | | | | | | | | | crypto(9) functions can now be used on buffers composed of an array of vm_page_t structures, such as those stored in an unmapped struct bio. It requires the running to kernel to support the direct memory map, so not all architectures can use it. Reviewed by: markj, kib, jhb, mjg, mat, bcr (manpages) MFC after: 1 week Sponsored by: Axcient Differential Revision: https://reviews.freebsd.org/D25671 Notes: svn path=/head/; revision=364799
* Add support for optional separate output buffers to in-kernel crypto.John Baldwin2020-05-251-0/+307
Some crypto consumers such as GELI and KTLS for file-backed sendfile need to store their output in a separate buffer from the input. Currently these consumers copy the contents of the input buffer into the output buffer and queue an in-place crypto operation on the output buffer. Using a separate output buffer avoids this copy. - Create a new 'struct crypto_buffer' describing a crypto buffer containing a type and type-specific fields. crp_ilen is gone, instead buffers that use a flat kernel buffer have a cb_buf_len field for their length. The length of other buffer types is inferred from the backing store (e.g. uio_resid for a uio). Requests now have two such structures: crp_buf for the input buffer, and crp_obuf for the output buffer. - Consumers now use helper functions (crypto_use_*, e.g. crypto_use_mbuf()) to configure the input buffer. If an output buffer is not configured, the request still modifies the input buffer in-place. A consumer uses a second set of helper functions (crypto_use_output_*) to configure an output buffer. - Consumers must request support for separate output buffers when creating a crypto session via the CSP_F_SEPARATE_OUTPUT flag and are only permitted to queue a request with a separate output buffer on sessions with this flag set. Existing drivers already reject sessions with unknown flags, so this permits drivers to be modified to support this extension without requiring all drivers to change. - Several data-related functions now have matching versions that operate on an explicit buffer (e.g. crypto_apply_buf, crypto_contiguous_subsegment_buf, bus_dma_load_crp_buf). - Most of the existing data-related functions operate on the input buffer. However crypto_copyback always writes to the output buffer if a request uses a separate output buffer. - For the regions in input/output buffers, the following conventions are followed: - AAD and IV are always present in input only and their fields are offsets into the input buffer. - payload is always present in both buffers. If a request uses a separate output buffer, it must set a new crp_payload_start_output field to the offset of the payload in the output buffer. - digest is in the input buffer for verify operations, and in the output buffer for compute operations. crp_digest_start is relative to the appropriate buffer. - Add a crypto buffer cursor abstraction. This is a more general form of some bits in the cryptosoft driver that tried to always use uio's. However, compared to the original code, this avoids rewalking the uio iovec array for requests with multiple vectors. It also avoids allocate an iovec array for mbufs and populating it by instead walking the mbuf chain directly. - Update the cryptosoft(4) driver to support separate output buffers making use of the cursor abstraction. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D24545 Notes: svn path=/head/; revision=361481