2015-02-26 13:48:57 -08:00
0. Building on *nix from git repository
2015-10-20 09:44:04 -07:00
Run the autogen script to generate configure, then proceed to step 1.
Prerequisites: You'll need autoconf, automake and libtool installed.
2015-02-26 13:48:57 -08:00
$ ./autogen.sh
1. Building on *nix from a release
$ ./configure
$ make
$ make check # (optional, but highly recommended)
$ sudo make install
2024-08-15 15:49:22 -07:00
Note: Building with configure generates a wolfssl/options.h file that contains
all the generated build options. This file needs to be included in your application
before any other wolfSSL headers. Optionally your application can define
WOLFSSL_USE_OPTIONS_H to do this automatically.
2015-02-26 13:48:57 -08:00
2. Building on iOS
Use on the xcode project in IDE/iOS/wolfssl.xcodeproj
There is a README in IDE/iOS with more information
2020-09-29 15:08:47 -07:00
3. Building for Apple ARM64
When building for an Apple ARM64 platform, ensure the host CPU type is detected as "aarch64" during configure, if not, pass --host=aarch64-apple-darwin to configure.
4. Building on Windows
2015-02-26 13:48:57 -08:00
2022-02-07 17:01:19 -06:00
Use the Visual Studio Solution wolfssl64.sln
2015-02-26 13:48:57 -08:00
2020-09-29 15:08:47 -07:00
5. Building with IAR
2015-02-26 13:48:57 -08:00
Please see the README in IDE/IAR-EWARM for detailed instructions
2020-09-29 15:08:47 -07:00
6. Building with Keil
2015-02-26 13:48:57 -08:00
Please see the Keil Projects in IDE/MDK5-ARM/Projects
2020-09-29 15:08:47 -07:00
7. Building with Microchip tools
2015-02-26 13:48:57 -08:00
Please see the README in mplabx
2020-09-29 15:08:47 -07:00
8. Building with Freescale MQX
2015-02-26 13:48:57 -08:00
Please see the README in mqx
2020-09-29 15:08:47 -07:00
9. Building with Rowley CrossWorks for ARM
2016-01-08 11:54:46 -07:00
Use the CrossWorks project in IDE/ROWLEY-CROSSWORKS-ARM/wolfssl.hzp
There is a README.md in IDE/ROWLEY-CROSSWORKS-ARM with more information
2020-09-29 15:08:47 -07:00
10. Building with Arduino
2016-01-08 11:54:46 -07:00
Use the script IDE/ARDUINO/wolfssl-arduino.sh to reformat the wolfSSL
library for compatibility with the Arduino IDE. There is a README.md in
IDE/ARDUINO for detailed instructions.
2020-09-29 15:08:47 -07:00
11. Building for Android with Visual Studio 2017
2017-10-02 12:00:11 -07:00
Please see the README in IDE/VS-ARM.
Use the Visual Studio solution IDE/VS-ARM/wolfssl.sln.
2020-09-29 15:08:47 -07:00
12. Building for Yocto Project or OpenEmbedded
2018-12-10 16:48:14 -07:00
Please see the README in the "meta-wolfssl" repository. This repository
holds wolfSSL's Yocto and OpenEmbedded layer, which contains recipes
for wolfSSL, wolfSSH, wolfMQTT, wolfTPM, wolfCrypt examples, and OSS
project bbappend files.
https://github.com/wolfssl/meta-wolfssl
The wolfSSL recipe can also be found in the OpenEmbedded
"meta-openembedded/meta-networking/recipes-connectivity" layer:
https://github.com/openembedded/meta-openembedded
2020-09-29 15:08:47 -07:00
13. Porting to a new platform
2015-02-26 13:48:57 -08:00
Please see section 2.4 in the manual:
2024-08-15 15:49:22 -07:00
https://www.wolfssl.com/documentation/manuals/wolfssl/chapter02.html#customizing-or-porting-wolfssl
2015-02-26 13:48:57 -08:00
2020-09-29 15:08:47 -07:00
14. Building with CMake
2020-10-21 13:41:02 -05:00
Note: Primary development uses automake (./configure). The support for CMake
is still under development.
For configuring wolfssl using CMake, we recommend downloading the CMake
GUI (https://cmake.org/download/). This tool allows you to see all of
wolfssl's configuration variables, set them, and view their descriptions.
Looking at the GUI or CMakeCache.txt (generated after running cmake once) is
the best way to find out what configuration options are available and what
they do. You can also invoke CMake from the GUI, which is described in the
Windows instructions below. For Unix-based systems, we describe the command
line work flow. Regardless of your chosen workflow, cmake will generate
a header options.h in the wolfssl directory that contains the options used
to configure the build.
2024-08-15 15:49:22 -07:00
Note: Building with configure generates a wolfssl/options.h file that contains
all the generated build options. This file needs to be included in your application
before any other wolfSSL headers. Optionally your application can define
WOLFSSL_USE_OPTIONS_H to do this automatically.
2020-10-21 13:41:02 -05:00
Unix-based Platforms
---
1) Navigate to the wolfssl root directory containing "CMakeLists.txt".
2) Create a directory called "build" and change into it. This is where
CMake will store build files.
3) Run `cmake ..` to generate the target build files (e.g. UNIX Makefiles).
To enable or disable features, set them using -D<option>=[yes/no]. For
example, to disable TLS 1.3 support, run cmake .. -DWOLFSSL_TLS13=no
(autoconf equivalent: ./configure --disable-tls13) To enable DSA, run
cmake .. -DWOLFSSL_DSA=yes (autoconf equivalent: ./configure
--enable-dsa). Again, you can find a list of these options and their
descriptions either using the CMake GUI or by looking at CMakeCache.txt.
5) The build directory should now contain the generated build files. Build
with `cmake --build .`. Under the hood, this runs the target build tool
(by default, make). You can also invoke the target build tool directly
(e.g. make).
To build with debugging use: `cmake .. -DCMAKE_BUILD_TYPE=Debug`.
2023-09-19 10:57:02 -07:00
In the simplest form:
# create a root directory for wolfssl repo
git clone https://github.com/wolfSSL/wolfssl.git
cd wolfssl
# From the root of the wolfSSL repo:
mkdir -p out
pushd out
cmake ..
cmake --build .
# View the available ciphers with:
./examples/client/client -e
popd
2023-11-01 10:35:12 -05:00
ARIA Cipher Suite.
2023-09-19 10:57:02 -07:00
The ARIA cipher needs a 3rd party source binary, typically called
`MagicCrypto.tar.gz`.
The MagicCrypto files can be either copied to the local `wolfssl` directory,
or an environment variable `ARIA_DIR` can be set to point to the location.
Simply having the environment variable or local `MagicCrypto` directory
will not automatically enable the ARIA Ciphers.
To enable ARIA Ciphers in wolfSSL for `CMake`:
# From the root of the wolfSSL repo:
# set to your path
export ARIA_DIR=~/workspace/MagicCrypto
mkdir -p out
pushd out
cmake .. -DWOLFSSL_ARIA=yes
cmake --build .
# View the available ciphers with:
./examples/client/client -e
popd
2020-10-21 13:41:02 -05:00
Windows (Visual Studio)
---
1) Go to this page, download the appropriate Windows installer, and install
to get the CMake GUI: https://cmake.org/download/ Native CMake support in
Visual Studio 16 2019 (and possibly older versions) has proven buggy. We
recommend using the CMake GUI in concert with Visual Studio, as described
in these steps.
2) Open CMake.
2021-11-10 11:30:24 -08:00
3) Where is the source code: <root directory of wolfssl containing
2020-10-21 13:41:02 -05:00
CMakeLists.txt>
4) Where to build the binaries: <build directory, e.g. wolfssl/build>
5) Hit Configure. CMake runs the code in CMakeLists.txt and builds up an
internal representation of the project.
6) Hit Generate. CMake generates the build files. For Windows, this will
be Visual Studio project (.vcxproj) and solution (.sln) files.
7) Open Visual Studio and select "Open a project or solution".
8) Navigate to the build directory and select wolfssl.sln to load the
project.
Windows (command line)
---
1) Open Command Prompt
2023-09-19 10:57:02 -07:00
2) Run the Visual Studio batch to setup command line variables, e.g. C:\Program Files (x86)\Microsoft Visual
2020-10-21 13:41:02 -05:00
Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat
3) Follow steps in "Unix-based Platforms" above.
2021-04-28 10:28:35 -07:00
2025-02-04 13:28:05 -05:00
15. Building Post-Quantum Support for TLS 1.3
2021-04-28 10:28:35 -07:00
$ cd wolfssl
2025-02-04 13:28:05 -05:00
$ ./autogen.sh (Only necessary if downloaded from github)
$ ./configure --enable-kyber --enable-dilithium
2021-04-28 10:28:35 -07:00
$ make all
2025-02-04 13:28:05 -05:00
Execute the following to see the options for KEM groups near
2021-10-14 10:43:08 -04:00
the end of the output of these commands:
2021-04-28 10:28:35 -07:00
$ ./examples/server/server -?
$ ./examples/client/client -?
For a quick start, you can run the client and server like this:
2025-02-04 13:28:05 -05:00
$ ./examples/server/server -v 4 --pqc P521_ML_KEM_1024
$ ./examples/client/client -v 4 --pqc P521_ML_KEM_1024
2021-04-28 10:28:35 -07:00
Look for the following line in the output of the server and client:
```
2025-02-04 13:28:05 -05:00
Using Post-Quantum KEM: P521_ML_KEM_1024
2021-04-28 10:28:35 -07:00
```
2025-02-04 13:28:05 -05:00
For authentication, you can generate a certificate chain using the Open
Quantum Safe project's OQS Provider with your system's OpenSSL application.
Instructions are maintained in our OSP repo here:
2021-10-14 10:43:08 -04:00
2022-08-17 08:59:00 -04:00
https://github.com/wolfSSL/osp/tree/master/oqs/README.md
2021-10-14 10:43:08 -04:00
2025-02-04 13:28:05 -05:00
For your convenience, there are also pre-generated ML-DSA certificates and
keys.
2021-10-14 10:43:08 -04:00
2025-02-04 13:28:05 -05:00
Please find instructions on how to generate the keys and certificates
in the `README.md` file.
Copy the certificates and keys into the certs directory of wolfssl. Now you
can run the server and client like this:
2021-10-14 10:43:08 -04:00
$ examples/server/server -v 4 -l TLS_AES_256_GCM_SHA384 \
2025-02-04 13:28:05 -05:00
-A certs/mldsa87_root_cert.pem \
-c certs/mldsa44_entity_cert.pem \
-k certs/mldsa44_entity_key.pem \
--pqc P521_ML_KEM_1024
2021-10-14 10:43:08 -04:00
$ examples/client/client -v 4 -l TLS_AES_256_GCM_SHA384 \
2025-02-04 13:28:05 -05:00
-A certs/mldsa44_root_cert.pem \
-c certs/mldsa87_entity_cert.pem \
-k certs/mldsa87_entity_key.pem \
--pqc P521_ML_KEM_1024
2021-10-14 10:43:08 -04:00
Congratulations! You have just achieved a fully quantum-safe TLS 1.3
connection!
2022-08-17 08:59:00 -04:00
The following NIST Competition winning algorithms are supported:
2025-02-04 13:28:05 -05:00
- ML-KEM (CRYSTALS-KYBER) (key encapsulation mechanism)
- ML-DSA (CRYSTALS-Dilithium) (signature scheme)
The following NIST Competition winning algorithms were supported by our
liboqs integration. Support for their standardized specifications will
return when we write our own implementations.
2022-08-17 08:59:00 -04:00
- FALCON (signature scheme)
- SPHINCS+ (signature scheme)
2022-11-25 14:54:08 -05:00
The following NIST Competition Round 3 finalist algorithms were supported,
but have been removed after 5.3.3
2021-10-14 10:43:08 -04:00
- SABER (KEM)
- NTRU (KEM)
2021-04-28 10:28:35 -07:00
2022-08-17 08:59:00 -04:00
Links to more information about all of these algorithms can be found here:
2021-10-14 10:43:08 -04:00
2021-04-28 10:28:35 -07:00
https://csrc.nist.gov/projects/post-quantum-cryptography/round-3-submissions
2025-02-04 13:28:05 -05:00
NOTE: The quantum-safe algorithms that we have implemented are standardized
by NIST and our implementations follow these standards. At the
protocol layer, OIDs and codepoints have been proposed in various
standards organizations but are not yet ratified. OIDs and codepoints
are temporary and expected to change in the future. You should have no
expectation of backwards compatibility at the protocol layer.
2022-08-31 11:41:43 -07:00
16. Building with vcpkg
# Building wolfssl - Using vcpkg
You can download and install wolfssl using the [vcpkg](https://github.com/Microsoft/vcpkg):
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
OR for Windows
bootstrap-vcpkg.bat
./vcpkg integrate install
./vcpkg install wolfssl
The wolfssl port in vcpkg is kept up to date by wolfSSL.
We also have vcpkg ports for wolftpm, wolfmqtt and curl.
2023-07-06 10:55:53 -05:00
17. Building with hash-sigs lib for LMS/HSS support [EXPERIMENTAL]
Using LMS/HSS requires that the hash-sigs lib has been built on
2023-07-11 15:04:51 -05:00
your system. We support hash-sigs lib at this git commit:
b0631b8891295bf2929e68761205337b7c031726
At the time of writing this, this is the HEAD of the master
branch of the hash-sigs project.
2023-07-06 10:55:53 -05:00
2023-07-10 23:43:07 -05:00
Currently the hash-sigs project only builds static libraries:
2023-08-29 16:37:21 -05:00
- hss_verify.a: a single-threaded verify-only static lib.
2023-07-10 23:43:07 -05:00
- hss_lib.a: a single-threaded static lib.
- hss_lib_thread.a: a multi-threaded static lib.
The multi-threaded version will mainly have speedups for key
generation and signing.
2023-08-30 21:02:50 -05:00
The default LMS build (--enable-lms) will look for
2023-08-29 16:37:21 -05:00
hss_lib.a first, and hss_lib_thread.a second, in a specified
hash-sigs dir.
2023-07-06 10:55:53 -05:00
2023-08-29 16:37:21 -05:00
The LMS verify-only build (--enable-lms=verify-only) will look
for hss_verify.a only, which is a slimmer library that includes
only the minimal functions necessary for signature verification.
2023-07-06 10:55:53 -05:00
How to get and build the hash-sigs library:
$ mkdir ~/hash_sigs
$ cd ~/hash_sigs
$ git clone https://github.com/cisco/hash-sigs.git src
$ cd src
2023-07-11 15:04:51 -05:00
$ git checkout b0631b8891295bf2929e68761205337b7c031726
2023-07-06 10:55:53 -05:00
2023-07-07 15:30:50 -05:00
In sha256.h, set USE_OPENSSL to 0:
2023-07-06 10:55:53 -05:00
#define USE_OPENSSL 0
2023-07-10 23:43:07 -05:00
To build the single-threaded version:
$ make hss_lib.a
$ ls *.a
hss_lib.a
To build multi-threaded:
$ make hss_lib_thread.a
2023-07-06 10:55:53 -05:00
$ ls *.a
2023-07-10 23:43:07 -05:00
hss_lib_thread.a
2023-07-06 10:55:53 -05:00
2023-08-29 16:37:21 -05:00
To build verify-only:
$ make hss_verify.a
$ ls *.a
hss_verify.a
2023-07-06 10:55:53 -05:00
Build wolfSSL with
$ ./configure \
--enable-static \
--disable-shared \
2023-08-30 21:02:50 -05:00
--enable-lms \
--with-liblms=<path to dir containing hss_lib.a or hss_lib_thread.a>
2023-07-06 10:55:53 -05:00
$ make
Run the benchmark against LMS/HSS with:
$ ./wolfcrypt/benchmark/benchmark -lms_hss
2023-08-09 00:39:55 +02:00
18. Building for Debian, Ubuntu, Linux Mint, and derivatives
To generate a .deb package, configure wolfSSL with the desired
configuration. Then run `make deb` to generate a Debian package
with the current configuration. To build the package inside a
Docker container, use `make deb-docker`. In both cases the
resulting packages are placed in the root directory of the
project.
2023-10-05 09:18:50 -05:00
19. Building for RHEL, Fedora, CentOS, SUSE, and openSUSE
2023-08-09 00:39:55 +02:00
To generate a .rpm package, configure wolfSSL with the desired
configuration. Then run `make rpm` to generate a .rpm package
with the current configuration. To build the package inside a
Docker container, use `make rpm-docker`. In both cases the
resulting packages are placed in the root directory of the
project.
2023-10-05 09:18:50 -05:00
20. Building with xmss-reference lib for XMSS/XMSS^MT support [EXPERIMENTAL]
Experimental support for XMSS/XMSS^MT has been achieved by integration
with the xmss-reference implementation from RFC 8391 (XMSS: eXtended
Merkle Signature Scheme). We support a patched version of xmss-reference
based on this git commit:
171ccbd26f098542a67eb5d2b128281c80bd71a6
At the time of writing this, this is the HEAD of the master branch of
the xmss-reference project.
How to get the xmss-reference library:
$ mkdir ~/xmss
$ cd ~/xmss
$ git clone https://github.com/XMSS/xmss-reference.git src
$ cd src
$ git checkout 171ccbd26f098542a67eb5d2b128281c80bd71a6
$ git apply <path to xmss reference patch>
The patch may be found in the wolfssl-examples repo here:
2023-10-11 21:29:45 -05:00
pq/stateful_hash_sig/0001-Patch-to-support-wolfSSL-xmss-reference-integration.patch
2023-10-05 09:18:50 -05:00
2023-10-09 10:13:32 -05:00
To build patched xmss-reference:
$ make xmss_lib.a
To build verify-only patched xmss-reference:
$ make xmss_verify_lib.a
2023-10-11 21:29:45 -05:00
Note that this patch changes xmss-reference to use wolfCrypt SHA256 hashing,
by registering a SHA callback function in xmss-reference. It
2023-10-05 09:18:50 -05:00
thus benefits from all the same asm speedups as wolfCrypt SHA hashing.
Depending on architecture you may build with --enable-intelasm, or
2023-10-11 21:29:45 -05:00
--enable-armasm, and see 30-40% speedups in XMSS/XMSS^MT.
2023-10-05 09:18:50 -05:00
For full keygen, signing, verifying, and benchmarking support, build
wolfSSL with:
$ ./configure \
--enable-xmss \
--with-libxmss=<path to xmss src dir>
$ make
Run the benchmark against XMSS/XMSS^MT with:
$ ./wolfcrypt/benchmark/benchmark -xmss_xmssmt
For a leaner xmss verify-only build, build with
$ ./configure \
--enable-xmss=verify-only \
--with-libxmss=<path to xmss src dir>
$ make