ChaCha20Poly1305-IP Demo Instruction
4 Command Details and Test Results
To operate ChaCha20Poly1305-IP demo, please prepare the following test environment.
1) FPGA development board.
2) Test PC.
3) Micro USB cable for JTAG connection between FPGA board and Test PC.
4) Micro USB cable for UART connection between FPGA board and Test PC.
5) Vivado tool for programming FPGA installed on Test PC.
6) Serial console software such as TeraTerm installed on PC. The setting on the console is Baudrate=115200, Data=8-bit, Non-parity and Stop=1.
7) Demo configuration file (To download this file, please visit our web site at www.design-gateway.com).

Figure 1 ChaCha20Poly1305-IP demo environment on ZCU106 board
1) Make sure power switch is off and connect power supply to FPGA development board.
2) Connect USB cable between PC to JTAG micro USB port.
3) Power on the system.
4) Download configuration file and firmware to FPGA board by following steps:
a) Open Vivado TCL shell.
b) Change current directory to download folder which includes demo configuration file.
c) Run bat script to program bit file, as shown in Figure 2.

Figure 2 Program Device on ZCU106
User can fill RAMs with AAD, IV, Input Data, and encryption/decryption key via serial console. The current parameters are shown together with the available options in the main menu as shown in Figure 3. The details of each menu are described in topic 4.

Figure 3 Serial Console Main menu
Select “Change Mode” from the main menu to switch the ChaCha20Poly1305-IP operation mode. The available options are shown in Figure 4.
1) ENCRYPT: Encrypts Input Data stored in memory.
2) DECRYPT: Decrypts Input Data stored in memory.
3) BYPASS: Bypasses Input Data stored in memory without encryption or decryption.
4) SPEED TEST: Evaluates the computational efficiency of the ChaCha20Poly1305-IP when processing large volumes of data.

Figure 4 Change Mode Menu
Step to set key as follows
1) Select “Edit Key”.
2) Enter up to 256-bit key value in hexadecimal format as shown in Figure 5.
3) After pressing Enter, the new key value will be updated and displayed in the main menu.

Figure 5 Key setting example
Step to set IV as follows
1) Select “Edit IV”.
2) Enter up to 96-bit IV value in hexadecimal format as shown in Figure 6.
3) After pressing Enter, the new IV value will be updated and displayed in the main menu.

Figure 6 IV setting example
Select “Edit AAD & Data” to update AAD and Data in memory. Users must update both AAD and Data in this menu. Editing differs by mode:
Speed Test Mode:
1) Enter AAD size (bytes) and press Enter.
2) Enter Data size (bytes) as shown in Figure 7 and press Enter.
3) After both inputs, the new sizes are updated and shown in the main menu.
Other Modes:
1) Enter AAD value in hexadecimal and press Enter.
2) Enter Data value in hexadecimal as shown in Figure 8 and press Enter.
3) After both inputs, the new values and sizes are updated and shown in the main menu.
Notes:
· Combined AAD + Data size can’t exceed 16 KB.
· In Decrypt mode, Data is treated as Ciphertext; in Encrypt mode, it is Plaintext.

Figure 7 AAD & Data setting example in Speed Test Mode

Figure 8 AAD & Data setting example in Other Modes
Step to Show AAD & Data in memory as follows:
1) Select “Show AAD & Data”
2) Enter the number of bytes to display (or press Enter to display all).
3) The AAD and Data values are shown in table form as shown in Figure 9.
4) After pressing Enter, the console will return to the main menu.

Figure 9 Show AAD & Data example
Select “Execute Operation” to start the operation in the currently selected mode.
In Encrypt mode, the IP uses the current key and IV to encrypt the Input Data in memory. The Output Data (Ciphertext) and 128-bit authentication tag are displayed as shown in Figure 10.

Figure 10 Encryption Mode result
In Decrypt mode, the IP uses the current key and IV to decrypt the Input Data in memory. The Output Data (recovered Plaintext) and the 128-bit authentication tag are displayed as shown in Figure 11.

Figure 11 Decryption Mode result
In Bypass mode, the IP simply passes the Input Data from memory to output memory without any encryption or decryption. Both Input Data and Output Data are displayed as shown in Figure 12.

Figure 12 Bypass Mode result
In Speed Test mode, the IP ignores the actual AAD and Data values. Only the entered sizes, together with the current key and IV, are used to run the encryption process. The console shows the execution time and calculated throughput, as shown in Figure 13.

Figure 13 Speed Test Mode result
|
Revision |
Date (D-M-Y) |
Description |
|
1.00 |
14-Oct-25 |
Initial version release |