* Use faster sober128 if available.
* Use stable PRNG state for ECC operations, so we get comparable results.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This also changes the API, since we need to know how many ADs are passed
and can't rely on a NULL element, as an empty element also changes the
tag.
Fixes: faa8cd71e5 ("add SIV")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
This also:
a) deprecates the old RSA and PKCS#1 API.
b) reverts the changes done to them in order to make the now deprecated API
compatible again with the last release.
The fixes commit mentioned below is the testcase for the Bleichenbacher
attack, which works now again as expected.
Fixes: 9d03c38e ("add flags to `der_decode_sequence()`")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
* 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>