The CryptoCell peripheral (see the nRF52840 Product Specification ) on nRF52840 SoCs provides fast and power-efficient cryptographic functionality. The Experimental: CryptoCell library provides an API to use hardware-accelerated cryptography.
To help you get started using the CryptoCell API , the SDK includes several example applications that demonstrate the use of many CryptoCells features and verify their behavior.
The following example applications are available:
| Name | Description |
|---|---|
| aes | Demonstrates how to use the Advanced Encryption Standard. |
| chacha_poly | Demonstrates how to use the ChaCha variant of the Salsa20 stream cipher. |
| ecc | Demonstrates how to use Elliptic Curve Cryptopgraphy (ECC). The example shows Elliptic Curve Diffie-Hellman (ECDH) and Elliptic Curve Digital Signature Algorithm (ECDSA) key generation, signing, and verification. CryptoCell supports the Edwards and Montgomery families of curves. |
| hash | Demonstrates the hash capabilities of CryptoCell. The following hash algorithms are supported: MD5, SHA-1, SHA-2, SHA-224, SHA-256, SHA-384, and SHA-512. |
| hkdf | Demonstrates the HMAC-based key derivation function. |
| hmac | Demonstrates how to use keyed-hash message authentication codes. |
| rnd | Demonstrates random number generation. |
| rsa | Demonstrates how to generate RSA keys and how to use them for encryption and decryption. |
You can find the source code and the project file of the examples in the following folder:
<InstallFolder>\examples\crypto\nrf_cc310
Testing
Test the CryptoCell Example applications by performing the following steps:
-
Navigate to the
armgccfolder of the example atexamples\crypto\nrf_cc310\ example_name \pca10056\blank\armgcc. -
Open a command prompt and type
maketo build the project. -
Use
nrfjprog
(from nRF5x Command Line Tools v9.2.0 or newer) to program the .hex file that was created in the
_buildfolder to the board. - Use an RTT viewer to see the log messages produced by the integration test. The messages describe the success or failure of each stage in the test in a human-readable format.