This also adds a note about the potential limitation of the signature
formats, depending on the tailoring.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
contrib/libtomcrypt.cmake is a snippet that can be used by any CMake
based project that wants to link with libtomcrypt, no matter if it
was installed with libtomcrypt-config.cmake or libtomcrypt.pc.
Fixes#681
* 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>
SM4 (formerly SMS4)[1] is a block cipher used in the Chinese
National Standard for Wireless LAN WAPI (Wired Authentication
and Privacy Infrastructure).
--from wikipedia
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 hash algorithms used in the MGF and to create the hash of the Label
must not forcibly be the same. This change allows to use different
algorithms.
Unfortunately this breaks the API if you use one of:
* `rsa_decrypt_key_ex()`
* `rsa_encrypt_key_ex()`
* `pkcs_1_oaep_decode()`
* `pkcs_1_oaep_encode()`
The `rsa_decrypt_key()` and `rsa_encrypt_key()` macros are still the same.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
`aes_desc` and `aes_enc_desc` now do auto-detection of the best suitable
AES implementation for the platform.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
* The RFC doesn't limit the context to be a string.
It talks about `octets` which means it could be any binary data.
* Move the context-preprocessing function out of tweetnacl.c
* Fix potential segfaults when Ed25519 signature verification fails and
`LTC_CLEAN_STACK` is enabled.
* Fix all the warnings.
* Update documentation.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>