WOLFSSL MICROCHIP PIC32 SUPPORT
The wolfSSL embedded SSL/TLS library (formerly CyaSSL) and wolfCrypt (CTaoCrypt) embedded crypto engine now support running on Microchip PIC32 processors in either MIPS16 or MIPS32 mode. To make it easy for developers to get started with wolfSSL and wolfCrypt on the PIC32, wolfSSL offers several example MPLAB® X IDE projects which have been developed for use with the Microchip PIC32 Ethernet Starter Kit.
wolfSSL Embedded SSL/TLS for PIC32
Developed with embedded devices and applications in mind, the wolfSSL embedded SSL/TLS library has been written from the ground up focusing on several key priorities – including performance, feature set, low memory usage, and portability. wolfSSL is progressive in its support for current and upcoming protocol and cipher standards, including both client and server support for TLS 1.2, DTLS 1.2, AES-GCM, AES-CCM, and ECC to name a few. The combination of these traits make wolfSSL the perfect fit for secure communication on PIC32-based devices and applications. For a full list of features offered by wolfSSL, please see the product page.
Building wolfSSL with Microchip PIC32 Support
To enable Microchip PIC32 support, define MICROCHIP_PIC32 and/or either MICROCHIP_TCPIP or MICROCHIP_TCPIP_V5 when building wolfSSL. The MICROCHIP_PIC32 define turns on board-specific settings used with the PIC32 Ethernet Starter Kit. If using Microchip TCP/IP stack version 5, define MICROCHIP_TCPIP_V5. If using Microchip TCP/IP stack version 6 or later, define MICROCHIP_TCPIP.
To see a list of specific preprocessor defines used to build wolfSSL on the Microchip PIC32 Ethernet Starter Kit board with the MPLAB® X IDE, see the two above defines located in the <wolfssl_root>/wolfssl/wolfcrypt/settings.h file of the wolfSSL download package.
Example MPLABX Projects
The wolfSSL download package ships with several example MPLAB® X projects which developers can use to get going quickly with wolfSSL on the PIC32. The following Microchip PIC32 MPLAB® X example projects can be found under the <cyassl_root>/mplabx directory:
wolfSSL Library (wolfssl.X)
This project builds a static wolfSSL library.
wolfCrypt Test Application (wolfcrypt_test.X)
This project tests the wolfCrypt cryptography modules. It is generally a good idea to run this first on a PIC32 system after compiling wolfSSL in order to verify all underlying crypto is working correctly.
wolfCrypt Benchmark Application (wolfcrypt_benchmark.X)
This project builds the wolfCrypt benchmark application which can be used on a PIC32-based device to see cryptography benchmark speeds. Results of running the wolfCrypt benchmark on a PIC32 Ethernet Starter Kit in the wolfSSL labs using MIPS32 mode yielded the following results (reference only):
AES 25 kB took 0.047 seconds, 0.52 MB/s
ARC4 25 kB took 0.007 seconds, 3.63 MB/s
RABBIT 25 kB took 0.009 seconds, 2.77 MB/s
3DES 25 kB took 0.202 seconds, 0.12 MB/s
MD5 25 kB took 0.004 seconds, 6.09 MB/s
SHA 25 kB took 0.007 seconds, 3.52 MB/s
SHA-256 25 kB took 0.018 seconds, 1.34 MB/s
SHA-512 25 kB took 0.037 seconds, 0.66 MB/s
RSA 1024 encryption took 35.57 milliseconds, avg over 1 iterations
RSA 1024 decryption took 308.67 milliseconds, avg over 1 iterations
DH 1024 key generation 196.59 milliseconds, avg over 1 iterations
DH 1024 key agreement 198.38 milliseconds, avg over 1 iterations
ECC 256 key generation 183.91 milliseconds, avg over 1 iterations
EC-DHE key agreement 181.20 milliseconds, avg over 1 iterations
EC-DSA sign time 190.48 milliseconds, avg over 1 iterations
wolfSSL Client and Server Examples for Microchip MPLAB Harmony
Microchip MPLAB Harmony now includes several demo applications using wolfSSL (CyaSSL):
cyassl_tcp_client – TCP/IP CyaSSL Client Demonstration (PDF)
This configuration demonstrates creating an Internet client that uses the MPLAB Harmony TCP API to create a TCP/IP connection to a Web server. The connection can either be clear text, or it can use SSL to encrypt the connection with CyaSSL. The demonstration can use either IPv4 or IPv6.
cyassl_tcp_server – TCP/IP CyaSSL Server Demonstration (PDF)
This configuration demonstrates creating a simple Internet Web server, that operates with clear text (TCP Port 80), and with encrypted text (TCP Port 443). If IPv6 is enabled than the demonstration also serves both types of connections on IPv6. The Web server only serves one page with the text ‘Nothing Here’ to all Web clients.
wifi_wolf_ssl – TCP/IP Wifi wolfSSL Demonstration (PDF)
This configuration provides a Wi?Fi wolfSSL TCP/IP demonstration. The demonstration is a dual port version of the cyassl_tcp_client demonstration, but it supports both Ethernet and Wi?Fi connections.
When testing embedded client or servers on a PIC32-based devices, it is recommended to test against one of the standard wolfSSL example applications running on a desktop machine. The standard wolfSSL example applications are located in the wolfSSL root directory under the <wolfssl_root>/examples directory. For more information about building and running these standard example applications on a desktop machine, please refer to Chapter 3 of the wolfSSL Manual.
Please contact wolfSSL with any questions about using wolfSSL on PIC32-based devices.
Microchip Technology Inc. is a leading provider of microcontroller, mixed-signal, analog and Flash-IP solutions, providing low-risk product development, lower total system cost and faster time to market for thousands of diverse customer applications worldwide. Headquartered in Chandler, Arizona, Microchip offers outstanding technical support along with dependable delivery and quality. For more information, visit the Microchip website at www.microchip.com.