Start with LPC55S69 : follow this link, download the IDE environment, and build the SDK file (to be imported into the IDE tool). Put the unzipped code in your workspace, and import it into MCUXpresso IDE.More info on this board is to be found at the Zephyr Project.
M33 Security FeaturesThis LPC55 comes with a dual M33 core, that has many functions. The interesting part are the security features to speed up encryption and hashing, as well the True random generator and TrustZone. Crypto keys use very large integer numbers (256bit), and normal MCU's have difficulty to do maths (modulo based multiplications) with these large numbers. The LPC55S69 has accelerators that can do 64-bit optimized complex instruction, usable for Elliptic Curve Encryption (ECC). This is used for many secure applications like SSL certificates, but also for blockchain applications. Combined with the TrustZone and encrypted storage, it could be an idea to buld a kind of CryptoWallet : to generate key-pairs, and sign certificates and transactions etc. This demo is just a first step.
Bitcoin AddressesThe web is full witth bitcoin examples and explanations, however a very interesting site is Mobilefish.com, Robert Lie has a great page explaining the address-generation and verification. Check also his Youtube-series on Crypto.For BTC addresses we require a TRNG (random number generator), hashing algortihms (SHA256 and RIPEMD-160) and elliptic encryption via Secp256k1 curve. NXP provides not all libraries yet, which is unfortunate: ECC is supported in many forms, but not yet secp256K1, hashing Ripemd-160 is not supported either, so this leaves us to use some open source libraries. uECC : Kenneth MacKay 2014 - link RIPEMD-160 : Mark Hoblit 2014 - linkAlso the base value conversions for character representation of the keys - Base58 encoder - is build separately.
TFT DisplayI used an old 2.8" iTead display with touch itdb02. It's supported for Arduino on the uTFT library, (almost plug 7 play!) but I had to port the basics to MCUXpresso IDE, using software-controlled IO Bit-banging. Usable code used is found here on AVR-Freaks and ported it to the LPC55S69.
uTFT library: link
uTFT is a great library, but for Arduino and some other not-to-mention Mcu, so it's not ported to LPC-series. However there is an interesting too to convert.png-icons to c-code, and you can download some font-files as well.
C-CodeApplication runs now in non-trusted environment.Setsup the LPC55S69 clock and IO, setup the display, and generates addresses in sets of 4. Addresses are not (yet) stored.
To Do- Migrate address generation into trusted zone (use 2nd M33 Core#1)
- Add encrypted storage for private keys using the PRINCE feature
- Optimize secp256K1 for Caspar module (I'm hoping NXP do this!)
- Add Certificate/message signing feature
- Build USB-interface to communicate to PC with Python script
Comments