* The oldest supported Ubuntu Version is 22.04 which comes with CMake 3.22.
* Refactor demos/CMakeLists.txt to set the list of binaries only once.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
* Rename `siv_{en,de}crypt()` to `siv_{en,de}crypt_memory()`.
* The number of AAD components per SIV operation must not exceed 126.
* Init OMAC only once per SIV operation.
All OMAC operations start off with the same key. Instead of
re-initializing the OMAC context for each operation, init once and
store the context.
* Add SIV to timing demo.
* Add 1000-times-encrypt-then-decrypt test for SIV.
* Update docs.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
* Add at least a `-h` option, sometimes more.
* Fix the exit codes of some of them.
* Make them all compile with `LTC_EASY`.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
* add `ltc` wrapper script for installed demos
* rework demos/CMakeLists.txt and add some more bells and whistles
* prefix installed demos with `ltc-`
Currently this makes the standard makefiles and CMake results diverge, but
we can fix that later if required.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
1. ChaCha20, two-key 3DES and DES-X encrypted OpenSSL PEM files
2. AES-GCM and Chacha20+Poly1305 encrypted SSH keys
* OpenSSH uses a slightly different algorithm for its
`chacha20-poly1305@openssh.com` than defined in the RFC.
Therefore add an `openssh_compat` flag to
`chacha20poly1305_state`.
* Add the option to give a 16byte IV and no counter, when calling
`chacha20poly1305_memory()`
* Add support for DES-X
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
The design before was not completely fine. The user had to allocate the
buffer and passed ownership to the library.
As of [0] this seems to be a problem in some environments.
[0] https://github.com/libtom/libtomcrypt/pull/587#issuecomment-1765324724
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This adds two new API functions
* `pem_decode_openssh()`
* `pem_decode_openssh_filehandle()`
It also introduces the following two new types:
* a new union type `ltc_pka_key` which can hold any PKA key type.
* a `password_ctx` type with a callback to retrieve a password
if necessary.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
`NULL` as defined by the standard is not guaranteed to be of a pointer
type. In order to make sure that in vararg API's a pointer type is used,
define our own version and use that one internally.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>