Links

Quick Start

Prerequisites

WSIoTSDK provides a reference implementation of the ARM Platform Security Architecture API. It is assumed that the reader is familiar with the specification, that can be found at Platform Security Architecture Resources.

Set up the build environment

Iotex SDK officially supports a limited set of build environments and setups. In this context, official support means that the environments listed below are actively used by team members and active developers, hence users should be able to recreate the same configurations by following the instructions described below. In case of problems, the Iotex SDK team provides support only for these environments, but building in other environments can still be possible.
The following environments are supported:
Docker container (Ubuntu 22.04)
Install the VSCode Remote: Dev containers extension. Open the repository inside VSCode and click the "Open Workspace in Container" pop up that appears. More info on using dev containers in VSCode in the VSCode documentation.
Linux (Ubuntu 18.04 or 22.04)
Run the following command to install the required dependencies:
sudo apt-get install -y cmake git curl wget build-essential libssl-dev python3
Windows 11 x64
Install the following dependencies:

Get the source code

Run the following command to clone the repository:
git clone https://github.com/machinefi/w3bstream-iot-sdk.git

Build

The build process is managed by CMake. The build can be customized by passing CMake options. Below is a description of the most common ones. For a full list of CMake options see the main CMakeLists.txt:
  • CRYPTO_IMPL: the crypto library to use. Possible values: "MbedTLS" or "TinyCrypt". Defaults to "MbedTLS". Note that TinyCrypt is not supported yet.
  • BUILD_IOTEX_F: build the IoTeX Firmware component. Defaults to ON.
  • BUILD_PSA_TEST_SUITE: build the PSA Architecture test suite. Defaults to OFF.
  • BUILD_EXAMPLE_DEVICE_REGISTRATION: build the device registration example. Defaults to OFF.
  • GIT_SUBMODULE_UPDATE: download or update any dependencies specified as submodules. Defaults to ON.
For example, if you want to build the SDK using Iotex Firmware + MbedTLS + PSA test suite, you can run the following commands:
# Configure the build components and place the output in ./build-out
cmake -DGIT_SUBMODULE_UPDATE=ON -DBUILD_IOTEX_F=ON -DCRYPTO_IMPL="MbedTLS" -DBUILD_PSA_TEST_SUITE=ON -S ./ -B ./build-out
# Compile all targets
cmake --build build-out --target all
Once the build finishes, you can run the tests executable using the following command:
./build-output/test/psa-arch-tests-crypto
You should see output similar to the one below:
...
******************************************
​
TEST: 260 | DESCRIPTION: Testing crypto AEAD APIs | UT: psa_aead_abort
[Info] Executing tests from non-secure
[Check 1] Test psa_aead_abort - Encrypt - CCM - AES
[Check 2] Test psa_aead_abort - Encrypt - GCM - AES
[Check 3] Test psa_aead_abort - Decrypt - CCM - AES
[Check 4] Test psa_aead_abort - Decrypt - GCM - AES
[Check 5] Test psa_aead_abort with all initializations
​
TEST RESULT: PASSED
​
******************************************
​
......
​
************ Crypto Suite Report **********
TOTAL TESTS : 63
TOTAL PASSED : 61
TOTAL SIM ERROR : 0
TOTAL FAILED : 0
TOTAL SKIPPED : 2
******************************************