You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Diffie-Hellman key exchange | Curve25519 (raw or with HChaCha20) |
35
35
| Authenticated encryption | XChaCha20 *or XSalsa20\**, with Poly1305 |
36
36
| Digital signatures | Ed25519 (with Blake2b or SHA-512) |
37
37
38
-
\* denotes optional algorithms not implemented in Monocypher itself. XSalsa20 is from [tweetnacl](https://tweetnacl.cr.yp.to) and SHA-256 is from Brad Conte’s [crypto-algorithms](https://github.com/B-Con/crypto-algorithms) (both public-domain.)
38
+
\* denotes optional algorithms not implemented in Monocypher itself. XSalsa20 is from [tweetnacl](https://tweetnacl.cr.yp.to), SHA-256 is from Brad Conte’s [crypto-algorithms](https://github.com/B-Con/crypto-algorithms) (both public-domain), and Blake3 is from the [reference C implementation](https://github.com/BLAKE3-team/BLAKE3/blob/master/c) (Apache2 or CC).
39
39
40
40
## Using it
41
41
42
42
You should be OK on recent versions of Linux, Windows, and Apple platforms, using up-to-date versions of Clang, GCC or MSVC, and CMake 3.16 or later. That's what the CI tests cover.
43
43
44
-
0. If you haven't already, get the Monocypher submodule by running `git submodule update --init`.
45
-
1. Run the script `build_and_test.sh`. This uses CMake to build the library and some unit tests, and runs the tests.
46
-
2. Add the `include` directory to your compiler's include path.
47
-
3. Add `src/Monocypher.cc` to your project's source file list.
48
-
4.`#include "Monocypher.hh"` in source files where you want to use Monocypher.
49
-
5. If you need to use Ed25519 signatures or SHA-512 digests, also compile `src/Monocypher-ed25519.cc` and `#include "Monocypher-ed25519.hh"`. Ditto for SHA-256 and XSalsa20, which have their own headers and source files.
50
-
5. Read the [Monocypher documentation](https://monocypher.org/manual/) to learn how to use the API! The correspondence between the functions documented there, and the classes/methods here, should be clear. You can also consult `tests/MonocypherCppTests.cc` as a source of examples.
44
+
1. If you haven't already, get the Monocypher submodule by running `git submodule update --init`.
45
+
2. Run the script `build_and_test.sh`. This uses CMake to build the library and some unit tests, and runs the tests.
46
+
47
+
If your project uses CMake to build, all you hve to do is update your `CMakeLists.txt`, adding the line `add_subdirectory(monocypher-cpp)` and adding `MonocypherCpp` to your target's `target_link_libraries`.
48
+
49
+
If you don't use CMake:
50
+
1. Add the `include` directory to your compiler's include path.
51
+
2. Add `src/Monocypher.cc` to your project's source file list.
52
+
3.`#include "Monocypher.hh"` in source files where you want to use Monocypher.
53
+
4. If you need to use Ed25519 signatures or SHA-512 digests, also compile `src/Monocypher-ed25519.cc` and `#include "Monocypher-ed25519.hh"`. Ditto for SHA-256, XSalsa20, which have their own headers and source files.
54
+
5. Blake3 is somewhat harder to build because you also need to build the code in `vendor/BLAKE3/c`, which has some specializations for different CPU types.
55
+
56
+
After building, read the [Monocypher documentation](https://monocypher.org/manual/) to learn how to use the API! The correspondence between the functions documented there, and the classes/methods here, should be clear. You can also consult `tests/MonocypherCppTests.cc` as a source of examples.
51
57
52
58
> ⚠️ You do _not_ need to compile or include the Monocypher C files in `vendor/monocypher/`. The C++ source files compile and include them for you indirectly, wrapping their symbols in a C++ namespace.
53
59
54
60
## Change Log
55
61
62
+
### 28 May 2024 -- Added Blake3
63
+
64
+
### 24 Oct 2023 -- Monocypher 4.0.2
65
+
56
66
### 10 April 2023 -- Monocypher 4.0.1
57
67
58
68
Upgraded the Monocypher library from 3.1.3 to 4.0.1. There were a lot of API changes in the C API, but most of them don't affect the C++ API. I've even added (trivial) wrappers for some functionality that was removed.
0 commit comments