Skip to content

Commit 2956ea8

Browse files
author
gojimmypi
committed
Update README, add Espressif details
1 parent 2d64093 commit 2956ea8

1 file changed

Lines changed: 53 additions & 14 deletions

File tree

README.md

Lines changed: 53 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ Portable TPM 2.0 project designed for embedded use.
55

66
## Project Features
77

8-
* This implementation provides all TPM 2.0 APIs in compliance with the specification.
8+
* This implementation provides all TPM 2.0 API's in compliance with the specification.
99
* Wrappers provided to simplify Key Generation/Loading, RSA encrypt/decrypt, ECC sign/verify, ECDH, NV, Hashing/HACM, AES, Sealing/Unsealing, Attestation, PCR Extend/Quote and Secure Root of Trust.
1010
* Testing done using TPM 2.0 modules from STMicro ST33 (SPI/I2C), Infineon OPTIGA SLB9670/SLB9672, Microchip ATTPM20, Nations Tech Z32H330TC and Nuvoton NPCT650/NPCT750.
1111
* wolfTPM uses the TPM Interface Specification (TIS) to communicate either over SPI, or using a memory mapped I/O range.
12-
* wolfTPM can also use the Linux TPM kernel interface (/dev/tpmX) to talk with any physical TPM on SPI, I2C and even LPC bus.
12+
* wolfTPM can also use the Linux TPM kernel interface (`/dev/tpmX`) to talk with any physical TPM on SPI, I2C and even LPC bus.
1313
* Platform support for Raspberry Pi (Linux), MMIO, STM32 with CubeMX, Atmel ASF, Xilinx, QNX Infineon TriCore and Barebox.
1414
* The design allows for easy portability to different platforms:
1515
* Native C code designed for embedded use.
1616
* Single IO callback for hardware SPI interface.
1717
* No external dependencies.
1818
* Compact code size and minimal memory use.
1919
* Includes example code for:
20-
* Most TPM2 native APIs
20+
* Most TPM2 native API's
2121
* All TPM2 wrapper API's
2222
* PKCS 7
2323
* Certificate Signing Request (CSR)
@@ -64,19 +64,29 @@ Contains hash digests for SHA-1 and SHA-256 with an index 0-23. These hash diges
6464
This project uses the terms append vs. marshall and parse vs. unmarshall.
6565

6666
Acronyms:
67+
* HAL: Hardware Abstraction Layer.
6768
* NV: Non-Volatile memory.
69+
* TPM: Trusted Platform Module.
6870

6971
## Platform
7072

7173
The examples in this library are written for use on a Raspberry Pi and use the `spi_dev` interface.
7274

7375
### IO Callback (HAL)
7476

75-
See the HAL manual in [`hal/README.md] (hal/README.md).
77+
See the HAL manual in [hal/README.md](hal/README.md).
7678

7779
For interfacing to your hardware interface (SPI/I2C) a single HAL callback is used and configuration on initialization when calling `TPM2_Init` or `wolfTPM2_Init`.
7880

79-
There are HAL examples in `hal` directory for Linux, STM32 CubeMX, Atmel ASF, Xilinx, Infineon TriCore and BareBox.
81+
There are HAL examples in `hal` directory for:
82+
83+
* Atmel ASF
84+
* BareBox
85+
* Espressif ESP-IDF
86+
* Infineon TriCore
87+
* Linux
88+
* STM32 CubeMX
89+
* Xilinx
8090

8191
We also support an advanced IO option (`--enable-advio`/`WOLFTPM_ADV_IO`), which adds the register and read/write flag as parameter to the IO callback. This is required for I2C support.
8292

@@ -135,7 +145,7 @@ Mfg NTC (0), Vendor NPCT75x"!!4rls, Fw 7.2 (131072), FIPS 140-2 1, CC-EAL4 0
135145

136146
### Building wolfSSL
137147

138-
```
148+
```bash
139149
git clone https://github.com/wolfSSL/wolfssl.git
140150
cd wolfssl
141151
./autogen.sh
@@ -147,9 +157,23 @@ sudo ldconfig
147157

148158
autogen.sh requires: automake and libtool: `sudo apt-get install automake libtool`
149159

150-
### Build options and defines
160+
### Building wolfSSL with an alternate directory
151161

162+
```bash
163+
# cd /your-wolfssl-repo
164+
./autogen.h # as necessary
165+
./configure --prefix=~/workspace/my_wolfssl_bin --enable-all
166+
make install
167+
168+
# then for some other library such as wolfTPM:
169+
170+
# cd /your-wolftpm-repo
171+
./configure --enable-swtpm --with-wolfcrypt=~/workspace/my_wolfssl_bin
152172
```
173+
174+
### Build options and defines
175+
176+
```text
153177
--enable-debug Add debug code/turns off optimizations (yes|no|verbose|io) - DEBUG_WOLFTPM, WOLFTPM_DEBUG_VERBOSE, WOLFTPM_DEBUG_IO
154178
--enable-examples Enable Examples (default: enabled)
155179
--enable-wrapper Enable wrapper code (default: enabled) - WOLFTPM2_NO_WRAPPER
@@ -188,7 +212,7 @@ Support for SLB9670 or SLB9672 (SPI) / SLB9673 (I2C)
188212

189213
Build wolfTPM:
190214

191-
```
215+
```bash
192216
git clone https://github.com/wolfSSL/wolfTPM.git
193217
cd wolfTPM
194218
./autogen.sh
@@ -200,7 +224,7 @@ make
200224

201225
Build wolfTPM:
202226

203-
```
227+
```bash
204228
./autogen.sh
205229
./configure --enable-st33 [--enable-i2c]
206230
make
@@ -210,7 +234,7 @@ make
210234

211235
Build wolfTPM:
212236

213-
```
237+
```bash
214238
./autogen.sh
215239
./configure --enable-microchip
216240
make
@@ -220,27 +244,42 @@ make
220244

221245
Build wolfTPM:
222246

223-
```
247+
```bash
224248
./autogen.sh
225249
./configure --enable-nuvoton
226250
make
227251
```
228252

253+
### Building Espressif ESP-IDF
254+
255+
See the wolfTPM-specific settings in the wolfSSL `user_settings.h` file, typically found in `[project]/components/wolfssl/include`.
256+
257+
```bash
258+
git clone https://github.com/wolfSSL/wolfTPM.git
259+
cd wolfTPM/IDE/Espressif
260+
261+
# set your path to ESP-IDF, shown here for VisualGDB using v5.2
262+
WRK_IDF_PATH=/mnt/c/SysGCC/esp32/esp-idf/v5.2
263+
264+
. ${WRK_IDF_PATH}/export.sh
265+
idf.py build
266+
```
267+
229268
### Building for "/dev/tpmX"
230269

231270
This build option allows you to talk to any TPM vendor supported by the Linux TIS kernel driver
232271

233272
Build wolfTPM:
234273

235-
```
274+
```bash
236275
./autogen.sh
237276
./configure --enable-devtpm
238277
make
239278
```
240279

241280
Note: When using a TPM device through the Linux kernel driver make sure sufficient permissions are given to the application that uses wolfTPM, because the "/dev/tpmX" typically has read-write permissions only for the "tss" user group. Either run wolfTPM examples and your application using sudo or add your user to the "tss" group like this:
242281

243-
```
282+
```bash
244283
sudo adduser yourusername tss
245284
```
246285

@@ -258,7 +297,7 @@ CMake supports compiling in many environments including Visual Studio
258297
if CMake support is installed. The commands below can be run in
259298
`Developer Command Prompt`.
260299

261-
```
300+
```bash
262301
mkdir build
263302
cd build
264303
# to use installed wolfSSL location (library and headers)

0 commit comments

Comments
 (0)