Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,9 @@ jobs:
BLOBDIR: /tools/blobs
with:
run: |
# install venv
# install python venv
apt-get update
apt install -y python3-dev
apt install -y python3-venv
apt-get install -y python3 python3-dev python3-venv

# get NTFC sources
git clone -b release-0.0.1 https://github.com/szafonimateusz-mi/nuttx-ntfc
Expand Down
29 changes: 1 addition & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,20 +166,9 @@ if(NOT EXISTS "${NUTTX_DEFCONFIG}")
endif()

# Process initial defconfig ###################################################
# Process initial defconfig to recursively expand #include in it

# Process initial defconfig to recursively expand #include in it
include(nuttx_process_config)
get_filename_component(NUTTX_DEFCONFIG_DIR "${NUTTX_DEFCONFIG}" DIRECTORY)
process_config(
${CMAKE_BINARY_DIR}/.defconfig.processed
${NUTTX_DEFCONFIG}
INCLUDE_PATHS
${NUTTX_DEFCONFIG_DIR}/../../common/configs
${NUTTX_DEFCONFIG_DIR}/../common
${NUTTX_DEFCONFIG_DIR}
${NUTTX_DIR}/../apps
${NUTTX_DIR}/../nuttx-apps)
set(NUTTX_DEFCONFIG ${CMAKE_BINARY_DIR}/.defconfig.processed)

# Generate initial .config ###################################################
# This is needed right before any other configure step so that we can source
Expand Down Expand Up @@ -502,22 +491,6 @@ if(CONFIG_NDEBUG)
add_compile_options(-DNDEBUG)
endif()

# Cmake build provide absolute paths to compile files. If __FILE__ macros are
# used in the source code(ASSERT), the binary will contain many invalid paths.
# This saves some memory, stops exposing build systems locations in binaries,
# make failure logs more deterministic and most importantly makes builds more
# failure logs more deterministic and most importantly makes builds more
# deterministic. Debuggers usually have a path mapping feature to ensure the
# files are still found.
if(NOT MSVC)
if(CONFIG_OUTPUT_STRIP_PATHS)
add_compile_options(-fmacro-prefix-map=${NUTTX_DIR}=)
add_compile_options(-fmacro-prefix-map=${NUTTX_APPS_DIR}=)
add_compile_options(-fmacro-prefix-map=${NUTTX_BOARD_ABS_DIR}=)
add_compile_options(-fmacro-prefix-map=${NUTTX_CHIP_ABS_DIR}=)
endif()
endif()

add_definitions(-D__NuttX__)

add_compile_options($<$<COMPILE_LANGUAGE:ASM>:-D__ASSEMBLY__>)
Expand Down
2 changes: 1 addition & 1 deletion Documentation/ReleaseNotes/NuttX-7.29
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ still needed). From Gregory Nutt.
- Rename all internal OS functions from task_* to nxtask_* to indicate
that they are NuttX internal functions. From Gregory Nutt.
- Rename sched_process_timer to nxsched_process_timer. Rename
sched_timer_expiration to nxsched_timer_expiration. Rename
sched_timer_expiration to nxsched_tick_expiration. Rename
sched_alarm_expiration to nxsched_alarm_expiration. Those are the
appropriate names for an internal sched/ function (still many named
incorrectly). From Gregory Nutt.
Expand Down
134 changes: 133 additions & 1 deletion Documentation/components/crypto.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,136 @@
Crypto API Subsystem
====================

In the future this page will contain details about the Crypto API in NuttX.
Overview
========

The NuttX Crypto API subsystem provides a unified interface for cryptographic operations, supporting various encryption, decryption, hashing, and authentication algorithms. The subsystem abstracts hardware and software crypto implementations through a common interface.

Supported Algorithms
====================

Symmetric Encryption Algorithms
--------------------------------

**AES (Advanced Encryption Standard)**

- AES-CBC Mode:
- CRYPTO_AES_CBC (128-bit key size)
- CRYPTO_AES_192_CBC (192-bit key size)
- CRYPTO_AES_256_CBC (256-bit key size)

- AES-CTR Mode (Counter mode):
- CRYPTO_AES_CTR

- AES-XTS Mode (XEX-based Tweaked CodeBook):
- CRYPTO_AES_XTS

- AES-GCM Mode (Galois/Counter Mode):
- CRYPTO_AES_GCM_16

- AES-OFB Mode (Output Feedback):
- CRYPTO_AES_OFB

- AES-CFB Mode (Cipher Feedback):
- CRYPTO_AES_CFB_8 (8-bit)
- CRYPTO_AES_CFB_128 (128-bit)

**Other Block Cipher Modes**

- Blowfish (BLF):
- CRYPTO_BLF_CBC

- CAST (CAST-128):
- CRYPTO_CAST_CBC

- Rijndael (128-bit):
- CRYPTO_RIJNDAEL128_CBC

- Null (No encryption):
- CRYPTO_NULL

Authentication and Hashing Algorithms
--------------------------------------

**HMAC (Hash-based Message Authentication Code)**

- MD5-HMAC:
- CRYPTO_MD5_HMAC

- SHA-1 HMAC:
- CRYPTO_SHA1_HMAC

- SHA-2 HMAC:
- CRYPTO_SHA2_256_HMAC (256-bit)
- CRYPTO_SHA2_384_HMAC (384-bit)
- CRYPTO_SHA2_512_HMAC (512-bit)

**Hash Functions**

- MD5:
- CRYPTO_MD5

- SHA-1:
- CRYPTO_SHA1

- SHA-2:
- CRYPTO_SHA2_224 (224-bit)
- CRYPTO_SHA2_256 (256-bit)
- CRYPTO_SHA2_384 (384-bit)
- CRYPTO_SHA2_512 (512-bit)

- RIPEMD-160:
- CRYPTO_RIPEMD160 (as hash function)
- CRYPTO_RIPEMD160_HMAC

**Message Authentication Codes**

- AES-GMAC (Galois Message Authentication Code):
- CRYPTO_AES_128_GMAC (128-bit key)
- CRYPTO_AES_192_GMAC (192-bit key)
- CRYPTO_AES_256_GMAC (256-bit key)
- CRYPTO_AES_GMAC (generic)

- AES-CMAC (Cipher-based Message Authentication Code):
- CRYPTO_AES_CMAC
- CRYPTO_AES_128_CMAC (128-bit)

- Poly1305:
- CRYPTO_POLY1305
- CRYPTO_CHACHA20_POLY1305
- CRYPTO_CHACHA20_POLY1305_MAC

**Stream Ciphers**

- ChaCha20:
- CRYPTO_CHACHA20_POLY1305 (with Poly1305 MAC)

Integrity and Checksums
------------------------

- CRC-32:
- CRYPTO_CRC32

- Extended Sequence Numbers (ESN):
- CRYPTO_ESN

Compression
-----------

- Deflate Compression:
- CRYPTO_DEFLATE_COMP

Usage
=====

The Crypto API is accessed through the cryptodev interface, which provides ioctl commands for initializing cryptographic sessions and performing operations.

Basic Usage Pattern
-------------------

1. Open the cryptodev device (/dev/crypto)
2. Initialize a cryptographic session with desired algorithm
3. Submit crypto operations (encrypt/decrypt/hash)
4. Close the session when done

For more details, refer to the cryptodev.h header file and specific driver documentation.
Loading