1.7.5 CHACHA20

Description

ChaCha20 is stream Cipher. It is a refinement of the Salsa20 algorithm. ChaCha20 is ARX (Addition/Rotation/XOR) based hash function, keyed, running in counter mode. It embodies the idea thathash function can be used to encrypt data. ChaCha20 initial version has 64 bit of nonce and 64bit of block counter but implementation reference published in RFC 8439, has changed the Nonce to 96-bit and Block counter to 32-bit size. Here the API uses 96-bit of Nonce and 32-bit of block Counter.

It is faster than AES in software-only implementations, making it around three times as fast on platforms that lack specialized AES hardware. This demo application demonstrates the functionality of Crypto v4 AES-CHACHA20 functions.

Downloading and Building the Application

To clone or download this application 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 MPLAB® Code Configurator Content Manager.

Path of the application group within the repository is apps/examples/symmetric/chacha20/chacha20_group.

The following table shows the contents of the project group.

Project NameDescription
pic32ck_sg01_cult.XMPLABX nonsecure project for PIC32CK SG Curiosity Ultra Development Board
pic32ck_sg01_cult_secure.XMPLABX secure project for PIC32CK SG Curiosity Ultra Development Board

Setting Up the Hardware

PIC32CK SG Curiosity Ultra Development Board

  • Connect the Debug USB port on the board to the computer using a micro USB cable.
  • Open a serial monitor with baud rate set to 115200, 8-bit data, no parity, 1 stop bit.

Running the Application

  1. Open the project group.
  2. Open the nonsecure version of the project.
  3. Build and program the application using its IDE and observe the serial COM output.
  4. The program displays which functions are being demonstrated, and prints if they are completed successfully.