crypto_request.9 (68f6800ce05c386ff045b4416d8595d09c4d8fdd) crypto_request.9 (74d3f1b63dbea05038e966cf4bb69a01b0589500)
1.\" Copyright (c) 2020, Chelsio Inc
2.\"
3.\" Redistribution and use in source and binary forms, with or without
4.\" modification, are permitted provided that the following conditions are met:
5.\"
6.\" 1. Redistributions of source code must retain the above copyright notice,
7.\" this list of conditions and the following disclaimer.
8.\"

--- 24 unchanged lines hidden (view full) ---

33.Dd February 8, 2021
34.Dt CRYPTO_REQUEST 9
35.Os
36.Sh NAME
37.Nm crypto_request
38.Nd symmetric cryptographic operations
39.Sh SYNOPSIS
40.In opencrypto/cryptodev.h
1.\" Copyright (c) 2020, Chelsio Inc
2.\"
3.\" Redistribution and use in source and binary forms, with or without
4.\" modification, are permitted provided that the following conditions are met:
5.\"
6.\" 1. Redistributions of source code must retain the above copyright notice,
7.\" this list of conditions and the following disclaimer.
8.\"

--- 24 unchanged lines hidden (view full) ---

33.Dd February 8, 2021
34.Dt CRYPTO_REQUEST 9
35.Os
36.Sh NAME
37.Nm crypto_request
38.Nd symmetric cryptographic operations
39.Sh SYNOPSIS
40.In opencrypto/cryptodev.h
41.Ft "struct cryptop *"
42.Fn crypto_clonereq "crypto_session_t cses" "struct cryptop *crp" "int how"
41.Ft int
42.Fn crypto_dispatch "struct cryptop *crp"
43.Ft int
44.Fn crypto_dispatch_async "struct cryptop *crp" "int flags"
45.Ft void
46.Fn crypto_dispatch_batch "struct cryptopq *crpq" "int flags"
47.Ft void
48.Fn crypto_destroyreq "struct cryptop *crp"

--- 22 unchanged lines hidden (view full) ---

71.Sh DESCRIPTION
72Each symmetric cryptographic operation in the kernel is described by
73an instance of
74.Vt struct cryptop
75and is associated with an active session.
76.Pp
77Requests can either be allocated dynamically or use caller-supplied
78storage.
43.Ft int
44.Fn crypto_dispatch "struct cryptop *crp"
45.Ft int
46.Fn crypto_dispatch_async "struct cryptop *crp" "int flags"
47.Ft void
48.Fn crypto_dispatch_batch "struct cryptopq *crpq" "int flags"
49.Ft void
50.Fn crypto_destroyreq "struct cryptop *crp"

--- 22 unchanged lines hidden (view full) ---

73.Sh DESCRIPTION
74Each symmetric cryptographic operation in the kernel is described by
75an instance of
76.Vt struct cryptop
77and is associated with an active session.
78.Pp
79Requests can either be allocated dynamically or use caller-supplied
80storage.
79Dynamically allocated requests should be allocated by
81Dynamically allocated requests should be allocated by either
80.Fn crypto_getreq
82.Fn crypto_getreq
83or
84.Fn crypto_clonereq ,
81and freed by
82.Fn crypto_freereq
83once the request has completed.
84Requests using caller-supplied storage should be initialized by
85.Fn crypto_initreq
86at the start of each operation and destroyed by
87.Fn crypto_destroyreq
88once the request has completed.
89.Pp
85and freed by
86.Fn crypto_freereq
87once the request has completed.
88Requests using caller-supplied storage should be initialized by
89.Fn crypto_initreq
90at the start of each operation and destroyed by
91.Fn crypto_destroyreq
92once the request has completed.
93.Pp
90For both
91.Fn crypto_getreq
94For
95.Fn crypto_clonereq ,
96.Fn crypto_getreq ,
92and
93.Fn crypto_initreq ,
94.Fa cses
95is a reference to an active session.
96For
97and
98.Fn crypto_initreq ,
99.Fa cses
100is a reference to an active session.
101For
102.Fn crypto_clonereq
103and
97.Fn crypto_getreq ,
98.Fa how
99is passed to
100.Xr malloc 9
101and should be set to either
102.Dv M_NOWAIT
103or
104.Dv M_WAITOK .
105.Pp
104.Fn crypto_getreq ,
105.Fa how
106is passed to
107.Xr malloc 9
108and should be set to either
109.Dv M_NOWAIT
110or
111.Dv M_WAITOK .
112.Pp
113.Fn crypto_clonereq
114allocates a new request that inherits request inputs such as request buffers
115from the original
116.Fa crp
117request.
118However, the new request is associated with the
119.Fa cses
120session rather than inheriting the session from
121.Fa crp .
122.Fa crp
123must not be a completed request.
124.Pp
106Once a request has been initialized,
107the caller should set fields in the structure to describe
108request-specific parameters.
109Unused fields should be left as-is.
110.Pp
111The
112.Fn crypto_dispatch ,
113.Fn crypto_dispatch_async ,

--- 414 unchanged lines hidden ---
125Once a request has been initialized,
126the caller should set fields in the structure to describe
127request-specific parameters.
128Unused fields should be left as-is.
129.Pp
130The
131.Fn crypto_dispatch ,
132.Fn crypto_dispatch_async ,

--- 414 unchanged lines hidden ---