otp_crypto: add ML-KEM-768 encapsulation by pguyot · Pull Request #2385 · atomvm/AtomVM · GitHub
Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ option(AVM_BUILD_RUNTIME_ONLY "Only build the AtomVM runtime" OFF)
option(COVERAGE "Build for code coverage" OFF)
option(AVM_PRINT_PROCESS_CRASH_DUMPS "Print crash reports when processes die with non-standard reasons" ON)
option(AVM_USE_LIBSODIUM "Enable optional libsodium backend for Ed25519 curve" OFF)
option(AVM_STATIC_LIBSODIUM "Static link libsodium." OFF)
option(AVM_MINIMAL_OPCODES "Reduce VM size by excluding opcodes for optional compiler flags (no_bs_match, no_ssa_opt_bs_ensure)" OFF)

# JIT & execution of precompiled code
Expand Down
8 changes: 7 additions & 1 deletion doc/src/programmers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,13 @@ for details on how to ensure the entropy source is properly initialized before p
cryptographic operations.
```

When AtomVM is built with `-DAVM_USE_LIBSODIUM=ON`, Ed25519 signing and verification (`crypto:sign/4`, `crypto:verify/5`) and X25519 key agreement (`crypto:generate_key/2`, `crypto:compute_key/4`) are also available. This option requires libsodium to be installed on the build host (e.g. `libsodium-dev` on Debian/Ubuntu), or the `espressif/libsodium` component on ESP32.
When AtomVM is built with `-DAVM_USE_LIBSODIUM=ON`, Ed25519 signing and verification
(`crypto:sign/4`, `crypto:verify/5`), X25519 key agreement (`crypto:generate_key/2`,
`crypto:compute_key/4`) and, with libsodium 1.0.22 or later, ML-KEM-768 key encapsulation
(`crypto:encapsulate_key/2`, `crypto:decapsulate_key/3`) are also available. This option requires
libsodium to be installed on the build host (e.g. `libsodium-dev` on Debian/Ubuntu), or the
`espressif/libsodium` component on ESP32. On generic UNIX, `-DAVM_STATIC_LIBSODIUM=ON` links
`libsodium.a` into the AtomVM binary instead of depending on the shared library at run time.

```{important}
**Increase the ESP32 task stack size when using libsodium.**
Expand Down
67 changes: 63 additions & 4 deletions libs/estdlib/src/crypto.erl
Loading
Loading