1 Harmony 3 Crypto Library Application Examples for PIC32CZ CA9X Family

MPLAB® Harmony 3 is an extension of the MPLAB® ecosystem for creating embedded firmware solutions for Microchip 32-bit SAM and PIC® microcontroller and microprocessor devices. Refer to the following links for more information.

To clone or download these applications from Github, go to the main page of this repository and then click Clone button to clone this repository or download as zip file. This content can also be downloaded using content manager by following these instructions.

Contents Summary

FolderDescription
apps/crypto_examplesContains Crypto v4 library example applications

Code Examples

The following applications are provided to demonstrate the typical usage models of the Crypto v4 library.

NameDescription
Authenticated Encryption with Associated DataThis example application shows how to use the AEAD functions provided in the Crypto v4 Library
Digital Signature AlgorithmsThis example application shows how to use the DSA functions provided in the Crypto v4 Library
Hash AlgorithmsThis example application shows how to use the Hash Algorithm functions provided in the Crypto v4 Library
Key Agreement Scheme AlgorithmsThis example application shows how to use the KAS functions provided in the Crypto v4 Library
Random Number GeneratorThis example application shows how to use the RNG functions provided in the Crypto v4 Library
Symmetric AlgorithmsThis example application shows how to use the Symmetric Algorithm functions provided in the Crypto v4 Library

Initial Setup

The PIC32CZ_CA9x Crypto v4 API utilizes an HSM that needs its firmware to be loaded into the board. This can be done in two ways:
  • Add the provided HSM firmware hex file into demo project.
  • Program the board with the provided HSM firmware hex file prior to flashing demo project. Preserve program memory ranges 0xc7df000-0xc7fffff to ensure HSM firmware is not overwritten by demo project.
Note: HSM Firmware hex is located under crypto_apps_pic32cz_ca9x\hsmbootstrap\. Use pic32cz_ca90_8m.hex for the pic32czca90 project, and pic32cz_ca91_4m.hex for the pic32czca91 project.

For pic32czca91 setup

CA91 has a different boot address that may need to be modified after generation. After generating in MCC, follow these steps:

  • Locate hsm_boot.h in the header files under crypto/drivers/driver
  • Ensure lines 20 and 21 have the following addresses:
  • HSM_BOOT_FIRMWARE_INIT_ADDR = 0x0c3df800
  • HSM_BOOT_FIRMWARE_ADDR = 0x0c3e0000