diff options
Diffstat (limited to 'static/freebsd/man9/crypto_driver.9 4.html')
| -rw-r--r-- | static/freebsd/man9/crypto_driver.9 4.html | 269 |
1 files changed, 0 insertions, 269 deletions
diff --git a/static/freebsd/man9/crypto_driver.9 4.html b/static/freebsd/man9/crypto_driver.9 4.html deleted file mode 100644 index ca7af164..00000000 --- a/static/freebsd/man9/crypto_driver.9 4.html +++ /dev/null @@ -1,269 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">CRYPTO_DRIVER(9)</td> - <td class="head-vol">Kernel Developer's Manual</td> - <td class="head-rtitle">CRYPTO_DRIVER(9)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">crypto_driver</code> — - <span class="Nd">interface for symmetric cryptographic drivers</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> -<p class="Pp"><code class="In">#include - <<a class="In">opencrypto/cryptodev.h</a>></code></p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">crypto_copyback</code>(<var class="Fa" style="white-space: nowrap;">struct - cryptop *crp</var>, <var class="Fa" style="white-space: nowrap;">int - off</var>, <var class="Fa" style="white-space: nowrap;">int size</var>, - <var class="Fa" style="white-space: nowrap;">const void *src</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">crypto_copydata</code>(<var class="Fa" style="white-space: nowrap;">struct - cryptop *crp</var>, <var class="Fa" style="white-space: nowrap;">int - off</var>, <var class="Fa" style="white-space: nowrap;">int size</var>, - <var class="Fa" style="white-space: nowrap;">void *dst</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">crypto_done</code>(<var class="Fa" style="white-space: nowrap;">struct - cryptop *crp</var>);</p> -<p class="Pp"><var class="Ft">int32_t</var> - <br/> - <code class="Fn">crypto_get_driverid</code>(<var class="Fa" style="white-space: nowrap;">device_t - dev</var>, <var class="Fa" style="white-space: nowrap;">size_t - session_size</var>, <var class="Fa" style="white-space: nowrap;">int - flags</var>);</p> -<p class="Pp"><var class="Ft">void *</var> - <br/> - <code class="Fn">crypto_get_driver_session</code>(<var class="Fa" style="white-space: nowrap;">crypto_session_t - crypto_session</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">crypto_read_iv</code>(<var class="Fa" style="white-space: nowrap;">struct - cryptop *crp</var>, <var class="Fa" style="white-space: nowrap;">void - *iv</var>);</p> -<p class="Pp"><var class="Ft">int</var> - <br/> - <code class="Fn">crypto_unblock</code>(<var class="Fa" style="white-space: nowrap;">uint32_t - driverid</var>, <var class="Fa" style="white-space: nowrap;">int - what</var>);</p> -<p class="Pp"><var class="Ft">int</var> - <br/> - <code class="Fn">crypto_unregister_all</code>(<var class="Fa" style="white-space: nowrap;">uint32_t - driverid</var>);</p> -<p class="Pp"><var class="Ft">int</var> - <br/> - <code class="Fn">CRYPTODEV_FREESESSION</code>(<var class="Fa" style="white-space: nowrap;">device_t - dev</var>, <var class="Fa" style="white-space: nowrap;">crypto_session_t - crypto_session</var>);</p> -<p class="Pp"><var class="Ft">int</var> - <br/> - <code class="Fn">CRYPTODEV_NEWSESSION</code>(<var class="Fa">device_t - dev</var>, <var class="Fa">crypto_session_t crypto_session</var>, - <var class="Fa">const struct crypto_session_params *csp</var>);</p> -<p class="Pp"><var class="Ft">int</var> - <br/> - <code class="Fn">CRYPTODEV_PROBESESSION</code>(<var class="Fa">device_t - dev</var>, <var class="Fa">const struct crypto_session_params - *csp</var>);</p> -<p class="Pp"><var class="Ft">int</var> - <br/> - <code class="Fn">CRYPTODEV_PROCESS</code>(<var class="Fa" style="white-space: nowrap;">device_t - dev</var>, <var class="Fa" style="white-space: nowrap;">struct cryptop - *crp</var>, <var class="Fa" style="white-space: nowrap;">int - flags</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">hmac_init_ipad</code>(<var class="Fa">struct auth_hash - *axf</var>, <var class="Fa">const char *key</var>, <var class="Fa">int - klen</var>, <var class="Fa">void *auth_ctx</var>);</p> -<p class="Pp"><var class="Ft">void</var> - <br/> - <code class="Fn">hmac_init_opad</code>(<var class="Fa">struct auth_hash - *axf</var>, <var class="Fa">const char *key</var>, <var class="Fa">int - klen</var>, <var class="Fa">void *auth_ctx</var>);</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">Symmetric cryptographic drivers process cryptographic requests - submitted to sessions associated with the driver.</p> -<p class="Pp" id="crypto_get_driverid">Cryptographic drivers call - <a class="permalink" href="#crypto_get_driverid"><code class="Fn">crypto_get_driverid</code></a>() - to register with the cryptographic framework. <var class="Fa">dev</var> is - the device used to service requests. The - <a class="permalink" href="#CRYPTODEV"><code class="Fn" id="CRYPTODEV">CRYPTODEV</code></a>() - methods are defined in the method table for the device driver attached to - <var class="Fa">dev</var>. <var class="Fa">session_size</var> specifies the - size of a driver-specific per-session structure allocated by the - cryptographic framework. <var class="Fa">flags</var> is a bitmask of - properties about the driver. Exactly one of - <code class="Dv">CRYPTOCAP_F_SOFTWARE</code> or - <code class="Dv">CRYPTOCAP_F_HARDWARE</code> must be specified. - <code class="Dv">CRYPTOCAP_F_SOFTWARE</code> should be used for drivers - which process requests using host CPUs. - <code class="Dv">CRYPTOCAP_F_HARDWARE</code> should be used for drivers - which process requests on separate co-processors. - <code class="Dv">CRYPTOCAP_F_SYNC</code> should be set for drivers which - process requests synchronously in - <code class="Fn">CRYPTODEV_PROCESS</code>(). - <code class="Dv">CRYPTOCAP_F_ACCEL_SOFTWARE</code> should be set for - software drivers which use accelerated CPU instructions. - <code class="Fn">crypto_get_driverid</code>() returns an opaque driver - id.</p> -<p class="Pp" id="crypto_unregister_all"><a class="permalink" href="#crypto_unregister_all"><code class="Fn">crypto_unregister_all</code></a>() - unregisters a driver from the cryptographic framework. If there are any - pending operations or open sessions, this function will sleep. - <var class="Fa">driverid</var> is the value returned by an earlier call to - <code class="Fn">crypto_get_driverid</code>().</p> -<p class="Pp" id="crypto_newsession">When a new session is created by - <a class="permalink" href="#crypto_newsession"><code class="Fn">crypto_newsession</code></a>(), - <a class="permalink" href="#CRYPTODEV_PROBESESSION"><code class="Fn" id="CRYPTODEV_PROBESESSION">CRYPTODEV_PROBESESSION</code></a>() - is invoked by the cryptographic framework on each active driver to determine - the best driver to use for the session. This method should inspect the - session parameters in <var class="Fa">csp</var>. If a driver does not - support requests described by <var class="Fa">csp</var>, this method should - return an error value. If the driver does support requests described by - <var class="Fa">csp</var>, it should return a negative value. The framework - prefers drivers with the largest negative value, similar to - <a class="Xr">DEVICE_PROBE(9)</a>. The following values are defined for - non-error return values from this method:</p> -<dl class="Bl-tag"> - <dt id="CRYPTODEV_PROBE_HARDWARE"><a class="permalink" href="#CRYPTODEV_PROBE_HARDWARE"><code class="Dv">CRYPTODEV_PROBE_HARDWARE</code></a></dt> - <dd>The driver processes requests via a co-processor.</dd> - <dt id="CRYPTODEV_PROBE_ACCEL_SOFTWARE"><a class="permalink" href="#CRYPTODEV_PROBE_ACCEL_SOFTWARE"><code class="Dv">CRYPTODEV_PROBE_ACCEL_SOFTWARE</code></a></dt> - <dd>The driver processes requests on the host CPU using optimized instructions - such as AES-NI.</dd> - <dt id="CRYPTODEV_PROBE_SOFTWARE"><a class="permalink" href="#CRYPTODEV_PROBE_SOFTWARE"><code class="Dv">CRYPTODEV_PROBE_SOFTWARE</code></a></dt> - <dd>The driver processes requests on the host CPU.</dd> -</dl> -<p class="Pp">This method should not sleep.</p> -<p class="Pp" id="CRYPTODEV_NEWSESSION">Once the framework has chosen a driver - for a session, the framework invokes the - <a class="permalink" href="#CRYPTODEV_NEWSESSION"><code class="Fn">CRYPTODEV_NEWSESSION</code></a>() - method to initialize driver-specific session state. Prior to calling this - method, the framework allocates a per-session driver-specific data - structure. This structure is initialized with zeroes, and its size is set by - the <var class="Fa">session_size</var> passed to - <code class="Fn">crypto_get_driverid</code>(). This method can retrieve a - pointer to this data structure by passing - <var class="Fa">crypto_session</var> to - <code class="Fn">crypto_get_driver_session</code>(). Session parameters are - described in <var class="Fa">csp</var>.</p> -<p class="Pp">This method should not sleep.</p> -<p class="Pp" id="CRYPTODEV_FREESESSION"><a class="permalink" href="#CRYPTODEV_FREESESSION"><code class="Fn">CRYPTODEV_FREESESSION</code></a>() - is invoked to release any driver-specific state when a session is destroyed. - The per-session driver-specific data structure is explicitly zeroed and - freed by the framework after this method returns. If a driver requires no - additional tear-down steps, it can leave this method undefined.</p> -<p class="Pp">This method should not sleep.</p> -<p class="Pp" id="CRYPTODEV_PROCESS"><a class="permalink" href="#CRYPTODEV_PROCESS"><code class="Fn">CRYPTODEV_PROCESS</code></a>() - is invoked for each request submitted to an active session. This method can - either complete a request synchronously or schedule it to be completed - asynchronously, but it must not sleep.</p> -<p class="Pp" id="crypto_unblock">If this method is not able to complete a - request due to insufficient resources such as a full command queue, it can - defer the request by returning <code class="Dv">ERESTART</code>. The request - will be queued by the framework and retried once the driver releases pending - requests via - <a class="permalink" href="#crypto_unblock"><code class="Fn">crypto_unblock</code></a>(). - Any requests submitted to sessions belonging to the driver will also be - queued until <code class="Fn">crypto_unblock</code>() is called.</p> -<p class="Pp">If a driver encounters errors while processing a request, it - should report them via the <var class="Fa">crp_etype</var> field of - <var class="Fa">crp</var> rather than returning an error directly.</p> -<p class="Pp"><var class="Fa">flags</var> may be set to - <code class="Dv">CRYPTO_HINT_MORE</code> if there are additional requests - queued for this driver. The driver can use this as a hint to batch - completion interrupts. Note that these additional requests may be from - different sessions.</p> -<p class="Pp" id="crypto_get_driver_session"><a class="permalink" href="#crypto_get_driver_session"><code class="Fn">crypto_get_driver_session</code></a>() - returns a pointer to the driver-specific per-session data structure for the - session <var class="Fa">crypto_session</var>. This function can be used in - the <code class="Fn">CRYPTODEV_NEWSESSION</code>(), - <code class="Fn">CRYPTODEV_PROCESS</code>(), and - <code class="Fn">CRYPTODEV_FREESESSION</code>() callbacks.</p> -<p class="Pp" id="crypto_copydata"><a class="permalink" href="#crypto_copydata"><code class="Fn">crypto_copydata</code></a>() - copies <var class="Fa">size</var> bytes out of the input buffer for - <var class="Fa">crp</var> into a local buffer pointed to by - <var class="Fa">dst</var>. The bytes are read starting at an offset of - <var class="Fa">off</var> bytes in the request's input buffer.</p> -<p class="Pp" id="crypto_copyback"><a class="permalink" href="#crypto_copyback"><code class="Fn">crypto_copyback</code></a>() - copies <var class="Fa">size</var> bytes from the local buffer pointed to by - <var class="Fa">src</var> into the output buffer for - <var class="Fa">crp</var>. The bytes are written starting at an offset of - <var class="Fa">off</var> bytes in the request's output buffer.</p> -<p class="Pp" id="crypto_read_iv"><a class="permalink" href="#crypto_read_iv"><code class="Fn">crypto_read_iv</code></a>() - copies the IV or nonce for <var class="Fa">crp</var> into the local buffer - pointed to by <var class="Fa">iv</var>.</p> -<p class="Pp" id="crypto_done">A driver calls - <a class="permalink" href="#crypto_done"><code class="Fn">crypto_done</code></a>() - to mark the request <var class="Fa">crp</var> as completed. Any errors - should be set in <var class="Fa">crp_etype</var> prior to calling this - function.</p> -<p class="Pp" id="crypto_unblock~2">If a driver defers a request by returning - <code class="Dv">ERESTART</code> from - <code class="Dv">CRYPTO_PROCESS</code>, the framework will queue all - requests for the driver until the driver calls - <a class="permalink" href="#crypto_unblock~2"><code class="Fn">crypto_unblock</code></a>() - to indicate that the temporary resource shortage has been relieved. For - example, if a driver returns <code class="Dv">ERESTART</code> due to a full - command ring, it would invoke <code class="Fn">crypto_unblock</code>() from - a command completion interrupt that makes a command ring entry available. - <var class="Fa">driverid</var> is the value returned by - <code class="Fn">crypto_get_driverid</code>(). <var class="Fa">what</var> - indicates which types of requests the driver is able to handle again:</p> -<dl class="Bl-tag"> - <dt id="CRYPTO_SYMQ"><a class="permalink" href="#CRYPTO_SYMQ"><code class="Dv">CRYPTO_SYMQ</code></a></dt> - <dd>indicates that the driver is able to handle symmetric requests passed to - <code class="Fn">CRYPTODEV_PROCESS</code>().</dd> -</dl> -<p class="Pp" id="hmac_init_ipad"><a class="permalink" href="#hmac_init_ipad"><code class="Fn">hmac_init_ipad</code></a>() - prepares an authentication context to generate the inner hash of an HMAC. - <var class="Fa">axf</var> is a software implementation of an authentication - algorithm such as the value returned by - <a class="permalink" href="#crypto_auth_hash"><code class="Fn" id="crypto_auth_hash">crypto_auth_hash</code></a>(). - <var class="Fa">key</var> is a pointer to a HMAC key of - <var class="Fa">klen</var> bytes. <var class="Fa">auth_ctx</var> points to a - valid authentication context for the desired algorithm. The function - initializes the context with the supplied key.</p> -<p class="Pp" id="hmac_init_opad"><a class="permalink" href="#hmac_init_opad"><code class="Fn">hmac_init_opad</code></a>() - is similar to <code class="Fn">hmac_init_ipad</code>() except that it - prepares an authentication context to generate the outer hash of an - HMAC.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN - VALUES</a></h1> -<p class="Pp"><code class="Fn">crypto_apply</code>() returns the return value - from the caller-supplied callback function.</p> -<p class="Pp"><code class="Fn">crypto_contiguous_subsegment</code>() returns a - pointer to a contiguous segment or <code class="Dv">NULL</code>.</p> -<p class="Pp"><code class="Fn">crypto_get_driverid</code>() returns a driver - identifier on success or -1 on error.</p> -<p class="Pp"><code class="Fn">crypto_unblock</code>(), - <code class="Fn">crypto_unregister_all</code>(), - <code class="Fn">CRYPTODEV_FREESESSION</code>(), - <code class="Fn">CRYPTODEV_NEWSESSION</code>(), and - <code class="Fn">CRYPTODEV_PROCESS</code>() return zero on success or an - error on failure.</p> -<p class="Pp"><code class="Fn">CRYPTODEV_PROBESESSION</code>() returns a - negative value on success or an error on failure.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">crypto(7)</a>, <a class="Xr">crypto(9)</a>, - <a class="Xr">crypto_buffer(9)</a>, <a class="Xr">crypto_request(9)</a>, - <a class="Xr">crypto_session(9)</a></p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">April 12, 2021</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> |
