Skip to content

Commit 38aaa7c

Browse files
jithu83Anas Nashif
authored andcommitted
samples/drivers/crypto: crypto sample app
A sample application to illustrate the usage of crypto APIs. This shows the usage of AES - CTR, CBC and CCM based encryption and decryption. origin: original Change-Id: I17e4d966a70169b71a754c9cdc3f713a5d0c3ac0 Signed-off-by: Jithu Joseph <[email protected]>
1 parent de106b0 commit 38aaa7c

File tree

6 files changed

+412
-0
lines changed

6 files changed

+412
-0
lines changed

samples/drivers/crypto/Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
BOARD ?= qemu_x86
2+
CONF_FILE = prj.conf
3+
4+
include ${ZEPHYR_BASE}/Makefile.inc

samples/drivers/crypto/README.txt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Title: crypto
2+
3+
Description:
4+
5+
An example to illustrate the usage of crypto APIs.
6+
7+
--------------------------------------------------------------------------------
8+
9+
Building and Running Project:
10+
11+
This microkernel project outputs to the console. It can be built and executed
12+
on QEMU as follows:
13+
14+
make qemu
15+
16+
--------------------------------------------------------------------------------
17+
18+
Troubleshooting:
19+
20+
Problems caused by outdated project information can be addressed by
21+
issuing one of the following commands then rebuilding the project:
22+
23+
make clean # discard results of previous builds
24+
# but keep existing configuration info
25+
or
26+
make pristine # discard results of previous builds
27+
# and restore pre-defined configuration info
28+
29+
--------------------------------------------------------------------------------
30+
31+
Sample Output:
32+
33+
[general] [INF] main: Encryption Sample
34+
35+
[general] [INF] cbc_mode: CBC Mode
36+
37+
[general] [INF] cbc_mode: cbc mode ENCRYPT - Match
38+
39+
[general] [INF] cbc_mode: cbc mode DECRYPT - Match
40+
41+
[general] [INF] ctr_mode: CTR Mode
42+
43+
[general] [INF] ctr_mode: ctr mode ENCRYPT - Match
44+
45+
[general] [INF] ctr_mode: ctr mode DECRYPT - Match
46+
47+
[general] [INF] ccm_mode: CCM Mode
48+
49+
[general] [INF] ccm_mode: CCM mode ENCRYPT - Match
50+
51+
[general] [INF] ccm_mode: CCM mode DECRYPT - Match
52+

samples/drivers/crypto/prj.conf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
CONFIG_STDOUT_CONSOLE=y
2+
#CONFIG_TEST_RANDOM_GENERATOR=y
3+
CONFIG_TINYCRYPT=y
4+
CONFIG_TINYCRYPT_AES=y
5+
CONFIG_TINYCRYPT_AES_CBC=y
6+
CONFIG_TINYCRYPT_AES_CTR=y
7+
CONFIG_TINYCRYPT_AES_CCM=y
8+
CONFIG_DEBUG=y
9+
CONFIG_CRYPTO=y
10+
CONFIG_CRYPTO_TINYCRYPT_SHIM=y
11+
CONFIG_SYS_LOG_CRYPTO_LEVEL=4
12+
CONFIG_SYS_LOG=y
13+
CONFIG_ASSERT=y
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
obj-y = main.o

0 commit comments

Comments
 (0)