xref: /freebsd/share/man/man4/safe.4 (revision edf8578117e8844e02c0121147f45e4609b30680)
1.\"-
2.\" Copyright (c) 2003	Sam Leffler, Errno Consulting
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"/
26.Dd July 29, 2020
27.Dt SAFE 4
28.Os
29.Sh NAME
30.Nm safe
31.Nd SafeNet crypto accelerator
32.Sh SYNOPSIS
33To compile this driver into the kernel,
34place the following lines in your
35kernel configuration file:
36.Bd -ragged -offset indent
37.Cd "device crypto"
38.Cd "device cryptodev"
39.Cd "device safe"
40.Ed
41.Pp
42Alternatively, to load the driver as a
43module at boot time, place the following line in
44.Xr loader.conf 5 :
45.Bd -literal -offset indent
46safe_load="YES"
47.Ed
48.Pp
49.Nm sysctl Va hw.safe.debug
50.Nm sysctl Va hw.safe.dump
51.Nm sysctl Va hw.safe.rnginterval
52.Nm sysctl Va hw.safe.rngbufsize
53.Nm sysctl Va hw.safe.rngmaxalarm
54.Sh DESCRIPTION
55The
56.Nm
57driver supports cards containing SafeNet crypto accelerator chips.
58.Pp
59The
60.Nm
61driver registers itself to accelerate AES,
62SHA1-HMAC, and NULL operations for
63.Xr ipsec 4
64and
65.Xr crypto 4 .
66.Pp
67On all models, the driver registers itself to provide random data to the
68.Xr random 4
69subsystem.
70Periodically the driver will poll the hardware RNG and retrieve
71data for use by the system.
72If the driver detects that the hardware RNG is resonating with any local
73signal, it will reset the oscillators that generate random data.
74Three
75.Xr sysctl 8
76settings control this procedure:
77.Va hw.safe.rnginterval
78specifies the time, in seconds, between polling operations,
79.Va hw.safe.rngbufsize
80specifies the number of 32-bit words to retrieve on each poll,
81and
82.Va hw.safe.rngmaxalarm
83specifies the threshold for resetting the oscillators.
84.Pp
85When the driver is compiled with
86.Dv SAFE_DEBUG
87defined, two
88.Xr sysctl 8
89variables are provided for debugging purposes:
90.Va hw.safe.debug
91can be set to a non-zero value to enable debugging messages to be sent
92to the console for each cryptographic operation,
93.Va hw.safe.dump
94is a write-only variable that can be used to force driver state to be sent
95to the console.
96Set this variable to
97.Dq Li ring
98to dump the current state of the descriptor ring,
99to
100.Dq Li dma
101to dump the hardware DMA registers,
102or
103to
104.Dq Li int
105to dump the hardware interrupt registers.
106.Sh HARDWARE
107The
108.Nm
109driver supports cards containing any of the following chips:
110.Bl -tag -width "SafeNet 1141" -offset indent
111.It SafeNet 1141
112The original chipset.
113Supports DES, Triple-DES, AES, MD5, and SHA-1
114symmetric crypto operations, RNG, public key operations, and full IPsec
115packet processing.
116.It SafeNet 1741
117A faster version of the 1141.
118.El
119.Sh SEE ALSO
120.Xr crypt 3 ,
121.Xr crypto 4 ,
122.Xr intro 4 ,
123.Xr ipsec 4 ,
124.Xr random 4 ,
125.Xr crypto 7 ,
126.Xr crypto 9
127.Sh BUGS
128Public key support is not implemented.
129