Skip to content

These MPLAB® X IDE demo projects showcase applications built with the Crypto Library which leverages the Pre-compiled Crypto Accelerator Module(CAM) Hardware Driver to demonstrate various cryptographic algorithms supported by the CAM

License

Notifications You must be signed in to change notification settings

microchip-pic-avr-examples/dspic33a-crypto-accelerator-module

Repository files navigation

Microchip Logo.

dsPIC33A Crypto Accelerator Module Hardware Driver and Demos

  • Crypto Accelerator Module will be referred to as CAM throughout the remainder of the document.

Description

dsPIC33A CAM Hardware Driver and Demos are a collection of MPLAB® X IDE projects to demonstrate the following CAM operations:

  • ECDSA Sign/Verify
  • Hashing
  • TRNG
  • AES

The included demonstration projects provide examples of the various CAM features. The application project needs to include the Crypto Library in the crypto/common_crypto folder. The Crypto Library API and associated hardware wrappers invoke the Pre-compiled CAM Hardware Driver.

Prerequisites

Software Tools

Hardware Tools

  • dsPIC33AK512MPS512 Curiosity GP DIM (EV80L65A)
  • Curiosity Platform Development Board (EV74H48A)

Contents Summary

Each folder contains a README describing the example application in more detail.

Folder Description
dsa Example application project for ECDSA
hash Example application project for Hashing
trng Example application project for TRNG
aes Example application project for AES

Crypto Accelerator Module APIs

The Pre-compiled CAM Hardware Driver can function independently by utilizing the following APIs.

MISRA

A MISRA scan has been conducted on the Pre-compiled CAM Hardware Driver source files. The source files are Misra compliant for Required and Mandatory rules.

Benchmarking

Performance Benchmarking

The following benchmarking results were obtained while testing the Crypto Library APIs that utilize the Pre-compiled Hardware Driver.

Benchmarking parameters: Device clock speed set to 200 MHz

Algorithm Performance Parameters (sizes are in bytes)
SHA-1 (Digest) 928.80 Mbps Message Size: 4,096
SHA-224 (Digest) 1084.67 Mbps Message Size: 4,096
SHA-256 (Digest) 1091.54 Mbps Message Size: 4,096
SHA-384 (Digest) 1294.15 Mbps Message Size: 4,096
SHA-512 (Digest) 1293.64 Mbps Message Size: 4,096
AES-ECB (Encrypt) 113.17 Mbps Key Size: 32, Plaintext Size: 128
AES-ECB (Decrypt) 109.12 Mbps Key Size: 32, Ciphertext Size: 128
AES-CTR (Encrypt) 115.07 Mbps Key Size: 32, Initialization Vector Size: 16, Plaintext Size: 128
AES-CTR (Decrypt) 115.07 Mbps Key Size: 32, Initialization Vector Size: 16, Ciphertext Size: 128
AES-GCM (Encrypt) 39.82 Mbps Key Size: 32, Initialization Vector Size: 12, Authentication Data Size: 4, Tag Size: 16, Plaintext Size: 13
AES-GCM (Decrypt) 35.13 Mbps Key Size: 32, Initialization Vector Size: 12, Authentication Data Size: 4, Tag Size: 16, Ciphertext Size: 13
AES-CMAC (Direct) 30.75 Mbps Key Size: 32, Plaintext Size: 532, MAC Size: 16
ECDSA (Sign) 3.92 ms Curve: P-192
ECDSA (Verify) 5.15 ms Curve: P-192
ECDSA (Sign) 7.42 ms Curve: P-256
ECDSA (Verify) 9.92 ms Curve: P-256
ECDSA (Sign) 19.79 ms Curve: P-384
ECDSA (Verify) 27.07 ms Curve: P-384
ECDSA (Sign) 42.16 ms Curve: P-521
ECDSA (Verify) 58.10 ms Curve: P-521
TRNG (Generate) 123.13 ms Output Size: 521

Memory Size Benchmarking

The following results include usage of single step and multi step APIs. Flash size will vary based on size of the stored data inputs used with the library.

All projects have the following compiler options:

  • Optimization for size (-Os)
  • Isolate each function in a section - unchecked
  • Remove unused sections - unchecked
Algorithm RAM (bytes) FLASH (bytes)
SHA-1 (Digest) 284 9,892
SHA-1 (Init, Update, and Final) 284 9,936
SHA-224 (Digest) 284 9,892
SHA-224 (Init, Update, and Final) 284 9,940
SHA-256 (Digest) 284 9,892
SHA-256 (Init, Update, and Final) 284 9,940
SHA-384 (Digest) 284 9,892
SHA-384 (Init, Update, and Final) 284 9,940
SHA-512 (Digest) 284 9,892
SHA-512 (Init, Update, and Final) 284 9,940
AES-ECB (Encrypt and Decrypt) 284 10,008
AES-ECB (Init and Cipher) 2,232 10,072
AES-CTR (Encrypt and Decrypt) 284 10,040
AES-CTR (Init and Cipher) 2,232 10,116
AES-GCM (Encrypt and Decrypt) 284 11,032
AES-GCM (Init, AddAadData, Cipher, and Final) 824 11,156
AES-CMAC (Direct) 284 9,644
AES-CMAC (Init, Cipher, and Final) 812 9,700
ECDSA (Sign and Verify (P-192)) 4,152 11,328
ECDSA (Sign and Verify (P-256)) 4,152 11,372
ECDSA (Sign and Verify (P-384)) 4,152 11,440
ECDSA (Sign and Verify (P-521)) 4,152 11,520
TRNG (Generate) 56 4,612

About

These MPLAB® X IDE demo projects showcase applications built with the Crypto Library which leverages the Pre-compiled Crypto Accelerator Module(CAM) Hardware Driver to demonstrate various cryptographic algorithms supported by the CAM

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •