| 1 |
Libgcrypt - The GNU Crypto Library |
| 2 |
------------------------------------ |
| 3 |
Version 1.12 |
| 4 |
|
| 5 |
Copyright (C) 1989,1991-2018 Free Software Foundation, Inc. |
| 6 |
Copyright (C) 2012-2025 g10 Code GmbH |
| 7 |
Copyright (C) 2013-2025 Jussi Kivilinna |
| 8 |
|
| 9 |
Libgcrypt is free software. See the file AUTHORS for full copying |
| 10 |
notices, and LICENSES for notices about contributions that require |
| 11 |
these additional notices to be distributed. |
| 12 |
|
| 13 |
|
| 14 |
Overview |
| 15 |
-------- |
| 16 |
|
| 17 |
Libgcrypt is a general purpose crypto library based on the code |
| 18 |
used in GnuPG. Libgcrypt depends on the library `libgpg-error', |
| 19 |
which must be installed correctly before Libgcrypt is to be built. |
| 20 |
Libgcrypt is distributed under the LGPL, see the section "License" |
| 21 |
below for details. |
| 22 |
|
| 23 |
|
| 24 |
Build Instructions |
| 25 |
------------------ |
| 26 |
|
| 27 |
The download canonical location for libgcrypt is: |
| 28 |
|
| 29 |
https://gnupg.org/ftp/gcrypt/libgcrypt/ |
| 30 |
|
| 31 |
To build libgcrypt you need libgpg-error: |
| 32 |
|
| 33 |
https://gnupg.org/ftp/gcrypt/libgpg-error/ |
| 34 |
|
| 35 |
You should get the latest versions of course. |
| 36 |
|
| 37 |
After building and installing the libgpg-error package, you may |
| 38 |
continue with Libgcrypt installation as with allmost all GNU |
| 39 |
packages, you just have to do |
| 40 |
|
| 41 |
./configure |
| 42 |
make |
| 43 |
make check |
| 44 |
make install |
| 45 |
|
| 46 |
The "make check" is not required but a good idea to see whether |
| 47 |
the library works as expected. The check takes some while and |
| 48 |
prints some benchmarking results. Before doing "make install" you |
| 49 |
probably need to become root. |
| 50 |
|
| 51 |
To build libgcrypt for Microsoft Windows, you need to have the |
| 52 |
mingw32 cross-building toolchain installed. Instead of running a |
| 53 |
plain configure you use |
| 54 |
|
| 55 |
./autogen.sh --build-w64 |
| 56 |
make |
| 57 |
make install |
| 58 |
|
| 59 |
By default this command sequences expects a libgpg-error |
| 60 |
installed below $HOME/w64root and installs libgcrypt to that |
| 61 |
directory too. See the autogen.sh code for details. |
| 62 |
|
| 63 |
To run the test suite on Windows, go to the tests directory of the |
| 64 |
build directory and run "make xtestsuite". This generates a |
| 65 |
tarball which can be unpacked on Windows. Over there cd to the |
| 66 |
respective subdir and run "testdrv --verbose". |
| 67 |
|
| 68 |
The documentation is available as an Info file (gcrypt.info). To |
| 69 |
build documentation in PDF, run this: |
| 70 |
|
| 71 |
cd doc |
| 72 |
make pdf |
| 73 |
|
| 74 |
|
| 75 |
Installation under Windows |
| 76 |
-------------------------- |
| 77 |
|
| 78 |
Due to the way file system permissions are implemented under |
| 79 |
Windows it is important to make sure that the directory |
| 80 |
%ALLUSERSPROFILE%\GNU\etc\gcrypt is only writable by |
| 81 |
administrators, so that users can't add a configuration file. |
| 82 |
that. (%ALLUSERSPROFILE% is commonly c:\ProgramData). A Windows |
| 83 |
installer script should take care of this. It is also possible |
| 84 |
and suggested to set these restricted permissions direct for the |
| 85 |
parent directory %ALLUSERSPROFILE%\GNU\etc. |
| 86 |
|
| 87 |
|
| 88 |
Mailing List |
| 89 |
------------ |
| 90 |
|
| 91 |
You may want to join the developer's mailing list |
| 92 |
[email protected] by sending mail with a subject of |
| 93 |
"subscribe" to [email protected]. An archive of this |
| 94 |
list is available at https://lists.gnupg.org . |
| 95 |
|
| 96 |
|
| 97 |
Configure options |
| 98 |
----------------- |
| 99 |
Here is a list of configure options which are sometimes useful |
| 100 |
for installation. |
| 101 |
|
| 102 |
--enable-large-data-tests |
| 103 |
With this option a "make check" will take really |
| 104 |
long due to extra checks for the hash algorithms. |
| 105 |
|
| 106 |
--disable-asm |
| 107 |
Do not use assembler modules. It is not possible |
| 108 |
to use this on some CPU types. |
| 109 |
|
| 110 |
--enable-ld-version-script |
| 111 |
Libgcrypt tries to build a library where internal |
| 112 |
symbols are not exported. This requires support |
| 113 |
from ld and is currently enabled for a few OSes. |
| 114 |
If you know that your ld supports the so called |
| 115 |
ELF version scripts, you can use this option to |
| 116 |
force its use. OTOH, if you get error message |
| 117 |
from the linker, you probably want to use this |
| 118 |
option to disable the use of version scripts. |
| 119 |
Note, that you should never ever use an |
| 120 |
undocumented symbol or one which is prefixed with |
| 121 |
an underscore. |
| 122 |
|
| 123 |
--enable-ciphers=list |
| 124 |
--enable-pubkey-ciphers=list |
| 125 |
--enable-digests=list |
| 126 |
If not otherwise specified, all algorithms |
| 127 |
included in the libgcrypt source tree are built. |
| 128 |
An exception are algorithms, which depend on |
| 129 |
features not provided by the system, like 64bit |
| 130 |
data types. With these switches it is possible |
| 131 |
to select exactly those algorithm modules, which |
| 132 |
should be built. The algorithms are to be |
| 133 |
separated by spaces, commas or colons. To view |
| 134 |
the list used with the current build the program |
| 135 |
tests/version may be used. |
| 136 |
|
| 137 |
--disable-endian-check |
| 138 |
Don't let configure test for the endianness but |
| 139 |
try to use the OS provided macros at compile |
| 140 |
time. This is helpful to create OS X fat binaries. |
| 141 |
|
| 142 |
--enable-random-daemon |
| 143 |
Include support for a global random daemon and |
| 144 |
build the daemon. This is an experimental feature. |
| 145 |
|
| 146 |
--enable-mpi-path=EXTRA_PATH |
| 147 |
Prepend EXTRA_PATH to list of CPU specific |
| 148 |
optimizations. For example, if you want to add |
| 149 |
optimizations forn a Intel Pentium 4 compatible |
| 150 |
CPU, you may use |
| 151 |
--enable-mpi-path=pentium4/sse2:pentium4/mmx |
| 152 |
Take care: The generated library may crash on |
| 153 |
non-compatible CPUs. |
| 154 |
|
| 155 |
--enable-random=NAME |
| 156 |
Force the use of the random gathering module |
| 157 |
NAME. Default is either to use /dev/random or |
| 158 |
the auto mode. Possible values for NAME are: |
| 159 |
egd - Use the module which accesses the |
| 160 |
Entropy Gathering Daemon. See the webpages |
| 161 |
for more information about it. |
| 162 |
unix - Use the standard Unix module which does not |
| 163 |
have a very good performance. |
| 164 |
linux - Use the module which accesses /dev/random. |
| 165 |
This is the first choice and the default one |
| 166 |
for GNU/Linux or *BSD. |
| 167 |
auto - Compile linux, egd and unix in and |
| 168 |
automagically select at runtime. |
| 169 |
|
| 170 |
--enable-hmac-binary-check |
| 171 |
Include support to check the binary at runtime |
| 172 |
against a HMAC checksum. This works only in FIPS |
| 173 |
mode on systems providing the dladdr function and using |
| 174 |
the ELF binary format. |
| 175 |
|
| 176 |
--with-fips-module-version=version |
| 177 |
Specify a string used as a module version for FIPS |
| 178 |
certification purposes. |
| 179 |
|
| 180 |
--disable-padlock-support |
| 181 |
Disable support for the PadLock engine of VIA |
| 182 |
processors. The default is to use PadLock if |
| 183 |
available. Try this if you get problems with |
| 184 |
assembler code. |
| 185 |
|
| 186 |
--disable-aesni-support |
| 187 |
Disable support for the AES-NI instructions of |
| 188 |
newer Intel CPUs. The default is to use AES-NI |
| 189 |
if available. Try this if you get problems with |
| 190 |
assembler code. |
| 191 |
|
| 192 |
--disable-O-flag-munging |
| 193 |
Some code is too complex for some compilers while |
| 194 |
in higher optimization modes, thus the compiler |
| 195 |
invocation is modified to use a lower |
| 196 |
optimization level. Usually this works very well |
| 197 |
but on some platforms these rules break the |
| 198 |
invocation. This option may be used to disable |
| 199 |
the feature under the assumption that either good |
| 200 |
CFLAGS are given or the compiler can grok the code. |
| 201 |
|
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
Build Problems |
| 206 |
-------------- |
| 207 |
|
| 208 |
If you have a problem with a a certain release, please first check |
| 209 |
the Release-info URL given in the NEWS file. |
| 210 |
|
| 211 |
We can't check all assembler files, so if you have problems |
| 212 |
assembling them (or the program crashes) use --disable-asm with |
| 213 |
./configure. If you opt to delete individual replacement files in |
| 214 |
hopes of using the remaining ones, be aware that the configure |
| 215 |
scripts may consider several subdirectories to get all available |
| 216 |
assembler files; be sure to delete the correct ones. Never delete |
| 217 |
udiv-qrnnd.S in any CPU directory, because there may be no C |
| 218 |
substitute (in mpi/genereic). Don't forget to delete |
| 219 |
"config.cache" and run "./config.status --recheck". We got a few |
| 220 |
reports about problems using versions of gcc earlier than 2.96 |
| 221 |
along with a non-GNU assembler (as). If this applies to your |
| 222 |
platform, you can either upgrade gcc to a more recent version, or |
| 223 |
use the GNU assembler. |
| 224 |
|
| 225 |
Some make tools are broken - the best solution is to use GNU's |
| 226 |
make. Try gmake or grab the sources from a GNU archive and |
| 227 |
install them. |
| 228 |
|
| 229 |
Specific problems on some machines: |
| 230 |
|
| 231 |
* AArch64 (GCC 11.1 and 11.2) |
| 232 |
|
| 233 |
Because of the bug in GCC (fixed in 11.3), with the option |
| 234 |
-O3, vectorization results wrong code for the function |
| 235 |
buf_eq_const. Please use -O2 or -fno-tree-loop-vectorize. |
| 236 |
|
| 237 |
* IBM RS/6000 running AIX |
| 238 |
|
| 239 |
Due to a change in gcc (since version 2.8) the MPI stuff may |
| 240 |
not build. In this case try to run configure using: |
| 241 |
CFLAGS="-g -O2 -mcpu=powerpc" ./configure |
| 242 |
|
| 243 |
* SVR4.2 (ESIX V4.2 cc) |
| 244 |
|
| 245 |
Due to problems with the ESIX as(1), you probably want to do: |
| 246 |
CFLAGS="-O -K pentium" ./configure --disable-asm |
| 247 |
|
| 248 |
* SunOS 4.1.4 |
| 249 |
|
| 250 |
./configure ac_cv_sys_symbol_underscore=yes |
| 251 |
|
| 252 |
* Sparc64 CPUs |
| 253 |
|
| 254 |
We have reports about failures in the AES module when |
| 255 |
compiling using gcc (e.g. version 4.1.2) and the option -O3; |
| 256 |
using -O2 solves the problem. |
| 257 |
|
| 258 |
* i686-pc-linux-gnu with gcc 4.1 |
| 259 |
|
| 260 |
There are reports on linking problems with CFI instructions. |
| 261 |
Disable the use of CFI with |
| 262 |
|
| 263 |
./configure gcry_cv_gcc_asm_cfi_directives=no |
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
License |
| 269 |
------- |
| 270 |
|
| 271 |
The library is distributed under the terms of the GNU Lesser |
| 272 |
General Public License (LGPL); see the file COPYING.LIB for the |
| 273 |
actual terms. |
| 274 |
|
| 275 |
The helper programs as well as the documentation are distributed |
| 276 |
under the terms of the GNU General Public License (GPL); see the |
| 277 |
file COPYING for the actual terms. |
| 278 |
|
| 279 |
The file LICENSES has notices about contributions that require |
| 280 |
that these additional notices are distributed. |
| 281 |
|
| 282 |
|
| 283 |
Contact |
| 284 |
------- |
| 285 |
|
| 286 |
See the file AUTHORS. |
| 287 |
|
| 288 |
Commercial grade support for Libgcrypt is available; for a listing |
| 289 |
of offers see https://www.gnupg.org/service.html . |
| 290 |
|
| 291 |
Since 2001 maintenance and development of Libgcrypt is done by g10 |
| 292 |
Code GmbH and was mostly financed by donations; since 2022 a raise |
| 293 |
in revenues from support contracts allows fully financing the |
| 294 |
development without resorting to donations. Many thanks to our |
| 295 |
paid developers for their work and also a big thank you to Jussi |
| 296 |
Kivilinna for all of his performance work. |
| 297 |
|
| 298 |
This file is Free Software; as a special exception the authors gives |
| 299 |
unlimited permission to copy and/or distribute it, with or without |
| 300 |
modifications, as long as this notice is preserved. For conditions |
| 301 |
of the whole package, please see the file COPYING. This file is |
| 302 |
distributed in the hope that it will be useful, but WITHOUT ANY |
| 303 |
WARRANTY, to the extent permitted by law; without even the implied |
| 304 |
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |