blob: 1ebf20826a7f1196b0451d5e8a6a77f148de6447 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
=pod
=head1 NAME
OPENSSL_riscvcap - the RISC-V processor capabilities vector
=head1 SYNOPSIS
env OPENSSL_riscvcap=... <application>
=head1 DESCRIPTION
libcrypto supports RISC-V instruction set extensions. These
extensions are denoted by individual extension names in the capabilities
vector. For Linux platform, when libcrypto is initialized, the results
returned by the RISC-V Hardware Probing syscall (hwprobe) are stored
in the vector. Otherwise all capabilities are disabled.
To override the set of instructions available to an application, you can
set the B<OPENSSL_riscvcap> environment variable before you start the
application.
The environment variable is similar to the RISC-V ISA string defined in the
RISC-V Instruction Set Manual. It is case insensitive. Though due to the limit
of the environment variable parser inside libcrypto, an extension must be
prefixed with an underscore to make it recognizable. This also applies to the
Vector extension.
OPENSSL_riscvcap="rv64gc_v_zba_zbb_zbs..."
Note that extension implication is currently not implemented.
For example, when "rv64gc_b" is provided as the environment variable,
zba/zbb/zbs would not be implied in the capability vector.
Currently only these extensions are recognized:
=over 4
=item ZBA
Address Generation
Could be detected using hwprobe for Linux kernel >= 6.5
=item ZBB
Basic bit-manipulation
Could be detected using hwprobe for Linux kernel >= 6.5
=item ZBC
Carry-less multiplication
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZBS
Single-bit instructions
Could be detected using hwprobe for Linux kernel >= 6.5
=item ZBKB
Bit-manipulation for Cryptography
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZBKC
Carry-less multiplication for Cryptography
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZBKX
Crossbar permutations
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZKND
NIST Suite: AES Decryption
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZKNE
NIST Suite: AES Encryption
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZKNH
NIST Suite: Hash Function Instructions
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZKSED
ShangMi Suite: SM4 Block Cipher Instructions
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZKSH
ShangMi Suite: SM3 Hash Function Instructions
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZKR
Entropy Source Extension
=item ZKT
Data Independent Execution Latency
Could be detected using hwprobe for Linux kernel >= 6.8
=item V
Vector Extension for Application Processors
Could be detected using hwprobe for Linux kernel >= 6.5
=item ZVBB
Vector Basic Bit-manipulation
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZVBC
Vector Carryless Multiplication
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZVKB
Vector Cryptography Bit-manipulation
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZVKG
Vector GCM/GMAC
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZVKNED
NIST Suite: Vector AES Block Cipher
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZVKNHA
NIST Suite: Vector SHA-2 Secure Hash
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZVKNHB
NIST Suite: Vector SHA-2 Secure Hash
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZVKSED
ShangMi Suite: SM4 Block Cipher
Could be detected using hwprobe for Linux kernel >= 6.8
=item ZVKSH
ShangMi Suite: SM3 Secure Hash
Could be detected using hwprobe for Linux kernel >= 6.8
=back
=head1 RETURN VALUES
Not available.
=head1 EXAMPLES
Check currently detected capabilities
$ openssl info -cpusettings
OPENSSL_riscvcap=ZBA_ZBB_ZBC_ZBS_V
Disables all instruction set extensions:
OPENSSL_riscvcap="rv64gc"
Only enable the vector extension:
OPENSSL_riscvcap="rv64gc_v"
=head1 COPYRIGHT
Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut
|