
Firmware image preparation tool
UM2262
78/94
UM2262 Rev 6
Appendix E
Firmware image preparation tool
The X-CUBE-SBSFU STM32Cube Expansion Package is delivered with the
prepareimage
firmware image preparation tool allowing:
•
Taking into account the selected cryptographic scheme and keys
•
Encrypting the firmware image when required
•
Generating partial firmware image, by extracting binary differences between two full
images
•
Generating the firmware header with all the data required for the authentication and
integrity checks
The
prepareimage
tool is delivered in two formats:
•
Windows
®
executable: the standard Windows
®
command interpreter is required
•
Python™ scripts: a Python™ interpreter as well as the elements listed in
Middlewares\ST\STM32_Secure_Engine\Utilities\KeysAndImages\readme.txt
are
required
The Windows
®
executable enables a quick and easy use of the package with all three
predefined cryptographic schemes. The Python™ scripts, delivered as source code, offer
the possibility to define additional cryptographic schemes in a flexible manner.
Note:
and
for KMS and STSAFE-A specificities.
E.1 Tool
location
The Python™ scripts as well as the Windows
®
executable are located in the Secure Engine
component, in folder
Middlewares\ST\STM32_Secure_Engine\Utilities\KeysAndImages
.
E.2 Inputs
The package is delivered with some default keys and cryptography settings in folder
Applications\2_Images\2_Images SECoreBin\Binary
.
Each of the following files can be used as such, or modified to take the user settings into
account:
•
ECCKEY.txt
: private ECC key in PEM format. It is used to sign the firmware header.
This key is
not
embedded in the
SECoreBin
, only the corresponding public key is
generated by the tools in file
se_key.s
•
nonce.bin
: this is either a nonce (when AES-GCM is used) or an IV (when AES-CBC is
used). This value is added automatically by the tools to the firmware header.
•
OEM_KEY_COMPANY1_key_AES_CBC.bin
: symmetric AES-CBC key. This key is
used for the AES-CBC encryption and decryption operations, and is embedded in file
se_key.s
. This file is exclusive with
OEM_KEY_COMPANY1_key_AES_GCM.bin
•
OEM_KEY_COMPANY1_key_AES_GCM.bin
: symmetric AES-GCM key. This key is
used for all AES-GCM operations and is embedded in file
se_key.s
. This file is
exclusive with
OEM_KEY_COMPANY1_key_AES_CBC.bin