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