Steffen Jaeckel
a10cad624d
Update makefiles
CI / CMake (-DCMAKE_BUILD_TYPE=Release, clang, , map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=Off], ubuntu-24.04) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, clang, , map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=Off], ubuntu-24.04-arm) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, clang, , map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-22.04) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, clang, , map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-22.04-arm) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, clang, , map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-24.04) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, clang, , map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-24.04-arm) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, clang, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=Off], ubuntu-22.04) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, clang, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=Off], ubuntu-22.04-arm) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, clang, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=Off], ubuntu-24.04) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, clang, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=Off], ubuntu-24.04-arm) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, clang, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-22.04) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, clang, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-22.04-arm) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, clang, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-24.04) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, clang, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-24.04-arm) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, , map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=Off], ubuntu-22.04) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, , map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=Off], ubuntu-22.04-arm) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, , map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=Off], ubuntu-24.04) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, , map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=Off], ubuntu-24.04-arm) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, , map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-22.04) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, , map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-22.04-arm) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, , map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-24.04) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, , map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-24.04-arm) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=Off], ubuntu-22.04) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=Off], ubuntu-22.04-arm) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=Off], ubuntu-24.04) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=Off], ubuntu-24.04-arm) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-22.04) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-22.04-arm) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-24.04) (push) Has been cancelled
CI / CMake (-DCMAKE_BUILD_TYPE=Release, gcc, -DLTC_CFLAGS="-DLTC_NO_ASM", map[CMAKEOPTIONS:-DBUILD_SHARED_LIBS=On], ubuntu-24.04-arm) (push) Has been cancelled
2026-08-07 08:33:48 +02:00
Karel Miko
0a0969b3d2
private - ltc_algname_match (relaxed alg name matching)
2026-08-04 12:40:06 +02:00
Karel Miko
a3ecbbc800
DER - fail cleanly when no math provider is registered
2026-08-04 12:40:06 +02:00
Steffen Jaeckel
223ecd23b8
Merge pull request #730 from libtom/pr/blake3
...
BLAKE3
2026-08-04 11:29:14 +02:00
Karel Miko
075342e984
Update makefiles
2026-08-04 11:26:06 +02:00
Karel Miko
5b05baaf36
BLAKE3
2026-08-04 11:26:06 +02:00
Karel Miko
4d5140219b
typo LTC_BLAKE2S / LTC_BLAKE2B
2026-08-03 11:39:44 +02:00
Steffen Jaeckel
dc77d926dc
Merge pull request #790 from libtom/fix-latex-tables
...
Fix latex tables
2026-08-03 11:38:00 +02:00
Steffen Jaeckel
82b193d7c6
Add ARIA to latex-tabels tool & PEM docs.
...
Fixes: 05ad38ab66 ("With ARIA added, we can now decrypt ARIA encrypted PEM files.")
Fixes : libtom/libtomcrypt#760
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-08-03 11:33:39 +02:00
Steffen Jaeckel
885578932a
Ensure that latex-tables tool succeeds
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-08-03 11:12:19 +02:00
Steffen Jaeckel
014cc99c75
Merge pull request #789 from libtom/pr/zero-stat
...
verify functions always set stat=0 before any other return
2026-08-03 10:53:27 +02:00
Karel Miko
47479c474f
verify functions always set stat=0 before any other return
2026-08-03 00:16:20 +02:00
karel-m
02788482af
Merge pull request #788 from libtom/pr/pbes-fix-stack-over-read
...
PBES - fix stack over-read with malformed PBES2 parameters
2026-08-01 18:37:52 +02:00
karel-m
59767256e6
Merge pull request #787 from libtom/pr/sha512-x86-alt
...
SHA-512 accelerated by x86 (alternative)
2026-08-01 18:37:40 +02:00
Karel Miko
b50ffea546
PBES - fix stack over-read with malformed PBES2 parameters
2026-08-01 15:44:26 +02:00
Karel Miko
22bc6b68e0
MSVC & SHA512 extension support
2026-08-01 14:13:43 +02:00
Karel Miko
51511d1cd0
Update makefiles
2026-08-01 11:17:41 +02:00
Karel Miko
9e2984aa7e
SHA-512 accelerated by x86 (alternative)
2026-08-01 11:17:36 +02:00
karel-m
4d9e2a1a57
Merge pull request #758 from libtom/more-fixes-and-improvements
...
More fixes and improvements
2026-08-01 10:20:27 +02:00
Karel Miko
bfc516d246
fix typo sha256_x86_compress/sha256_compress (LTC_CLEAN_STACK only)
2026-08-01 09:26:29 +02:00
Steffen Jaeckel
97f5d72457
Ensure the table sizes are OK.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-07-31 23:57:51 +02:00
Steffen Jaeckel
5a2bc6b131
Fix importing certificate with Ed448 key.
...
While running the tests in verbose mode I saw that
`tests/pem/openssl_ed448_x509.pem` is skipped instead of processed.
Fixes: 076a11037a ("Ed448 + X448")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-07-31 23:57:51 +02:00
Steffen Jaeckel
2320e44205
Allow processing of empty files.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-07-31 23:57:51 +02:00
Steffen Jaeckel
b0894f683f
Add pem tests with empty files.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-07-31 23:57:51 +02:00
Steffen Jaeckel
7978822b69
Add help to test binary.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-07-31 23:57:51 +02:00
Steffen Jaeckel
429d07e388
Some minor SHA1/256 improvements&fixes.
...
* Use a shared init function.
* Fix some functions used in descriptors and implementation.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-07-31 23:57:51 +02:00
Steffen Jaeckel
fb857d83ed
Auto-generate table of hashes.
...
Fixes: 6c885c7732 ("SM3 hash function")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-07-31 23:57:51 +02:00
Steffen Jaeckel
54f5803ad8
Rename keccac hash descriptors.
...
They're the only ones which don't follow the same pattern.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-07-31 23:57:51 +02:00
Steffen Jaeckel
459bd79006
Merge pull request #786 from libtom/pr/appveyor-clang-cl
...
appveyor + clang-cl
2026-07-31 23:50:20 +02:00
Karel Miko
a58d4b5278
clang-cl fix related to intrin.h
2026-07-31 23:48:18 +02:00
Karel Miko
3acb5aed64
appveyor + clang-cl
2026-07-31 23:48:18 +02:00
Steffen Jaeckel
2d16cc7f76
Merge pull request #756 from libtom/fast-type
...
Fix LTC_FAST_TYPE
2026-07-31 23:48:02 +02:00
Steffen Jaeckel
4a964ea017
Align macro based and inline LTC_FAST functions.
2026-07-31 20:27:50 +02:00
Karel Miko
6bc4dd9b7b
fix UBSanitizer issue: load of misaligned address for type LTC_FAST_TYPE (replacing LTC_FAST_TYPE_PTR_CAST approach)
2026-07-31 20:16:48 +02:00
Steffen Jaeckel
88f95afc5c
Rename according to PR #756
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-07-31 20:16:48 +02:00
karel-m
a467ea586b
Merge pull request #785 from libtom/pr/hash-memcpyable
...
Another attempt to make sha1/sha256 states memcpyable
2026-07-31 11:10:10 +02:00
Steffen Jaeckel
927191b193
Merge pull request #763 from MarekKnapek/ubsan
...
ubsan
2026-07-31 10:54:12 +02:00
Marek Knápek
c727c4032a
Get rid of LTC_FAST_TYPE_PTR_CAST entirely.
...
As it might be dangerous to use it.
This introduces `LTC_FAST_TYPE_{ASSIGN,MASK,XOR{2,3}}()` in order to
replace the potential unaligned loads.
This fixes the following UBSAN errors:
src/modes/ctr/ctr_encrypt.c:56:66: runtime error: load of misaligned address 0x7ffea07ee82f for type 'LTC_FAST_TYPE', which requires 8 byte alignment
src/modes/ctr/ctr_encrypt.c:56:64: runtime error: store to misaligned address 0x7ffea07ee82f for type 'LTC_FAST_TYPE', which requires 8 byte alignment
tests/store_test.c:66:91: runtime error: load of misaligned address 0x7ffdd32f0d9f for type 'LTC_FAST_TYPE', which requires 8 byte alignment
tests/store_test.c:66:52: runtime error: load of misaligned address 0x7ffdd32f0d71 for type 'LTC_FAST_TYPE', which requires 8 byte alignment
tests/store_test.c:66:50: runtime error: store to misaligned address 0x7ffdd32f0dc1 for type 'LTC_FAST_TYPE', which requires 8 byte alignment
src/mac/pmac/pmac_process.c:40:50: runtime error: load of misaligned address 0x57c89c4329ec for type 'LTC_FAST_TYPE', which requires 8 byte alignment
src/mac/xcbc/xcbc_process.c:35:60: runtime error: load of misaligned address 0x57c89c432ccc for type 'LTC_FAST_TYPE', which requires 8 byte alignment
src/mac/f9/f9_process.c:39:58: runtime error: load of misaligned address 0x5c2b1a1d2c14 for type 'LTC_FAST_TYPE', which requires 8 byte alignment
src/encauth/gcm/gcm_process.c:82:58: runtime error: load of misaligned address 0x596b3e6aa354 for type 'LTC_FAST_TYPE', which requires 8 byte alignment
2026-07-31 10:45:09 +02:00
Marek Knápek
471f143078
Fix UBSAN errors
...
src/encauth/siv/siv.c:164:19: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:44:28: note: nonnull attribute specified here
src/misc/compare_testvector.c:63:25: runtime error: null pointer passed as argument 2, which is declared to never be null
/usr/include/string.h:65:33: note: nonnull attribute specified here
2026-07-31 10:44:16 +02:00
Karel Miko
a1a631efe4
make sha1/sha states clonable via memcpy
2026-07-30 20:17:44 +02:00
karel-m
c5607aff6b
Merge pull request #784 from libtom/pr/msvc-fallthrough
...
Fix LTC_FALLTHROUGH related error reported by MSVC compiler
2026-07-30 16:48:17 +02:00
Karel Miko
23fca6ed39
Fix LTC_FALLTHROUGH related error reported by MSVC compiler
2026-07-30 16:01:06 +02:00
Steffen Jaeckel
79f2b5762d
Merge pull request #777 from libtom/pr/siv-zero-ad
...
SIV properly handle zero AD components
2026-07-30 15:42:03 +02:00
Karel Miko
511252c49e
update SIV doc - fix adnum; explain no associated data vs. empty associated data
2026-07-30 15:39:27 +02:00
Karel Miko
cff7442824
SIV properly handle zero AD components
2026-07-30 15:39:27 +02:00
Steffen Jaeckel
f5fe918ab8
Merge pull request #755 from libtom/fix-warnings
...
Fix warnings
2026-07-30 15:37:58 +02:00
Karel Miko
074a354151
fix build failures with -std=c99
2026-07-30 15:22:33 +02:00
Karel Miko
0b6f0e1232
fix clang warnings -Wimplicit-fallthrough (while keeping /* FALLTHROUGH */ for some code review tools)
2026-07-30 15:22:33 +02:00
Karel Miko
26605163a4
fix clang warnings -Wmissing-variable-declarations
2026-07-30 15:22:33 +02:00
Karel Miko
317994fb1b
fix clang warnings -Wstrict-prototypes -Wmissing-prototypes in tests+demos
2026-07-30 15:22:33 +02:00
Karel Miko
661fcd6486
fix UBSanitizer issue: applying non-zero offset to null pointer
2026-07-30 15:22:33 +02:00
Karel Miko
5c8ac18bd1
fix UBSanitizer issue: memcpy/memcmp require non-null pointers even when the length is zero
2026-07-30 15:22:33 +02:00
Karel Miko
76a9ece653
fix UBSanitizer issue: left-shifting negative integer is undefined behavior
2026-07-30 15:22:33 +02:00
Karel Miko
509da35eee
fix clang warning: 'err' may be used uninitialized
2026-07-30 15:22:33 +02:00
karel-m
612f211bbc
Merge pull request #783 from libtom/pr/der-misc-issues
...
various DER related fixes/improvements
2026-07-29 23:50:05 +02:00
Karel Miko
209df8ae1a
hardening pkcs8_get_children against uninitialized output pointers
2026-07-28 16:33:09 +02:00
Karel Miko
5c7757d0a5
various DER related fixes/improvements
2026-07-28 00:10:29 +02:00
Steffen Jaeckel
a8ed78c2ca
Merge pull request #780 from libtom/pr/argon2-parallelism-overflow
...
Argon2 enforce parallelism max 2^24-1
2026-07-21 11:07:46 +02:00
Karel Miko
fcadf67bbb
Argon2 enforce parallelism max 2^24-1
2026-07-21 11:02:31 +02:00
Steffen Jaeckel
b7b04ffd37
Merge pull request #778 from libtom/pr/eax-taglen
...
EAX properly handle taglen boundaries
2026-07-21 10:59:19 +02:00
Karel Miko
39f5e1fae8
EAX properly handle taglen boundaries
2026-07-21 10:56:44 +02:00
Steffen Jaeckel
84aec00adc
Merge pull request #776 from libtom/pr/ccm-nonce
...
Fix issue #775 - CCM nonce is 7..13 bytes
2026-07-21 10:56:27 +02:00
Karel Miko
e00b22d939
CCM nonce is 7..13 bytes
2026-07-21 10:53:25 +02:00
Steffen Jaeckel
1027dcfaf6
Merge pull request #765 from libtom/pr/fix-issue764
...
Fix issue #764 - small-subgroup attack
2026-07-21 10:53:14 +02:00
Karel Miko
bc95a1fd2d
hardening ecc_shared_secret against small-subgroup attacks
2026-05-25 16:18:14 +02:00
Karel Miko
ec7c05f94e
fix issue #764 as suggested by @yaotushaozhu
2026-05-25 14:11:27 +02:00
Karel Miko
afb09869f7
failing test for issue #764 - small-subgroup attack regression test
2026-05-25 13:56:48 +02:00
Steffen Jaeckel
a68fa19bc2
Merge pull request #732 from libtom/pr/sm3-hash
...
SM3 hash function
2026-05-19 13:31:48 +02:00
Steffen Jaeckel
c17e5ed051
Update makefiles
2026-05-19 13:29:49 +02:00
Karel Miko
6c885c7732
SM3 hash function
2026-05-19 13:29:36 +02:00
Steffen Jaeckel
291d847c10
Merge pull request #752 from libtom/pr/AES-GCM-SIV
...
RFC 8452 - AES-GCM-SIV
2026-05-19 13:14:53 +02:00
Karel Miko
96d2d09d7a
Update makefiles
2026-05-19 13:12:32 +02:00
Karel Miko
37a2e345a4
AES-GCM-SIV
2026-05-19 13:12:32 +02:00
Steffen Jaeckel
8512e3e891
Merge pull request #759 from libtom/pr/KMAC128-256
...
KMAC as defined in NIST SP 800-185
2026-05-19 13:05:06 +02:00
Karel Miko
7bcdb63950
Update makefiles
2026-05-19 13:03:25 +02:00
Karel Miko
9b268d6258
KMAC - NIST SP 800-185
2026-05-19 13:03:25 +02:00
Steffen Jaeckel
6e4dcfcc11
Merge pull request #760 from libtom/pr/ARIA
...
ARIA block cipher (RFC 5794)
2026-05-19 10:22:37 +02:00
Steffen Jaeckel
05ad38ab66
With ARIA added, we can now decrypt ARIA encrypted PEM files.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-17 13:49:10 +02:00
Karel Miko
2f6b257def
Update makefiles
2026-05-16 11:38:42 +02:00
Karel Miko
4d513a02fc
ARIA block cipher (RFC 5794)
2026-05-16 11:38:38 +02:00
Steffen Jaeckel
8b5af49b94
Merge pull request #754 from libtom/pr/shake128-256
...
RFC 8702: RSA-PSS-SHAKE128/256 and ECDSA-SHAKE128/256
2026-05-06 09:48:25 +02:00
Karel Miko
1e4d471a9f
RFC 8702: RSA-PSS-SHAKE128/256 and ECDSA-SHAKE128/256
2026-05-06 09:23:52 +02:00
Steffen Jaeckel
efd7f24f1a
Merge pull request #753 from libtom/pr/wycheproof-pk-stricter-checks
...
Stricter checks (RSA OAEP, X25519, X448) - based on wycheproof results
2026-05-05 07:42:48 +02:00
Karel Miko
2c375b3a3c
RSA OAEP - reject ciphertext values 0 and 1
2026-05-05 07:42:20 +02:00
Karel Miko
71f45fedbc
x25519/x448 - reject all-zero shared secrets
2026-05-05 07:40:06 +02:00
Steffen Jaeckel
efad039f19
Merge pull request #751 from libtom/more-fixes-and-improvements
...
More fixes and improvements
2026-05-04 15:32:59 +02:00
Steffen Jaeckel
a724483a0b
Add gcm_hw_pmul_is_supported()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-04 10:47:11 +02:00
Steffen Jaeckel
c05b3088b4
Use __has_attribute() for target attribute.
...
... and bring aarch64/PMULL in similar shape as x86/PCLMUL.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-04 10:47:05 +02:00
Karel Miko
42489a16cb
fix basename(..) in demos
2026-05-04 10:44:57 +02:00
Steffen Jaeckel
9e446e665f
Better position to print this info.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-04 10:08:07 +02:00
Steffen Jaeckel
fdf0b60170
Replace some CI builds with a single build_options.sh run.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-04 10:08:07 +02:00
Steffen Jaeckel
078fd15f69
Apply V option to make clean
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-04 10:08:07 +02:00
Steffen Jaeckel
f940880a67
Create ENCRYPT_ONLY descriptors in amalgamated build.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-04 10:08:07 +02:00
Steffen Jaeckel
3520a0fcf5
Fix maybe-unitialized warnings.
...
Fixes: e20fff1f3d ("Add more TurboSHAKE unit tests.")
Fixes: 6832f3c106 ("Add KangarooTwelve XOF functions.")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-04 10:08:07 +02:00
Steffen Jaeckel
011d427196
Remove dirty hacks in SHA3.
...
Fixes: 6832f3c106 ("Add KangarooTwelve XOF functions.")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-04 10:08:07 +02:00
Steffen Jaeckel
001fa107d1
Some minor fixes detected in AMALGAMATED builds.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-04 10:08:07 +02:00
Marek Knápek
580be51806
Use LTC_UNUSED_PARAM().
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-04 10:08:07 +02:00
Steffen Jaeckel
07cab77569
Test aesgcm demo.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-04 10:08:07 +02:00
Steffen Jaeckel
7fb003f1a2
Slightly improve timing demo.
...
* 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>
2026-05-04 10:08:07 +02:00
Steffen Jaeckel
ccbbb797f0
Fix indentation.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-03 11:11:39 +02:00
Steffen Jaeckel
229f540c48
Don't print warning in case LTC_NO_TEST is defined.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-03 11:11:39 +02:00
Steffen Jaeckel
0834f876cd
Split up ec25519/448 tests.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-03 11:11:39 +02:00
Steffen Jaeckel
811b1a6c14
Introduce LTC_NOP_TEST()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-05-03 11:11:39 +02:00
Steffen Jaeckel
45f95768da
Merge pull request #747 from libtom/pr/wycheproof-padding_depad
...
padding_depad - reject zero-length input (except for LTC_PAD_ZERO)
2026-04-30 11:42:08 +02:00
Steffen Jaeckel
180ffcdd65
Merge pull request #748 from libtom/pr/wycheproof-ecdh
...
ECC failing wycheproof tests
2026-04-30 11:41:18 +02:00
Karel Miko
e312fffaf2
fix ECC failing wycheproof tests
2026-04-30 11:41:04 +02:00
Karel Miko
7c0e52114e
ecc - failing wycheproof tests
2026-04-30 11:41:04 +02:00
Steffen Jaeckel
2317c13d62
Merge pull request #749 from libtom/pr/wycheproof-ed448
...
Ed448/X448 failing wycheproof tests
2026-04-30 08:46:24 +02:00
Karel Miko
176c4827fc
fix Ed448/X448 failing wycheproof tests
2026-04-30 08:46:13 +02:00
Karel Miko
8dd6ecfd20
ed448/x448 - failing wycheproof tests
2026-04-30 08:46:13 +02:00
Steffen Jaeckel
284129706a
Merge pull request #746 from libtom/pr/wycheproof-frp256v1
...
add FRP256v1 - French governmental ECC curve
2026-04-30 08:45:07 +02:00
Karel Miko
8a1b70a040
add FRP256v1 (French governmental ECC curve referenced in wycheproof test suite)
2026-04-30 08:44:46 +02:00
Steffen Jaeckel
888307876a
Merge pull request #750 from libtom/pr/wycheproof-decode_bit_string
...
wycheproof - fix failing ASN.1 BIT STRING related test
2026-04-30 08:43:45 +02:00
Karel Miko
577f2bc155
fix failing wycheproof test (ecdh_brainpoolP224r1_test.json tcId=787) ASN.1 BIT STRING related
2026-04-29 20:07:43 +02:00
Karel Miko
8ea53b4eaf
padding_depad - reject zero-length input (except for LTC_PAD_ZERO)
2026-04-29 14:33:20 +02:00
Steffen Jaeckel
6e699f964d
Merge pull request #410 from libtom/pr/fix-LTC_MECC_FP
...
fix LTC_MECC_FP
2026-04-29 10:56:18 +02:00
Steffen Jaeckel
9e1c6174fc
Add CI jobs with ECC FP enabled.
...
We replace the PTHREAD job with `ECC_FP+PTHREAD` since PTHREAD is only
relevant for ECC_FP and the PRNG's.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-29 10:53:40 +02:00
Steffen Jaeckel
576258b5fc
Fix ECC FP API.
...
We have to return an error code when working with the mutex API.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-29 10:53:40 +02:00
Steffen Jaeckel
1f28017b10
Fix typo
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-29 10:53:40 +02:00
Steffen Jaeckel
22586373c3
Fix potential unsigned underflow.
...
Running the `timing` demo with `LTC_MECC_FP` enabled gave a segfault,
which Valgrind narrowed down to
```
==135594== Invalid read of size 1
==135594== at 0x49298C: ss_accel_fp_mul2add (ltc_ecc_fp_mulmod.c:1007)
==135594== by 0x4931C1: ltc_ecc_fp_mul2add (ltc_ecc_fp_mulmod.c:1192)
==135594== by 0x41C1B2: ecc_verify_hash_internal (ecc_verify_hash_internal.c:114)
==135594== by 0x41C830: ecc_verify_hash_rfc7518_internal (ecc_verify_hash_rfc7518.c:35)
==135594== by 0x40340F: time_ecc (timing.c:1031)
==135594== by 0x402894: main (timing.c:1621)
==135594== Address 0x20feffeb2f is not stack'd, malloc'd or (recently) free'd
```
The origin being `ltc_mp_unsigned_bin_size(tkb)` returning 0, so y is -1,
but as an unsigned type that's no fun.
Fixed by making y a signed type.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-29 10:53:40 +02:00
Karel Miko
6affa8b99f
fix LTC_MECC_FP
2026-04-29 10:53:40 +02:00
Steffen Jaeckel
0a46eb2e5c
Merge pull request #740 from MarekKnapek/738
...
Fix for issue #738 .
2026-04-27 23:26:19 +02:00
Marek Knápek
44d111e755
Fix for issue #738 .
...
Closes : libtom/libtomcrypt#738
2026-04-27 23:25:14 +02:00
Steffen Jaeckel
d062d0e31f
Merge pull request #446 from libtom/pr/wycheproof-fail-changed-seq-tag
...
Wycheproof failing ECC tests
2026-04-27 14:23:07 +02:00
Karel Miko
66a2e73eb8
fix for issue #116
2026-04-27 14:19:59 +02:00
Karel Miko
8e9b1983af
fix ecc_projective_add_point + ecc_projective_dbl_point
2026-04-27 14:19:59 +02:00
Steffen Jaeckel
689b57755b
Fix cases where the points are equal.
...
In the case where `(P.x,P.y) == (Q.x,Q.y)` in affine coordinates, which
shows itself as either of the two being 0 after the add, we have
to double instead of add.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-27 14:19:59 +02:00
Steffen Jaeckel
b67f4397f4
Ensure that stat is initialized.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-27 14:19:59 +02:00
Steffen Jaeckel
9fa2f16ddc
Fix length-related wycheproof testcases
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-27 14:19:59 +02:00
Karel Miko
1d55aca785
failing wycheproof tests
2026-04-27 14:19:59 +02:00
Steffen Jaeckel
7d0d0799ce
Merge pull request #744 from libtom/fix-743
...
Fix 743
2026-04-27 14:16:54 +02:00
tynus3
1bb1e6172c
Fix off-by-one heap BOF.
...
Fixes: 1b3a757345 ("add ASN.1-identifier functions")
Closes : libtom/libtomcrypt#743
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-27 12:56:58 +02:00
Steffen Jaeckel
876460e7b6
Add testcases.
...
Link: libtom/libtomcrypt#743
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-27 12:56:58 +02:00
Steffen Jaeckel
143679efce
Merge pull request #741 from libtom/pr/rsa-import-failure
...
fix RSA import
2026-04-24 18:34:59 +02:00
Steffen Jaeckel
55bf39c50e
Also add the failing key to the test corpus.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-24 18:32:50 +02:00
Karel Miko
9f56c5803e
fix RSA import
2026-04-24 16:49:08 +02:00
Steffen Jaeckel
0971e458ba
Merge pull request #722 from libtom/pr/ed448-x448-attempt3
...
Ed448 + X448
2026-04-24 13:14:56 +02:00
Karel Miko
e0599e2b3a
Update makefiles
2026-04-24 11:50:39 +02:00
Karel Miko
076a11037a
Ed448 + X448
2026-04-24 11:49:23 +02:00
Steffen Jaeckel
c80285ba04
Merge pull request #725 from libtom/remove-ocb-v1
...
Remove OCB v1
2026-04-24 10:49:18 +02:00
Steffen Jaeckel
b6d4e6384e
Update makefiles
2026-04-24 10:45:27 +02:00
Steffen Jaeckel
800e5ce319
Remove OCB v1.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-24 10:45:24 +02:00
Steffen Jaeckel
f5438b298d
Deprecate OCB v1.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-24 09:45:26 +02:00
Steffen Jaeckel
8c82c8786b
Update OCB docs regarding patents.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-24 09:45:26 +02:00
Steffen Jaeckel
2be5cceb84
Merge pull request #729 from libtom/pr/xchacha20-xchacha20poly130
...
XChaCha20 / XChaCha20-Poly1305
2026-04-24 09:44:28 +02:00
Karel Miko
b0a1804d50
Update makefiles
2026-04-24 09:41:08 +02:00
Karel Miko
0e4c5aff7e
XChaCha20 / XChaCha20-Poly1305
2026-04-24 09:41:08 +02:00
Steffen Jaeckel
c53dfcc6df
Merge pull request #739 from libtom/pr/wycheproof-ed25519
...
Wycheproof Ed25519 test vectors + fix
2026-04-24 09:36:21 +02:00
Karel Miko
0f37c60fd7
Wycheproof Ed25519 test vectors + fix
2026-04-24 09:36:09 +02:00
Steffen Jaeckel
14d9bd0f82
Merge pull request #736 from libtom/pr/gcm-freebsd
...
GCM + FreeBSD + HWCAP_PMULL
2026-04-24 09:35:00 +02:00
Karel Miko
e63dca1277
GCM + FreeBSD + HWCAP_PMULL
2026-04-24 09:34:50 +02:00
Steffen Jaeckel
cfb3ba8339
Merge pull request #726 from libtom/cleanup-and-fixes
...
Cleanup and fixes
2026-04-23 12:27:16 +02:00
Steffen Jaeckel
760d09031e
Add Project Wycheproof testvectors for SIV.
...
Gemini proposed this to convert
```
import json
import requests
def to_c_hex(hex_str):
if not hex_str: return "NULL"
bytes_list = [f"0x{hex_str[i:i+2]}" for i in range(0, len(hex_str), 2)]
return "{" + ",".join(bytes_list) + "}"
url = "https://raw.githubusercontent.com/C2SP/wycheproof/main/testvectors_v1/aes_siv_cmac_test.json "
data = requests.get(url).json()
print("#include <stdint.h>\n#include <stddef.h>\n")
print("typedef struct { int tcId; const char* comment; uint8_t key[64]; size_t keyLen; const uint8_t* aad; size_t aadLen; const uint8_t* msg; size_t msgLen; const uint8_t* ct; size_t ctLen; const char* result; } aes_siv_test_case;\n")
for group in data['testGroups']:
for test in group['tests']:
tid = test['tcId']
if test['aad']: print(f"static const uint8_t aad_{tid}[] = {to_c_hex(test['aad'])};")
if test['msg']: print(f"static const uint8_t msg_{tid}[] = {to_c_hex(test['msg'])};")
if test['ct']: print(f"static const uint8_t ct_{tid}[] = {to_c_hex(test['ct'])};")
print("\nstatic const aes_siv_test_case aes_siv_tests[] = {")
for group in data['testGroups']:
for test in group['tests']:
tid = test['tcId']
key_hex = to_c_hex(test['key'])
aad_ptr = f"aad_{tid}" if test['aad'] else "NULL"
msg_ptr = f"msg_{tid}" if test['msg'] else "NULL"
ct_ptr = f"ct_{tid}" if test['ct'] else "NULL"
print(f" {{ {tid}, \"{test['comment']}\", {key_hex}, {len(test['key'])//2}, {aad_ptr}, {len(test['aad'])//2}, {msg_ptr}, {len(test['msg'])//2}, {ct_ptr}, {len(test['ct'])//2}, \"{test['result']}\" }},")
print("};")
```
I manually modified the result type to be an enum.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 10:30:32 +02:00
Steffen Jaeckel
098e0e3030
Explicitly use padding type.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 10:30:32 +02:00
Steffen Jaeckel
72642a7e8c
Make depadding better against timing attacks.
...
Fixes: 82482119df ("add padding module")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 10:30:27 +02:00
Steffen Jaeckel
f700888231
Accept zero-length data in CTR mode.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 10:30:27 +02:00
Steffen Jaeckel
b8c5ea8f18
Accept zero-length data in OMAC.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 10:30:27 +02:00
Steffen Jaeckel
5f4287aced
Fix SIV.
...
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>
2026-04-23 10:29:48 +02:00
Steffen Jaeckel
5c7e0e9fb1
Allow pt as NULL if there's nothing to encrypt.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 09:13:02 +02:00
Steffen Jaeckel
57b92e7351
Add a sentence about the origins of the CHC hash.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 09:13:02 +02:00
Steffen Jaeckel
d7c650d398
Update PR template.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 09:13:02 +02:00
Steffen Jaeckel
18cfd0f87a
Suppress warnings emitted by Clang.
...
Fixes: 874e095a19 ("SHA-256 & SHA-224 x86")
Fixes: 7ac05df902 ("Add x86-optimized SHA1.")
Fixes: 46e0137e55 ("Optimize gcm_gf_mult using PCLMULQDQ and PMULL")
Fixes: 31c7f891aa ("add support for AES-NI instructions")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 09:13:02 +02:00
Steffen Jaeckel
fe7bfb053a
Branch once, not on each iteration.
...
Even though the branch predictor should get this, it's unnecessary.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 09:13:02 +02:00
Steffen Jaeckel
6be6de1ffa
Replace int* recid hack in ECC.
...
Link: libtom/libtomcrypt#724
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 09:13:02 +02:00
Steffen Jaeckel
233f226108
Fix some ifdefs, include guards and a function call.
...
Fixes: 7ac05df902 ("Add x86-optimized SHA1.")
Fixes: 874e095a19 ("SHA-256 & SHA-224 x86")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 09:13:02 +02:00
Steffen Jaeckel
e5df4f7ce8
Fix build with -DLTC_MINIMAL.
...
Fixes: 661109f660 ("re-factor modes to use internal ECB implementation")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 09:13:02 +02:00
Steffen Jaeckel
e2544d4071
Further improve timing demo.
...
Filtering is now possible for all classes besides public key crypto.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 09:13:02 +02:00
Steffen Jaeckel
661dad10c7
Make HW-accel checkers always available.
...
Since the SHA-NI checker does the same for all three versions, we only have
to make one version public. This also now enables explicit testing of the
SHA-NI blocks.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 09:13:02 +02:00
Steffen Jaeckel
ec3804c452
Use s_x86_cpuid() in s_{aesni,pclmul}_is_supported().
...
Hopefully at one point we can get rid of its duplication. Why again don't
we use inline functions as they should be used?
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 09:13:02 +02:00
Steffen Jaeckel
e3bf539e5d
Clean-up some defines.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 09:13:02 +02:00
Steffen Jaeckel
4bdd0480f7
Introduce LTC_NO_ACCEL.
...
Related-to: libtom/libtomcrypt#727
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-23 09:13:02 +02:00
Steffen Jaeckel
a8236250a9
Merge pull request #737 from libtom/pr/sha3-missing-ltc_test
...
couple of missing: if defined(LTC_TEST)
2026-04-23 08:55:41 +02:00
Karel Miko
854749e2f4
couple of missing: if defined(LTC_TEST)
2026-04-23 08:16:12 +02:00
Steffen Jaeckel
ff52a70038
Merge pull request #734 from libtom/pr/fix-unused-parameter
...
fix unused-parameter warning
2026-04-22 14:41:44 +02:00
Karel Miko
a29e328b07
fix unused-parameter warning
2026-04-22 14:41:34 +02:00
Steffen Jaeckel
463431edc2
Merge pull request #735 from libtom/pr/hmac-zero-key
...
patch HMAC to accept zero-length keys and remove the scrypt workaround
2026-04-22 14:40:45 +02:00
Karel Miko
557e9e2678
patch HMAC to accept zero-length keys and remove the scrypt workaround
2026-04-21 23:35:10 +02:00
Steffen Jaeckel
2e441a17df
Merge pull request #717 from MarekKnapek/SHA-1x86
...
SHA-1, SHA-224 & SHA-256 with x86 instructions
2026-04-15 17:27:26 +02:00
Steffen Jaeckel
070d613d26
Update makefiles
2026-04-15 15:22:32 +02:00
Marek Knápek
874e095a19
SHA-256 & SHA-224 x86
2026-04-15 15:22:25 +02:00
Marek Knápek
7ac05df902
Add x86-optimized SHA1.
2026-04-15 15:20:28 +02:00
Steffen Jaeckel
68aae28a9d
Merge pull request #706 from libtom/new-rsa-api
...
New RSA API
2026-04-15 12:27:08 +02:00
Karel Miko
fa26d13016
RSA: update documentation (crypt.tex) to reflect the latest changes
2026-04-15 11:12:30 +02:00
Karel Miko
7ab625c090
RSA: fix demos/timing.c
2026-04-15 11:12:30 +02:00
Karel Miko
21d100d862
RSA: make rsa_decode_parameters work with rsa_key instead of ltc_rsa_parameters
2026-04-15 11:12:30 +02:00
Karel Miko
80de9b088b
RSA: cosmetics - consistency tomcrypt_pk.h vs implementation files
2026-04-15 11:12:30 +02:00
Karel Miko
32ab39fb42
RSA: comment typo
2026-04-15 11:12:30 +02:00
Karel Miko
e4d3bd2fa5
RSA: replace hash_alg + mgf1_hash_alg with hash_idx + mgf1_hash_idx
2026-04-15 11:12:30 +02:00
Karel Miko
7fa7c2ad51
RSA: remove unnecessary #define LTC_DEPRECATED(x)
2026-04-15 11:12:30 +02:00
Karel Miko
557cb62b06
RSA: use consistently ltc_rsa_op_checked (+ cosmetic renaming op_check >> op_checked)
2026-04-15 11:12:30 +02:00
Karel Miko
c1b3281433
RSA: no more dual semantics of pss_oaep (removed from ltc_rsa_parameters; now lives on rsa_key where it belongs)
2026-04-15 11:12:30 +02:00
Karel Miko
d2829aa10f
RSA: PSS + all encryption needs a PRNG
2026-04-15 11:12:30 +02:00
Steffen Jaeckel
66e677aedd
Introduce new RSA API.
...
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>
2026-04-15 11:12:30 +02:00
Steffen Jaeckel
208ee2be4e
Refactor SubjectPublicKeyInfo import
...
Slightly minimize both space and time when importing a
SubjectPublicKeyInfo. Time for ECC keys stays the same.
Those tests were done with X.509 support already available, but later these
commits were split up to be independent of the X.509 feature.
Running the entire set of pem files through `x509_verify` via [0]
resp. the timing app via [1] resulted in the following data:
Before this patch:
[0]
```
==1031519== HEAP SUMMARY:
==1031519== in use at exit: 0 bytes in 0 blocks
==1031519== total heap usage: 424,057 allocs, 424,057 frees, 73,527,730 bytes allocated
```
[1]
```
x509 cert-rsa-pss.pem : 50021 cycles
x509 LTC_CA.pem : 10335 cycles
x509 LTC_S0.pem : 47284 cycles
x509 LTC_SS0.pem : 36687 cycles
x509 secp384r1.pem : 1985416 cycles
x509 secp521r1.pem : 3287773 cycles
x509 LTC_SSS0.pem : 25086 cycles
x509 secp224r1.pem : 775807 cycles
```
After this patch:
[0]
```
==1043548== HEAP SUMMARY:
==1043548== in use at exit: 0 bytes in 0 blocks
==1043548== total heap usage: 337,244 allocs, 337,244 frees, 65,047,463 bytes allocated
```
[1]
```
x509 cert-rsa-pss.pem : 32568 cycles
x509 LTC_CA.pem : 5478 cycles
x509 LTC_S0.pem : 36093 cycles
x509 LTC_SS0.pem : 23351 cycles
x509 secp384r1.pem : 1984030 cycles
x509 secp521r1.pem : 3303396 cycles
x509 LTC_SSS0.pem : 13220 cycles
x509 secp224r1.pem : 781534 cycles
```
[0] find tests/x509 -name '*.pem' -exec valgrind --leak-check=full --show-leak-kinds=all './x509_verify' {} \+
[1] ./timing x509
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-15 11:12:30 +02:00
Steffen Jaeckel
d1ab64ec25
Add support for RSA-PSS keys
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-15 11:12:30 +02:00
Steffen Jaeckel
56f0e118dd
Add support for separate MGF1 hashes
...
Update PKCS#1-PSS and RSA APIs that allow passing a separate hash index for
the MGF1 hash.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-15 11:12:30 +02:00
Steffen Jaeckel
33d8f8464d
Merge pull request #723 from cyanogilvie/fix/ocb-decrypt-aliasing
...
Fix s_ocb_done aliasing bug in decrypt path
2026-04-15 11:10:32 +02:00
Cyan Ogilvie
8c68d99221
Fix s_ocb_done aliasing bug in decrypt path
...
In decrypt mode (mode==1), s_ocb_done was XORing `ct[x]` into the
checksum before writing the output. The function's parameter names are
misleading (the header comment notes pt/ct really mean in/out), so in
decrypt mode `ct` is the not-yet-written *output* buffer and `pt` is
the *input* ciphertext. Reading from `ct` only worked when callers
aliased the input and output buffers (in-place decryption), as the
self-test does. Callers passing distinct buffers got CRYPT_OK with
stat=0 -- correct plaintext but failed tag verification.
Fix by reading from `pt[x]` (the input). Add a separate-buffer
regression case to ocb_test that runs against every existing test
vector and was confirmed to fail without the fix.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 19:32:17 -03:00
Steffen Jaeckel
e5bfb94f63
Merge pull request #719 from libtom/pr/scrypt-rfc7914
...
The scrypt Password-Based Key Derivation Function (RFC 7914)
2026-04-14 16:17:28 +02:00
Karel Miko
3aed12c410
The scrypt Password-Based Key Derivation Function (RFC 7914)
2026-04-14 13:59:38 +02:00
Steffen Jaeckel
94287f0480
Merge pull request #721 from cyanogilvie/fix/pclmul-cache-init-msvc
...
Fix s_pclmul_is_supported() cache flag on MSVC
2026-04-14 13:36:27 +02:00
Cyan Ogilvie
baac704391
Fix s_pclmul_is_supported() cache flag on MSVC
...
Move initialized=1 out of the #else branch so that on MSVC it doesn't
call __cpuid every time.
2026-04-14 07:45:41 -03:00
Steffen Jaeckel
cf29490bfc
Introduce LTC_ALIGNED_BUF_SIZE(). [skip ci]
...
Since there's absolutely no way to ensure that a struct is somehow
aligned -- all those compile-time mechanism are best-effort and no
guarantee -- we align the necessary buffers at run-time.
AES-NI already introduced that, let's improve a bit upon its usage.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-14 09:55:43 +02:00
Steffen Jaeckel
14352f5036
Improve timing demo a bit. [skip ci]
...
Allow more classes to be filtered.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-14 09:17:11 +02:00
Karel Miko
66925c259c
Fix helper.pl. [skip ci]
...
Fix matching of other uses of a descriptor type, besides their declaration.
2026-04-13 19:48:05 +02:00
Steffen Jaeckel
25e93e39cf
Add uninstall_hooks make command. [skip ci]
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-13 14:45:12 +02:00
Steffen Jaeckel
5abd33ea32
Merge pull request #718 from libtom/pr/argon2-rfc9106
...
Argon2 password hashing function (RFC 9106)
2026-04-13 10:47:50 +02:00
Steffen Jaeckel
c68b9c0b3f
Minor changes of argon2 implementation.
...
* We continue using `LTC_ARGCHK()` until we've decided on something else.
* Call the enum/struct the same as the typedef.
* Some other small adjustments/fixes.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-12 16:06:53 +02:00
Karel Miko
458b392d01
Argon2 password hashing function (RFC 9106)
2026-04-12 14:48:32 +02:00
Steffen Jaeckel
3223b87588
Merge pull request #709 from MarekKnapek/sha-stack
...
Smaller stack usage for SHA-1, SHA-256 and SHA-512.
2026-04-09 17:04:26 +02:00
Steffen Jaeckel
cc53195945
Update docs.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-09 15:40:07 +02:00
Steffen Jaeckel
11929885a4
Basic algo self-tests should be run before the ones using them.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-09 15:40:07 +02:00
Steffen Jaeckel
77afa82d14
Add option LTC_SMALL_STACK.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-09 15:40:07 +02:00
Steffen Jaeckel
a9cd3cd0ff
Slightly improve timing demo.
...
* Add the option to only run for a subset of algos.
* Improve `hash` to show something meaningful.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-09 08:29:50 +02:00
Marek Knápek
17cbd2be0a
Smaller stack usage for SHA-1, SHA-256 and SHA-512.
2026-04-09 08:29:50 +02:00
Steffen Jaeckel
d0e09092f9
Re-format gitignore. [skip ci]
...
I wasn't aware that the gitignore file had DOS line endings. Changed that
to UNIX line endings.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-09 08:29:38 +02:00
Steffen Jaeckel
ecc36868a9
Merge pull request #714 from sjlombardo/develop
...
Optimize gcm_gf_mult using PCLMULQDQ and PMULL
2026-04-07 18:31:43 +02:00
Steffen Jaeckel
93eed8d3fa
Add CMake CI testrun w/o ASM
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-07 16:51:37 +02:00
Stephen Lombardo
46e0137e55
Optimize gcm_gf_mult using PCLMULQDQ and PMULL
...
GCM table setup disproportionately hurts LTC performance
with small messages. Disabling LTC_GCM_TABLES helps for
small payloads but hurts large ones.
This implements hardware carry-less multiplication for GCM that
performs well for both cases using PCLMULQDQ on x86/x86_64 and
PMULL on AArch64.
There are no public API changes.
These features can be disabled with LTC_NO_GCM_PCLMUL,
LTC_NO_GCM_PMULL, or LTC_NO_ASM. LTC_GCM_TABLES is disabled
automatically when no opt-out macro is set.
2026-04-07 16:51:37 +02:00
Steffen Jaeckel
6ad2ce97a4
Merge pull request #715 from libtom/add-cmake-tests
...
Add CMake & arm64 tests to CI
2026-04-07 15:45:09 +02:00
Steffen Jaeckel
0572f9564f
Update nick-fields/retry GH action
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-07 12:40:22 +02:00
Steffen Jaeckel
97be312324
Add CMake tests to CI
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-04-07 12:19:33 +02:00
Steffen Jaeckel
63af5f6dc1
Update docs of ecc_free().
...
This fixes #710
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2026-02-04 11:30:24 +01:00
Steffen Jaeckel
9a13375d47
Merge pull request #708 from MarekKnapek/KangarooTwelve
...
KangarooTwelve
2025-11-28 22:27:59 +01:00
Marek Knápek
6832f3c106
Add KangarooTwelve XOF functions.
...
KangarooTwelve 128bits and KangarooTwelve 256 bits.
https://keccak.team/files/TurboSHAKE.pdf
https://www.rfc-editor.org/rfc/rfc9861.txt
https://datatracker.ietf.org/doc/html/rfc9861
2025-11-28 19:05:31 +01:00
Marek Knápek
189f9ccdf0
LTC_TURBO_SHAKE requires LTC_SHA3
2025-11-28 19:05:31 +01:00
Marek Knápek
e20fff1f3d
Add more TurboSHAKE unit tests.
2025-11-28 19:05:31 +01:00
Marek Knápek
d31ca86251
Introduce the concept of "domain" for SHAKE XOF.
2025-11-27 14:28:00 +01:00
Steffen Jaeckel
4db24a7d08
Merge pull request #692 from MarekKnapek/turboshake
...
Add TurboSHAKE XOF functions.
2025-11-26 11:08:29 +01:00
Steffen Jaeckel
2c487a2e4b
Update docs.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-25 10:09:14 +01:00
Steffen Jaeckel
e33128e18c
Fix LTC_COMPARE_TESTVECTOR()
...
Fixes: 6daff83d ("Deprecate `compare_testvector()`.")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-25 09:28:20 +01:00
Marek Knápek
709572e22e
Add TurboSHAKE XOF functions.
...
TurboSHAKE128 and TurboSHAKE256.
https://datatracker.ietf.org/doc/html/rfc9861
https://www.rfc-editor.org/rfc/rfc9861.txt
https://keccak.team/files/TurboSHAKE.pdf
https://github.com/libtom/libtomcrypt/issues/691
2025-11-25 09:22:35 +01:00
Steffen Jaeckel
34b6ad9a2e
Merge pull request #707 from libtom/improve-tests
...
Improve tests
2025-11-24 16:15:18 +01:00
Steffen Jaeckel
dda1c7eedf
Re-factor modes_test().
...
... also funny that no static analyzer complained about `ret` being
assigned, but never read ...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-24 14:58:13 +01:00
Steffen Jaeckel
6daff83d82
Deprecate compare_testvector().
...
This should never have been public API.
Also introduce a `LTC_COMPARE_TESTVECTOR()` macro to be used within the
library, which doesn't exit, but only returns an error.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-24 14:58:13 +01:00
Steffen Jaeckel
03881e4abc
Merge pull request #699 from libtom/some-improvements
...
Some improvements
2025-11-19 00:22:08 +01:00
Steffen Jaeckel
369650ccd3
Update makefiles
2025-11-18 23:20:01 +01:00
Steffen Jaeckel
e2918971fa
Re-order PEM headers to prepare for X.509 APIs
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:20:01 +01:00
Steffen Jaeckel
ea672df7a3
Put realloc logic into pem_read()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:20:01 +01:00
Steffen Jaeckel
9abf12305a
Add SubjectPublicKeyInfo support to dsa_import()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:20:01 +01:00
Steffen Jaeckel
d77afd6a68
Use rsa_init() to initialize an rsa_key
...
(and you should do that too)
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:03:42 +01:00
Steffen Jaeckel
c9b609a0b7
Extend der_flexi_sequence_cmp()
...
To be able to do a bit more, add an optional handler callback function.
Additional to that, also make it possible to mark elements as optional.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:03:42 +01:00
Steffen Jaeckel
7e78899af6
Re-factor s_import_pkcs8()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:03:42 +01:00
Steffen Jaeckel
002a6c8330
Export static function as x509_import_spki()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:03:42 +01:00
Steffen Jaeckel
06b7a7e416
Extract static function as x509_get_pka()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 23:03:41 +01:00
Steffen Jaeckel
eda303df0f
Merge pull request #705 from libtom/new-ecc-api
...
New ECC API
2025-11-18 21:41:41 +01:00
Steffen Jaeckel
7f73f83853
Update docs
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 18:53:26 +01:00
Steffen Jaeckel
a642e69afb
Update makefiles
2025-11-18 18:53:26 +01:00
Steffen Jaeckel
b46c695505
Add tests for deprecated APIs
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 18:53:26 +01:00
Steffen Jaeckel
35a4a5fc1b
Move RFC6979 hash alg to a new ecc signature options struct
...
Fixes #700
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-18 18:53:26 +01:00
Steffen Jaeckel
c421e570c6
Merge pull request #704 from libtom/minor-improvements
...
Minor improvements
2025-11-11 09:04:01 +01:00
Steffen Jaeckel
91757cf54d
Bump required CMake version & DRY
...
* 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>
2025-11-03 13:57:15 +01:00
Steffen Jaeckel
d8a62f3367
Create table of supported ECC curves programmatically
...
Related to #349
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:56:58 +01:00
Steffen Jaeckel
47162b9609
Add demos/der_print_flexi.c
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:56:42 +01:00
Steffen Jaeckel
e2d0935792
Add SHA3-HMAC support to PKCS#8
...
This also enables testing of PKCS#8 keys using modern hash algos with
LTC_EASY.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:52:38 +01:00
Steffen Jaeckel
934bd7e0fe
Remove init_{GMP,LTM,TFM}()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:52:34 +01:00
Steffen Jaeckel
e0f49a924f
Use LTC_TMPVAR() in more Macros.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:52:32 +01:00
Steffen Jaeckel
78e2675bfe
Make store_test() a bit more aggressive.
...
With `LTC_FAST` enabled test to read from different offsets.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:52:29 +01:00
Steffen Jaeckel
6f085d349e
Allow disabling of CLZL and CTZL builtins.
...
Fixes: fe8e4bf5 ("Use more builtin functions if available")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:52:26 +01:00
Steffen Jaeckel
3c906ab3da
Enable AES-NI per default on x86_64.
...
This can be disabled by defining `LTC_NO_AES_NI`.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:52:24 +01:00
Steffen Jaeckel
1924f43503
Fix warning uncovered by scan-build.
...
```
src/ciphers/aes/aesni.c:150:7: warning: Value stored to 'temp' is never read [deadcode.DeadStores]
150 | temp = temp_invert(rk);
| ^ ~~~~~~~~~~~~~~~
1 warning generated.
```
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:52:20 +01:00
Steffen Jaeckel
5dbdaff16b
Minor fixes
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:52:16 +01:00
Steffen Jaeckel
ac291e8bdd
Fix hmac_memory_multi() invocation
...
It expects a pair of type `(unsigned char*,unsigned long)` and not
`(unsigned char*,unsigned int)`.
Fixes: 46fa363f ("Finish up RFC6979 ECDSA keygen")
Reported-via: https://github.com/libtom/libtomcrypt/pull/699#issuecomment-3414862539 ff.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:52:06 +01:00
Steffen Jaeckel
c9259ffa31
Allow deprecation warnings to be disabled
...
One can now define them on a per-case basis to disable them.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:51:58 +01:00
Nicolas Mora
95a492a184
Make build of docs reproducible
2025-11-03 13:51:48 +01:00
Steffen Jaeckel
0c15edb22c
Don't abort() in "release" builds
...
Change the default behavior of `LTC_ARGCHK()` for Release, resp.
Release+Shared Library builds to be non-fatal.
This closes #458
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:51:45 +01:00
Steffen Jaeckel
5e0d801c1d
Clarify MPI providers a bit further
...
This closes #354
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:51:37 +01:00
Steffen Jaeckel
52b93bf3d1
Revert "cmake: add ccache support"
...
This reverts commit 93f5348c47 .
You should use the CMake flag `-DCMAKE_CXX_COMPILER_LAUNCHER=ccache`
instead.
Sibling-to: https://github.com/libtom/libtommath/pull/577
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:51:29 +01:00
Steffen Jaeckel
c895dd990c
Improve readability of script and the logs it creates
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:50:16 +01:00
Steffen Jaeckel
dd6ef9cdc7
Correctly treat NULL in the parameters of a SubjectPublicKeyInfo
...
The NULL is optional.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:50:11 +01:00
Steffen Jaeckel
eb807b84d0
Don't use written parameter of macro directly
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:50:06 +01:00
Steffen Jaeckel
2d64fc45e0
Fix curve25519 in case sha512 is not available
...
Before this patch it silently didn't work, now it errors out.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:49:58 +01:00
Steffen Jaeckel
8001748cd1
Improve register_{cipher,hash,prng}()
...
Only go once through `X_descriptor[]` when calling `register_X()`
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:49:53 +01:00
Steffen Jaeckel
4c03415dea
Re-order hash registrations
...
... in order of likelihood of usage and/or strength.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:49:47 +01:00
Steffen Jaeckel
fc3af1e0ec
A BitString of length 0 can be only 3bytes long
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-11-03 13:49:30 +01:00
Steffen Jaeckel
a3cc5bf623
Update issue template according to the new way how GH wants it.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-10-31 09:49:37 +01:00
Steffen Jaeckel
b1fa61d594
Merge pull request #698 from enginelesscc/develop
...
Fix build of aesni on msvc
2025-10-06 10:23:13 +02:00
Steffen Jaeckel
4d84f53ee7
Let's see if AESNI makes a difference
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-10-04 16:19:15 +02:00
Steffen Jaeckel
0aef68af83
Lets try to build with AESNI support on MSVC
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-10-04 12:12:49 +02:00
Vivyy
89b37c3606
Fix build of aesni on msvc
2025-09-20 23:43:10 +02:00
Steffen Jaeckel
5edb54e522
Merge pull request #696 from libtom/some-improvements
...
Some improvements
2025-09-15 15:35:47 +02:00
Steffen Jaeckel
ae50082c0f
Only compute length of OID data once.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-13 12:04:42 +02:00
Steffen Jaeckel
ef1453d5ba
It should be static inline
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-13 12:04:38 +02:00
Steffen Jaeckel
a58de2e03d
Fix some scan-build warnings
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-13 12:04:38 +02:00
Steffen Jaeckel
f8c319ee6e
Update crypt_build_settings
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-13 12:04:38 +02:00
Steffen Jaeckel
fe8e4bf547
Use more builtin functions if available
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-13 12:04:38 +02:00
Steffen Jaeckel
1978245572
Update makefiles
2025-09-13 12:04:38 +02:00
Steffen Jaeckel
bb389e2c99
Make some DER helpers private
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-13 12:04:38 +02:00
Steffen Jaeckel
18b4e3f2ef
Handle long OID nodes.
...
This will behave differently on 32bit architectures, but since 32bit
is mostly dead and I don't see a way how to handle this w/o breaking
ABI&API, I guess we have to live with it.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-13 12:04:38 +02:00
Steffen Jaeckel
c00b006174
Make pem_read() ignore all junk before a real PEM header is found
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-12 18:25:09 +02:00
Steffen Jaeckel
78bb06c8d6
Minor cleanup
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-12 18:25:09 +02:00
Steffen Jaeckel
07d544c5d9
Add tests for & fix pk_oid API
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-12 18:25:09 +02:00
Steffen Jaeckel
fe32e7ea9d
Add LTC_ARRAY_SIZE() macro
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-06 15:00:00 +02:00
Steffen Jaeckel
8d44e48d46
Be less strict in register_all_hashes()
...
Allow using all hashes in case we didn't register our ciphers.
Nobody should really use CHC, so we shouldn't make it mandatory.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-06 15:00:00 +02:00
Steffen Jaeckel
19a5520936
Allow base16_encode() to re-use the input buffer as output
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-06 15:00:00 +02:00
Steffen Jaeckel
72b353f3dd
Workflow trigger filtering changed
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-06 15:00:00 +02:00
Steffen Jaeckel
6155a33e5f
Use COMPARE_TESTVECTOR() consistently
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-06 15:00:00 +02:00
Steffen Jaeckel
cb12f2e7d0
Clarify some test descriptions
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-06 15:00:00 +02:00
Steffen Jaeckel
6fe391956d
Fix/improve some install/uninstall make targets
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-06 15:00:00 +02:00
Steffen Jaeckel
87d51de391
Improve variable naming
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-06 14:59:59 +02:00
Steffen Jaeckel
563f0fb4f2
Merge pull request #524 from libtom/modes-use-ecb
...
Make all modes use the ECB mode API
2025-09-06 14:58:49 +02:00
Steffen Jaeckel
cd18fed7ba
fix scan-build warnings
2025-09-05 18:23:26 +02:00
Steffen Jaeckel
3c42b6a668
fix timing demo
2025-09-05 17:38:30 +02:00
Steffen Jaeckel
06adf5269f
refactor AEAD's and MAC's to use ECB API
2025-09-05 17:37:02 +02:00
Steffen Jaeckel
661109f660
re-factor modes to use internal ECB implementation
2025-09-05 17:37:02 +02:00
Steffen Jaeckel
23803626b6
Merge pull request #594 from orbea/shared
...
makefile.shared: Don't use libtool
2025-09-05 10:56:13 +02:00
orbea
d2f50cc16d
makefile.shared: Don't use libtool
...
Gentoo Bug: https://bugs.gentoo.org/777084
2025-09-04 20:59:48 +02:00
Steffen Jaeckel
60566ebe0e
Merge pull request #477 from rmw42/feature/rfc6979
...
Deterministic EcDSA according to RFC6979
2025-09-04 20:59:17 +02:00
Steffen Jaeckel
46fa363f2c
Finish up RFC6979 ECDSA keygen
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-04 17:36:30 +02:00
Steffen Jaeckel
d05119491b
Update makefiles
2025-09-04 17:36:30 +02:00
Russ Williams
d376af52ca
RFC6979: implementation, tests, docs
2025-09-04 17:36:30 +02:00
Steffen Jaeckel
f5a626f15f
Let's wait a bit longer before bailing out
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-09-04 17:36:11 +02:00
Steffen Jaeckel
d448df1938
Merge pull request #689 from momo5502/develop
...
Fix CMake configure on Windows
2025-05-06 08:19:25 +02:00
Steffen Jaeckel
aeccd41afc
Also run CMake build in Appveyor
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-05-05 21:17:57 +02:00
Maurice Heumann
5b93429053
Fix CMake configure on Windows
2025-05-03 10:10:40 +02:00
Steffen Jaeckel
3905c28913
Merge pull request #687 from UnknownDK/fix-flag-scopes
...
Fix PBES and OMAC flag scopes
2025-04-23 18:10:45 +02:00
Bjørn Højmose Grevenkop-Castenskiold
0672c6182f
Fix PBES and OMAC flag scopes
...
pbes_properties and omac_state are gatekept by LTC_PBES and LTC_OMAC
respectively. Therefore they should only be used within those scopes.
2025-04-11 20:01:28 +02:00
Steffen Jaeckel
a6b9aff7aa
Merge pull request #450 from libtom/pr/ecdsa-der-attempt1
...
Fix #449 (ECDSA forcing DER/ASN.1)
2025-03-02 12:31:08 +01:00
Steffen Jaeckel
46f33c6b5d
Update ecc_recover_key() docs.
...
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>
2025-03-02 12:09:24 +01:00
Steffen Jaeckel
3b7ad1b5d1
Improve ecc_recover_key()
...
It is already nearly independent of `LTC_DER`, so simply `#ifdef` that
code path instead of multiplying the APIs by the number of signature
formats.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-03-02 12:09:24 +01:00
Steffen Jaeckel
ecb5fdd997
Add testcase for Ethereum signatures.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-03-02 12:09:24 +01:00
Steffen Jaeckel
bdffc3d53e
Update docs.
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-03-02 12:09:24 +01:00
Steffen Jaeckel
47c721c164
Update doc formatting
...
* make PDF content copy&paste-able
* add new `\code{}` command
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-03-02 12:09:24 +01:00
Steffen Jaeckel
2e09d68712
Update makefiles
2025-03-02 12:09:24 +01:00
Steffen Jaeckel
161b3be130
There is also no private PEM API if it's disabled
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-03-02 12:09:24 +01:00
Steffen Jaeckel
77bc1a7737
allow compilation of ECC w/o DER
...
via e.g.
```
make -j9 EXTRALIBS="../libtommath/libtommath.a " \
CFLAGS="-DLTC_NOTHING -DLTC_MINIMAL -DLTC_MECC -DUSE_LTM \
-DLTM_DESC -I../libtommath"
```
2025-03-02 12:09:24 +01:00
Karel Miko
6561b37bac
refactor ecc_verify_hash_ex
2025-03-02 12:09:24 +01:00
Karel Miko
0ee3bb5786
refactor ecc_sign_hash_ex
2025-03-02 12:09:24 +01:00
Steffen Jaeckel
c996610ca6
Merge pull request #685 from paperchalice/quote
...
Quote header list when finding bcrypt
2025-03-02 11:42:59 +01:00
paperchalice
b508028b14
Quote header list when finding bcrypt
...
Found try compile source is incorrect, add quote to generate correct source file.
2025-03-01 19:49:54 +01:00
Steffen Jaeckel
5c73ba894e
Merge pull request #686 from libtom/retry-dependencies-install
...
Try to work around build failures
2025-03-01 19:49:39 +01:00
Steffen Jaeckel
e609a505ca
Try to work around build failures
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-03-01 11:52:51 +01:00
Steffen Jaeckel
d032686639
Merge pull request #596 from libtom/amalgamation
...
Amalgamation
2025-02-21 12:08:14 +01:00
Steffen Jaeckel
92aef0ade1
Include the tables into the amalgamation
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-02-20 14:43:07 +01:00
Steffen Jaeckel
22e71d755b
Fix return value.
...
Instead of wrongfully always returning OK, return the real error code.
This was uncovered by the amalgamation via the warning:
```
pre_gen/tomcrypt_amalgam.c: In function ‘der_decode_custom_type_ex’:
pre_gen/tomcrypt_amalgam.c:49820:10: warning: ‘*(unsigned int *)((char *)&ident + offsetof(ltc_asn1_list, type))’ may be used uninitialized [-Wmaybe-uninitialized]
49820 | if ((ident.type != root->type) ||
| ^
pre_gen/tomcrypt_amalgam.c:49780:18: note: ‘*(unsigned int *)((char *)&ident + offsetof(ltc_asn1_list, type))’ was declared here
49780 | ltc_asn1_list ident;
| ^~~~~
```
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-02-20 14:43:07 +01:00
Steffen Jaeckel
00f662da80
Fix compiler warning
...
```
pre_gen/tomcrypt_amalgam.c: In function ‘pkcs_1_oaep_encode’:
pre_gen/tomcrypt_amalgam.c:64485:18: warning: ‘DB’ may be used uninitialized [-Wmaybe-uninitialized]
64485 | if ((err = hash_memory(lparam_hash_used, DB, 0, DB, &x)) != CRYPT_OK) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pre_gen/tomcrypt_amalgam.c:22613:5: note: by argument 2 of type ‘const unsigned char *’ to ‘hash_memory’ declared here
22613 | int hash_memory(int hash, const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen)
| ^~~~~~~~~~~
```
Use `out` instead of `DB`, since `out` is `LTC_ARGCHK`'ed.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-02-20 14:43:07 +01:00
Steffen Jaeckel
647b340ec3
Use LTC_NULL with ssh_decode_sequence_multi()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-02-20 14:43:07 +01:00
Steffen Jaeckel
08b69be797
minor changes for amalgamation
...
* de-duplicate `struct oid_to_pbes`
* add makefile target
* add amalgamation to release
* fix `small` demo
* add header guards for `tomcrypt_private.h`
* update docs
* add CI job with amalgamated library
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-02-20 14:43:06 +01:00
Steffen Jaeckel
236477823a
prefix the MPI related macros with ltc_
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-02-20 14:41:50 +01:00
Steffen Jaeckel
3cc754610d
undef Macros after usage & rename duplicate symbols
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-02-20 14:41:50 +01:00
Steffen Jaeckel
ac2c11aa17
Merge pull request #683 from libtom/some-improvements
...
Some improvements
2025-02-20 14:41:11 +01:00
Richard Levitte
894f33b81c
Add contrib/libtomcrypt.cmake, and write about it in doc/crypt.tex
...
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
2025-02-18 21:27:38 +01:00
Steffen Jaeckel
cda7d42647
Improve ILP32 detection
...
This should fix https://github.com/DCIT/perl-CryptX/issues/117
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-02-17 15:12:53 +01:00
Steffen Jaeckel
b4d41d53bb
Ubuntu-20.04 is no longer
...
https://github.com/actions/runner-images/issues/11101
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-02-17 15:08:44 +01:00
Steffen Jaeckel
c93cc120f0
LTC_SOURCE ceased to exist
...
f55039bfeb removed all usage of
`LTC_SOURCE`, but I missed to remove it from the makefiles etc.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2025-02-17 15:05:01 +01:00
Steffen Jaeckel
54f0456559
Merge pull request #682 from paperchalice/cmake
...
Check BCryptGenRandom correctly
2025-01-29 17:13:55 +01:00
paperchalice
ae7f26ed44
Check BCryptGenRandom correctly
2025-01-29 19:05:43 +08:00
Steffen Jaeckel
427e0551c0
Merge pull request #680 from levitte/tomcrypt_private-stdarg
2025-01-21 09:35:06 +01:00
Richard Levitte
2fd160eae9
Have src/headers/tomcrypt_private.h include stdarg.h
...
This ensures that va_list, which is used in that file, gets properly
declared.
As a consequence, the following pattern in other files can be reduced:
#include "tomcrypt_private.h"
#include <stdarg.h>
Fixes #679
2025-01-21 07:18:45 +01:00
Steffen Jaeckel
2e9f2b5e44
Merge pull request #319 from libtom/add/SIV
...
Add SIV
2025-01-09 13:36:02 +01:00
Steffen Jaeckel
ad2696f24f
Update SIV a bit
...
* 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>
2025-01-01 17:05:36 +01:00
Steffen Jaeckel
8bdc093fae
Add omac_vprocess()
...
As a new private API.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-28 19:11:32 +01:00
Steffen Jaeckel
197be81918
Re-factor SIV and add siv_memory()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-19 16:17:34 +01:00
Steffen Jaeckel
f4df47b59b
Update makefiles
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-17 18:24:26 +01:00
Steffen Jaeckel
faa8cd71e5
add SIV
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-17 18:24:26 +01:00
Steffen Jaeckel
c900951dab
Fix c&p error [skip-ci]
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-17 18:24:16 +01:00
Steffen Jaeckel
a81dab9970
Merge pull request #678 from libtom/some-improvements
2024-12-11 18:24:46 +01:00
Steffen Jaeckel
f6e71dfced
Remove even more footers
...
Fixes 2400883060
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-11 12:10:02 +01:00
Steffen Jaeckel
87ff205c8b
Handle potential pkg-config failures
...
There are cases where we want to use an MPI provider, but the package is
not installed in the system, so `pkg-config` can't find it.
To solve this simply ignore the errors created and only print something
if the user asks us to by passing `V=1`.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-11 11:57:08 +01:00
Steffen Jaeckel
54a16fb672
There are no broken demos anymore
...
... at least at compile time.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-11 11:09:58 +01:00
Steffen Jaeckel
795e8e8cfe
Re-work some of the demos
...
* 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>
2024-12-11 11:09:58 +01:00
Steffen Jaeckel
d96605b4b9
Fix build on x32
...
* `CONSTPTR()` must be 32bit.
* `CRYPT_HASH_OVERFLOW` test operates on `unsigned long`, which is only
32bit wide on x32.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-11 11:09:58 +01:00
Steffen Jaeckel
e487f8400e
Introduce CRYPT_ERR_NUM and build-time check err_2_str[] size
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-11 11:09:58 +01:00
Steffen Jaeckel
507c66827f
Merge pull request #677 from libtom/some-improvements
...
Some improvements
2024-12-05 18:34:05 +01:00
Steffen Jaeckel
88dcebdbf5
Rework demos building and installation
...
* 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>
2024-12-05 17:23:12 +01:00
Steffen Jaeckel
a9bb1c1525
Use cmake-format to format CMake files
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-03 19:51:26 +01:00
Steffen Jaeckel
98415b8a38
Change ltcrypt back to crypt
...
This reverts 85dc39483f
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-03 19:51:22 +01:00
Steffen Jaeckel
9eef89c5a4
Cancel running GH action on update of PR branch
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-12-03 19:48:18 +01:00
Steffen Jaeckel
dc945f9697
Add LTC_PTHREAD to pkg-config file if enabled at build time
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-11-20 13:11:59 +01:00
Steffen Jaeckel
2400883060
Remove remaining footers
...
Fixes 24765c30c5
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-11-20 12:59:49 +01:00
Richard Levitte
6659f36ad6
Align demo/CMakeLists.txt a bit more with with makefile_include.mk
...
Now, they build the same executables.
2024-11-20 12:59:45 +01:00
Steffen Jaeckel
17642547e4
Merge pull request #676 from hughsie/hughsie/sbom
...
Add a SBOM file in CycloneDX format
2024-11-19 14:39:57 +01:00
Richard Hughes
55441f12d2
Add a SBOM file in CycloneDX format
...
Improve supply chain security by including a SBOM file with substituted values.
This will be used to construct a composite platform SBOM.
Signed-off-by: Richard Hughes <richard@hughsie.com>
2024-11-19 12:28:13 +00:00
Steffen Jaeckel
5d2b15472f
Merge pull request #667 from levitte/constify-math
...
Constify math descriptors
2024-11-09 09:56:08 +01:00
Steffen Jaeckel
1d07689581
Remove unnecessary casts in the tests
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-11-08 17:15:39 +01:00
Richard Levitte
1e31c38e61
Remove unnecessary casts in the demos
2024-11-08 17:15:39 +01:00
Richard Levitte
4b3c98a4e6
Remove unnecessary casts in the misc implementations
2024-11-08 17:15:39 +01:00
Richard Levitte
b98ef26112
Remove unnecessary casts in the Sober128 implementation
2024-11-08 17:15:39 +01:00
Richard Levitte
fc32d77845
Remove unnecessary casts in the ECC implementation
2024-11-08 17:15:39 +01:00
Richard Levitte
477d09fd01
Remove unnecessary casts in the DSA implementation
2024-11-08 17:15:39 +01:00
Richard Levitte
7d3e6b7066
Remove unnecessary casts in the RSA implementation
2024-11-08 17:15:39 +01:00
Richard Levitte
e95069924a
src/math/tfm_desc.c: Compensate for TFM before 0.14.0 (yet to be released)
...
TFM is notorious for not having a properly constified API. This is to appear
in its next release, which is tentatively set to 0.14.0.
2024-11-08 17:15:39 +01:00
Richard Levitte
88315ff8df
Constify all the functions in ltc_math_descriptor appropriately
...
This includes amending the documentation in doc/crypt.tex
This also includes removing unnecessary casts in src/math/*.c
2024-11-08 17:15:39 +01:00
Steffen Jaeckel
2dd6690edf
Merge pull request #674 from cmorty/pem_decode_filehandle
...
Add missing ifndef LTC_NO_FILE
2024-11-07 10:46:30 +01:00
Moritz Strübe
89d73ac405
Add missing ifndef LTC_NO_FILE
...
pem_decode_filehandle is deactiveted in the header, but not the module.
2024-11-06 15:35:29 +00:00
Steffen Jaeckel
d34f2130a6
Merge pull request #673 from cmorty/ltc_lrw_mode-macro
...
Add missing LTC_ prefix to LTC_LRW_MODE macro
2024-11-06 00:07:28 +01:00
Moritz Strübe
8daa79f85b
Add missing LTC_ prefix to LTC_LRW_MODE macro
...
This also fixes the implicit declaration of function ‘gcm_gf_mult’
warning in lrw_start.c.
2024-11-04 14:36:19 +00:00
Steffen Jaeckel
cbb01b3708
Merge pull request #672 from libtom/some-fixes
...
Some fixes
2024-10-14 19:30:11 +02:00
Steffen Jaeckel
5a1545a8ae
Ensure test buffers are always '\0' terminated
...
This caused spurious test failures.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-10-12 14:04:49 +02:00
Steffen Jaeckel
ebfcff3027
Fix handling of trailing spaces when decoding PEM files
...
Reported via [0].
[0] https://github.com/DCIT/perl-CryptX/issues/110#issuecomment-2407279713
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-10-12 14:04:49 +02:00
Steffen Jaeckel
31a48d06bf
Const arrays should be const
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-10-12 14:04:49 +02:00
Steffen Jaeckel
c1437deec2
Fix hang when decoding PEM
...
Reported via [0]
[0] https://github.com/DCIT/perl-CryptX/issues/110#issue-2533207989
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-10-12 14:04:33 +02:00
Steffen Jaeckel
29af8922b6
Merge pull request #670 from libtom/fix-669
...
Fix type in PEM+SSH decoder
2024-10-07 12:42:12 +02:00
Steffen Jaeckel
3df7a96258
Fix type in PEM+SSH decoder
...
9b6bf32f88 changed the type of the length
argument of a `LTC_SSHDATA_STRING` from `ulong32` to `unsigned long` and
usage of this wrong type survived multiple re-factors and code moves.
This fixes #669
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-10-07 12:10:40 +02:00
Steffen Jaeckel
24fc92b857
Merge pull request #668 from levitte/pem-doc-fixes
...
Fix PEM documentation
2024-10-06 14:41:34 +02:00
Richard Levitte
2026e2865d
Fix demos/pem-info.c to properly display different CFB modes
...
Also, make CMake build it.
2024-09-20 13:38:26 +02:00
Richard Levitte
dd3b9e59e1
Fix PEM documentation
2024-09-20 11:24:19 +02:00
Steffen Jaeckel
e0d90c58da
Merge pull request #646 from Xartrick/patch-1
...
Allow 72 bytes (576 bits) keys for Blowfish
2024-09-14 11:28:07 +02:00
Steffen Jaeckel
5f4ddc8d13
Update notes/cipher_tv.txt
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-09-14 10:33:04 +02:00
Xartrick
556c3222f2
Allow 72 bytes (576 bits) keys for Blowfish
2024-09-14 10:20:54 +02:00
Steffen Jaeckel
6865b9fc81
Merge pull request #666 from libtom/fix-aesni-in-ci
...
Fix AESNI build job
2024-09-03 13:03:29 +02:00
Steffen Jaeckel
dd98fcc461
Fix AESNI build job
...
Fixes: 33d1c814 ("Improve SSE4.1/AES-NI support")
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-09-03 12:35:12 +02:00
Steffen Jaeckel
ce904c86ef
Merge pull request #644 from tbvdm/aesni
...
Improve SSE4.1/AES-NI support
2024-09-02 14:26:39 +02:00
Tim van der Molen
33d1c81485
Improve SSE4.1/AES-NI support
2024-09-02 13:54:35 +02:00
Steffen Jaeckel
e8eb4a0312
Merge pull request #664 from libtom/pr/fix-sm4-on-cygwin
...
Cygwin fix for SM4 (issue #663 )
2024-09-02 08:54:16 +02:00
Karel Miko
24e31ef373
Cygwin fix for SM4 (issue #663 )
2024-09-01 18:59:41 +02:00
Steffen Jaeckel
fc6b42025b
Merge pull request #665 from libtom/pr/fix-anon-union
...
avoid using anonymous union (issue #662 )
2024-09-01 17:28:56 +02:00
Karel Miko
d85a4e05e7
avoid using anonymous union (issue #662 )
2024-09-01 12:59:32 +02:00
Steffen Jaeckel
ab16280bf1
Merge pull request #657 from levitte/ChaoWeiAtGit/develop
...
Add SM4 block cipher [reboot]
2024-08-31 15:13:06 +02:00
Chao Wei
6f15a45adc
Add SM4 block cipher
...
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
2024-08-30 05:30:48 +02:00
Steffen Jaeckel
12bf723b74
Merge pull request #661 from libtom/fix-ccm
...
Fix compiler warning
2024-08-29 22:37:17 +02:00
Steffen Jaeckel
349d56e38c
Fix compiler warning
...
Repeated from 97edea362a
```
src/encauth/ccm/ccm_add_nonce.c: In function ‘ccm_add_nonce’:
src/encauth/ccm/ccm_add_nonce.c:61:21: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
61 | ccm->PAD[x++] = (unsigned char)((len >> 24) & 255);
| ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./src/headers/tomcrypt.h:82,
from ./src/headers/tomcrypt_private.h:4,
from src/encauth/ccm/ccm_add_nonce.c:3:
./src/headers/tomcrypt_mac.h:410:24: note: at offset 16 into destination object ‘PAD’ of size 16
410 | unsigned char PAD[16], /* flags | Nonce N | l(m) */
```
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-28 08:47:34 +02:00
Steffen Jaeckel
c4b423f809
Merge pull request #660 from levitte/no-BCryptGenRandom
...
Make the definition of LTC_WIN32_BCRYPT private
2024-08-26 14:49:35 +02:00
Richard Levitte
00708c8837
Make the definition of LTC_WIN32_BCRYPT private
...
1. It's internal anyway, so doesn't quite need to be reflected in a
public header file.
2. This makes it easy for someone build this library to choose not
to use BCryptGenRandom() by simply definining LTC_NO_WIN32_BCRYPT,
which was hard to reflect in an unmodified public header file.
Alternative to #653
2024-08-22 09:36:38 +02:00
Steffen Jaeckel
427ce3315e
Merge pull request #659 from levitte/cmake-build-tv_gen
...
With CMake, build demos/tv_gen as well
2024-08-20 14:36:09 +02:00
Richard Levitte
ba132eb4a7
With CMake, build demos/tv_gen as well
2024-08-20 14:35:58 +02:00
Steffen Jaeckel
e75c563d1d
Merge pull request #658 from levitte/fix-cipher_hash_test.c
...
fix: tests/cipher_hash_test.c failed to use aes_enc_test
2024-08-20 14:35:34 +02:00
Richard Levitte
6170ba5205
fix: tests/cipher_hash_test.c failed to use aes_enc_test
...
Depending on build circumstances, the AES test function is either
aes_test() or aes_enc_test().
2024-08-20 14:35:16 +02:00
Steffen Jaeckel
668bd74b93
Merge pull request #587 from libtom/add-pem-support
...
Add PEM support
2024-08-20 14:34:57 +02:00
Steffen Jaeckel
2594f3a7d2
Update docs
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
2613264cef
We can now also decrypt PEM files encrypted in CFB1 and CFB8 mode
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
cf79facfb9
Add support for CFB1 and CFB8
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
5dec1ee02d
Fix make tvs, add make pr-check
...
Fixup of 5ad1681ccb
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
ec8ffbb5bd
Update makefiles
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
478f43fc56
Add support for reading authorized_keys files
...
This also changes the requirements when calling `ecc_find_curve()` that
the `cu` argument can be NULL.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
c0be0aa0bf
Add support for more types of encrypted PEM files
...
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>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
65e05bfa56
Update docs
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
95790221fb
Add free() function to password_ctx
...
The user can now pass a `free()` function pointer that will be used to
free the memory that has been allocated by the `callback()`.
If `free()` is NULL, the library will still call `XFREE()`.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
02cb0c4957
Revert "Move password buffer into the library"
...
This reverts commit d840323bc1d3bc35bc72271e55ffa644f02b4582
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
9db30dfdc5
Make everything compile on MSVC
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
03515d5611
Move password buffer into the library
...
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>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
fe3b3e627b
Add generic PEM decode APIs
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
8d19047336
Add support for more PEM file types + some fixes
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
7b5d85d735
Calm old Valgrind ...
...
Valgrind 3.15.0 on Ubuntu 20.04 reports a false positive [0]
```
==7922== Conditional jump or move depends on uninitialised value(s)
==7922== at 0x461F0C: s_decode_header (pem_ssh.c:316)
[...]
```
Simply suppress this false positive.
[0] https://github.com/libtom/libtomcrypt/actions/runs/6507805191/job/17676616149?pr=587
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
ca7b4ee354
Add more SSH key tests
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
928c476734
Per default support PEM line lengths up to 80 chars
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
23eb8f97bc
Add support for importing PEM public keys
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Karel Miko
cda6211712
pem: support for RC5-CBC, RC5-CFB, RC5-OFB
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
f6497d22ce
Add support for more algos of encrypted PEM files
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
5d8658946b
Refactor some of the ECC import internals
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
934abdd82f
Add "Enter passphrase" support to openssh-privkey
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
9333d5c8a1
Use the public key contained within the ssh key
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
6c24c5c06d
Add support for aes256-ctr encrypted SSH keys
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
661f5845fe
distinguish between Ed25519 and X25519
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
39d4b089ac
Update docs
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
651582254b
introduce pka_key_free()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
4e46f823df
clean-up a bit
...
* more `const` correctness
* take `LTC_NO_FILE` into account
* only declare `extern` variables where they're required
* ensure keys don't contain stale data
* ensure input arguments are valid
* add `CRYPT_PW_CTX_MISSING` error code
* fix documentation
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
5523eadc13
disable PEM support on MSVC
...
If someone wants to fix builds on MSVC, please step forward. Until then
the library can still be used on Windows via `mingw-gcc`.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
26fbebb9d0
add support for DH keys
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
# Conflicts:
# src/pk/dh/dh_import.c
# src/pk/dh/dh_set.c
# src/pk/dh/dh_set_pg_dhparam.c
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
87a1758f2f
split-up into multiple C files
...
... and slightly optimize multiple things, e.g. `DEK-Info` decoding
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
3e981af4c4
also test FILE-based PEM API's
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
a76447f7aa
add file-iterator to test_process_dir()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
d1e48df763
Verify that the imported keys match
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
22a952b813
add DSA support to PEM decoder
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
464c9b1986
add dsa_import_pkcs8()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
370457f405
add PEM tests
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
f036a471bd
add support for regular PEM files
...
This adds support to decode plain and encrypted PEM files.
Either in OpenSSL specific format or PKCS#8
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
3f6f885852
re-factor PKCS#8 API a bit
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
e9f1db1742
add pkcs8_get_children()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
b8cb13f998
add LTC_OID_MAX_STRLEN
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
18baa1476c
add der_flexi_sequence_cmp()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
35c306feae
add pk_get_oid_from_asn1()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
69c93a82a5
rename file
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
cf71fffbd9
re-factor openssh-privkey demo into library functions
...
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>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
a301ea1419
use updated API
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
350fbc6546
refactor & clean-up
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
e0046fbd7e
add ssh private testkeys
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
2ff20d7966
add ecdsa key support
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
fec3d45adc
add rsa-support
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
bee3ad2a2a
add OpenSSH Private Key decryption demo
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-20 13:29:27 +02:00
Steffen Jaeckel
f27a312a6c
Merge pull request #655 from levitte/upgrade-workflows
...
In workflows, modernise the actions that are used
2024-08-20 08:50:38 +02:00
Richard Levitte
3cea832f5e
In workflows, modernise the actions that are used
...
actions/checkout@v2 → actions/checkout@v4
actions/upload-artifact@v3 → actions/upload-artifact@v4
This will reduce the amount of warnings in the workflow summary.
2024-08-20 06:53:53 +02:00
Steffen Jaeckel
cacfc2dc04
Merge pull request #651 from libtom/pr/fix-warning-unusedvar-tiger
...
fix unused variable warning in hashes/tiger
2024-08-18 16:14:45 +02:00
Steffen Jaeckel
1405c732ee
Merge pull request #652 from libtom/pr/fix-asm-volatile
...
Use standard __asm__ blocks instead of asm (from CryptX PR)
2024-08-18 13:22:44 +02:00
Karel Miko
e78a7b65eb
Use standard __asm__ blocks instead of asm (from CryptX PR)
2024-08-18 13:21:37 +02:00
Steffen Jaeckel
90529a2d0c
Fix missing static
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-08-18 12:57:04 +02:00
Karel Miko
9bdf5794d3
fix unused variable warning in hashes/tiger
2024-08-18 12:57:04 +02:00
Steffen Jaeckel
7d4a646f50
Merge branch 'fix-b64-zero-length-array' into develop
...
Closes #538
2024-08-18 12:56:05 +02:00
Steffen Jaeckel
9183396b85
Avoid zero length array with LTC_BASE64_URL unset
2024-08-18 12:53:47 +02:00
Steffen Jaeckel
2302a3a897
Merge pull request #647 from etienne-lms/xcalloc
...
fix XCALLOC() against GCC 14 -Wcalloc-transposed-args
2024-06-26 19:59:31 +02:00
Etienne Carriere
9c1e83b51b
fix XCALLOC() against GCC 14 -Wcalloc-transposed-args
...
Fix use of XCALLOC() macro against GCC 14 directive
-Wcalloc-transposed-args that makes GCC to complain with an warning/error
trace message like the below when 1st argument is given by sizeof().
warning: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
No functional changes.
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
2024-06-25 17:28:16 +02:00
Steffen Jaeckel
f7e6519fae
Merge pull request #636 from libtom/update-fortuna
...
Update fortuna
2024-02-26 17:02:46 +01:00
Steffen Jaeckel
0e12dbd964
Update AES integration of fortuna
...
* Use `aes_` based API instead of `rijndael_`, so we can profit from
a potential hardware accelerated version of AES.
* Add option to use 'encrypt_only' variant of AES inside fortuna
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-02-26 16:25:17 +01:00
Steffen Jaeckel
090f52755c
Add aes_enc_test()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-02-26 16:25:17 +01:00
Steffen Jaeckel
86fe3b91f1
Merge pull request #640 from libtom/extend-tiger
...
Extend tiger
2024-02-26 16:22:59 +01:00
Steffen Jaeckel
5ad1681ccb
Add new make target tvs
...
To simplify generating the necessary testvectors when adding a new
algorithm.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-02-26 15:53:17 +01:00
Steffen Jaeckel
8be96ac2f6
Update docs
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-02-26 15:51:54 +01:00
Steffen Jaeckel
d11758e700
Add support for Tiger2
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-02-26 15:51:54 +01:00
Steffen Jaeckel
c272d2264c
Add support for Tiger with more than 3 passes
...
This fixes #632
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-02-26 10:16:49 +01:00
Steffen Jaeckel
1777e6d5c3
Fix potential memory leak
...
Fixup of 97edea362a
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2024-02-25 23:55:53 +01:00
Steffen Jaeckel
7e863d2142
Merge pull request #612 from libtom/rsaaes_oaep_hashes
...
add possibility to use different hash algorithms in RSAES-OAEP
2023-10-09 14:38:14 +02:00
Steffen Jaeckel
63091c9e5c
Add possibility to use different hash algorithms in RSAES-OAEP
...
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>
2023-10-09 12:26:21 +02:00
Steffen Jaeckel
91b7bbe4c1
Merge pull request #633 from libtom/some-fixes
...
Fix AES-NI and other minor stuff
2023-10-08 23:04:26 +02:00
Steffen Jaeckel
e4adaafd90
Fix make incompatibility
...
Since make version 4.3 [0] the `#` sign inside a string is handled
differently. Fix that.
[0] https://lists.gnu.org/archive/html/info-gnu/2020-01/msg00004.html
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-10-05 12:34:33 +02:00
Steffen Jaeckel
124e020437
Add missing package name suffix to CMake/CPack
...
Fixes e98e0a64e6
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-10-05 11:14:46 +02:00
Steffen Jaeckel
d9b25936fb
Fix CMake with MSVC
...
Reported by @pineappleiceberg in [0]
[0] https://github.com/libtom/libtomcrypt/issues/577#issuecomment-1722545061
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-10-05 11:14:46 +02:00
Steffen Jaeckel
97edea362a
Fix compiler warning
...
```
src/encauth/ccm/ccm_memory.c: In function ‘ccm_memory’:
src/encauth/ccm/ccm_memory.c:164:17: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
164 | PAD[x++] = (unsigned char)((len >> 24) & 255);
| ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/encauth/ccm/ccm_memory.c:43:19: note: at offset 16 into destination object ‘PAD’ of size 16
43 | unsigned char PAD[16], ctr[16], CTRPAD[16], ptTag[16], b, *pt_real;
| ^~~
```
Multiple reviews and tests determined that this can't happen, but most
likely computers are better in finding out such stuff (or it was a false
positive).
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-10-05 11:14:46 +02:00
Steffen Jaeckel
7aaa8ebe19
Re-order struct members
...
In order to memory-align the used buffers for keys, IVs etc. we re-order
the struct members of ciphers, modes and encauth.
There's no guarantee that this works, but it improves the chances.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-10-05 11:14:46 +02:00
Steffen Jaeckel
c48673234c
Always determine manually whether CC is clang
...
This is required
1. when cross-compiling
2. to enable/disable the specific compiler warnings
Tested on `bash`, `dash`, `zsh` and FreeBSD `sh`.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-10-05 11:14:46 +02:00
Steffen Jaeckel
d3a297c341
Add option to disable AES-NI at compile time
...
One can now define `LTC_NO_AES_NI` to disable AES-NI.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-10-05 11:14:46 +02:00
Steffen Jaeckel
1c36997bd0
Ensure that AES key is always correctly aligned
...
Aligning a `struct` member via `attribute(align(<n>))` is not guaranteed
to work.
Change the approach to use an opaque buffer and always manually align
the start pointers of the keys.
c.f. https://github.com/DCIT/perl-CryptX/issues/95
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-10-05 11:14:46 +02:00
Steffen Jaeckel
024d8a1340
Add LTC_ALIGN_BUF()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-10-05 11:14:46 +02:00
Steffen Jaeckel
b96e96cf8b
Merge pull request #626 from libtom/some-fixes
...
Some fixes
2023-08-23 14:37:18 +02:00
Steffen Jaeckel
c4fd304ff4
Fix #627
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 13:06:53 +02:00
Steffen Jaeckel
dc883ea0ea
Add Testcase for #627
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 13:06:53 +02:00
Steffen Jaeckel
c4d22b9046
Fix build for Windows ARM (UWP)
...
This fixes #576
Patch inspired by the same, but modified.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 13:06:53 +02:00
Steffen Jaeckel
bc59fb82b8
Add support for reading random data from "bcrypt" on Windows
...
This fixes #577
Patch inspired by the same, but simplified after reading the docs.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 13:06:53 +02:00
Steffen Jaeckel
e591a35c6a
Port WinCSP usage from libtommath
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 11:37:19 +02:00
Steffen Jaeckel
5fa7837f3a
Add empty stub for s_der_tests_print_flexi()
...
So we don't have to `#ifdef` whether it's available or not.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 11:37:19 +02:00
Steffen Jaeckel
18863a8ade
Fix DER decoding of UTF-8 Strings
...
Don't read more than the length indicated by the length field.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 11:37:19 +02:00
Steffen Jaeckel
c939720699
Add Testcase that UTF-8 decoding respects the ASN.1 length
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 11:37:19 +02:00
Steffen Jaeckel
7a38fca62a
Fix some pkg-config related things
...
* use a separate `libtomcrypt` folder to install the headers to
* use `INCPATH` and `LIBPATH` when installing `libtomcrypt.pc`
* fix `libtomcrypt.pc` generation for `makefile.unix`
This fixes #625
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 11:37:19 +02:00
Steffen Jaeckel
e98e0a64e6
Port CMake changes from libtommath for Debian packaging
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 11:37:19 +02:00
ycaibb
ee24a31ae1
fix missing mutex unlock
...
Fixes a missing mutex unlock on an out of memory error
in ltc_ecc_fp_save_state().
Originates from: 4af447d408
Fixes #571
Comment by sj:
This patch version slightly deviates from the original patch to OP-TEE
since we don't call `XFREE(NULL)` as there exist implementations of
`free()` that don't support it.
Signed-off-by: Ryan Cai <ycaibb@gmail.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
Modified-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 11:37:19 +02:00
Steffen Jaeckel
2cb51b656c
Merge pull request #631 from ulikos/fix-630
...
Fixed size check in ecc_get_key, Fixes #630
2023-08-07 11:36:53 +02:00
Ulrich Koschella
48462aab40
Fixed size check in ecc_get_key, Fixes #630
2023-08-07 11:05:09 +02:00
Steffen Jaeckel
6120c82618
Add Testcase for #630
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-08-07 11:05:09 +02:00
Steffen Jaeckel
06b0f7711b
Merge pull request #629 from ulikos/fix-628
...
Fixed wrong sign in docu of ECC Extended Key Generation, Fixes #628
2023-08-07 07:49:23 +02:00
Ulrich Koschella
7ddd4f7de2
Fixed wrong sign in docu of ECC Extended Key Generation, Fixes #628
2023-08-03 13:03:25 +02:00
Steffen Jaeckel
1e629e6f64
Merge pull request #557 from libtom/add-aesni
...
Add AES-NI
2023-06-22 19:15:27 +02:00
Steffen Jaeckel
d026c63075
Update makefiles
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-22 18:37:25 +02:00
Steffen Jaeckel
9e0a131b2c
introduce separate aes_desc
...
`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>
2023-06-22 18:37:25 +02:00
Steffen Jaeckel
2314444cb0
Disable warnings from clang
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-22 18:37:25 +02:00
Steffen Jaeckel
37a8d7ec77
add CI testrun with AESNI
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-22 18:37:25 +02:00
Steffen Jaeckel
31c7f891aa
add support for AES-NI instructions
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-22 18:37:25 +02:00
Steffen Jaeckel
0173cac3be
Add LTC_TMPVAR() macro
...
Use unique names for variables declared in macros.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-21 13:23:52 +02:00
Steffen Jaeckel
93f5348c47
cmake: add ccache support
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-19 21:14:38 +02:00
Steffen Jaeckel
a2245e8696
Merge pull request #611 from libtom/fix-mpi-pkgconfig
...
update `Libs` part of pkg-config file with configured MPI providers
2023-06-19 20:56:48 +02:00
Steffen Jaeckel
4767558fd0
Add correct MPI provider defines to pkg-config cflags
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-19 20:24:03 +02:00
Steffen Jaeckel
3f33ccf181
cmake: Add TomsFastMath support
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-19 20:23:23 +02:00
Steffen Jaeckel
5330cd1d9b
also update pkg-config file generated by cmake
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-19 19:18:28 +02:00
Steffen Jaeckel
2c3a5fd0ac
update Libs part of pkg-config file with configured MPI providers
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-19 19:18:28 +02:00
Steffen Jaeckel
93dc29ab9a
Merge pull request #623 from libtom/update-ci
...
Update base OS version of CI
2023-06-19 19:17:15 +02:00
Steffen Jaeckel
90359498e1
Remove pre-installed libtommath
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-19 17:16:23 +02:00
Steffen Jaeckel
acec8a5c3e
More error logs on CI failure
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-19 17:15:59 +02:00
Steffen Jaeckel
8076d86366
Fix missing include paths of ltm and tfm
...
Default include paths of ltm and tfm have changed.
Try to get include paths from pkg-config.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-19 16:44:40 +02:00
Steffen Jaeckel
e1a52a5b94
Fix Valgrind CI run when building with Clang
...
Clang creates now DWARFv5 debug infos which isn't supported in old Valgrind
versions. Instruct Clang to create DWARFv4 debug infos, so we can run our
tests in Valgrind.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-19 16:34:07 +02:00
Steffen Jaeckel
87665fb276
Calm scan-build static analyser
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-19 16:34:07 +02:00
Steffen Jaeckel
f0328b02c2
Update base OS version of CI
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-06-19 16:34:07 +02:00
Steffen Jaeckel
fae62af0ab
Merge pull request #613 from SOuajih/pkcs_fix
...
fix pkcs_1_v1_5_decode() when empty message
2023-03-31 20:55:08 +02:00
Steffen Jaeckel
6164cc1cb6
ensure that input-data pointer is non-NULL
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-03-31 14:42:50 +02:00
Steffen Jaeckel
f9c0c63433
allow input-data pointer to be NULL
...
If we allow the length to be 0, we should also prepare for the case where
the user doesn't want to provide a valid input-data pointer.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-03-31 14:42:50 +02:00
Safae Ouajih
caf3500288
fix pkcs_1_v1_5_decode() when empty message
...
In case of EME-PKCS1-v1_5 decoding, the encoded message
format is as follow : EM = 0x00 || 0x02 || PS || 0x00 || M.
When using an empty message, the 0x00 octet that separates
the padding string and message is located at the end. Thus,
update the condition to pass the check in case of empty message.
This fixes the following AOSP cts test:
Module: CtsKeystoreTestCases
Test: testEmptyPlaintextEncryptsAndDecrypts
Link: https://android.googlesource.com/platform/cts/+/refs/tags/android-cts-12.0_r6/tests/tests/keystore/src/android/keystore/cts/CipherTest.java
Signed-off-by: Safae Ouajih <souajih@baylibre.com>
2023-03-31 14:21:01 +02:00
Steffen Jaeckel
05f94077cc
fix help message of aesgcm demo
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2023-03-31 14:17:51 +02:00
Steffen Jaeckel
2a1b284677
Merge pull request #609 from atomicmooseca/fix-cmake
...
Update CMakeLists.txt
2023-01-18 19:33:50 +01:00
Steve Manley
2e24591795
Fix CMakeLists.txt which still used variables from the ltm port
...
It still used `LTM_{C,LD}_FLAGS` instead of `LTC_{C,LD}_FLAGS`.
2023-01-18 19:02:36 +01:00
Steffen Jaeckel
29986d04f2
Merge pull request #607 from Jinbosh8/reset-gcm-memory
2022-11-15 16:23:23 +01:00
Jin
b207b63bb3
Added gcm_reset() to gcm_memory() to avoid key leakage
2022-11-14 23:45:09 -08:00
Steffen Jaeckel
3474ca3712
Merge pull request #606 from libtom/docs-in-ci
...
Docs in ci
2022-10-14 12:47:50 +02:00
Steffen Jaeckel
06f22b61b5
create developer manual in CI
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-10-14 11:06:10 +02:00
Steffen Jaeckel
b073ee0c62
use correct Build Status badge in README
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-10-14 10:37:19 +02:00
Steffen Jaeckel
e8e678e101
improve MPI providers section in documentation
...
.. also add a checkbox regarding MPI providers to the issue template
This closes #605
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-10-12 12:06:59 +02:00
Steffen Jaeckel
e10c62ec18
Merge pull request #586 from libtom/feature/cmake-support
...
Feature/cmake support
2022-10-05 15:23:59 +02:00
Steffen Jaeckel
cdc1dbe6f5
port cmake integration changes from libtommath
...
... also enable building of tests.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-10-05 14:49:54 +02:00
Adrian Antonana
a9a010d5fc
introduce initial cmake support
2022-09-13 12:29:55 +02:00
Steffen Jaeckel
e6be20bfc7
Merge pull request #601 from libtom/fix-600
...
remove camellia tests if `LTC_TEST` is not defined
2022-09-13 12:29:16 +02:00
Steffen Jaeckel
2fe75d31cb
remove camellia tests if LTC_TEST is not defined
...
Fixes #600
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-09-13 11:55:20 +02:00
Steffen Jaeckel
fde3e8c10a
Merge pull request #599 from libtom/rereview-curve25519-ctx-and-ph
...
Re-review curve25519 ctx and ph
2022-09-13 11:50:57 +02:00
Steffen Jaeckel
1873838e96
fix incompatibility issues with LLP64 data models
...
This is also a fixup of a921112fe3
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-09-12 11:34:27 +02:00
Steffen Jaeckel
ca92434d9d
don't overwrite arguments
...
There's no need to store those values first somewhere else.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-09-12 11:34:27 +02:00
Steffen Jaeckel
24275fee7e
optimize stack arrays
...
* minimize stack usage
* no need to zero-initialize the arrays
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-09-12 11:34:27 +02:00
Steffen Jaeckel
97f78901e9
ensure that ctx is non-NULL
...
The code-path via the `ed25519ph_*()` APIs would have allowed to get here
and de-reference `ctx` even if it is `NULL`.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-09-12 11:34:27 +02:00
Steffen Jaeckel
e836af56c2
re-factor tweetnacl_crypto_hash[_ctx]()
...
@etienne-lms remarked in [0] that the stack usage could be minimized
by using `hash_memory_multi()` instead of copying the data, so let's do
that.
[0] https://github.com/OP-TEE/optee_os/pull/5486#discussion_r955095821
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-09-12 11:34:27 +02:00
Steffen Jaeckel
288088ce3f
Merge pull request #598 from libtom/improve-vararg-apis
...
Improve vararg apis
2022-09-12 11:34:01 +02:00
Steffen Jaeckel
1ee85a8f25
Update makefiles
2022-09-02 11:30:45 +02:00
Steffen Jaeckel
13dc1f4fa2
add test-case that uses LTC_NO_NULL_TERMINATION_CHECK
...
It's a compile-only test, but we run it anyways so we can finally get
`crypt_fsa()` included in the coverage report. It's not really useful but
also doesn't hurt.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-09-02 11:30:45 +02:00
Steffen Jaeckel
6ab01a8e8f
fix possible UB
...
A user isn't guaranteed to use the `der_..._multi()` in a correct fashion.
Therefor change the pattern in the library and terminate further vararg
processing immediately after the `EOL` marker is hit.
The previous changes introducing the function-`attribute(sentinel)` would
allow detecting this, but not all compilers have support for the attribute.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-08-31 13:05:00 +02:00
Steffen Jaeckel
1c805e1c66
use LTC_NULL in the library code
...
`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>
2022-08-31 13:05:00 +02:00
Steffen Jaeckel
0ad23e1b4c
introduce LTC_NULL_TERMINATED function attribute
...
In order to be able to check at compile time whether a vararg function
is correctly NULL-terminated.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-08-31 13:05:00 +02:00
Steffen Jaeckel
ddfe2e8aa7
Merge pull request #597 from sa-kib/ed25519ctx
...
contextualized extension of the Ed25519 scheme
2022-08-21 11:34:22 +02:00
Steffen Jaeckel
23d7091b9f
Update makefiles
2022-08-20 14:38:43 +02:00
Steffen Jaeckel
9dec999564
re-factor some parts of the Ed25519ctx and Ed25519ph implementation
...
* 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>
2022-08-20 14:38:43 +02:00
Valerii Chubar
b761cc0f67
Add ed25519ctx and ed25519ph support
...
Signed-off-by: Valerii Chubar <valerii_chubar@epam.com>
Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
2022-08-20 14:38:43 +02:00
Valerii Chubar
a6c6492139
ed25519: Add testcase for segfault on verify
...
In case when the signature is not verified the "mlen" variable
is equal to ULONG_MAX. When LTC_CLEAN_STACK has been defined
this results in a segmentation fault.
Signed-off-by: Valerii Chubar <valerii_chubar@epam.com>
Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
2022-08-20 14:38:43 +02:00
Steffen Jaeckel
8fd5dad96b
Merge pull request #593 from libtom/cleanup
...
Cleanup
2022-07-18 10:55:46 +02:00
Steffen Jaeckel
a921112fe3
Ensure that hash overflow is detected
...
Previously it was not detected if `inlen` itself was too big and would
overflow the multiplication by 8.
Related to #592
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-07-16 15:09:48 +02:00
Steffen Jaeckel
bb09c272bb
also build with MSVC 2019 & 2022
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-07-16 15:07:09 +02:00
Oliver Schneider
0219ace105
Spelling fix in tomcrypt_cfg.h
2022-03-18 10:43:09 +01:00
Steffen Jaeckel
038db7e03e
fix sporadically failing tests when built with pthreads support
...
... I hope ... :)
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-03-17 15:08:39 +01:00
Steffen Jaeckel
2c51ae81ac
make sure to check yarrow_read() return values
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-03-17 15:08:37 +01:00
Steffen Jaeckel
69843a4807
pack up failed build to be able to investigate
...
Sometimes it's hard to reproduce an issue as they happen on CI, so let's
pack-up what we can on failure and upload it as artifact.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-03-17 15:08:32 +01:00
Steffen Jaeckel
6552fbcfe2
add hash Id to docs
2022-03-17 14:26:44 +01:00
Steffen Jaeckel
06a81aeb22
Merge pull request #584 from libtom/cleanup
...
Clean-up & minor improvements
2022-03-16 20:52:33 +01:00
Steffen Jaeckel
c8e49539e6
add cipher Id to docs
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-11 16:12:27 +01:00
Steffen Jaeckel
31ab638fb6
silence valgrind
...
When compiling with clang (9-12) and then running the tests in
valgrind (I tested 3.13.0 and 3.15.0) the following error was created:
```
Conditional jump or move depends on uninitialised value(s)
at 0x47761F: ecc_ssh_ecdsa_encode_name (ecc_ssh_ecdsa_encode_name.c:38)
...
Uninitialised value was created by a stack allocation
at 0x477570: ecc_ssh_ecdsa_encode_name (ecc_ssh_ecdsa_encode_name.c:21)
```
This silences this error by initialising the stack-array on creation.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-11 16:12:27 +01:00
Steffen Jaeckel
7a8496df5c
better debug output
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-11 16:12:27 +01:00
Steffen Jaeckel
cf58641c99
migrate from travis CI to GitHub actions
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-11 16:12:27 +01:00
Steffen Jaeckel
5c30a53074
improve pk_oid_num_to_str()
...
* allow `OID` to be `NULL` until you want to write it ...
* make sure we don't overflow the `int i`
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-11 16:12:27 +01:00
Steffen Jaeckel
1052703116
fix/improve DER tests
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-11 16:12:27 +01:00
Steffen Jaeckel
c2f6c403fe
prevent UB
...
This prevents incrementing `adata`, which can be a NULL pointer at this
point.
Fixes #583
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-11 16:12:27 +01:00
Steffen Jaeckel
4a1477e289
add (private) rsa_import_pkcs1()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-11 16:12:27 +01:00
Steffen Jaeckel
3bf3dffabc
signal a potential overflow when decoding a LTC_ASN1_SHORT_INTEGER
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-11 16:12:27 +01:00
Steffen Jaeckel
8899c81601
continue looping on NOP
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-11 16:12:27 +01:00
Steffen Jaeckel
ec27d57548
slightly improve base64 encoding
...
* ensure base64 encode in&out buffers aren't the same
* allow calling any of the encode functions with `out` being a
NULL-pointer, to be able to determine the size for storing
the output.
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-11 16:12:27 +01:00
Steffen Jaeckel
a24af5f7e1
correctly prefix enum ltc_oid_id members
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-11 16:12:27 +01:00
Steffen Jaeckel
0bfa7d0e1e
add base64_encode_pem()
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-10 16:15:14 +01:00
Steffen Jaeckel
1aac5b322a
fix typo
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-10 16:15:14 +01:00
Steffen Jaeckel
b39c46f817
re-order code a bit
...
... so only relevant parts are executed
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-10 16:15:14 +01:00
Steffen Jaeckel
11590de241
add SSH-style padding
...
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-10 16:15:14 +01:00
Steffen Jaeckel
cee9569fdd
annotate some and fix un-aligned #endif
...
This fixes #572
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2022-02-10 16:15:14 +01:00
Steffen Jaeckel
673f5ce290
Merge pull request #569 from cneveux/rsa_public_exponent
...
rsa: add rsa key generate with bignumber public exponent
2021-06-04 18:51:41 +02:00
Cedric Neveux
75cfdaa490
documentation: add new rsa generate key API
...
Add rsa_make_key_ubin_e api documentation.
Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
2021-06-04 08:05:58 +02:00
Cedric Neveux
d6bc30e8b8
test: add test rsa key generate with public exponent upto 256 bits
...
Add a RSA test generating a RSA key with a 256 bits public exponent.
Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
2021-06-04 08:05:58 +02:00
Cedric Neveux
49556a8e60
rsa: add rsa key generate with public exponent upto 256 bits
...
Function rsa_make_key() limits the RSA key generates to a public
exponent of type long (32 bits or 64 bits).
RSA standard specify that public exponent e can be between 65537 (included)
and 2^256 (excluded).
Add function rsa_make_key_ubin_e to use a hexadecimal public exponent.
Add function rsa_make_key_bn_e to use a bignumber public exponent
(op-tee).
Signed-off-by: Cedric Neveux <cedric.neveux@nxp.com>
2021-06-04 08:05:58 +02:00
Steffen Jaeckel
165c795b65
Merge pull request #546 from libtom/fix-dsa-sha-dependency
...
fix DSA dependency to SHA2
2021-04-14 15:52:41 +02:00
Karel Miko
9a07c425bd
DSA gen params: fixed check group_size vs LTC_MDSA_MAX_GROUP, updated LTC_MDSA_DELTA, new LTC_MDSA_MAX_MODULUS
2021-04-14 12:10:45 +02:00
Steffen Jaeckel
4bcb2c1873
don't undermine hash-registry concept
...
This allows registering an own implementation with a different
descriptor name.
2021-04-14 12:07:03 +02:00
Steffen Jaeckel
32d650807c
use sha3 if available
2021-04-14 12:07:03 +02:00
Steffen Jaeckel
96c72ec31e
fix dependency to sha2
...
DSA had a hard dependency to the basic sha2 operations.
In case one wanted to compile e.g. only with sha256 this lead to a
compilation error.
2021-04-14 12:07:03 +02:00
Steffen Jaeckel
077f4d6367
Merge pull request #567 from dcantrell/develop
...
m68k platforms are big endian
2021-04-11 21:01:42 +02:00
David Cantrell
112c32d756
m68k platforms are big endian
...
The endianness fallback in tomcrypt_cfg.h lacked a check for the gcc
define for m68k. I discovered this while building dropbear on A/UX
3.1.1 on a Macintosh Quadra 700 (yes, in 2021). Adding the check for
the gcc __m68k__ define gets everything building.
Signed-off-by: David Cantrell <david.l.cantrell@gmail.com>
2021-04-11 12:21:42 -04:00
Steffen Jaeckel
d34c440421
Merge pull request #560 from libtom/cleanup-and-fixes
...
Cleanup and fixes
2021-04-10 15:16:55 +02:00
Steffen Jaeckel
c117cd8a85
add comment indicating supported platforms of makefile.shared
2021-04-10 13:02:39 +02:00
Karel Miko
5329bdc5fb
missing endif
2021-04-10 13:02:39 +02:00
Steffen Jaeckel
2a6e57fc2f
fix unbalanced #ifdef for MIPS R5900
...
This fixes #562
[skip ci]
2021-04-10 13:02:39 +02:00
Steffen Jaeckel
2bee98076f
cast away cast-align warnings
2021-04-10 13:02:39 +02:00
Steffen Jaeckel
9616356abe
review CCM
...
* improve some comments
* harden some arguments
* fix the overflow warning
fixes #555 , fixes #544
2021-04-10 13:02:39 +02:00
Steffen Jaeckel
ea7d8eb541
make sure that CTR->pad[] is aligned to 16 bytes
...
Fixes #549
2021-04-10 13:02:39 +02:00
Steffen Jaeckel
8f36c37acb
clarify LTC_PAD_PKCS7
2021-04-10 13:02:39 +02:00
Steffen Jaeckel
748994c55f
add LTC_ALIGN() macro
2021-04-10 13:02:39 +02:00
Steffen Jaeckel
5bc034ff55
re-factor some tests
2021-04-10 13:02:39 +02:00
Steffen Jaeckel
ddf1b63ac2
Merge pull request #565 from libtom/fix-cryptx69
...
make sure basic types are marked as UNIVERSAL&PRIMITIVE
2021-04-10 13:02:19 +02:00
Steffen Jaeckel
df6e14a9cb
make sure basic types are marked as UNIVERSAL&PRIMITIVE
...
This fixes DCIT/perl-CryptX#69
2021-04-09 12:48:17 +02:00
Steffen Jaeckel
ae87fca70a
Merge pull request #564 from Biswa96/develop
...
Makefile: Fix shared library build in MinGW.
2021-04-09 12:30:37 +02:00
Biswapriyo Nath
e86dbc4591
Makefile: Fix shared library build in MinGW.
...
This enables -no-undefined linker flag in mingw toolchain.
Previous related commit 9c2c9f8af4
2021-03-28 22:06:52 +05:30
Steffen Jaeckel
910d625277
Merge pull request #558 from jamuir/develop
...
Add new utf8 test-vector, update comments explaining utf8 decoding
2021-01-19 13:51:22 +01:00
James Muir
2092250088
Add new utf8 test-vector, update comments explaining utf8 decoding
...
Description:
Minor changes to help test and clarify the way utf8 strings are
decoded. This originated from my misunderstanding of the fix for
issue #507 . The new test-vector uses two bytes to encode each
wide-char.
The utf8 format is described here:
https://tools.ietf.org/html/rfc3629#section-3
Testing:
$ make clean
$ make CFLAGS="-DUSE_LTM -DLTM_DESC -I../libtommath" EXTRALIBS="../libtommath/libtommath.a" test
$ ./test
You can confirm that the new utf8 test data is correct using python:
>>> s="\xD7\xA9\xD7\x9C\xD7\x95\xD7\x9D"
>>> s.decode("utf-8")
u'\u05e9\u05dc\u05d5\u05dd'
2021-01-15 20:55:09 -05:00
Steffen Jaeckel
954ab9bcfc
Merge pull request #550 from libtom/clean-up-stuff
...
Patch & clean up
2020-12-21 19:34:39 +01:00
Steffen Jaeckel
6b12bc5bd8
don't allow LTC_CLEAN_STACK to be enabled until fixed
...
As discussed in issue #486 [1] the current behavior shouldn't be used
anymore.
[1] https://github.com/libtom/libtomcrypt/issues/486
2020-12-21 13:53:36 +01:00
Steffen Jaeckel
53b0f1e30f
update TEA testvectors
2020-12-21 13:53:36 +01:00
Steffen Jaeckel
3ec7f71f4f
fix tea_ecb_encrypt()
...
This fixes #553
2020-12-21 13:53:36 +01:00
Steffen Jaeckel
77a932cb07
fix tea_test()
2020-12-21 13:53:36 +01:00
Steffen Jaeckel
11978c16d7
make sure PKCS#5 iteration count is a "positive integer"
...
This fixes #552
2020-12-21 13:53:36 +01:00
Steffen Jaeckel
c549f0fb3b
add check maketarget
2020-12-21 13:53:36 +01:00
Steffen Jaeckel
f8393fd7c2
Exclude tests/test.key from potential crlf conversion
...
This closes #521
2020-12-21 13:53:36 +01:00
Steffen Jaeckel
8f12addd0f
add comment about padding types
2020-12-21 13:53:36 +01:00
Steffen Jaeckel
7d57bae82c
read system timer on AARCH64
2020-12-21 13:53:36 +01:00
Steffen Jaeckel
98dd1df545
recent aesgcm versions have shorter iv/key strings
2020-12-21 13:53:36 +01:00
Steffen Jaeckel
696e781d41
Fix returning too many or too few bits
...
original patch by @friedrichsenm
This closes #543
2020-12-21 13:53:36 +01:00
Steffen Jaeckel
b3305b05e7
Merge pull request #556 from timgates42/bugfix_typo_success
...
docs: fix simple typo, succes -> success
2020-12-21 11:16:09 +01:00
Tim Gates
59d8741d65
docs: fix simple typo, succes -> success
...
There is a small typo in src/mac/f9/f9_test.c, src/mac/xcbc/xcbc_test.c.
Should read `success` rather than `succes`.
2020-12-08 21:44:22 +11:00
Steffen Jaeckel
cfbd7f8d36
Merge pull request #545 from libtom/pattop/fixes
...
Minor fix & cleanup
2020-08-29 11:30:23 +02:00
Patrick Oppenlander
d63d6faf22
sha256: minor undef cleanup
...
RND is #defined in both the #if and #else case, so move the #undef after
the #endif.
2020-08-17 09:54:14 +10:00
Patrick Oppenlander
40b9560521
HASH_PROCESS: fix overflow test
...
state_var.length counts bits, inlen is in bytes.
2020-08-17 09:44:21 +10:00
Steffen Jaeckel
3f1b6877c0
Merge pull request #541 from pattop/fixes
...
Minor dependency cleanups
2020-08-16 15:13:27 +02:00
Steffen Jaeckel
93ae347132
prevent usage of ifdef in code
2020-08-14 00:49:44 +02:00
Patrick Oppenlander
78f94225c8
error on missing dependencies for LTC_PBES and LTC_PKCS_5
2020-08-13 23:37:16 +02:00
Patrick Oppenlander
3a775da837
support compilation of x509 without LTC_MECC
2020-08-13 23:37:16 +02:00
Patrick Oppenlander
a5765d2b61
make ecc_ssh_ecdsa_encode_name conditional on LTC_SSH
...
This fixes build breakage when LTC_MECC is not defined:
src/pk/ecc/ecc_ssh_ecdsa_encode_name.c:20:74: error: unknown type name 'ecc_key'
20 | int ecc_ssh_ecdsa_encode_name(char *buffer, unsigned long *buflen, const ecc_key *key)
2020-08-13 23:37:16 +02:00
Steffen Jaeckel
40eea675cd
Merge pull request #534 from libtom/pr/macro-names-cleanup
...
Clean up macro names and static functions
2020-08-03 14:01:42 +02:00
Steffen Jaeckel
469eeaf632
prefix static function in multi2 with s_
...
This fixes #540
2020-07-16 11:03:40 +02:00
Steffen Jaeckel
c5d7bfb2cc
manually fix the remaining leading _'s
2020-07-16 10:38:33 +02:00
Steffen Jaeckel
373974edee
Revert "rename according to currently still valid rules"
...
This reverts commit 561d4ab8e8 .
2020-07-16 10:38:33 +02:00
Steffen Jaeckel
3447eaff53
also prefix static hash functions by s_
2020-07-16 10:38:33 +02:00
Steffen Jaeckel
4fd7b5002d
prefix static functions with s_
2020-07-14 18:44:40 +02:00
Karel Miko
cb63d3c074
Fix macro names - related to #448
2020-07-14 18:44:38 +02:00
Karel Miko
89d991e946
add macro name check to helper.pl
2020-07-14 18:44:23 +02:00
Steffen Jaeckel
d8d7a83b34
Merge pull request #539 from libtom/relicense
...
Relicense
2020-07-14 18:42:24 +02:00
Steffen Jaeckel
3630bee6fc
update LICENSE file
2020-07-14 18:41:30 +02:00
Steffen Jaeckel
9824af8e3b
update header
2020-07-14 18:41:30 +02:00
Steffen Jaeckel
24765c30c5
remove footer
2020-07-14 18:41:29 +02:00
Steffen Jaeckel
6b85be4095
Merge pull request #533 from libtom/fix-373
...
really implement DER decoding resursion limit
2020-07-14 18:40:46 +02:00
Steffen Jaeckel
561d4ab8e8
rename according to currently still valid rules
2020-06-20 12:43:08 +02:00
Steffen Jaeckel
cac400cf79
really implement DER decoding resursion limit
...
PR #373 did not really fix the issue of preventing a potential stack
overflow in case a lot of nested sequences have to be decoded.
Instead it only threw an error after successfully decoding all the nested
sequences.
This change fixes this and prevents the decoding.
2020-06-20 12:28:22 +02:00
Steffen Jaeckel
14ed10c11f
Merge pull request #535 from libtom/fix-532
...
Add "memory" to clobber list of `STORE/LOAD32`
2020-05-08 14:01:59 +02:00
Frédéric Recoules
19c6e7942d
Add "memory" to clobber list of STORE/LOAD32
...
c.f. cefff85550
2020-05-07 13:00:21 +02:00
Steffen Jaeckel
1937f41260
Merge pull request #523 from libtom/cleanup-hmac-state
...
remove unused `hashstate` from `hmac_state`
2019-11-22 12:03:27 +01:00
Steffen Jaeckel
c713e9536f
remove unused hashstate from hmac_state
2019-11-22 12:02:52 +01:00
Steffen Jaeckel
193086d6eb
Merge pull request #526 from libtom/latest-ltm
...
allow building against latest ltm
2019-11-22 11:43:15 +01:00
Steffen Jaeckel
8842720236
allow building against latest ltm
2019-11-21 08:53:30 +01:00
Steffen Jaeckel
0c30412a66
Merge pull request #503 from libtom/fix-502
...
Replace (ed|x)25519_set_key by (ed|x)25519_import_raw
2019-10-21 11:44:04 +02:00
Steffen Jaeckel
354c90517e
Merge pull request #514 from libtom/pr/fix-for-513
...
Avoid 64-bit rotation for i386 targets
2019-10-20 12:45:51 +02:00
Karel Miko
23a7ba244c
Avoid 64-bit rotation for i386 targets
2019-10-20 10:06:51 +02:00
Steffen Jaeckel
2d930616e0
Update docs
...
[skip ci]
2019-10-19 16:30:18 +02:00
Steffen Jaeckel
461a047afd
Update makefiles
2019-10-19 16:30:18 +02:00
Steffen Jaeckel
334876db78
rename x25519_set_key to x25519_import_raw
2019-10-19 16:30:18 +02:00
Steffen Jaeckel
44a18342ba
rename ed25519_set_key to ed25519_import_raw
2019-10-19 16:30:18 +02:00
Steffen Jaeckel
3540fd713c
fixup x25519_import()
...
bring x25519_import() in line with its ed25519 counterpart
2019-10-19 16:30:05 +02:00
Steffen Jaeckel
25410c7524
Merge pull request #505 from libtom/rsa-improvements
...
Add rsa_init() and rsa_shrink_key()
2019-10-17 22:28:18 +02:00
Steffen Jaeckel
5c6212af75
make rsa_shrink_key() private for now
2019-10-17 22:27:54 +02:00
Steffen Jaeckel
08abc93c40
Update makefiles
2019-10-17 22:27:54 +02:00
Steffen Jaeckel
4e28b922a9
add rsa_shrink_key()
2019-10-17 22:27:54 +02:00
Steffen Jaeckel
6fa98beb8a
fix comment
2019-10-17 22:27:54 +02:00
Steffen Jaeckel
b9a75829a6
add rsa_init()
2019-10-17 22:27:54 +02:00
Steffen Jaeckel
50584ac7ec
do timing on actual RSA key sizes
2019-10-17 22:27:54 +02:00
Steffen Jaeckel
49bb37dff1
Merge pull request #512 from fperrad/20191017_indent
...
fix indentation
2019-10-17 22:27:32 +02:00
Francois Perrad
38c144870b
fix indentation
2019-10-17 17:17:38 +02:00
Steffen Jaeckel
9682df98e4
Merge pull request #511 from libtom/more-fixes
...
More fixes
2019-10-17 14:50:11 +02:00
Steffen Jaeckel
68cc580602
use macros in more tests
2019-10-17 12:49:20 +02:00
Steffen Jaeckel
a3310959d0
fix changed ltm API
2019-10-17 12:49:20 +02:00
Steffen Jaeckel
a68b703e22
use zeromem in stream-cipher done() functions
2019-10-17 10:29:27 +02:00
Steffen Jaeckel
ef55d1335e
fix some MSVC compiler warnings
2019-10-17 10:29:27 +02:00
Steffen Jaeckel
2a63adc1ab
add XSTRLEN
2019-10-17 10:29:27 +02:00
Steffen Jaeckel
fcdb14ede1
Merge pull request #500 from libtom/fix-ssh-api
...
Fix SSH API
2019-10-16 23:16:46 +02:00
Steffen Jaeckel
9b6bf32f88
use unsigned long for the length of a string
2019-10-13 14:05:41 +02:00
Steffen Jaeckel
27ec31d4f3
improve SSH decoding & doc
2019-10-13 14:05:41 +02:00
Steffen Jaeckel
c13dc105f3
verify pointer to be non-NULL before dereferencing
2019-10-13 14:05:41 +02:00
Steffen Jaeckel
58254f76e8
fix SSH string implementation
2019-10-13 14:05:41 +02:00
Steffen Jaeckel
f89909bd6c
use macros in ssh_test()
2019-10-13 14:05:41 +02:00
Steffen Jaeckel
8b5ce8ba7e
add ENSURE() macro
2019-10-13 14:05:41 +02:00
Steffen Jaeckel
26dc2766bd
move LTC_SSHDATA_EOL to the beginning of the enum
...
If there's an EOL at the end of the enum I'm tempted to add new entries
before that one and then this will break the ABI which I don't like.
2019-10-13 14:05:41 +02:00
Steffen Jaeckel
5ded083bb0
Merge pull request #497 from libtom/bcrypt
...
Bcrypt
2019-10-13 14:05:13 +02:00
Steffen Jaeckel
36260aea85
Update makefiles
2019-10-12 14:31:38 +02:00
Steffen Jaeckel
d4233e9156
rename arguments
2019-10-12 14:31:38 +02:00
Steffen Jaeckel
e9ff57d5d7
fix varargs error
...
When compiling with "-g -O0" valgrind complained about "Conditional jump
or move depends on uninitialised value(s)", c.f. e.g. [1]
[1] https://travis-ci.org/libtom/libtomcrypt/jobs/588690930
2019-10-12 14:31:38 +02:00
Steffen Jaeckel
9423f3b26d
add bcrypt
2019-10-12 14:31:38 +02:00
Steffen Jaeckel
5e30d3512f
add required private API
2019-10-12 13:13:49 +02:00
Steffen Jaeckel
e69579cac2
start re-factor
2019-10-12 13:13:49 +02:00
Steffen Jaeckel
238eb7339a
Merge pull request #504 from libtom/minor-fixes
...
Minor fixes and improvements
2019-10-12 13:11:20 +02:00
Steffen Jaeckel
c0d1cbdf1d
fix #469
...
[skip ci]
2019-10-11 14:32:22 +02:00
Steffen Jaeckel
4fd4e86ce0
re-order examples
2019-10-11 14:32:22 +02:00
Steffen Jaeckel
d2027d60eb
add testcase for issue #507
2019-10-11 14:32:22 +02:00
Steffen Jaeckel
197621d867
re-order vars of travis.yml
...
the travis UI shows them right besides the build and the name says more
than the script on what is done
2019-10-11 14:32:22 +02:00
Steffen Jaeckel
8d22018065
don't produce any console-output on make V=0
2019-10-11 14:32:22 +02:00
Steffen Jaeckel
5e41924d85
use mp_init_copy() instead of init()+copy()
2019-10-11 14:32:22 +02:00
Steffen Jaeckel
34d865488b
update LTC_DEPRECATED macro from ltm
2019-10-11 14:32:22 +02:00
Steffen Jaeckel
3e11e86f3e
further updated ltm API
2019-10-11 14:32:22 +02:00
Steffen Jaeckel
c113c03c13
run {A,UB}SAN again with GMP
...
Fixup of 798d7dc61f
2019-10-11 14:32:22 +02:00
Steffen Jaeckel
9c67f8ac3c
Fix includes
...
Headers which are included with '< >' can only be found if the folder where
the files are located is given as include path.
To be able to install the files to a separate folder, include them instead
with '" "'.
2019-10-11 14:32:22 +02:00
Steffen Jaeckel
0ca8a31cd3
clean-up define
2019-10-11 14:32:22 +02:00
Steffen Jaeckel
f9ab401098
check ranges of more ciphers
...
Inspired by #493 of @jbech-linaro I reviewed all blockciphers
for similar patterns.
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
2019-10-11 14:32:22 +02:00
Steffen Jaeckel
659540393e
Merge pull request #506 from libtom/add-tea
...
Add TEA blockcipher
2019-10-11 14:30:21 +02:00
Steffen Jaeckel
79f812c9f4
update TV's
2019-10-11 14:20:43 +02:00
Steffen Jaeckel
06a58ab519
update doc
2019-10-11 14:20:43 +02:00
Steffen Jaeckel
74197c81c5
Update makefiles
2019-10-11 14:20:43 +02:00
Steffen Jaeckel
0f2c415e7a
add TEA
2019-10-11 14:20:43 +02:00
Steffen Jaeckel
8e044b8bf6
Merge pull request #509 from armcc/improve-des-tests
...
fix and cleanup des and 3des test cases
2019-10-11 09:39:13 +02:00
Andre McCurdy
d85045e18a
fix and cleanup des and 3des test cases
...
- Drop unused 'num' field from struct des_test_case.
- Fix the order of arguments passed to compare_testvector() (actual
and expected buffers were swapped, leading to misleading error
messages for failing tests).
- Enable all DES test vectors by default and use them for both
encrypt and decrypt. That allows the struct des_test_case 'mode'
field (which was previously incorrect for the LTC_TEST_EXT tests)
to be dropped.
- Run the "encrypt / decrypt all zero's" tests once, instead of
running repeatedly from within the test vectors loop.
- Add minimal set of 128bit key 3DES test vectors.
- Try to more closely align the des_test() and des3_test() functions
(common flow, common variable names, etc).
- Minor indent fixes.
Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
2019-10-10 00:58:55 -07:00
Steffen Jaeckel
64d1153e5a
Merge pull request #508 from werew/develop
...
Fixes #507
2019-10-08 09:07:43 +02:00
werew
25c26a3b7a
Fixes #507
2019-10-03 19:57:10 +02:00
Steffen Jaeckel
734ba7ec50
Merge pull request #499 from libtom/minor-improvements
...
Minor improvements
2019-09-30 15:00:05 +02:00
Steffen Jaeckel
da9f55231f
don't exclude other settings when giving make options
...
Now `make LTC_DEBUG=1` builds a full-speed library but with debug infos.
One has to do `make LTC_DEBUG=1 IGNORE_SPEED=1` now to have the same
results as before.
This was done since
1. it makes sense to enable optimization also when adding debug infos
2. clang+valgrind creates errors if there's no optimization enabled
(c.f. #497 )
2019-09-30 11:55:51 +02:00
Steffen Jaeckel
d4b8d9b507
fix scan-build error
2019-09-30 11:55:51 +02:00
Steffen Jaeckel
9416a88468
install libtool-bin
2019-09-30 11:55:49 +02:00
Steffen Jaeckel
e4dd30af54
run tests on bionic
2019-09-30 11:54:07 +02:00
Steffen Jaeckel
4458e91151
be more strict when searching scan-build-*
...
clang-9 brings `scan-build-py-9` which matched the old pattern
2019-09-30 11:54:03 +02:00
Steffen Jaeckel
62bbdecaff
use rotate intrinsics if available
2019-09-30 11:35:49 +02:00
Steffen Jaeckel
33dabf9693
only run the standard build in travis PR's
...
all the other builds are only get built, the testrun is skipped
2019-09-30 11:35:49 +02:00
Steffen Jaeckel
e2f5d17dcc
test default-build as first
2019-09-30 09:59:59 +02:00
Steffen Jaeckel
6f3a7c9e3e
improve GNU Makefiles a bit
...
* unignore type-limits warning
* add the possibility to do `make V=0 >/dev/null` and still get the
CFLAGS and LDFLAGS that are used while compilation
2019-09-30 09:59:59 +02:00
Steffen Jaeckel
1e67d81f7b
Merge pull request #498 from libtom/appveyor
...
Add AppVeyor MSVC builds
2019-09-29 17:33:24 +02:00
Steffen Jaeckel
eaf2c7b6b9
fix build for msvc
2019-09-24 14:09:35 +02:00
Steffen Jaeckel
d25c52b546
add AppVeyor to README
2019-09-24 14:09:35 +02:00
Steffen Jaeckel
b4c6c4c45f
also build on appveyor
2019-09-24 13:24:09 +02:00
Steffen Jaeckel
a1f6312416
Merge pull request #493 from jbech-linaro/rijndael_range
...
check range in _rijndael_ecb_ functions
2019-09-04 13:44:47 +02:00
Joakim Bech
7b4a5c1dcf
check range in _rijndael_ecb_ functions
...
There is no check that the 'skey' structure has been properly
initialized. For example, the skey->rijndael.Nr is assumed to contain a
positive number corresponding to the number of AES rounds to perform. In
_rijndael_ecb_encrypt the skey->rijndael.Nr is subtracted by two, which
can result in an integer underflow if the structure hasn't been
initialized correctly.
By clamping the value for skey->rijndael.Nr into the valid rounds for
AES we can return an error instead of ending up reading outside the
boundaries (of skey->rijndael.eK).
Signed-off-by: Joakim Bech <joakim.bech@linaro.org>
Reported-by: Martijn Bogaard <bogaard@riscure.com>
2019-08-02 10:39:08 +02:00
Steffen Jaeckel
e01e4c5c97
Merge pull request #491 from fperrad/20190610_lint
...
some linting
2019-06-11 07:55:21 +02:00
Francois Perrad
75d53696c2
remove useless initialization
2019-06-10 23:56:27 +02:00
Steffen Jaeckel
c23f4699fb
Merge pull request #490 from libtom/improve/curve25519
...
Improve curve25519
2019-06-10 21:53:51 +02:00
Steffen Jaeckel
c971205404
fix clang-tidy warnings: do not use else after return
2019-06-10 12:48:16 +02:00
Steffen Jaeckel
e673906026
fix differing parameter names
2019-06-10 12:48:16 +02:00
Steffen Jaeckel
0b06979b10
prefix tweetnacl crypto_ API
2019-06-10 12:48:16 +02:00
Karel Miko
10056ed540
make crypto_verify_32 static
2019-06-10 12:32:28 +02:00
Karel Miko
1301cc5d2f
fix clang-tidy warnings: do not use else after return
2019-06-10 12:31:56 +02:00
Steffen Jaeckel
3da27d71a0
Improve comments&doc
...
[skip ci]
2019-06-10 03:28:42 +02:00
Steffen Jaeckel
55d6661d48
Update makefiles
2019-06-09 23:20:45 +02:00
Steffen Jaeckel
fef07fd843
add documentation of Curve25519 API
2019-06-09 23:20:45 +02:00
Steffen Jaeckel
e0a9114129
move setting of sig-verification result to crypto_sign_open()
2019-06-09 23:20:45 +02:00
Steffen Jaeckel
0392867678
use shared {ed,x}25519_export() implementation
2019-06-09 23:20:45 +02:00
Steffen Jaeckel
3957c22e28
remove unused code from tweetnacl
2019-06-09 23:20:45 +02:00
Steffen Jaeckel
819656a12f
add ed25519_make_key() testcase
2019-06-09 23:20:45 +02:00
Steffen Jaeckel
41731855c9
fix comment
2019-06-09 23:20:45 +02:00
Steffen Jaeckel
e3766e16ca
add real pkcs#8 import of Curve25519 private keys
2019-06-09 22:46:57 +02:00
Steffen Jaeckel
8ea0fb1195
rename x25519_set_ku() to x25519_set_key()
2019-06-09 22:46:57 +02:00
Steffen Jaeckel
5d87aa21a5
Merge pull request #364 from libtom/feature/curve25519
...
Add curve25519
2019-06-09 22:22:39 +02:00
Steffen Jaeckel
47c34b37ef
Update makefiles
2019-06-09 20:41:04 +02:00
Steffen Jaeckel
94b894fda9
update tests
2019-06-09 20:41:04 +02:00
Steffen Jaeckel
34196b90b9
add {ed,x}25519_import_x509()
2019-06-09 20:41:04 +02:00
Steffen Jaeckel
54d7c6782b
clean-up macros
...
no need to enable them separately now
2019-06-09 20:41:04 +02:00
Steffen Jaeckel
233f8af490
draft-ietf-curdle-pkix is meanwhile rfc8410
2019-06-09 20:41:02 +02:00
Steffen Jaeckel
fe00be4abc
Fix removed oid_st
2019-06-09 20:40:42 +02:00
Steffen Jaeckel
52a24ca3a3
add Curve25519 API
2019-06-09 20:40:40 +02:00
Steffen Jaeckel
59190c4f3c
fix warnings & apply required changes
2019-06-09 11:43:54 +02:00
Steffen Jaeckel
a5072b17d5
add new signed datatype
2019-06-09 11:43:54 +02:00
Steffen Jaeckel
5698e0592c
remove not required stuff & re-implement crypto_hash()
2019-06-09 11:43:54 +02:00
Steffen Jaeckel
ee11f2d500
add headers & footers
2019-06-09 11:43:54 +02:00
Steffen Jaeckel
85e902bcc0
add tweetnacl.c Version 20140427
2019-06-09 11:43:54 +02:00
Steffen Jaeckel
c600d81e31
Merge pull request #489 from libtom/pr/fix-stringop-truncation
...
Fix gcc 8.3 warning (stringop-truncation)
2019-06-09 11:40:51 +02:00
Karel Miko
5f09c2c584
Fix gcc 8.3 warning (stringop-truncation)
2019-06-09 11:40:27 +02:00
Steffen Jaeckel
65282c17b5
Merge pull request #488 from libtom/update/ltm
...
Update ltm
2019-06-09 11:39:19 +02:00
Steffen Jaeckel
7c56243a0f
use replacement functions if they're available
...
we use the fact that in the same move of deprecating those functions,
tommath_class.h also isn't included anymore in tommath.h so those defines
are gone as well and can be used as an indication if the new functions are
available
2019-06-06 15:06:20 +02:00
Steffen Jaeckel
c11287a0ad
latest version of ltm deprecated DIGIT_BIT
2019-06-06 15:06:20 +02:00
Steffen Jaeckel
4ed50d8da1
Merge pull request #485 from libtom/minor-fixes
...
Minor fixes
2019-06-05 09:24:19 +02:00
Steffen Jaeckel
b0bb7c830a
fix missing dependencies
2019-06-04 08:50:27 +02:00
Steffen Jaeckel
4b3ef78901
TGTLIBTOOL wasn't always defined
2019-06-04 08:50:27 +02:00
Steffen Jaeckel
061237e6b1
Merge pull request #484 from fperrad/20190603_indent
...
fix indentation
2019-06-03 09:31:01 +02:00
Francois Perrad
b40cc35c2d
fix indentation
2019-06-03 04:18:53 +02:00
Steffen Jaeckel
e9b2277a49
Merge pull request #483 from libtom/improve/x509
...
Improve/x509
2019-06-02 22:19:43 +02:00
Steffen Jaeckel
f6299995f8
update ecc_import_x509()
2019-05-27 10:05:11 +02:00
Steffen Jaeckel
21fa9cd92e
Update makefiles
2019-05-27 10:05:11 +02:00
Steffen Jaeckel
dfa5258db5
update rsa_import_x509()
2019-05-27 10:05:11 +02:00
Steffen Jaeckel
5119e71023
add x509_decode_public_key_from_certificate()
2019-05-27 10:05:11 +02:00
Steffen Jaeckel
c28a8495d2
Merge pull request #481 from RektInator/develop
...
fixed compile issue on msvc++
2019-05-08 17:19:56 +02:00
Micky Langeveld
596e9a65e6
fixed compile issue on msvc++
2019-04-18 09:22:38 +02:00
Steffen Jaeckel
e8afa13d5c
Merge pull request #476 from libtom/fix/474
...
Fix issue #474
2019-04-10 17:05:59 +02:00
Steffen Jaeckel
19e7f73948
fix scan-build warnings
2019-04-10 11:26:33 +02:00
Steffen Jaeckel
99fcbea2a2
don't error-out if no MPI is available
2019-04-10 11:26:33 +02:00
Steffen Jaeckel
a72aa2fc14
try to make travis job error-out if first build fails
2019-04-10 11:26:33 +02:00
Steffen Jaeckel
a76c823992
fix unused-function _sha256() in xsalsa20_test.c
2019-04-10 11:26:32 +02:00
Steffen Jaeckel
5f7feeab59
fix build
...
* LDFLAGS were missing when building the demo's
* change how CFLAGS and EXTRALIBS are passed
* also use EXTRALIBS when running testbuild.sh
2019-04-10 11:26:32 +02:00
Steffen Jaeckel
1bfde18513
FIPS 186.4 compliant usage of ltm mp_prime_is_prime()
2019-04-10 11:26:32 +02:00
Steffen Jaeckel
5ed32b73e6
improve ecc_test() output
2019-04-10 11:26:32 +02:00
Steffen Jaeckel
27d09b6104
also provide LTC_NORETURN for msvc
2019-04-10 09:17:50 +02:00
Steffen Jaeckel
a9ff2d0dac
fixup meta_builds.sh after 798d7dc61f
2019-01-02 23:30:00 +01:00
Steffen Jaeckel
d58103d54f
oops, NORETURN isn't only used in crypt_argchk()
2019-01-02 22:22:34 +01:00
Steffen Jaeckel
ee13f6ffec
let ssh_test() NOP silently
2018-12-31 17:22:28 +01:00
Steffen Jaeckel
912f6da757
add some more builds to travis
2018-12-29 22:37:50 +01:00
Steffen Jaeckel
b7874c5864
fix warnings when using other ARGTYPE's
2018-12-29 22:37:09 +01:00
Steffen Jaeckel
798d7dc61f
turn around static and dynamic build-options in travis recipe
2018-12-29 18:09:33 +01:00
Steffen Jaeckel
252a172c08
SSH requires MPI funtionality
2018-12-29 18:08:46 +01:00
Steffen Jaeckel
f95be00582
unconditonally create ssh_test()
2018-12-29 18:08:31 +01:00
Steffen Jaeckel
f6f70aa2ec
fix ssh tests when compiled w/o MPI provider
2018-12-29 18:08:07 +01:00
Steffen Jaeckel
4b448d29a2
fix warnings on ARGTYPE=3
2018-12-29 18:02:42 +01:00
Steffen Jaeckel
01c455c3d5
Merge pull request #473 from libtom/fixup/padding_pad
...
fix compilation of padding_pad
2018-12-17 15:44:02 +01:00
Jordan Hrycaj
11ee9683e7
fix compilation of padding_pad
...
... in cases where rng_get_bytes() isn't available
2018-12-17 13:28:47 +01:00
karel-m
d432b13139
Merge pull request #465 from libtom/pr/ecc-test-cleanup
...
ecc_test cleanup
2018-11-07 13:35:57 +01:00
Karel Miko
ae2ab2083b
ecc_test cleanup
2018-11-07 09:25:08 +01:00
Karel Miko
0de6fa3084
Update makefiles
2018-11-07 09:15:34 +01:00
karel-m
3fa462a7f0
Merge pull request #464 from fperrad/20181029_indent
...
fix indentation
2018-10-29 20:33:05 +01:00
Francois Perrad
acf3fcda84
fix indentation
2018-10-29 18:56:02 +01:00
karel-m
f413335b2a
Merge pull request #463 from libtom/pr/ssh-decode-encode-fix
...
Avoid using LOAD32H/STORE32H with unsigned long
2018-10-29 13:04:52 +01:00
Karel Miko
09d116da87
avoid using LOAD32H/STORE32H with unsigned long
2018-10-29 11:28:07 +01:00
karel-m
62cd87342e
Merge pull request #451 from libtom/pr/wycheproof-gcm
...
Wycheproof failing GCM test - invalid/modified tag
2018-10-29 07:28:56 +01:00
Karel Miko
7d8567695b
update doc - chacha20poly1305_memory + gcm_memory
2018-10-29 07:28:18 +01:00
Karel Miko
9a1131da14
add tag validation to chacha20poly1305_memory in decrypt mode
2018-10-29 07:28:18 +01:00
Karel Miko
fd4d8fbc05
add tag validation to gcm_memory in decrypt mode
2018-10-29 07:28:18 +01:00
Karel Miko
27c472654c
fix chacha20poly1305 encrypt/decrypt empty pt/ct
2018-10-29 07:28:18 +01:00
Karel Miko
2599618ca6
wycheproof failing test - invalid/modified tag
2018-10-29 07:28:18 +01:00
karel-m
60eb5d0591
Merge pull request #454 from libtom/pr/wycheproof-padding
...
Wycheproof failing PKCS7 depadding test
2018-10-29 07:27:26 +01:00
Karel Miko
dee704d063
padding_depad + PKCS7 - reject invalid pad 0
2018-10-29 07:26:40 +01:00
Karel Miko
2adc261612
wycheproof failing PKCS7 depadding test
2018-10-29 07:26:40 +01:00
karel-m
332f66dfbe
Merge pull request #452 from libtom/pr/wycheproof-ccm
...
Wycheproof failing CCM test - invalid tag len
2018-10-29 07:25:55 +01:00
Steffen Jaeckel
9a0df8d936
fix scan-build
2018-10-27 10:50:27 +02:00
Steffen Jaeckel
ac5192cf56
update CCM tv's and tv generation
2018-10-27 10:50:27 +02:00
Karel Miko
890c1a8dad
fix - CCM invalid tag len
2018-10-27 10:50:27 +02:00
Karel Miko
93c676ccd8
wycheproof failing CCM test - invalid tag len
2018-10-27 10:50:27 +02:00
karel-m
983fd25e40
Merge pull request #459 from libtom/pr/copy_or_zeromem
...
Avoid LTC_ARGCHK in void functions
2018-10-27 10:46:53 +02:00
Karel Miko
058a7e2c4e
properly use LTC_ARGCHKVD in void function
2018-10-26 19:35:06 +02:00
Steffen Jaeckel
99f9181f67
Merge pull request #456 from dinamicoplus/patch-1
...
Fix RSA Encryption Example
2018-10-25 16:42:54 +02:00
Marcos Brito
be29591812
Fix RSA Encryption Example
...
RSA Encryption Example is missing a closing comment bracket */
2018-10-25 16:34:45 +02:00
Karel Miko
9c0d708523
fix typo pkcs7_depad > padding_depad [skip-ci]
2018-10-15 10:51:17 +02:00
karel-m
fba6ae3ed7
Merge pull request #447 from libtom/pr/ecc-LTC_ECCSIG_RFC7518_RELAXED
...
Make LTC_ECCSIG_RFC7518 strict (again)
2018-10-13 18:50:48 +02:00
Karel Miko
c2cdaaab4d
make LTC_ECCSIG_RFC7518 strict (again)
2018-10-13 18:48:49 +02:00
karel-m
dec99ed99c
Merge pull request #438 from rmw42/feature/ssh-ecdsa
...
LTC_ECCSIG_RFC5656 SSH+ECDSA signature format
2018-10-13 17:51:29 +02:00
Russ Williams
4ee5bfc013
GCC 4.8 -Wmaybe-uninitialized is *really* dumb
2018-10-12 10:22:10 +01:00
Russ Williams
7c4d7cb610
Fixes suggested by Matt Johnston
2018-10-12 10:22:10 +01:00
Russ Williams
9706aa62a7
Update makefiles
2018-10-12 10:22:10 +01:00
Russ Williams
b4b50cc0c6
Initial commit of SSH+ECDSA signature format
...
Wrap signature format in #ifdef LTC_SSH
Update docs
Code review fixes
Replace strcmp/memcmp with XSTRCMP/XMEMCMP for check-source
Fix for check-defines
XSTRCMP/XMEMCMP != 0
GCC7.3 wants only literal strings for sprintf format
Code review changes
Rework SSH decoding and tests
Fix encoding and tests
COMPARE_TESTVECTOR macro
Single return point in ssh_decode_sequence_multi
Actually use XSTRNCPY rather than just defining it
More code review fixes
Code review tweaks
Ensure it's not possible to read past buffer end
Keep track of size remaining, not end pointer
2018-10-12 10:22:10 +01:00
Steffen Jaeckel
2e7c194322
Merge pull request #445 from fperrad/20181007_lint
...
pbes: some linting
2018-10-08 15:34:49 +02:00
Francois Perrad
a381957846
more const
2018-10-07 14:52:43 +02:00
Francois Perrad
bd767a3116
fix condition
2018-10-07 14:52:36 +02:00
Francois Perrad
46bb470aaa
remove useless initialization
2018-10-07 14:52:16 +02:00
Steffen Jaeckel
838feac7c6
Merge pull request #404 from libtom/pr/pkcs8-improved
...
Improved pkcs8 support
2018-10-07 11:40:30 +02:00
Steffen Jaeckel
a55e7caa48
fix missing handling of optional keyLength in PBKDF2-params
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
f81bdc46e7
add more rsa-pkcs8 PBES2-RC2 test-files
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
c96639bef6
add rsa-pkcs8 PBES2 AES and SHA512-224/256 test-files
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
cbe65fe59a
add rsa-pkcs8 PBE-SHA1-3DES test-file
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
8fabca6171
merge duplicated tables into separate chapter
...
[skip ci]
2018-10-06 23:04:51 +02:00
Karel Miko
14b09138a9
doc update
...
[skip ci]
2018-10-06 23:04:51 +02:00
Karel Miko
8349eda5a5
fix LTC_EASY test failure
2018-10-06 23:04:51 +02:00
Karel Miko
e5a2683f5b
RSA - pkcs8 test keys
2018-10-06 23:04:51 +02:00
Karel Miko
2dd8bcdfe9
rsa_import_pkcs8 tests
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
7af942a66b
use pkcs8_decode_flexi() in rsa_import_pkcs8()
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
52c5473a13
use pkcs8_decode_flexi() in ecc_import_pkcs8()
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
bc673c2853
implement pkcs8_decode_flexi()
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
a2ec37b93c
refactor PBES into separate modules
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
aac1e592b4
Update makefiles
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
0af0033390
add empty der_decode_pkcs8_flexi.c
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
362e0c9284
add pk_oid_cmp_with_ulong()
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
4abd84b7c3
Update makefiles
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
3d6a49a64b
rename pk_oid_asn1.c to pk_oid_cmp.c
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
498a534b9c
Update makefiles
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
97d1c17c8d
add empty pbes files
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
6bdfa7c428
add _der_flexi_sequence_cmp()
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
c56053870a
pkcs#8 support for aes and reduced sha512
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
36d603e3d2
re-factor ecc_import_pkcs8()
2018-10-06 23:04:51 +02:00
Karel Miko
3c9d2ebc5e
clang-tidy fix misc-suspicious-string-compare
2018-10-06 23:04:51 +02:00
Karel Miko
e29fecde12
use ecc_find_curve + ecc_set_curve
2018-10-06 23:04:51 +02:00
Karel Miko
8207a6a1c4
use pkcs12_kdf + pkcs12_utf8_to_utf16
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
c4642bacf0
mark fall-through in switch-case to calm linter
2018-10-06 23:04:51 +02:00
Steffen Jaeckel
93e758a82e
introduce LTC_ASN1_IS_TYPE()
2018-10-06 23:04:51 +02:00
Karel Miko
bf04bf18a4
add ecc_import_pkcs8
2018-10-06 23:04:51 +02:00
Karel Miko
7529e02b96
Update makefiles
2018-10-06 23:04:51 +02:00
karel-m
223ece7f6d
Merge pull request #443 from libtom/pr/ecc-verify-was-too-strict
...
Less strict ecc_verify_hash_ex (as it was before ecc_recover_key)
2018-10-05 12:32:49 +02:00
Karel Miko
59bc3b5885
make ecc_verify_hash_ex less strict (as it was before ecc_recover_key addition)
2018-10-05 07:44:15 +02:00
karel-m
4d6f973b2d
Merge pull request #444 from libtom/pr/fix-unused-macros
...
Remove unused macros
2018-10-05 07:05:29 +02:00
Karel Miko
ef20f2e656
remove unused macros
2018-10-04 23:29:12 +02:00
karel-m
0157bef943
Merge pull request #442 from libtom/pr/ltc-byte
...
Rename macro 'byte' to 'LTC_BYTE'
2018-10-04 19:52:34 +02:00
Karel Miko
bb5ea12d0b
move LTC_BYTE macro from tomcrypt_macros.h to tomcrypt_private.h
2018-10-04 17:21:58 +02:00
Karel Miko
1bbbc60d06
rename macro byte >> LTC_BYTE - related to #439
2018-10-04 17:20:47 +02:00
Steffen Jaeckel
c5e4679b7a
Merge pull request #436 from rmw42/feature/ecrecover
...
Implement ecc_recover_key to recover public key from hash+signature
2018-09-30 16:28:22 +02:00
Russ Williams
88d9b6db26
Make ECC signature format explicit
...
Optionally return recovery ID from ecc_sign_hash()
Update documentation
Update tests for ECC recovery
Fix (v,r,s) signature format, regenerate recovery test
Fix over-freeing of private key
Code review fixes to docs
Rename LTC_ECCSIG_BLOCKCHAIN to LTC_ECCSIG_ETH to reflect original definition
Rename to LTC_ECCSIG_ETH27 to make clear it's using the Ethereum +27 convention
Code review changes - calculate recovery ID only if needed, type safety on signature format enum
Use enum for sigformat in docs, and add explanatory note for recid<0
Range checks on v, check RFC7518 signatures' length based on size of key. Fix for when order>prime.
Limit LET_ECCSIG_ETH27 to secp256k1 curve only
2018-09-29 21:07:41 +01:00
Russ Williams
57781c7acd
Update makefiles
2018-09-23 09:03:30 +01:00
Russ Williams
76190521e3
Implementation of ecc_recover_key to obtain public key from hash+signature
...
Workaround for TFM missing sqrtmod_prime
Fix unused variable warnings with USE_TFM, make TomsFastMath a runtime check
Disable ecc_recover_key if no ecc_mul2add available
Wrap ecc_recover_key and its test in #ifdef LTC_ECC_SHAMIR
Fix unused variables when built without LTC_ECC_SHAMIR
Code review tweaks
Code review tweaks - remove sigformat, tidy up (de)allocation
Code review tweaks
2018-09-23 09:03:30 +01:00
Larry Bugbee
b44155fdb0
Merge pull request #431 from libtom/streams-add-single-call-crypt-functions
...
Streams - add single call crypt functions
2018-09-21 12:03:36 -07:00
buggywhip
a2b343b2d0
streams-add-single-call-crypt-functions
...
fix mixed declarations and code
add _memory chacha_ivctr32() test
2018-09-10 02:21:09 -07:00
buggywhip
305a589d64
update makefiles
2018-09-10 02:21:09 -07:00
Steffen Jaeckel
e77ad636e7
Merge pull request #435 from fperrad/20180907_lint
...
some lintings
2018-09-08 17:00:54 +02:00
Francois Perrad
9d9718e56b
remove useless initialization
2018-09-08 11:49:36 +02:00
Francois Perrad
698790fdeb
explicit condition
2018-09-07 17:06:09 +02:00
Steffen Jaeckel
e5f56d4617
Merge pull request #429 from libtom/rework/oid
...
Remove oid_st
2018-09-07 16:49:25 +02:00
Steffen Jaeckel
fb7b8799cd
rename enum public_key_algorithms to something more generic
2018-09-07 11:58:54 +02:00
Steffen Jaeckel
4cf2e80346
remove oid_st
2018-09-07 11:58:54 +02:00
Steffen Jaeckel
af23fdd1c2
Update makefiles
2018-09-07 11:58:54 +02:00
Steffen Jaeckel
645460a5d5
add pk_oid_cmp_with_asn1()
2018-09-07 11:58:54 +02:00
Steffen Jaeckel
e318f6f1e3
re-work pk_oid_str functions a bit
2018-09-07 11:58:54 +02:00
Steffen Jaeckel
1a90da844c
only print der flexi-test on higher debug level
...
it's smashing the stack for some inputs :>
2018-09-07 11:58:54 +02:00
Steffen Jaeckel
caff4cea40
change pk_get_oid() to return a string
2018-09-07 11:58:54 +02:00
Steffen Jaeckel
41599db904
Update makefiles
2018-09-07 11:58:54 +02:00
Steffen Jaeckel
fdc97f8648
move oid functions to own folder
2018-09-07 11:58:54 +02:00
Steffen Jaeckel
86ff14100f
Merge pull request #430 from libtom/fix/oid-decode
...
Fix OID issues
2018-09-07 11:57:38 +02:00
Steffen Jaeckel
2e9c80cbc1
fix der_length_object_identifier()
...
... there are only three root nodes
As of X6.90 Ch. 8.19.4: "NOTE – This packing of the first two
object identifier components recognizes that only three values
are allocated from the root node..."
2018-09-07 08:24:25 +02:00
Steffen Jaeckel
6584569872
add another OID testcase for root-node 3
2018-09-07 08:24:25 +02:00
Steffen Jaeckel
4ffdb915f0
fix der_decode_object_identifier()
2018-09-07 08:24:25 +02:00
Steffen Jaeckel
079ed04b17
add OID testcase from x.690
2018-09-07 08:24:25 +02:00
Steffen Jaeckel
bd542c6c30
Merge pull request #433 from orbea/rlibtool
...
makefile.shared: Support rlibtool.
2018-09-07 08:24:03 +02:00
orbea
ccc18b9eda
makefile.shared: Support rlibtool.
...
When building libtomcrypt with rlibtool instead of libtool it will fail
when rlibtool fails to parse the generated libtool which does not exist.
Since rlibtool should be the default choice for most slibtool users in
the future this patch will use slibtool-shared instead which will
correctly build the shared library.
This could also help build the shared library on additional targets and
hosts where the stock libtool does not have shared libraries enabled.
2018-09-06 18:19:10 +02:00
Steffen Jaeckel
c9c3c42739
Merge branch 'streams-make_state_names_consistent' into develop
...
This fixes #427
2018-07-10 07:11:39 +02:00
buggywhip
380d1d2452
streams-make_state_names_consistent
2018-07-09 17:31:24 -07:00
karel-m
c9376c29ba
Merge pull request #428 from libtom/pr/fix-gcc-warnings1
...
fix -Wmissing-declarations -Wmissing-prototypes -Wmissing-noreturn
2018-07-09 11:32:35 +02:00
Karel Miko
ba8fa04f9a
reorganize ifdefs in tv_gen
2018-07-08 21:59:06 +02:00
Karel Miko
4fb0562a3b
fix -Wmissing-declarations -Wmissing-prototypes -Wmissing-noreturn
2018-07-07 19:54:08 +02:00
Steffen Jaeckel
b5009d704c
Merge pull request #426 from libtom/feature/pkcs12
...
Feature/pkcs12
2018-07-06 18:37:54 +02:00
Steffen Jaeckel
53fc5694c9
re-work pkcs12 a bit
2018-07-06 18:26:43 +02:00
Steffen Jaeckel
6fe1b5b765
Update makefiles
2018-07-06 18:26:43 +02:00
Karel Miko
a96997dd29
add pkcs12_utf8_to_utf16()
2018-07-06 18:26:43 +02:00
Karel Miko
b3f483a204
add pkcs12_kdf()
2018-07-06 18:26:43 +02:00
karel-m
98ad88b3ee
Merge pull request #422 from libtom/pr/clang-tidy-google-readability-braces-around-statements
...
fix clang-tidy warning: google-readability-braces-around-statements
2018-07-06 17:53:12 +02:00
Karel Miko
a3dab04074
fix clang-tidy warning: google-readability-braces-around-statements
2018-07-06 13:58:15 +02:00
karel-m
e02694cfc2
Merge pull request #393 from libtom/pr/ecc-doc-update
...
ECC doc update
2018-07-06 13:44:17 +02:00
Karel Miko
4f3bce103f
move ecc_make_key_ex to Legacy Key Generation
...
[skip ci]
2018-07-06 13:42:54 +02:00
Karel Miko
b30c27066d
new names: ecc_find_curve, ecc_set_curve
2018-07-06 13:42:38 +02:00
Steffen Jaeckel
415c19b8df
re-work ECC docs a bit
...
[skip ci]
2018-07-06 13:42:38 +02:00
Karel Miko
57c884d50d
ECC doc update
...
[skip ci]
2018-07-06 13:42:38 +02:00
karel-m
d3c5890a1b
Merge pull request #423 from libtom/pr/ecc_set_dp--ecc_set_curve
...
rename ecc_set_dp >> ecc_set_curve + ecc_get_curve >> ecc_find_curve
2018-07-06 13:39:51 +02:00
Karel Miko
4bec98f88c
rename ecc_get_curve to ecc_find_curve
2018-07-04 10:43:15 +02:00
Karel Miko
611ca6bf14
rename ecc_set_dp (+related) to ecc_set_curve
2018-07-04 10:41:10 +02:00
Karel Miko
091d52828c
Update makefiles
2018-07-04 10:41:02 +02:00
karel-m
4473953742
Merge pull request #415 from libtom/pr/clang-tidy-else-after-return
...
fix clang-tidy warning: readability-else-after-return
2018-07-03 22:45:28 +02:00
Karel Miko
ed2ec2e3ed
add script .ci/clang-tidy.sh
2018-07-03 22:43:26 +02:00
Karel Miko
22b764ec85
fix clang-tidy warning: readability-else-after-return
2018-07-03 22:42:15 +02:00
karel-m
6ac6d36bf4
Merge pull request #416 from libtom/pr/clang-tidy-readability-non-const-parameter
...
fix clang-tidy warning: readability-non-const-parameter
2018-07-03 22:37:34 +02:00
Karel Miko
ae6aa3dd86
fix clang-tidy warning: readability-non-const-parameter
2018-07-03 22:37:05 +02:00
karel-m
48ad48f900
Merge pull request #417 from libtom/pr/clang-tidy-readability-inconsistent-declaration-parameter-name
...
fix clang-tidy warning: inconsistent-declaration-parameter-name
2018-07-03 22:35:56 +02:00
Karel Miko
12c3091077
fix clang-tidy warning: readability-inconsistent-declaration-parameter-name - issue #376
2018-07-03 22:33:48 +02:00
karel-m
168f3bd1db
Merge pull request #421 from libtom/pr/tests-cosmetics
...
fix "make test" built with no math provider or multiple providers
2018-07-03 22:30:41 +02:00
Karel Miko
fc056a645d
fix "make test" built with no math provider or multiple providers
2018-07-03 00:12:08 +02:00
Steffen Jaeckel
3fb0eea01b
show in SCRYPT etc. that we're on develop
2018-07-02 23:25:20 +02:00
Steffen Jaeckel
215ec5f69d
Merge tag 'v1.18.2' into develop
...
libtomcrypt v1.18.2
2018-07-02 23:23:47 +02:00
Steffen Jaeckel
7e7eb695d5
Merge branch 'release/1.18.2'
2018-07-01 22:49:01 +02:00
Steffen Jaeckel
a015a8f05f
don't install test in target install_all
...
This fixes #396
2018-07-01 22:47:05 +02:00
Steffen Jaeckel
54e6db588a
Bump version
2018-07-01 12:51:54 +02:00
Steffen Jaeckel
788a0463b9
Update changes
...
[skip ci]
2018-06-22 14:25:34 +02:00
Steffen Jaeckel
bf5ad76c28
Merge pull request #414 from libtom/fix/411
...
Fix/411
(cherry picked from commit 8972027b46 )
2018-06-22 11:33:54 +02:00
Steffen Jaeckel
8972027b46
Merge pull request #414 from libtom/fix/411
...
Fix/411
2018-06-22 11:33:14 +02:00
Steffen Jaeckel
73426f4b26
fix constants and sizes demos
2018-06-22 10:10:23 +02:00
Steffen Jaeckel
ecfe5882ac
re-factor crypt_list_all_sizes()
2018-06-22 10:10:23 +02:00
Steffen Jaeckel
8bc889cd64
re-factor crypt_list_all_constants()
2018-06-22 10:10:23 +02:00
Steffen Jaeckel
07b626d7a1
fix-up 250eced904
2018-06-22 02:05:03 +02:00
Steffen Jaeckel
11bdffcf05
fix-up 719d297e9f
2018-06-22 00:31:44 +02:00
karel-m
250eced904
Merge pull request #408 from libtom/pr/fix-cve-2018-12437
...
ecc_sign_hash blinding CVE-2018-12437
(cherry picked from commit 6aef5e3765 )
2018-06-22 00:17:24 +02:00
Steffen Jaeckel
927b196210
Merge pull request #406 from libtom/remove-sosemanuk_setup()-"NOP"
...
Sosemanuk - remove what is effectively a NOP
2018-06-19 11:45:38 +02:00
Steffen Jaeckel
fd6535c74b
remove lying comment
2018-06-19 11:45:13 +02:00
Larry Bugbee
6cfa1fcad7
remove what is effectively a NOP
...
prior return stmt was a failed attempt to initialize the remaining bytes of the state which is also negated by the policy of enforcing a call to sosemanuk_setiv() before calling sosemanuk_crypt().
2018-06-19 11:44:04 +02:00
karel-m
6aef5e3765
Merge pull request #408 from libtom/pr/fix-cve-2018-12437
...
ecc_sign_hash blinding CVE-2018-12437
2018-06-19 09:30:51 +02:00
Karel Miko
f0a51bbdbd
ecc_sign_hash blinding CVE-2018-12437
2018-06-17 12:54:01 +02:00
Steffen Jaeckel
b7873025b7
Merge pull request #405 from libtom/pr/fix-ecc_import_openssl
...
fix ecc_import_openssl - bin_seed size
2018-06-12 08:17:48 +02:00
Karel Miko
5efbddc3f4
fix ecc_import_openssl - bin_seed size
2018-06-12 00:00:11 +02:00
Steffen Jaeckel
6238b6381f
Merge pull request #187 from libtom/pr/ecc-asn1-part
...
ECC-step3: extra import/export (ASN.1 related)
2018-06-11 19:13:21 +02:00
Steffen Jaeckel
4f36e03970
re-factor ecc_import_openssl()
...
... into several smaller functions
2018-06-11 10:00:37 +02:00
Karel Miko
05d397d634
ECC improved import/export
2018-06-11 10:00:37 +02:00
Karel Miko
abedfa17eb
Update makefiles
2018-06-11 10:00:37 +02:00
karel-m
d11a1a7f06
Merge pull request #402 from libtom/pr/fix-ecc_set_key
...
fix ecc_set_key - no check of private key input buffer size
2018-06-10 19:06:24 +02:00
Karel Miko
70d800f6b3
fix ecc_set_key - no check of private key input buffer size
2018-06-10 17:30:00 +02:00
karel-m
504396764e
Merge pull request #401 from libtom/pr/fix-der_length_custom_type
...
fix der_length_custom_type - incorrect length of length
2018-06-10 17:27:54 +02:00
Karel Miko
ac1622e042
fix der_length_custom_type - incorrect length of length
2018-06-05 16:39:38 +02:00
karel-m
a8d0442bd3
Merge pull request #400 from libtom/pr/avoid-anonymous-union
...
avoid anonymous union
2018-06-04 11:49:23 +02:00
Karel Miko
5834223db5
avoid anonymous union (which is not supported by some compilers)
2018-06-04 08:56:29 +02:00
karel-m
10355675a9
Merge pull request #398 from libtom/improve/base16_api
...
Improve base16 api
2018-06-04 08:55:07 +02:00
Steffen Jaeckel
06c0606da2
generalize caps argument of base16_encode()
...
probably we want to add more options in the future
I could think of support for some options of `xxd` resp. `hexdump`
2018-06-03 20:50:06 +02:00
Steffen Jaeckel
a1341e028e
fix doxygen warning
2018-06-03 20:50:06 +02:00
Steffen Jaeckel
c315b1c3b7
Merge pull request #399 from libtom/remove/katja
...
Remove katja
2018-06-03 20:49:48 +02:00
Steffen Jaeckel
f8ed30bc22
Update makefiles
2018-06-03 19:19:58 +02:00
Steffen Jaeckel
d9215be060
Remove katja
2018-06-03 19:19:58 +02:00
Steffen Jaeckel
e31e757a86
fix build of crypt.pdf
2018-06-03 17:48:48 +02:00
Steffen Jaeckel
55fbe256ad
Merge pull request #395 from libtom/feature/private_header
...
Add a new header file for private functions
2018-06-03 17:48:30 +02:00
Steffen Jaeckel
c725be276a
add blake2-hash API documentation
2018-06-03 15:07:28 +02:00
Steffen Jaeckel
d752f90d18
fix Doxygen docs
2018-06-03 15:07:28 +02:00
Steffen Jaeckel
7cfc0c93e6
use tomcrypt_private.h
2018-06-03 15:07:28 +02:00
Steffen Jaeckel
2cb77edf4c
update makefiles etc. for tomcrypt_private.h
2018-06-03 15:07:27 +02:00
Steffen Jaeckel
f55039bfeb
add tomcrypt_private.h
2018-06-03 15:07:27 +02:00
Steffen Jaeckel
5d8f35e5ed
Merge pull request #397 from fperrad/20180601_lint
...
xsalsa20: some linting
2018-06-02 12:16:01 +02:00
Francois Perrad
57bffbaa82
remove useless initialization
2018-06-01 21:05:49 +02:00
Francois Perrad
772a9e68cf
make _sha256 a static function
2018-06-01 21:05:47 +02:00
Steffen Jaeckel
b7493253ea
fix misplaced #endif
2018-06-01 14:47:19 +02:00
Karel Miko
7f6a4e1ff1
fix chmod
2018-06-01 10:07:17 +02:00
Larry Bugbee
82ac9a2275
Merge pull request #387 from libtom/add_xsalsa20
...
Add XSalsa20
2018-05-31 16:42:08 -07:00
buggywhip
8144209695
add XSalsa20
2018-05-31 11:58:21 -07:00
buggywhip
2ffcd1706e
update makefiles
2018-05-31 11:58:08 -07:00
Steffen Jaeckel
94132324a9
fix testvectors for two-key 3des
...
(cherry picked from commit e4a03ca72a )
2018-05-31 14:18:44 +02:00
Steffen Jaeckel
4c2ae4758e
fix "two-key 3des"-related things
...
(cherry picked from commit 715103a203 )
2018-05-31 14:18:44 +02:00
Steffen Jaeckel
615b361673
no need to include wchar.h in all cases
...
(cherry picked from commit a32d1afd10 )
2018-05-31 14:18:44 +02:00
Steffen Jaeckel
4c2bb90dec
Merge pull request #382 from ararslan/aa/freebsd
...
Make the build logic more robust for BSD systems
(cherry picked from commit 5ab8dcf04d )
2018-05-31 14:18:13 +02:00
Steffen Jaeckel
e7f4c6e47f
Merge pull request #392 from orbea/libtool
...
makefile.shared: Respect LIBTOOL.
(cherry picked from commit a528528a2b )
2018-05-31 14:18:01 +02:00
Steffen Jaeckel
3d6181d0a7
there should be no need to pass CFLAGS when linking
...
(cherry picked from commit 196f25e32f )
2018-05-31 14:16:54 +02:00
Steffen Jaeckel
5ab8dcf04d
Merge pull request #382 from ararslan/aa/freebsd
...
Make the build logic more robust for BSD systems
2018-05-31 13:51:54 +02:00
Alex Arslan
f5c665b9f6
Make the build logic more robust for BSD systems
...
This properly sets MAKE (when undefined) on BSDs to gmake rather than
make, which refers to the incompatible BSD Make. Further, it betters
detection of Clang as the default compiler, which is the case on FreeBSD
11.0+ and OpenBSD 6.0+.
2018-05-29 14:05:41 -07:00
karel-m
a94b02be94
Merge pull request #390 from libtom/fixes/and/improvements
...
Fixes and improvements
2018-05-24 17:08:28 +02:00
Steffen Jaeckel
e4a03ca72a
fix testvectors for two-key 3des
2018-05-23 10:33:47 +02:00
Steffen Jaeckel
0011f7f927
add generic test_process_dir()
2018-05-23 10:33:47 +02:00
Steffen Jaeckel
715103a203
fix "two-key 3des"-related things
2018-05-23 10:33:47 +02:00
Steffen Jaeckel
a32d1afd10
no need to include wchar.h in all cases
2018-05-23 10:33:47 +02:00
karel-m
fe665c5246
Merge pull request #236 from libtom/pr/ecc-non-asn1-part
...
ECC curves y^2 = x^3 + ax + b
2018-05-23 09:30:39 +02:00
Karel Miko
24c0eb84f9
ECC curves y^2 = x^3 + ax + b
2018-05-22 23:02:44 +02:00
Karel Miko
ea32b2b194
Update makefiles
2018-05-22 23:02:44 +02:00
Steffen Jaeckel
a528528a2b
Merge pull request #392 from orbea/libtool
...
makefile.shared: Respect LIBTOOL.
2018-05-20 10:29:56 +02:00
orbea
f2918866bc
makefile.shared: Respect LIBTOOL.
2018-05-19 08:36:41 -07:00
karel-m
b0c098e9c0
Merge pull request #389 from libtom/pr/avoid-exit
...
avoid calling exit() in sosemanuk_setup
2018-05-07 08:18:32 +02:00
Karel Miko
cdc256258a
avoid calling exit() in sosemanuk_setup
2018-05-06 22:47:06 +02:00
karel-m
49001f01b3
Merge pull request #383 from libtom/pr/fortuna-fix
...
new fortuna: fix getting current time
2018-05-05 17:59:26 +02:00
Karel Miko
29af2d95cc
fix getting current time on MS Windows + improve gettimeofday/clock_gettime usage on UNIX
2018-05-04 16:42:47 +02:00
Karel Miko
a8aa207381
change fortuna_prng.wd to ulong64
2018-05-04 16:42:47 +02:00
Karel Miko
d2ba3c93f6
introducing LTC_CLOCK_GETTIME macro
2018-05-04 16:42:47 +02:00
karel-m
73465cfb95
Merge pull request #388 from libtom/pr/check-all
...
do --check-all in check_source.sh
2018-05-04 16:42:02 +02:00
Karel Miko
41341195c5
do --check-all in check_source.sh
2018-05-04 12:48:42 +02:00
karel-m
c2548bf190
Merge pull request #386 from libtom/pr/fix-issue-384
...
fix #384 "const" related warnings
2018-05-04 07:17:52 +02:00
Karel Miko
11e15eaaa7
fix #384 "const" related warnings
2018-05-03 12:32:32 +02:00
karel-m
d16e5b0b05
Merge pull request #379 from libtom/pr/clang-tidy-misc-misplaced-widening-cast
...
clang-tidy: misc-misplaced-widening-cast
(cherry picked from commit 248352c36f )
With back-ported patch from src/misc/copy_or_zeromem.c back to
src/encauth/ccm/ccm_memory.c
2018-04-13 09:56:43 +02:00
karel-m
00dfe66081
Merge pull request #378 from libtom/pr/clang-tidy-misc-suspicious-string-compare
...
clang-tidy: misc-suspicious-string-compare
(cherry picked from commit 24f933d22a )
2018-04-13 09:54:03 +02:00
karel-m
1783100e7b
Merge pull request #377 from libtom/pr/clang-tidy-void-return
...
clang-tidy: readability-redundant-control-flow
(cherry picked from commit 4cc8d08e50 )
2018-04-13 09:53:59 +02:00
karel-m
92c5082a25
Merge pull request #375 from libtom/pr/fix-unused-const-variable
...
Fix -Wunused-const-variable in aes_tab.c
(cherry picked from commit 5c31c3d016 )
2018-04-13 09:53:59 +02:00
Steffen Jaeckel
719d297e9f
Merge pull request #373 from libtom/fix/der-recursion-limit
...
implement DER recursion limit
(cherry picked from commit af67321bf3 )
2018-04-13 09:52:11 +02:00
Steffen Jaeckel
af67321bf3
Merge pull request #373 from libtom/fix/der-recursion-limit
...
implement DER recursion limit
2018-04-13 09:42:47 +02:00
Steffen Jaeckel
62c2124b82
implement DER resursion limit
2018-04-11 11:15:21 +02:00
Steffen Jaeckel
2e8371ce0b
Merge pull request #381 from felixdoerre/const_hash
...
add const to the hashes' compress functions
2018-04-11 11:14:49 +02:00
Felix Dörre
332ae41a2b
add const to the hashes' compress functions
2018-04-10 13:30:12 +02:00
Steffen Jaeckel
8236ade38e
Merge pull request #363 from libtom/improve/fortuna
...
Improve Fortuna PRNG
2018-04-10 04:23:19 +02:00
Steffen Jaeckel
c7a880f222
update docs
2018-04-09 23:30:27 +02:00
Steffen Jaeckel
2dfc2d87da
make fortuna_update_seed() public
...
In order to be able to implement UpdateSeedFile from the original paper
this is required to be available on the public API.
2018-04-09 23:30:27 +02:00
Steffen Jaeckel
7b97911cc6
add build with LTC_FORTUNA_RESEED_RATELIMIT_STATIC to travis
2018-04-09 23:30:27 +02:00
Steffen Jaeckel
ca91ae5a1f
add fortuna_add_random_event()
2018-04-09 23:30:27 +02:00
Steffen Jaeckel
75dad9473d
implement FORTUNA's reseed rate limit based on time
2018-04-09 23:30:27 +02:00
Steffen Jaeckel
1fb478ea31
Merge pull request #324 from TrinityCoder/fix-missing-const-params
...
Added missing 'const' qualifier to many functions' parameters
2018-04-09 11:58:37 +02:00
Steffen Jaeckel
1c3629fc06
add more missing const
2018-04-09 10:29:29 +02:00
Miroslav Mareš
228d29d1e7
Added missing 'const' qualifier to many functions' parameters
2018-04-09 10:29:29 +02:00
karel-m
248352c36f
Merge pull request #379 from libtom/pr/clang-tidy-misc-misplaced-widening-cast
...
clang-tidy: misc-misplaced-widening-cast
2018-04-09 08:56:53 +02:00
Karel Miko
7465d0bac3
fix clang-tidy misc-misplaced-widening-cast
2018-04-09 08:56:41 +02:00
karel-m
24f933d22a
Merge pull request #378 from libtom/pr/clang-tidy-misc-suspicious-string-compare
...
clang-tidy: misc-suspicious-string-compare
2018-04-09 08:55:32 +02:00
Karel Miko
fa01052b32
fix memcmp is called without explicitly comparing result
2018-04-09 08:55:13 +02:00
karel-m
4cc8d08e50
Merge pull request #377 from libtom/pr/clang-tidy-void-return
...
clang-tidy: readability-redundant-control-flow
2018-04-09 08:53:20 +02:00
Karel Miko
061fe36114
fix redundant return statement at the end of a function with a void return type
2018-04-08 18:04:34 +02:00
karel-m
5c31c3d016
Merge pull request #375 from libtom/pr/fix-unused-const-variable
...
Fix -Wunused-const-variable in aes_tab.c
2018-04-08 16:22:05 +02:00
Karel Miko
318451ce66
Fix -Wunused-const-variable in aes_tab.c
2018-04-08 14:28:57 +02:00
Steffen Jaeckel
49b3425de7
Merge pull request #374 from libtom/fix/cygwin
...
fix aesgcm on cygwin
2018-04-08 02:56:20 +02:00
Steffen Jaeckel
3249dcb963
allow TAB_SIZE to be defined at compile-time
2018-04-06 10:27:12 +02:00
Steffen Jaeckel
ba54b891b9
fix aesgcm on cygwin
...
This fixes #372
2018-04-06 10:19:53 +02:00
Steffen Jaeckel
70ec9b3b35
back-port of the bugfix done in #363
2018-04-04 19:31:36 +02:00
Steffen Jaeckel
24aab18d5b
Merge pull request #359 from vchong/ltc_ctr
...
ltc: ctr: improve performance
(cherry picked from commit 9b80d07487 )
2018-04-04 19:27:40 +02:00
Steffen Jaeckel
affb3d70cb
improve fortuna_import()
...
This makes fortuna_import() kinda compliant to the "Update seed file"
behavior of the original paper.
It differs from the original behavior in that it allows to import
seed files which are larger than 64 bytes.
(cherry picked from commit 39d4a14c29 )
2018-04-04 19:25:31 +02:00
Steffen Jaeckel
89dffe6c7e
add comment to Fortuna docs
...
(cherry picked from commit cccd1e3053 )
2018-04-04 19:25:31 +02:00
Steffen Jaeckel
415c57f3af
don't ignore additional data on SOBER128-PRNG import
...
(cherry picked from commit d502869728 )
2018-04-04 19:25:31 +02:00
Steffen Jaeckel
b9fa4c063a
fortuna_import() shouldn't ignore additional input
...
(cherry picked from commit 0c05e5386f )
2018-04-04 19:25:31 +02:00
Steffen Jaeckel
67d8ca19f5
ensure that fortuna has been seeded properly
...
(cherry picked from commit 04ce8cf613 )
2018-04-04 19:25:31 +02:00
karel-m
243898972c
Merge pull request #351 from libtom/pr/fix-time_cipher_lrw
...
LTC_EASY & time_cipher_lrw
(cherry picked from commit ea5b6cdce9 )
2018-04-04 19:19:52 +02:00
Steffen Jaeckel
873240e7a0
Merge pull request #350 from libtom/fix/no-file-warnings
...
Fix warnings in `XMAC_file()` functions when compiling with `LTC_NO_FILE`.
(cherry picked from commit 11cda2e274 )
2018-04-04 19:19:19 +02:00
karel-m
fa759d8ee9
Merge pull request #371 from libtom/pr/baseNN-consistent-nul
...
consistent NUL byte handling in baseNN_encode
2018-03-28 09:30:56 +02:00
Karel Miko
6d33ecdbf9
consistent NUL byte handling in baseNN_encode
2018-03-28 07:46:31 +02:00
karel-m
ef1fba20b7
Merge pull request #365 from libtom/pr/base64-decode-less-relaxed
...
Make base64_decode relaxed mode less relaxed
2018-03-27 23:18:15 +02:00
Karel Miko
f0f1283dbb
doc - add indexes for base64url_*
2018-03-27 21:06:31 +02:00
Karel Miko
798f257059
fix base64_decode comments
2018-03-27 21:06:31 +02:00
Karel Miko
229aec965c
enhanced base64 related tests
2018-03-27 21:06:30 +02:00
Karel Miko
ad8067eaf7
doc for base64_sane_decode
2018-03-27 21:06:30 +02:00
Karel Miko
964f61709f
introducing base64_sane_decode
2018-03-27 21:06:30 +02:00
Karel Miko
b10bf8fa0d
make base64_decode relaxed mode less relaxed
2018-03-27 21:06:30 +02:00
Steffen Jaeckel
8b6d9dba76
Merge pull request #369 from libtom/demo/aesgcm
...
Add aesgcm demo
2018-03-27 19:39:13 +02:00
Steffen Jaeckel
e040ef1a59
add aesgcm demo
...
yeah I know, it's GNU specific, therefore it's also only added to the
GNU makefiles
2018-03-27 14:26:16 +02:00
Steffen Jaeckel
31088c0e9e
add gcm_file() and gcm_filehandle()
2018-03-27 14:26:16 +02:00
Steffen Jaeckel
f4afa5d5bb
Merge pull request #368 from libtom/fix/base16-api
...
Improve base16
2018-03-27 12:58:18 +02:00
Steffen Jaeckel
ed5025398b
check input of base16_decode()
2018-03-27 10:08:29 +02:00
Steffen Jaeckel
efbf38adce
update docs
2018-03-27 10:08:29 +02:00
Steffen Jaeckel
73e5330c47
add inlen parameter to base16_decode()
2018-03-27 10:08:29 +02:00
Steffen Jaeckel
9b80d07487
Merge pull request #359 from vchong/ltc_ctr
...
ltc: ctr: improve performance
2018-03-27 02:25:25 +02:00
Steffen Jaeckel
bed9811d74
fix-up ctr_encrypt.c
2018-03-26 23:34:15 +02:00
Tetsuya Yoshizaki
431319f30b
ltc: ctr: improve performance
...
When accel_ctr_encrypt() is not used, accel_ecb_encrypt() is used via
ecb_encrypt() instead. The accel_ecb_encrypt() is frequently called at
every single block process. VFP assembly code called from the
accel_ecb_encrypt() is protected by
tomcrypt_arm_neon_enable()/disable(). FIQ enable/disable and VFP
register save/restore (64bitx32 registers!) to/from memory are done in
the tomcrypt_arm_neon_enable()/disable(). These overhead exist in each
single block process cause the degradation of system performance
eventually. Cases where h/w accelerated AES-CTR did not show any effects
or showed less performance than pure software processing have been
observed.
This patch resolves the issue by increasing utilization rate of
accel_ctr_encrypt().
Signed-off-by: Tetsuya Yoshizaki <yoshizaki.tetsuya@socionext.com>
Signed-off-by: Victor Chong <victor.chong@linaro.org>
2018-03-26 23:29:07 +02:00
karel-m
f240aeadc2
Merge pull request #366 from libtom/pr/base64-char
...
base64 - use `char *` for Base64 strings
2018-03-26 21:06:43 +02:00
Karel Miko
e73bb36f3f
update doc - base64 & char*
2018-03-26 16:42:19 +02:00
Karel Miko
065c89108e
base64_* use char * for Base64 strings
2018-03-26 16:42:19 +02:00
karel-m
f72621e276
Merge pull request #367 from libtom/pr/base32-nul
...
base32_encode - make the output NUL-terminated
2018-03-26 16:41:25 +02:00
Karel Miko
981f3ef844
base32_encode - make the output NUL-terminated
2018-03-25 22:17:46 +02:00
Karel Miko
7a7b773b3c
Revert "make base64_decode relaxed mode less relaxed"
...
This reverts commit e7117ea9df .
2018-03-25 19:41:43 +02:00
Karel Miko
e7117ea9df
make base64_decode relaxed mode less relaxed
2018-03-25 15:46:49 +02:00
Steffen Jaeckel
e299431be8
Merge pull request #343 from libtom/feature/pkcs7
...
Add padding/depadding support
2018-03-25 14:12:35 +02:00
Steffen Jaeckel
bc2739347d
Update makefiles
2018-03-23 22:01:41 +01:00
Steffen Jaeckel
daed6fe91e
add padding documentation
2018-03-23 22:01:41 +01:00
Steffen Jaeckel
6a48f7d184
add padding tests
2018-03-23 22:01:41 +01:00
Steffen Jaeckel
ea79c5f8b1
use new padding functions in openssl-enc
2018-03-23 22:01:41 +01:00
Steffen Jaeckel
82482119df
add padding module
2018-03-23 22:01:41 +01:00
Steffen Jaeckel
8a6ee82e17
Merge pull request #341 from libtom/review/prngs
...
Review of prngs
2018-03-23 22:00:56 +01:00
Steffen Jaeckel
39d4a14c29
improve fortuna_import()
...
This makes fortuna_import() kinda compliant to the "Update seed file"
behavior of the original paper.
It differs from the original behavior in that it allows to import
seed files which are larger than 64 bytes.
2018-03-23 15:16:13 +01:00
Steffen Jaeckel
4fb3a6468e
unify the prng's export() functions
...
This also makes fortuna_export() compliant to the "Write seed file"
behavior of the original paper.
2018-03-23 15:16:13 +01:00
Steffen Jaeckel
979a36b9bb
add possibility to seed PRNG as if it's imported
2018-03-23 15:16:13 +01:00
Steffen Jaeckel
cccd1e3053
add comment to Fortuna docs
2018-03-23 15:16:13 +01:00
Steffen Jaeckel
d502869728
don't ignore additional data on SOBER128-PRNG import
2018-03-23 15:16:13 +01:00
Steffen Jaeckel
0c05e5386f
fortuna_import() shouldn't ignore additional input
2018-03-23 15:16:13 +01:00
Steffen Jaeckel
04ce8cf613
ensure that fortuna has been seeded properly
2018-03-23 15:16:13 +01:00
Steffen Jaeckel
70fd5dd83d
Merge pull request #353 from libtom/minor/improvements
...
Minor improvements
2018-03-23 15:15:30 +01:00
Steffen Jaeckel
0dc3ab00d9
update/improve docs
2018-03-22 16:12:56 +01:00
Steffen Jaeckel
9d72e81ce8
use 'char*' in base32
...
... instead of 'unsigned char*'
2018-03-22 16:12:56 +01:00
Steffen Jaeckel
6f20738057
Update makefiles
2018-03-22 16:12:56 +01:00
Steffen Jaeckel
3d99d9b443
add base16_{de,en}code()
2018-03-22 16:12:56 +01:00
Steffen Jaeckel
b026c23b0a
use do_compare_testvector() where possible
2018-03-22 16:12:56 +01:00
Steffen Jaeckel
e1cba4da7d
fix der_test and rsa_test when compiling for msvc
2018-03-22 16:12:56 +01:00
Steffen Jaeckel
e36e512459
use DO() macro in file_test
2018-03-22 16:12:56 +01:00
Steffen Jaeckel
ffd4dd9e6a
give a name to the public-key-type enum
...
... and add PK_STD to it
2018-03-22 16:12:56 +01:00
Steffen Jaeckel
ccc7cf4af2
improve/fix x509_decode_subject_public_key_info()
...
1. only pass in as many alg_id sequence elements as used
2. we weren't able to import into exactly sized public_key buffers
3. fix types in API signature
4. make `public_key` arg a `const*`
2018-03-22 14:39:16 +01:00
Steffen Jaeckel
ecd3fb714d
add do_compare_testvector()
2018-03-22 14:39:16 +01:00
Steffen Jaeckel
4d17d1328d
Merge pull request #358 from libtom/travis/build-debug
...
Travis/build debug
2018-03-10 22:42:35 +01:00
Steffen Jaeckel
7fb108d884
add full-debug build to ci-tests
2018-03-10 17:37:54 +01:00
Steffen Jaeckel
3cfdd4bfdb
fix compilation with debug output enabled
2018-03-10 11:34:05 +01:00
Steffen Jaeckel
2c07ff6fbe
Merge pull request #355 from MilkywayPwns/develop
...
renamed class -> klass
2018-03-10 10:43:14 +01:00
RektInator
b477e2c221
Renamed class->klass
2018-03-09 16:37:18 +01:00
karel-m
249d4694da
Merge pull request #356 from libtom/pr/keccak
...
Keccak
2018-03-08 09:58:46 +01:00
Karel Miko
e1ffc82bfb
add keccak_NNN_init + keccak_process defines
2018-03-08 07:18:33 +01:00
Karel Miko
3cd8044290
Keccak
2018-03-08 07:18:33 +01:00
karel-m
2731b9a873
Merge pull request #357 from libtom/pr/357-msvc-warning
...
MSVC fix warning: signed/unsigned mismatch
2018-03-08 07:10:52 +01:00
Karel Miko
1871c5dff4
fix warning: signed/unsigned mismatch
2018-03-07 23:39:43 +01:00
Steffen Jaeckel
0a4f36d45d
Merge pull request #352 from fperrad/20180226_lint
...
some linting after ecc-asn1-minimal-part merge
2018-03-01 08:47:59 +01:00
Francois Perrad
1662910b40
refactor der_encode_asn1_length
...
in order to avoid comparison : len <= 0xffffffffffffffffULL
2018-02-28 16:19:15 +01:00
Francois Perrad
995e575521
variable 'len' must be initialized in all case
2018-02-27 22:16:57 +01:00
Francois Perrad
525b129466
fix indentation
2018-02-26 21:11:44 +01:00
karel-m
ea5b6cdce9
Merge pull request #351 from libtom/pr/fix-time_cipher_lrw
...
LTC_EASY & time_cipher_lrw
2018-02-26 12:55:41 +01:00
Karel Miko
733d3e5d7d
fix: return with a value, in function returning void (LTC_EASY)
2018-02-26 09:52:57 +01:00
Steffen Jaeckel
64298c1819
Merge pull request #309 from libtom/pr/ecc-asn1-part-minimal
...
ECC-step1: ASN.1 changes required for future ECC enhancements
2018-02-25 23:34:09 +01:00
Steffen Jaeckel
d89326bbea
update doc
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
e4efd70382
add der_decode_custom_type_ex()
...
This merges der_decode_sequence_ex() into a new der_decode_custom_type_ex()
which can decode SEQUENCEs, SETs and custom types.
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
9d03c38ea4
add flags to der_decode_sequence()
2018-02-25 20:42:26 +01:00
Karel Miko
3044b227f8
improve style of length-checks
...
As `der_decode_asn1_length()` will now also decode a uint64 with all 0xff
the old style would overflow in that check which "wouldn't be good"^TM.
The old way the length-checks were written were kind of fine when building
on 64bit architectures, but have the same problem on 32bit.
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
7e2d163d1d
add testvectors from [1]
...
[1] https://misc.daniel-marschall.de/asn.1/oid_facts.html
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
756bc7fa21
use new ASN.1 functionality
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
3431763275
update/add more DER tests
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
b75c3ce9db
remove LTC_ASN1_CONSTRUCTED and LTC_ASN1_CONTEXT_SPECIFIC
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
799e147254
Update makefiles
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
5230977219
implement the Custom-type de-/encoders
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
0d02137a8e
add required ASN.1 custom-types functions
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
1b3a757345
add ASN.1-identifier functions
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
509ad5222f
add maps for ASN.1 en-/decoding
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
64875d3a8f
add ASN.1-length functions
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
2a78ed31bf
add CRYPT_PK_ASN1_ERROR
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
54dd6ce840
fix naming of SubjectPublicKeyInfo de-&encoder
2018-02-25 20:42:26 +01:00
Karel Miko
fd7c2b8c1f
no need for der_decode_subject_public_key_info_ex
2018-02-25 20:42:26 +01:00
Karel Miko
f155d3c530
ASN.1 changes required fo future ECC enhancements
2018-02-25 20:42:26 +01:00
Steffen Jaeckel
11cda2e274
Merge pull request #350 from libtom/fix/no-file-warnings
...
Fix warnings in `XMAC_file()` functions when compiling with `LTC_NO_FILE`.
2018-02-25 20:35:49 +01:00
Steffen Jaeckel
b1b40d48fa
silencio por favor
...
Fix warnings in `XMAC_file()` functions when compiling with `LTC_NO_FILE`.
2018-02-25 17:17:04 +01:00
Steffen Jaeckel
5a3a12c9b3
don't export .travis.yml in future releases
2018-01-22 11:09:38 +01:00
Steffen Jaeckel
fa96614366
Update makefiles
2018-01-22 11:05:22 +01:00
Steffen Jaeckel
d68de4d26d
show in SCRYPT etc. that we're on develop
2018-01-22 11:05:20 +01:00
Steffen Jaeckel
7de2d910fe
libtomcrypt v1.18.1
...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Gnu Privacy Tools
iF4EABEIAAYFAlpltt4ACgkQrwyxdiHtrXIaugD+PZ1lGJ3Hhm5nQzVycQqp5ryc
BbfeJhhrRVr1art3ftMA/2AOFXS0SEKtkgALCh1qJkK9YwZIZcDGPqSl/6uTEbKq
=1DpZ
-----END PGP SIGNATURE-----
Merge tag 'v1.18.1' into develop
libtomcrypt v1.18.1
2018-01-22 11:04:49 +01:00
Steffen Jaeckel
e08fd8630f
Merge branch 'release/1.18.1'
2018-01-22 11:02:57 +01:00
Steffen Jaeckel
60df7d360a
Fix 'fixme check'
...
The error produced by `make zipup` - but ignored by make - was:
```
...
fixme check
makefile_include.mk:448: recipe for target 'zipup' failed
make: [zipup] Error 123 (ignored)
mkdir -p libtomcrypt-...
```
2018-01-22 11:01:34 +01:00
Steffen Jaeckel
c7ff3bb86e
Bump revision
2018-01-22 10:45:28 +01:00
Steffen Jaeckel
08e0424d52
Update changes
2018-01-22 10:06:54 +01:00
Steffen Jaeckel
4800543664
add -p switch to install commands in GNU makefiles
...
This fixes #340
[skip ci]
(cherry picked from commit fc6eb3ecf0 )
2018-01-22 10:05:03 +01:00
Steffen Jaeckel
fc6eb3ecf0
add -p switch to install commands in GNU makefiles
...
This fixes #340
[skip ci]
2018-01-21 13:23:14 +01:00
Steffen Jaeckel
da7054820c
Fix some latex formatting errors
...
[skip ci]
2018-01-20 15:31:00 +01:00
Tetsuya Yoshizaki
144839a8db
ltc: ctr: update pt and ct after acceleration
...
Problem occurs in the condition of the following case:
1st decryption:
Decrypt a ciphertext whose length is a multiple of the block size (16B)
(len = n * block_size)
2nd decryption:
Decrypt the continuing ciphertext whose length is not a multiple of the
block size
(len = m * block_size + l)
In this case accel_ctr_encrypt() is firstly used at the 2nd decryption.
If pt and ct are not updated, the top (l = len % block_size) bytes of
decryption result are sometimes destroyed.
From: Tetsuya Yoshizaki <yoshizaki.tetsuya@socionext.com>
Signed-off-by: Tetsuya Yoshizaki <yoshizaki.tetsuya@socionext.com>
Signed-off-by: Victor Chong <victor.chong@linaro.org>
(cherry picked from commit d1d3ae2d1e )
2018-01-19 10:01:03 +01:00
Tetsuya Yoshizaki
d1d3ae2d1e
ltc: ctr: update pt and ct after acceleration
...
Problem occurs in the condition of the following case:
1st decryption:
Decrypt a ciphertext whose length is a multiple of the block size (16B)
(len = n * block_size)
2nd decryption:
Decrypt the continuing ciphertext whose length is not a multiple of the
block size
(len = m * block_size + l)
In this case accel_ctr_encrypt() is firstly used at the 2nd decryption.
If pt and ct are not updated, the top (l = len % block_size) bytes of
decryption result are sometimes destroyed.
From: Tetsuya Yoshizaki <yoshizaki.tetsuya@socionext.com>
Signed-off-by: Tetsuya Yoshizaki <yoshizaki.tetsuya@socionext.com>
Signed-off-by: Victor Chong <victor.chong@linaro.org>
2018-01-19 09:39:25 +01:00
Steffen Jaeckel
5501572b35
Merge pull request #339 from libtom/minor_improvements
...
Minor improvements
(cherry picked from commit df8ed5c76b )
2018-01-15 00:39:26 +01:00
Steffen Jaeckel
df8ed5c76b
Merge pull request #339 from libtom/minor_improvements
...
Minor improvements
2018-01-14 22:31:24 +01:00
Steffen Jaeckel
aa8441409e
fix some DER bugs
...
1. the "ask for required memory size" pattern wasn't implemented for
`der_decode_object_identifier()`
2. fix wrong "required memory size" returned by UTF-8 de- & encoder
2018-01-11 18:06:23 +01:00
Steffen Jaeckel
a898fde5b7
better debug output
2018-01-11 18:06:23 +01:00
Larry Bugbee
48a798261d
Merge pull request #334 from libtom/add-rabbit
...
Add Rabbit stream cipher
2017-12-18 04:16:32 -08:00
Larry Bugbee
8ef60f7b47
add rabbit
2017-12-17 08:05:41 -08:00
Larry Bugbee
784fc5313c
makefile updates
2017-12-17 08:05:41 -08:00
Steffen Jaeckel
f4d2b37cf4
Merge pull request #337 from libtom/fix/prng_pthread
...
prevent undefined behavior with LTC_PTHREAD
(cherry picked from commit 45db2a9d9a )
2017-12-17 01:20:32 +01:00
Karel Miko
dd868600b3
fix staticfunc_name detection
...
(cherry picked from commit 6d71d657ef )
2017-12-17 01:05:53 +01:00
Steffen Jaeckel
10ad3b5b41
fixup type of type in ltc_asn1_list doc
...
(cherry picked from commit 5e3e7e5304 )
2017-12-17 01:05:43 +01:00
Steffen Jaeckel
8ef3b9dffd
Merge pull request #335 from libtom/minor_cleanup
...
Minor cleanup
2017-12-17 00:43:35 +01:00
Steffen Jaeckel
35c4d157d0
as of POSIX.1-2008 gettimeofday() is obsolete
2017-12-16 16:02:00 +01:00
Steffen Jaeckel
b84bea8e78
easier calculation
2017-12-16 16:02:00 +01:00
Steffen Jaeckel
38143771d7
Update makefiles
2017-12-16 16:02:00 +01:00
Steffen Jaeckel
fd46a74331
re-order tomcrypt_mac.h
2017-12-16 16:02:00 +01:00
Steffen Jaeckel
8fffebc395
fix .travis.yml
2017-12-16 16:02:00 +01:00
Steffen Jaeckel
5c0b1b4bf6
add copy_or_zeromem()
2017-12-16 16:02:00 +01:00
Steffen Jaeckel
c0b7c8dd67
more output in debug build
...
make compare_testvector() a bit more verbose in debug build
2017-12-10 12:35:59 +01:00
Steffen Jaeckel
5546e85218
introduce LTC_EXTRALIBS
...
it's used for libraries added in the makefile
2017-12-10 12:35:59 +01:00
Karel Miko
6d71d657ef
fix staticfunc_name detection
2017-12-10 12:35:59 +01:00
Steffen Jaeckel
5e3e7e5304
fixup type of type in ltc_asn1_list doc
2017-12-10 12:35:59 +01:00
Steffen Jaeckel
ea43e5dd68
suppress 'missing-braces' warnings
2017-12-10 12:35:59 +01:00
Steffen Jaeckel
196f25e32f
there should be no need to pass CFLAGS when linking
2017-12-10 12:35:59 +01:00
Steffen Jaeckel
45db2a9d9a
Merge pull request #337 from libtom/fix/prng_pthread
...
prevent undefined behavior with LTC_PTHREAD
2017-12-10 12:35:01 +01:00
Steffen Jaeckel
c0eefc2b20
prevent undefined behavior with LTC_PTHREAD
...
as of `man pthread_mutex_init`:
"Attempting to initialize an already initialized mutex
results in undefined behavior."
2017-12-07 14:56:44 +01:00
Larry Bugbee
479cce29ab
Merge pull request #332 from libtom/sosemanuk--cleanup-comments-and-doc
...
sosemanuk updated comments and doc
2017-12-05 12:20:06 -08:00
Larry Bugbee
b6ae9ab000
grammatical change
2017-12-05 09:53:15 -08:00
Steffen Jaeckel
cec171c17e
Update changes
2017-12-05 18:41:11 +01:00
Steffen Jaeckel
c7bdb247bf
Update makefiles
2017-12-05 18:40:57 +01:00
Steffen Jaeckel
cfaf964284
Bump version
2017-12-05 18:40:49 +01:00
Steffen Jaeckel
ce93eaa577
add fixme-check to zipup make-target
...
(cherry picked from commit 6c83a2f363 )
2017-12-05 18:39:46 +01:00
Steffen Jaeckel
f9e90f5b1c
revert the change of MAXBLOCKSIZE
...
Currently this only plays a role in HMAC which still uses dynamic
allocation depending on the real blocksize defined by the hash
algorithm.
2017-12-05 17:46:08 +01:00
Steffen Jaeckel
f122e9b887
Merge pull request #329 from libtom/pr/sha3-blocksize
...
Correct SHA3 block sizes
(cherry picked from commit 64d028832b )
2017-12-05 17:43:46 +01:00
Steffen Jaeckel
64d028832b
Merge pull request #329 from libtom/pr/sha3-blocksize
...
Correct SHA3 block sizes
2017-12-05 17:41:44 +01:00
Karel Miko
8fdc46cc4b
updated tv_gen outputs
2017-12-05 13:00:13 +01:00
Karel Miko
e89a1f2ae6
correct SHA3 block sizes
2017-12-05 13:00:13 +01:00
Larry Bugbee
83ee79ac56
change crypt() length data name to match doc
2017-12-05 01:02:10 -08:00
Larry Bugbee
c4fdf5c1fc
rephrase one sentence
2017-12-05 00:55:07 -08:00
Steffen Jaeckel
13d91e7c8b
Merge pull request #327 from libtom/fix/ccm_segfault
...
Fix ccm_memory() cleaning user-supplied key
(cherry picked from commit 85ac227862 )
2017-12-05 09:23:06 +01:00
Steffen Jaeckel
368dc60ff3
Merge pull request #326 from libtom/pr/ccm_process
...
fixes #323 ccm_process fails to process input buffer longer than 256
(cherry picked from commit 7c4c61d7ef )
2017-12-05 09:21:52 +01:00
Karel Miko
153b897984
helper.pl - detect sizeof without brackets
...
(cherry picked from commit b7e35e9f57 )
2017-12-05 09:21:27 +01:00
Karel Miko
f10c2055dc
helper.pl - improved detection of static functions without _
...
(cherry picked from commit 5c34fb2bad )
2017-12-05 09:21:17 +01:00
Karel Miko
a674de7408
Merge branch 'diamondo25-patch-2' into develop
...
Fix not defined warnings (-Wundef)
(cherry picked from commit 617698e544 )
2017-12-05 09:20:41 +01:00
karel-m
7f6af93798
Merge pull request #320 from diamondo25/patch-1
...
Remove duplicate prototypes
(cherry picked from commit b4eae5231d )
2017-12-05 09:20:15 +01:00
karel-m
00ca140c57
Merge pull request #316 from libtom/pr/register-all
...
register_all_* should return CRYPT_OK on success
(cherry picked from commit e4763d940a )
2017-12-05 09:19:40 +01:00
Steffen Jaeckel
521d0737ea
fix typo
...
(cherry picked from commit 442bb90a51 )
2017-12-05 09:17:30 +01:00
Steffen Jaeckel
035e958edd
Merge pull request #310 from libtom/pr/fix-changes
...
proper 1.18.0 date in changes
(cherry picked from commit a6c8be292e )
2017-12-05 09:16:30 +01:00
Larry Bugbee
f42bf2f942
updated comments and doc
2017-12-04 22:15:18 -08:00
Steffen Jaeckel
c6cccf9120
Merge pull request #330 from J08nY/fix/sosemanuk-doc
...
Fix docs build in Sosemanuk section.
2017-11-29 09:52:39 +01:00
J08nY
684c0890e7
Fix docs build in Sosemanuk section.
2017-11-28 17:13:09 +01:00
karel-m
af10ad084d
Merge pull request #328 from fperrad/20171122_lint
...
sosemanuk: some linting
2017-11-22 18:00:51 +01:00
Francois Perrad
77b0aff4e6
remove always true condition
...
ivlen is unsigned, so always >= 0
2017-11-22 10:34:45 +01:00
Francois Perrad
e985a9c111
add const
2017-11-22 10:34:42 +01:00
Karel Miko
2dec37044c
chmod sosemanuk.c
2017-11-21 08:55:01 +01:00
Larry Bugbee
174f0aaf33
Merge pull request #322 from libtom/add-sosemanuk
...
add Sosemanuk
2017-11-20 14:35:56 -08:00
Steffen Jaeckel
85ac227862
Merge pull request #327 from libtom/fix/ccm_segfault
...
Fix ccm_memory() cleaning user-supplied key
2017-11-20 14:25:45 +01:00
Steffen Jaeckel
2a5f5cff16
test that ccm_memory() doesn't touch user-supplied key
2017-11-20 12:11:12 +01:00
Steffen Jaeckel
e05097e413
fix segfault in ccm_memory() with LTC_CLEAN_STACK
...
we shouldn't clean user-supplied variables
2017-11-20 12:11:12 +01:00
Larry Bugbee
108ddf5b50
add Sosemanuk
2017-11-20 02:41:30 -08:00
Larry Bugbee
807ae09916
Update makefiles
2017-11-20 02:40:45 -08:00
Steffen Jaeckel
7c4c61d7ef
Merge pull request #326 from libtom/pr/ccm_process
...
fixes #323 ccm_process fails to process input buffer longer than 256
2017-11-10 00:41:50 +01:00
Karel Miko
08dee27359
fixes #323 ccm_process fails to process input buffer longer than 256 bytes
2017-11-09 19:47:51 +01:00
Steffen Jaeckel
28d44b35f3
Merge pull request #325 from libtom/pr/new_63
...
Statically allocated key in hmac_state
This fixes #63 and closes #64
2017-11-09 19:44:28 +01:00
Pascal Brand
c2ce5a18e7
Statically allocated key in hmac_state
...
Signed-off-by: Pascal Brand <pascal.brand@st.com>
2017-11-09 15:32:01 +01:00
Steffen Jaeckel
b159ca0d12
add missing file footers
...
[skip ci]
2017-11-09 15:31:51 +01:00
Steffen Jaeckel
f5e5c6eed7
simplify calculation
2017-11-06 12:13:16 +01:00
Karel Miko
b7e35e9f57
helper.pl - detect sizeof without brackets
2017-11-05 17:08:02 +01:00
Karel Miko
5c34fb2bad
helper.pl - improved detection of static functions without _
2017-11-05 11:40:01 +01:00
Karel Miko
617698e544
Merge branch 'diamondo25-patch-2' into develop
...
Fix not defined warnings (-Wundef)
2017-11-03 17:06:23 +01:00
Karel Miko
053996dc5e
Fix _POSIX_C_SOURCE not defined warning (-Wundef)
2017-11-03 17:05:56 +01:00
Erwin Oegema
5a6c258679
Fix LTC_TEST_DBG not defined warning (-Wundef)
2017-11-03 17:04:32 +01:00
karel-m
b4eae5231d
Merge pull request #320 from diamondo25/patch-1
...
Remove duplicate prototypes
2017-11-03 17:01:51 +01:00
Erwin Oegema
b1115b4e8f
Remove duplicate prototypes
2017-11-01 15:30:36 +01:00
Larry Bugbee
9b65d46584
Merge pull request #318 from libtom/add-salsa20
...
Add salsa20
2017-10-24 13:28:55 -07:00
Larry Bugbee
f1da5783eb
fixed C90 warning: value after decl
...
warning: ISO C90 forbids mixed declarations and code
2017-10-23 22:40:21 -07:00
Larry Bugbee
74dcbc810f
fixed C90 warning: value after decl
...
warning: ISO C90 forbids mixed declarations and code
2017-10-23 22:00:45 -07:00
Larry Bugbee
6ada199d7d
added keystream regression test
2017-10-23 21:43:17 -07:00
Larry Bugbee
4341424ce9
Add Salsa20
2017-10-23 15:45:02 -07:00
Larry Bugbee
aa5a2e5a26
Update makefiles
2017-10-23 15:41:04 -07:00
Karel Miko
6c5dea3e61
__declspec(deprecated) is supported since Visual Studio 2008
2017-10-23 20:18:59 +02:00
Steffen Jaeckel
80665ac576
Merge pull request #317 from libtom/pr/base32
...
Base32
2017-10-22 11:04:40 +02:00
Karel Miko
854a145c92
Base32: alpha_id >> id
2017-10-20 20:00:46 +02:00
Karel Miko
3fc98adaf5
tuning base32 stuff
2017-10-20 19:51:40 +02:00
Karel Miko
8674eb3097
base32_decode + base32_encode
2017-10-20 19:51:40 +02:00
Karel Miko
035205af85
update makefiles
2017-10-20 19:51:40 +02:00
Steffen Jaeckel
c8edd3c2e9
Merge pull request #315 from libtom/improve/travis_build
...
Improve/travis build
2017-10-20 15:44:41 +02:00
Steffen Jaeckel
1fc46a0f15
fix travis detection in coverage.sh
2017-10-19 09:54:47 +02:00
Steffen Jaeckel
742a6c7a33
fix paths
2017-10-19 09:54:47 +02:00
Steffen Jaeckel
b070672f59
move ci scripts to .ci/
2017-10-19 09:54:47 +02:00
Steffen Jaeckel
c5caac505b
print stderr on the fly also to console
2017-10-19 09:54:47 +02:00
Steffen Jaeckel
29c640f7e1
enable parallel builds
2017-10-19 09:54:47 +02:00
Steffen Jaeckel
30948fc0e9
move valgrind build to own travis instance
...
testing under valgrind takes forever, so we start a separate build-job
2017-10-19 09:54:47 +02:00
Steffen Jaeckel
384f82d0a9
also create coverage for gmp_desc
2017-10-19 09:54:47 +02:00
Steffen Jaeckel
91e1d04831
incorporate scan_build.sh in meta_builds.sh
2017-10-19 09:54:47 +02:00
Steffen Jaeckel
65e1eb68e9
fix missing valgrind & don't be that noisy
2017-10-19 09:54:47 +02:00
Steffen Jaeckel
ce3da7c06f
use correct set of parameters
2017-10-19 09:54:47 +02:00
Steffen Jaeckel
2dad6d30bf
add meta_builds.sh
...
This fixes #267 #268 #269
2017-10-19 09:54:47 +02:00
Steffen Jaeckel
18ba0cbda9
fix tv_gen.c for scan-build run
2017-10-19 09:54:47 +02:00
Steffen Jaeckel
3f024c0685
only run scan_build for clang
2017-10-19 09:54:47 +02:00
Steffen Jaeckel
315d03ccd5
use parameters instead of pre-defined values
2017-10-19 09:54:47 +02:00
karel-m
e4763d940a
Merge pull request #316 from libtom/pr/register-all
...
register_all_* should return CRYPT_OK on success
2017-10-19 07:29:05 +02:00
Karel Miko
152513477b
fix return value of register_all_*()
2017-10-18 22:35:16 +02:00
karel-m
d470f8a7ab
Merge pull request #314 from libtom/pr/serpent-cipher
...
Serpent cipher
2017-10-18 17:24:18 +02:00
Karel Miko
aa3e5a43bb
fix warning: Value stored to 'e' is never read
2017-10-18 17:21:46 +02:00
Karel Miko
a37a93aecc
doc update
2017-10-18 17:21:46 +02:00
Karel Miko
c5735be01e
update makefiles
2017-10-18 17:21:46 +02:00
Karel Miko
5a63e7ef7d
Serpent cipher
2017-10-18 17:21:46 +02:00
Steffen Jaeckel
49f732101c
Merge pull request #297 from libtom/improve/mpi_selection
...
Improve MPI provider selection
2017-10-18 08:47:10 +02:00
Steffen Jaeckel
d709e3d9a3
Update doc
...
[skip ci]
2017-10-18 08:46:17 +02:00
Steffen Jaeckel
1a892960fe
don't be that strict
2017-10-18 08:46:17 +02:00
Steffen Jaeckel
bfef6350a2
deprecate init_{LTM,TFM,GMP}
2017-10-18 08:46:17 +02:00
Steffen Jaeckel
beb1e279ec
add LTC_DEPRECATED
2017-10-18 08:46:17 +02:00
Steffen Jaeckel
735566993b
add crypt_mp_init()
2017-10-18 08:46:17 +02:00
Steffen Jaeckel
fdc6cd2013
improve tests and timing in regards to MPI provider selection
2017-10-18 08:46:17 +02:00
Steffen Jaeckel
442bb90a51
fix typo
2017-10-18 08:45:56 +02:00
Steffen Jaeckel
6c83a2f363
add fixme-check to zipup make-target
2017-10-18 08:45:56 +02:00
karel-m
dd95518db4
Merge pull request #312 from libtom/pr/idea-cipher
...
IDEA cipher
2017-10-18 07:08:04 +02:00
Karel Miko
ee484a0bc0
burn_stack
2017-10-16 23:15:54 +02:00
Karel Miko
a2dd766ed5
IDEA cipher
2017-10-16 21:20:33 +02:00
Karel Miko
295bde14c1
update makefiles
2017-10-16 21:19:54 +02:00
Steffen Jaeckel
a6c8be292e
Merge pull request #310 from libtom/pr/fix-changes
...
proper 1.18.0 date in changes
2017-10-12 19:41:52 +02:00
karel-m
437cb0207a
proper 1.18.0 date in changes
2017-10-12 17:19:38 +02:00
Steffen Jaeckel
44b15a76aa
add issue and PR templates
2017-10-10 18:08:35 +02:00
Steffen Jaeckel
976e7c4e31
Merge tag 'v1.18.0' into develop
...
libtomcrypt v1.18.0
2017-10-10 15:52:19 +02:00
Steffen Jaeckel
0676c9aec7
Merge branch 'release/1.18.0'
2017-10-10 15:51:36 +02:00
Steffen Jaeckel
c165f3a23a
Update makefiles
2017-10-10 15:48:35 +02:00
Steffen Jaeckel
a7d0008f52
bump version
2017-10-10 15:48:35 +02:00
Steffen Jaeckel
b3c9f586dc
also patch doc/Doxyfile automatically
2017-10-10 15:48:35 +02:00
Steffen Jaeckel
62143d96bd
fix doxygen warning
2017-10-10 15:43:26 +02:00
Steffen Jaeckel
58b5e5c7ca
improve README
...
[skip ci]
2017-10-10 15:19:23 +02:00
Steffen Jaeckel
ea5cb8bff6
make it possible to use LTC_NOTHING with a math provider
2017-10-10 15:19:01 +02:00
Steffen Jaeckel
233ef83530
suppress some warnings when compiling with mingw-gcc
...
[skip ci]
2017-10-10 14:29:34 +02:00
Steffen Jaeckel
e40482f82a
review README.md and changes
2017-10-09 18:26:38 +02:00
Steffen Jaeckel
dd0bbdeac0
increase default value of Miller-Rabin rounds to 40
2017-10-09 17:58:47 +02:00
Steffen Jaeckel
4503ddcfb0
improve wording
...
[skip ci]
2017-10-08 01:05:12 +02:00
Steffen Jaeckel
6493f0fe94
Merge pull request #308 from libtom/pr/avoid-dulplicit-manes
...
Aviod duplicit rc4.c sober128.c
2017-10-08 00:57:47 +02:00
Steffen Jaeckel
bab6af73e5
fix check_source()
2017-10-07 18:09:13 +02:00
Karel Miko
2041f9528e
update makefiles
2017-10-07 11:35:27 +02:00
Karel Miko
959121253d
rename duplicit rc4.c sober128.c
2017-10-07 11:35:10 +02:00
Steffen Jaeckel
adcd6ee9fd
only try to print the version from git if there's git installed
2017-10-03 19:54:27 +02:00
Steffen Jaeckel
58b71292c3
fixup caed025f8a
...
Simply always use an unsigned long long for ltc_mp_digit on 64-bit besides
when using MSVC.
2017-10-03 19:20:33 +02:00
Steffen Jaeckel
e438dbc3bf
add ltc_mp_digit to sizes and tests
2017-10-03 18:43:32 +02:00
Steffen Jaeckel
caed025f8a
define ltc_mp_digit as 'unsigned long' resp 'unsigned long long' for x32
...
This fixes #306
2017-10-03 18:42:26 +02:00
Steffen Jaeckel
cb34ef8626
fix-up LTC_FAST related defines/typedefs
2017-10-03 13:32:17 +02:00
Steffen Jaeckel
bb291cbbeb
init_GMP() works perfectly fine
2017-10-02 14:06:42 +02:00
Steffen Jaeckel
01a61e64ef
Merge pull request #302 from libtom/fix/pr/301
...
re-work PK crypto im- & export
2017-10-02 14:05:58 +02:00
Steffen Jaeckel
7f302dab54
make sure size is valid
2017-10-02 01:18:36 +02:00
Steffen Jaeckel
c702ac6f1c
improve rsa_test a bit
2017-10-02 01:18:19 +02:00
Karel Miko
67f9064b71
missing rsa_free in _rsa_issue_301 test
2017-10-01 22:56:47 +02:00
Steffen Jaeckel
ce7ae84d0d
correctly fix decoding of SubjectPublicKeyInfo
2017-10-01 22:56:47 +02:00
Steffen Jaeckel
db7d7a866e
Revert "fix bit-length check in der_decode_raw_bit_string()"
...
This reverts commit 2b8d83ff93da0764f19f494de0a8211515428cef.
2017-10-01 22:56:47 +02:00
Steffen Jaeckel
e5de0a0004
Revert "catch case where blen%8 != 0"
...
This reverts commit 548ee347c0d3366a41e5fa28ac3c0b44b362fdb5.
2017-10-01 22:56:47 +02:00
Steffen Jaeckel
d1d9566250
format code
2017-10-01 22:56:47 +02:00
Steffen Jaeckel
30b3a9a986
remove {MIN,MAX}_RSA_SIZE
2017-10-01 22:56:47 +02:00
Steffen Jaeckel
40e4a66693
catch case where blen%8 != 0
2017-10-01 22:56:47 +02:00
Steffen Jaeckel
3fef07c03e
also clear bits in der_decode_raw_bit_string()
2017-10-01 22:56:47 +02:00
Steffen Jaeckel
1d20c32a45
update README
...
[skip ci]
2017-10-01 22:56:47 +02:00
Steffen Jaeckel
9cfbaa83a3
mostly remove MAX_RSA_SIZE
2017-10-01 22:56:47 +02:00
Steffen Jaeckel
ab02d2e450
fix rsa_import() of MAX_RSA_SIZE'ed keys
...
The ASN1 encoded RSA key contains two MPI's therefore MAX_RSA_SIZE / 8
isn't enough.
2017-10-01 22:56:47 +02:00
Steffen Jaeckel
0500aaec45
add tests for MAX_RSA_SIZE sized openssl-standard RSA keys
2017-10-01 22:56:47 +02:00
Steffen Jaeckel
efa089e211
fixup #290
2017-10-01 22:56:47 +02:00
Steffen Jaeckel
15eab9702b
don't over-allocate that much in der_decode_subject_public_key_info()
2017-10-01 22:56:46 +02:00
Steffen Jaeckel
0b04279890
fix bit-length check in der_decode_raw_bit_string()
2017-10-01 22:56:46 +02:00
Steffen Jaeckel
062fc3ffe3
print info when doing a debug build
2017-10-01 22:56:46 +02:00
Rob Swindell
6da2211ee9
Update rsa_import.c
...
Bug-fix: MAX_RSA_SIZE is the maximum RSA key size in *bits* (as commented in tomcrypt_custom.h), so the proper conversion to bytes (as the argument value to XCALLOC) would be to divide by 8 (bits per byte), not multiply by 8. This excessive allocation (32 Kbytes instead of 512 bytes) is readily apparent in memory-constrained environments.
2017-10-01 22:56:46 +02:00
karel-m
c2f0675ede
Merge pull request #304 from libtom/pr/fix-303
...
missing dsa_free
2017-10-01 17:24:08 +02:00
Karel Miko
98536fa5bf
add missing dsa_free to _dsa_wycheproof_test - fixes #303
2017-10-01 15:40:19 +02:00
Steffen Jaeckel
f4802ef40a
add ltc_math_descriptor to crypt_sizes
2017-09-30 13:01:08 +02:00
Steffen Jaeckel
9ff889b330
Update makefiles
2017-09-27 21:37:23 +02:00
Steffen Jaeckel
07c5e6b0a4
bump version
2017-09-27 21:37:21 +02:00
Steffen Jaeckel
5f89a5ce2c
Merge pull request #298 from libtom/strict_der_decoding
...
initialize 'flags' etc. to invalid values before trying to decode
2017-09-27 21:34:30 +02:00
Steffen Jaeckel
4a8bfc0a21
introduce CRYPT_INPUT_TOO_LONG
2017-09-27 21:34:11 +02:00
Steffen Jaeckel
13cb43ad4c
initialize 'flags' etc. to invalid values before trying to decode
2017-09-27 21:34:11 +02:00
Steffen Jaeckel
8935cd9a8a
Merge pull request #299 from libtom/pr/libtool-cygwin
...
libtool + cygwin
2017-09-27 21:33:29 +02:00
Karel Miko
9c2c9f8af4
libtool on cygwin needs -no-undefined
2017-09-27 21:25:19 +02:00
Steffen Jaeckel
5049463774
bump the libtool version
...
yeah, helper.pl doesn't update it anymore automagically...
we'll probably find a new way to do that in the future...
or we keep on updating it manually...
This fixes #300
2017-09-27 21:19:33 +02:00
Steffen Jaeckel
f868a16a44
Update makefiles
2017-09-25 16:56:59 +02:00
Steffen Jaeckel
20c6bf812b
bump version
2017-09-25 16:56:57 +02:00
Karel Miko
83e7f4a1c7
keep dh_key.x instead of free'ing it
...
the approach before probably saves some bytes on the heap, but it's
inconsistent in regards to what we normally do
2017-09-25 15:35:29 +02:00
Steffen Jaeckel
f7c0b25146
add missing math constants
2017-09-23 11:42:05 +02:00
Steffen Jaeckel
91a10318f1
Merge pull request #296 from libtom/cleanup/3
...
General clean-up 3
2017-09-21 20:46:41 +02:00
Karel Miko
ea43d9a1d2
Fix openssl-enc compilation
2017-09-21 18:37:37 +02:00
Steffen Jaeckel
8f7986bbb2
fix coverage_more.sh after updating hashsum
2017-09-21 18:37:37 +02:00
Steffen Jaeckel
5bb63f1bca
hashsum: improve help
2017-09-21 18:37:37 +02:00
Steffen Jaeckel
eb75c894db
hashsum: cleanup at exit
2017-09-21 18:37:37 +02:00
Steffen Jaeckel
312247fa0b
better comments for PKCS#5
2017-09-21 18:37:37 +02:00
Steffen Jaeckel
da4f854329
make sure chacha_crypt() can only be called after setting the IV
2017-09-21 18:37:37 +02:00
Steffen Jaeckel
342a10cc14
make PK_MAX_RETRIES a config option
2017-09-21 18:37:37 +02:00
Steffen Jaeckel
a278f72659
skip comment lines when checking hashes
...
[skip ci]
2017-09-20 17:43:07 +02:00
Steffen Jaeckel
9a83397376
catch case where we could BOF should_buffer[]
...
[skip ci]
2017-09-20 17:29:05 +02:00
Steffen Jaeckel
b6213309ca
Merge pull request #197 from libtom/update/doc
...
Update documentation
2017-09-20 15:14:54 +02:00
Steffen Jaeckel
f8d132ea03
update changes
...
[skip ci]
2017-09-20 15:14:10 +02:00
Steffen Jaeckel
7cc9aad5cc
remove TODO
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
9fb08af23d
fix location of some of the tables
...
this fixes the last open issue of #54
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
2d3a921de4
align code
...
[skip-ci]
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
4f7747eaec
DSA not DH
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
c210f24853
IV is short for 'initialization vector'
2017-09-20 15:06:40 +02:00
Karel Miko
fff9fee129
DSA new functions - doc
2017-09-20 15:06:40 +02:00
Karel Miko
f3f839ec6c
BLAKE2s + BLAKE2b MAC doc
2017-09-20 15:06:40 +02:00
Karel Miko
50e52d0b4c
poly1305 doc
2017-09-20 15:06:40 +02:00
Karel Miko
11827feef3
ChaCha20-Poly1305 doc
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
35d920a688
moar doc
...
[skip ci]
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
8b3af12d70
add radix_to_bin() docs
...
[skip ci]
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
78e9601eb6
review "Configuring and Building the Library"
...
[skip ci]
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
13b484f8a5
moar doc
...
[skip ci]
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
0742a99fb5
update README
...
[skip ci]
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
fc65352261
moar doc
...
[skip ci]
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
dd01232bcb
review stream ciphers
...
[skip ci]
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
2ccb3fb53d
update OCB3 doc
...
[skip ci]
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
56d17c8e55
some more doc updates
2017-09-20 15:06:40 +02:00
Karel Miko
5d74fee9dc
doc tuning
2017-09-20 15:06:40 +02:00
Karel Miko
468245ce56
doc: stream ciphers
2017-09-20 15:06:40 +02:00
Karel Miko
9584975a6d
some crypt.tex hacking
2017-09-20 15:06:40 +02:00
Karel Miko
7edc41162d
fix crypt.pdf building
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
39650b4a08
add doc of new RSA API functions
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
583b2b3938
document PKCS#1 v1.5 signatures w/o ASN.1
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
09c3196930
use v1.18.0 instead of v1.18
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
9a0e208f5e
add 'ltc_mp_digit' docs
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
728bc4a6a4
update "Primality Testing"
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
ce68fa34ee
add rand_bn_X() doc
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
a0a7daea6f
add termdoc option to view documentation on the terminal
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
01cb819c48
trim trailing spaces
2017-09-20 15:06:40 +02:00
Steffen Jaeckel
a9d9466694
beautify some strings
...
[skip-ci]
2017-09-20 15:06:28 +02:00
karel-m
632d2b757b
Merge pull request #291 from libtom/pr/dsa-test-wycheproof
...
dsa_verify_hash fix + dsa_wycheproof_test
2017-09-20 13:23:51 +02:00
Karel Miko
66abefc54b
add dsa_wycheproof_test + fix old dsa tests
2017-09-20 11:59:03 +02:00
Karel Miko
155e29dd68
dsa_verify_hash must set stat=0 on any error
2017-09-20 11:58:32 +02:00
Steffen Jaeckel
4b36f0654f
Add 'Installation' section
...
This closes #293
[skip-ci]
2017-09-19 14:19:43 +02:00
Steffen Jaeckel
d169aa2af2
Merge pull request #290 from libtom/pr/write-strings
...
Add -Wwrite-strings (char* vs. const char*)
2017-09-19 13:24:13 +02:00
Karel Miko
b2813480bf
LTC_CFLAGS += -Wwrite-strings
2017-09-18 12:35:03 +02:00
Karel Miko
5057af3ef1
fix char* vs. const char*
2017-09-18 12:35:03 +02:00
karel-m
565be29bb0
Merge pull request #292 from libtom/pr/write-strings-test-part
...
Partial changes from #290 (char* vs. const char* - tests related part)
2017-09-18 12:34:14 +02:00
Karel Miko
3b663a199f
fix char* vs. const char* (tests related part)
2017-09-18 09:24:19 +02:00
karel-m
0ceb1c1213
Merge pull request #289 from libtom/pr/scan-build-status-bugs
...
scan-build --status-bugs, related to #287
2017-09-15 06:47:08 +02:00
Karel Miko
84fcd4aec7
scan_build --status-bugs - related to #287
2017-09-14 23:07:18 +02:00
karel-m
04cc6cc652
Merge pull request #288 from libtom/pr/fix-tv_gen-scan-build
...
Fix scan-build bug/warning in tv_gen - related to #287
2017-09-14 23:05:10 +02:00
Karel Miko
3ddb45a6b7
fix scan-build bug/warning in tv_gen
2017-09-14 20:32:47 +02:00
Karel Miko
5e71849942
properly exit dsa_int_validate_pqg
2017-09-14 20:07:32 +02:00
karel-m
5934eb3b7c
Merge pull request #280 from libtom/pr/fix-dsa-cdf
...
fixes necessary to pass DSA cdf tests
2017-09-14 19:10:13 +02:00
Karel Miko
bb6a7e1c6c
if dsa_int_validate_* fails return consistently CRYPT_INVALID_PACKET
2017-09-14 18:53:09 +02:00
Karel Miko
a990a8252e
mp_clear_multi - reverse the order
2017-09-14 18:51:02 +02:00
Karel Miko
6200f301a5
add comment #ifdef LTC_SOURCE + internal helper functions
2017-09-14 18:49:42 +02:00
Karel Miko
d91d59421f
fix de-referencing stat before checking for NULL
2017-09-14 18:48:04 +02:00
Karel Miko
444d9f3fb7
do dsa_int_validate_* in dsa_import
2017-09-14 17:38:12 +02:00
Karel Miko
fd94e9540f
move qord trest to dsa_int_validate_pqg
2017-09-14 17:37:39 +02:00
Karel Miko
9765befd6b
do dsa_int_validate_pqg in dsa_set_pqg_dsaparam
2017-09-14 17:29:59 +02:00
Karel Miko
45b6b947da
dsa_int_validate_primes & LTC_MILLER_RABIN_REPS
2017-09-14 17:21:48 +02:00
Karel Miko
c806ea17f9
fix dsa_int_validate_xy
2017-09-14 17:21:48 +02:00
Karel Miko
1ea4fecc81
FIPS 186-4 DSA validity tests
2017-09-14 17:21:48 +02:00
Karel Miko
5fb4c9f89b
another approach for dsa_int_validate_*
2017-09-14 17:21:48 +02:00
Karel Miko
aa5b9dafc4
fix dsa_int_validate_key related compiler warnings
2017-09-14 17:21:48 +02:00
Steffen Jaeckel
1625ce4001
re-factor & re-name internal dsa key validation
2017-09-14 17:21:48 +02:00
Karel Miko
053ba6d600
introducing dsa_verify_key_ex
2017-09-14 17:21:48 +02:00
Karel Miko
2505e3b609
add basic validity tests to dsa_set
2017-09-14 17:21:48 +02:00
Karel Miko
c908eb16bb
Merge pull request #283 from apjanke-build-on-mac-darnit
2017-09-14 17:15:53 +02:00
Steffen Jaeckel
2dd446dbdb
clang and -Wno-missing-field-initializers
2017-09-14 17:11:06 +02:00
Andrew Janke
cfce691a50
initialize ltc_mp to force allocation under all compilers, including clang on macOS
2017-09-14 17:07:49 +02:00
karel-m
32d60ac134
Merge pull request #278 from libtom/pr/fix-dsa-wycheproof
...
DSA wycheproof tests
2017-09-10 14:00:54 +02:00
Karel Miko
c927e4315a
dsa_verify_hash: fix wycheproof - appending unused 0's
2017-09-02 14:16:52 +02:00
Karel Miko
7e4bd971de
dsa_verify_hash: properly handle (=reject) negative r, s
2017-09-02 14:16:52 +02:00
karel-m
aade47c62c
Merge pull request #286 from libtom/pr/fix-dsa-rsa-trouble
...
Fix DSA dependency on RSA
2017-09-01 20:15:52 +02:00
Karel Miko
59857ba5e0
fix DSA dependency on RSA #285
2017-09-01 18:24:15 +02:00
Karel Miko
87f94e1f0d
Merge branch 'apjanke-add-sizes-and-constants-demo-targets' into release/1.18.0
...
PR #282
2017-08-31 19:08:00 +02:00
Andrew Janke
f5353a613d
makefile.msvc: add targets for sizes and constants demos
2017-08-31 18:55:31 +02:00
Andrew Janke
d7461a91bc
makefile.mingw: add targets for sizes and constants demos
2017-08-31 18:55:31 +02:00
Andrew Janke
509086253e
makefile.unix: add targets for sizes and constants demos
2017-08-31 18:55:31 +02:00
Karel Miko
c04e8a397f
Merge branch 'apjanke-fix-typos-in-makefile.shared-help' into release/1.18.0
...
PR #284
2017-08-31 18:52:53 +02:00
Andrew Janke
39c721c8da
makefile.shared: protect commas in function calls through variable substitution
2017-08-31 05:51:37 -04:00
Karel Miko
9ea6247da1
Revert "add basic validity tests to dsa_set"
...
This reverts commit 9003e87e5a .
2017-08-30 00:03:04 +02:00
Karel Miko
9003e87e5a
add basic validity tests to dsa_set
2017-08-30 00:01:00 +02:00
karel-m
a86287b698
Merge pull request #277 from libtom/pr/fix-rsa-wycheproof
...
RSA wycheproof tests
2017-08-29 22:13:35 +02:00
Steffen Jaeckel
43e6860925
fix RSA - wycheproof "wrong length"
2017-08-29 17:26:14 +02:00
Karel Miko
fe9af6cfbd
RSA: handle wycheproof test vectors - Legacy:missing NULL
2017-08-29 17:26:14 +02:00
Steffen Jaeckel
a22140f94c
oops, fix .common_uninstall make-target
...
[skip-ci]
2017-08-28 17:31:44 +02:00
Steffen Jaeckel
e6d23834ae
Merge pull request #276 from libtom/pr/fix-gcm-iv
...
GCM zero size IV
2017-08-28 17:28:30 +02:00
Karel Miko
105abdd8cd
GCM: 0 size IV is not valid #273
2017-08-28 16:10:30 +02:00
Steffen Jaeckel
042df8ca20
Merge pull request #279 from libtom/cleanup/2
...
Yet another clean-up and bugfix PR
2017-08-28 09:14:25 +02:00
Steffen Jaeckel
bb42345234
fix missing registration of PRNG's in ltcrypt
2017-08-26 12:07:24 +02:00
Steffen Jaeckel
b49ce35b2c
fix DH timing when compiling with TFM support
2017-08-26 12:05:53 +02:00
Steffen Jaeckel
33e70b427a
CRYPT_INVALID_KEYSIZE isn't only used for block ciphers
2017-08-26 12:03:35 +02:00
Steffen Jaeckel
041b7aa5c0
Update makefiles
2017-08-23 22:35:35 +02:00
Steffen Jaeckel
0afbefc549
bump version
2017-08-23 22:35:32 +02:00
Larry Bugbee
725532c6b6
Merge pull request #272 from libtom/update-demos-demo_dynamic.py
...
Update demos demo dynamic.py - everything is green
2017-08-19 18:19:00 -07:00
Larry Bugbee
de6ac748c7
refine comments
2017-08-19 16:29:48 -07:00
Larry Bugbee
3794ecaf94
Update demo_dynamic.py
...
removed trailing spaces
2017-08-18 20:34:03 -07:00
Larry Bugbee
631de35ee3
Update and rename demo_dynamic.py3 to demo_dynamic.py
...
this version runs under python2 and python3 so only one version need be distributed
2017-08-17 21:11:59 -07:00
Larry Bugbee
ae16210939
Delete demo_dynamic.py
2017-08-17 21:06:50 -07:00
Steffen Jaeckel
d502c247db
Merge pull request #271 from libtom/rel-1.18-sm-demo-cleanup
...
Rel 1.18 sm demo cleanup
2017-08-17 10:11:30 +02:00
Larry Bugbee
147a406243
Update demo_dynamic.py3
...
clean comments
2017-08-16 23:50:23 -07:00
Larry Bugbee
5d3e2d1e90
Update demo_dynamic.py
...
clean comments
2017-08-16 23:49:39 -07:00
Steffen Jaeckel
7a64e13845
Merge pull request #270 from libtom/minor_changes
...
Minor changes
2017-08-16 13:42:22 +02:00
Steffen Jaeckel
1fa8caff6c
fix call to gettimeofday()
...
as of `man gettimeofday`
"The use of the timezone structure is obsolete;
the tz argument should normally be specified as NULL."
2017-08-16 11:52:40 +02:00
Steffen Jaeckel
bb9d397975
default ChaCha to ChaCha20
2017-08-16 11:49:25 +02:00
karel-m
385bae81a1
Merge pull request #266 from libtom/pr/fix-lint-issues
...
Fix lint issues
2017-08-13 18:16:55 +02:00
Karel Miko
de8a53a2e5
ocb3_test cosmetics
...
[skip ci]
2017-08-13 18:15:44 +02:00
Karel Miko
2a52c68f2e
fix lint issues from #199
2017-08-13 14:54:39 +02:00
Steffen Jaeckel
daaab843f3
Merge pull request #263 from libtom/pr/crypt_sizes
...
missing items in crypt sizes
2017-08-11 13:27:23 +02:00
Larry Bugbee
6bbb450d40
remove trailing space
2017-08-11 02:17:31 -07:00
Larry Bugbee
8b703c1505
remove traling space for Travis
2017-08-11 02:16:26 -07:00
Larry Bugbee
bab115c631
converted demo_dynamic.py to Python3
2017-08-11 01:27:21 -07:00
Larry Bugbee
ee55c4e51c
minor cleanup and formatting changes
2017-08-11 01:21:59 -07:00
Larry Bugbee
695c3b235d
Update demo_dynamic.py
...
added error strings (with function returning a string type) and a decryption to ChCha.
2017-08-10 16:40:28 -07:00
Steffen Jaeckel
87d876f6ac
add comment about usage to demo_dynamic
...
[skip ci]
2017-08-09 16:06:11 +02:00
Steffen Jaeckel
35925eada5
improve constants demo
2017-08-09 16:06:11 +02:00
Steffen Jaeckel
d5d4cadbde
PKA_{D,R}SA shouldn't be public
2017-08-09 16:06:11 +02:00
Steffen Jaeckel
a247583e63
add error-codes to crypt_constants
2017-08-09 16:06:11 +02:00
Larry Bugbee
9f548c9928
update demo_dynamic.py
2017-08-09 16:06:11 +02:00
Steffen Jaeckel
91e5e8350b
ltc_dh_set_type can be hidden as well
2017-08-09 16:06:11 +02:00
Steffen Jaeckel
d22b20833e
we don't expose internal structs
2017-08-09 16:06:11 +02:00
Steffen Jaeckel
22822417c9
really define LTC_{DE,EN}CRYPT
2017-08-09 16:06:11 +02:00
Larry Bugbee
a3a199e14b
update crypt_sizes.c
2017-08-09 16:06:11 +02:00
Larry Bugbee
7a2aabf47e
update crypt_constants.c
2017-08-09 16:06:11 +02:00
Steffen Jaeckel
9f02fde06e
improve sizes demo a bit
2017-08-09 16:06:11 +02:00
Karel Miko
b79ae63408
add missing items to crypt_sizes
2017-08-09 16:06:11 +02:00
Steffen Jaeckel
b5ab8ec811
update README.md a bit
...
[skip ci]
2017-08-09 15:55:15 +02:00
karel-m
231af66e03
Merge pull request #264 from libtom/pr/doxygen-warnings
...
fix doxygen warnings (as mentioned in #228 )
2017-08-09 09:53:19 +02:00
Karel Miko
0286b36ad6
fix doxygen warnings (as mentioned in #228 )
...
[skip ci]
2017-08-09 09:44:12 +02:00
Steffen Jaeckel
65dc00e23a
align HASH_PROCESS() macro
2017-08-08 19:05:59 +02:00
Steffen Jaeckel
c29c9f140d
disable DSA4096 timing tests when building for TFM
...
this fixes #260
2017-08-08 08:47:58 +02:00
Steffen Jaeckel
227838bb09
Merge pull request #261 from libtom/improve/test_without_mpi
...
make it possible to 'make all' w/o an MPI provider
2017-08-08 08:46:31 +02:00
Steffen Jaeckel
a65cfb8dbe
make it possible to 'make all' w/o an MPI provider
2017-08-07 21:11:42 +02:00
Steffen Jaeckel
7993ce8e10
Merge pull request #262 from libtom/pr/ocb3-done-taglen-fix
...
ocb3_done taglen fix
2017-08-07 21:07:25 +02:00
Steffen Jaeckel
9139b59699
OCBv3: fix testvector generation
2017-08-07 19:43:09 +02:00
Steffen Jaeckel
9952fac68e
tv.txt contains errors from tv_gen
2017-08-07 19:37:53 +02:00
Karel Miko
f647baa778
OCBv3: ocb3_init taglen check
2017-08-07 18:24:59 +02:00
Karel Miko
af63d0a55f
OCBv3: improved handling of taglen in ocb3_done
2017-08-07 18:24:59 +02:00
Steffen Jaeckel
41130900d0
fix 1. help-line of openssl-enc
...
[skip ci]
2017-08-07 17:28:49 +02:00
Steffen Jaeckel
28ecdd5d12
minor improvements
...
[skip ci]
2017-08-07 16:33:38 +02:00
Steffen Jaeckel
ac4687d88d
also put LTC_TEST_DBG in crypt_build_settings
2017-08-07 16:18:15 +02:00
Steffen Jaeckel
44076e3815
Merge branch 'fix/254' into release/1.18.0
...
This fixes #254
2017-08-07 16:05:38 +02:00
Steffen Jaeckel
7a59f71af8
fix warning
...
warning: 'ltc_asn1_type {aka enum ltc_asn1_type_}' is promoted to 'int' when passed through '...'
type = va_arg(args, ltc_asn1_type);
note: (so you should pass 'int' not 'ltc_asn1_type {aka enum ltc_asn1_type_}' to 'va_arg')
note: if this code is reached, the program will abort
2017-08-07 16:04:57 +02:00
Steffen Jaeckel
32355d04bb
fix endianness detection for some versions of gcc
...
This fixes #254
2017-08-07 16:04:57 +02:00
Steffen Jaeckel
9f020b17df
limit malloc'ed data in eax_decrypt_verify_memory()
2017-08-07 16:04:36 +02:00
Steffen Jaeckel
05f7393067
Merge pull request #256 from libtom/fix/256
...
OCB3 is not according to RFC7253
2017-08-07 16:03:39 +02:00
Karel Miko
6ac1c5fa34
OCBv3: fix demos/timing failures
2017-08-07 07:48:21 +02:00
Steffen Jaeckel
3ecd18763b
OCBv3: better taglen limitation
2017-08-03 13:40:57 +02:00
Steffen Jaeckel
3b4d39ea45
OCBv3: improve a bit when ARGCHK'ing pointers
...
* it didn't really make sense to check that the _in_ pointer is NULL
* instead we should check that _in_ and _out_ are not NULL when there's
something to process
2017-08-03 13:40:26 +02:00
Steffen Jaeckel
868c5a82c3
OCBv3: fix handling of empty plaintext
2017-08-03 13:19:12 +02:00
Steffen Jaeckel
bc0c18f347
Update makefiles
2017-08-02 18:55:42 +02:00
Steffen Jaeckel
0c2ff4a1b0
OCBv3: small review
...
* better LTC_ARGCHK()
* move unnecessary functions from API to be static
* limit malloc'ed data in ocb3_decrypt_verify_memory()
2017-08-02 18:55:34 +02:00
Steffen Jaeckel
d77cf0e248
OCBv3: implement RFC7253 compliance
...
This fixes #256
2017-08-02 17:45:59 +02:00
Steffen Jaeckel
1aaa5abb33
ocb3: check the length of the nonce
2017-08-02 14:41:46 +02:00
Steffen Jaeckel
b2448c593a
ocb3: properly handle empty AAD
...
* allow passing "no additional data" to ocb3_decrypt_verify_memory() and
ocb3_encrypt_authenticate_memory()
* ensure that the caller didn't want to add AAD
2017-08-01 14:44:37 +02:00
Steffen Jaeckel
4805c89adb
add ARGTYPE to crypt_build_settings
2017-08-01 14:21:11 +02:00
Michael Stapelberg
541ab1c16c
Fix crypt.tex with newer TeXLive (thanks Norbert Preining)
...
See https://lists.debian.org/debian-tex-maint/2017/08/msg00000.html for details
2017-08-01 12:04:01 +02:00
Steffen Jaeckel
129bc7175f
beautify dh & rsa
2017-07-21 10:16:19 +02:00
Steffen Jaeckel
6b925485a8
make sure to request an element which is always available
2017-07-20 13:34:16 +02:00
Steffen Jaeckel
ab8c5b8b49
fix help of {un,}install targets
2017-07-20 12:58:28 +02:00
Steffen Jaeckel
61eb98b76e
add compile-time check for sprng requirements
2017-07-20 12:47:19 +02:00
Steffen Jaeckel
a46d6eb819
remove define of LTC_NO_FILE when defining LTC_NOTHING
...
it doesn't make sense to define this opt-out option especially
since there's no way to undefine it again.
2017-07-19 16:44:37 +02:00
Steffen Jaeckel
83407feaa6
Merge pull request #250 from libtom/pr/readme-building
...
README building instructions
2017-07-17 18:34:52 +02:00
Steffen Jaeckel
1e1170df29
move timing to BROKEN_DEMOS
2017-07-17 13:36:34 +02:00
Steffen Jaeckel
24c5b74193
introduce 'make help'
2017-07-17 13:36:34 +02:00
Steffen Jaeckel
bffaab4eed
re-group demos and really build everything in 'all' target
2017-07-17 13:36:34 +02:00
Steffen Jaeckel
22c13b49d8
oops, refman.pdf can't be built with DOT
2017-07-17 13:36:34 +02:00
Steffen Jaeckel
0e081d666a
improve error message when using makefile on Mac OSX
...
[skip ci]
2017-07-17 13:36:34 +02:00
Steffen Jaeckel
4cb8936a31
update readme
...
[skip ci]
2017-07-17 13:36:34 +02:00
Karel Miko
bfe6c4d35c
improved README - building instructions
...
[skip ci]
2017-07-17 13:36:34 +02:00
karel-m
ff54ec2f0d
Merge pull request #253 from libtom/pr/rc2-fix-win64
...
Fix MS Windows/64bit related warnings
2017-07-14 20:41:10 +02:00
Karel Miko
909b4954a9
fix MS Windows/64bit related warnings
2017-07-14 19:59:03 +02:00
Steffen Jaeckel
aa0f396c0c
Update makefiles
2017-07-13 14:58:01 +02:00
Steffen Jaeckel
535358ec28
bump version
2017-07-13 14:57:45 +02:00
Steffen Jaeckel
89d0c64335
Merge pull request #247 from libtom/pr/custom_compile_flags
...
introduce LTC_CFLAGS and LTC_LDFLAGS
2017-07-13 14:34:05 +02:00
Steffen Jaeckel
a2f48578e9
also pre-pend -Itests
2017-07-12 22:48:46 +02:00
Steffen Jaeckel
a949ef5a89
append instead of prepend CFLAGS for the other makefiles
2017-07-11 15:37:31 +02:00
Steffen Jaeckel
b1c0227d54
introduce LTC_CFLAGS and LTC_LDFLAGS
2017-07-11 15:33:33 +02:00
Steffen Jaeckel
24e69b2956
more printf() clean-up
...
* remove last occurences in non-test code
* minimize in tests
2017-07-11 15:29:45 +02:00
Steffen Jaeckel
8b7edf5478
update DOT max values
2017-07-11 15:29:45 +02:00
Steffen Jaeckel
c6b93ae72e
Merge branch 'pr/245' into release/1.18.0
...
This closes #245
2017-07-11 15:29:45 +02:00
Francois Perrad
37de73db01
add static _chc_process like in its prototype
2017-07-11 15:29:45 +02:00
Francois Perrad
53c62b3670
remove redundant prototypes
...
already declared in src/headers/tomcrypt_hash.h
2017-07-11 15:29:45 +02:00
Steffen Jaeckel
70f8a57f01
Merge pull request #249 from libtom/pr/dh-dsa-api
...
dh_set_key + dsa_set_key
2017-07-11 10:36:09 +02:00
Steffen Jaeckel
1819a02d5a
update comments
...
[skip ci]
2017-07-11 10:32:53 +02:00
Karel Miko
e20e204b8c
dh_set_key + dsa_set_key API change described in #248
2017-07-11 00:13:26 +02:00
karel-m
fa4713b68e
Merge pull request #246 from libtom/pr/gcm-corner-cases
...
GCM allow skipping gcm_add_aad and gcm_process
2017-07-10 23:26:13 +02:00
Karel Miko
0792e3701e
GCM allow skipping gcm_add_aad and gcm_process
2017-07-10 22:35:42 +02:00
Steffen Jaeckel
dd5996dd1f
don't find the lo's to link, but use the list of objects
2017-07-10 10:20:36 +02:00
Steffen Jaeckel
221f7f223d
add 'uninstall' make target
...
[skip ci]
2017-07-10 10:16:35 +02:00
Steffen Jaeckel
3806629e9e
fix default make target
2017-07-09 17:34:45 +02:00
Steffen Jaeckel
4d897a36a3
Merge pull request #243 from libtom/pr/fix-chmod
...
Fix: chmod -x
2017-07-09 17:34:04 +02:00
Karel Miko
b89f3d8b5a
fix: chmod -x notes/rsa-testvectors/*.txt
2017-07-09 16:22:28 +02:00
Karel Miko
2aa42f002f
fix: chmod -x
2017-07-09 16:22:28 +02:00
Steffen Jaeckel
68bf547f9c
use rsa_free() on error in rsa_make_key()
2017-07-09 16:02:11 +02:00
Steffen Jaeckel
749873c306
fix docs generation with TeX Live 2017
...
[skip ci]
2017-07-06 10:19:38 +02:00
Steffen Jaeckel
f15e0172ca
Travis: also build master and 'release/*' branches
2017-07-05 14:43:21 +02:00
Steffen Jaeckel
e53858c740
update VERSION variables in makefiles
...
VERSION is now VERSION_PC
the new VERSION contains the entire string of SCRYPT
2017-07-05 14:30:17 +02:00
Steffen Jaeckel
a8965f048a
Update makefiles
2017-07-05 14:30:17 +02:00
Steffen Jaeckel
fa5acee802
bump version
2017-07-05 14:30:17 +02:00
Steffen Jaeckel
d03635acab
support patch-releases in helper.pl
2017-07-05 14:30:17 +02:00
Steffen Jaeckel
ac6f62badc
update changes
2017-07-05 14:30:16 +02:00
Steffen Jaeckel
b59f066de3
update prng section in doc
2017-07-05 14:27:05 +02:00
Steffen Jaeckel
ac6fb72ef1
fix some doxygen headers
2017-07-05 14:27:05 +02:00
Steffen Jaeckel
6598dc0c3f
update Doxyfile
2017-07-05 14:27:05 +02:00
Steffen Jaeckel
e1fcd3ab04
add hashsum multi-hash option
2017-07-05 14:26:53 +02:00
Steffen Jaeckel
ebc9d2943b
Merge pull request #239 from libtom/pr/asn1-small-fixes
...
ASN.1 changes extracted from ECC stuff
2017-07-05 12:46:59 +02:00
Steffen Jaeckel
7d60fd2bfe
don't expose der_length_sequence_ex()
2017-07-05 11:52:46 +02:00
Karel Miko
4bc1489584
small ASN.1 changes extracted from ECC stuff
2017-07-05 11:34:27 +02:00
Steffen Jaeckel
ce1ba58f00
Merge pull request #238 from libtom/proposal/ltc_pk_part
...
Re-factor X_import_radix() etc. API's
2017-07-05 11:33:17 +02:00
Steffen Jaeckel
c2f50459e2
better doc of radix_to_bin()
2017-07-05 10:25:01 +02:00
Steffen Jaeckel
4221c44fbc
rename rand_bn_range() to rand_bn_upto()
2017-07-05 10:03:56 +02:00
Steffen Jaeckel
22919cd4f2
rand_bn_range(): count bits once
2017-07-04 10:58:10 +02:00
Steffen Jaeckel
8167b4d1cc
Update makefiles
2017-07-04 10:30:50 +02:00
Steffen Jaeckel
a6aef23438
dh_make_key() is now dh_generate_key()
2017-07-04 10:30:39 +02:00
Steffen Jaeckel
e647f9a0e4
not good to check that prng is non-NULL
...
e.g. sprng() lives w/o context
2017-07-04 10:25:38 +02:00
Steffen Jaeckel
a0f2abc5b5
re-format
2017-07-04 10:25:38 +02:00
Steffen Jaeckel
a80abb1222
put dh_set_pg_dhparam() in own c file
2017-07-04 10:25:38 +02:00
Steffen Jaeckel
5640f8afc7
put dsa_set_pqg_dsaparam() in own c file
2017-07-04 10:25:38 +02:00
Steffen Jaeckel
3c2e0d6686
dsa_make_key_ex() is now dsa_generate_key()
2017-07-04 10:25:38 +02:00
Steffen Jaeckel
dbeaefd65b
remove LTC_{DH,DSA}_KEY_INITIALIZER
2017-07-04 10:25:38 +02:00
Steffen Jaeckel
d1ecd82a42
use rand_bn_range() where possible
2017-06-28 20:50:21 +02:00
Steffen Jaeckel
bdfecc5f3c
more doc updates
2017-06-28 16:45:29 +02:00
Steffen Jaeckel
d64880eeb1
add dsa_set_pqg_dsaparam()
2017-06-28 16:07:54 +02:00
Steffen Jaeckel
35e0c5fc71
clean-up a bit around DSA
...
* comments
* dsa_test()
* order of alloc/free of key parts
2017-06-28 16:07:32 +02:00
Steffen Jaeckel
1cce065676
Update makefiles
2017-06-28 14:44:17 +02:00
Steffen Jaeckel
0aad68c20d
clean-up some PK tests
...
no need to test the same functionality multiple times
these tests were multiplied for the XX_import_radix() functions which
are gone now.
2017-06-28 14:44:06 +02:00
Steffen Jaeckel
cfff656e25
re-factor dsa_make_key() etc.
2017-06-28 14:40:30 +02:00
Steffen Jaeckel
24946d08b7
use mp_cleanup_multi()
2017-06-28 14:40:30 +02:00
Steffen Jaeckel
ed149c9396
add tests for radix_to_bin()
2017-06-28 14:40:30 +02:00
Steffen Jaeckel
76b9bba857
introduce mp_cleanup_multi()
2017-06-28 14:40:30 +02:00
Steffen Jaeckel
292f42d3c0
Merge pull request #227 from libtom/pr/dh_make_key_ex
...
DH facelift part 2 (dh_make_key_ex & co.)
2017-06-27 22:25:00 +02:00
Steffen Jaeckel
37ce78fdc8
Update makefiles
2017-06-27 22:10:10 +02:00
Steffen Jaeckel
f2f113880b
also rename file
2017-06-27 22:10:07 +02:00
Steffen Jaeckel
c493a2a0a3
re-factor dh_export_radix() to dh_export_key()
2017-06-27 22:09:21 +02:00
Steffen Jaeckel
f226efc9a9
Update makefiles
2017-06-27 22:00:13 +02:00
Steffen Jaeckel
9d6689fc08
re-factor dh_make_key() and variants
2017-06-27 22:00:13 +02:00
Steffen Jaeckel
fbc54756c1
replace dh_import_radix() by dh_set_{pg,key}
2017-06-27 21:53:02 +02:00
Karel Miko
b3e535f933
update makefiles
2017-06-27 20:11:52 +02:00
Karel Miko
f60e2902ed
dh_make_key_ex dh_export_radix dh_import_radix
2017-06-27 20:11:52 +02:00
Steffen Jaeckel
a42f467ff1
Update makefiles
2017-06-27 20:05:36 +02:00
Steffen Jaeckel
ae7d4d2947
re-factor rsa_test() to new rsa_set_X() API
2017-06-27 20:05:36 +02:00
Steffen Jaeckel
627f6696cb
add radix_to_bin()
2017-06-27 20:05:36 +02:00
Steffen Jaeckel
6b798ca6a6
replace rsa_import_radix() by rsa_set_{key,factors,crt_params}()
2017-06-27 20:05:36 +02:00
Steffen Jaeckel
05e9f0ee79
Revert "use ltc_pk_part in rsa_import_radix()"
...
This reverts commit 023e4a2c23641d852cf47000948fa29a53249457.
2017-06-27 20:05:36 +02:00
Steffen Jaeckel
083e8af78b
Revert "also test binary import"
...
This reverts commit 8b6f8c8cce325fa1ce3b61805aa80cdabc1826b4.
2017-06-27 20:05:36 +02:00
Steffen Jaeckel
4afc024f6a
also test binary import
2017-06-27 20:05:36 +02:00
Steffen Jaeckel
bfae92e4ab
use compare_testvector() in rsa_test()
2017-06-27 20:05:36 +02:00
Steffen Jaeckel
00a5212d99
use ltc_pk_part in rsa_import_radix()
2017-06-27 20:05:36 +02:00
Steffen Jaeckel
51ac4da8fc
Merge pull request #241 from libtom/cleanup/4
...
Fourth general clean-up
2017-06-27 20:04:59 +02:00
Steffen Jaeckel
0a6af8d333
rsa_exptmod(): verify that p and q are valid before going the CRT path
2017-06-27 19:01:56 +02:00
Steffen Jaeckel
f5b8cc9dae
this should really implement a patch for the illegal access
2017-06-27 12:35:39 +02:00
Steffen Jaeckel
1a3880fda5
Revert "re-factor size checks in blake2 implementations"
...
This reverts commit af38b1830e .
2017-06-27 12:33:40 +02:00
Steffen Jaeckel
af38b1830e
re-factor size checks in blake2 implementations
2017-06-26 14:02:52 +02:00
Steffen Jaeckel
907d5301ee
update coverity build script to use makefile.unix
...
it seems like the regular makefile is somehow broken...
2017-06-23 16:46:31 +02:00
Steffen Jaeckel
3cfb2a5e2e
hide some of the 'new since 1.17' internal functions
2017-06-23 14:14:05 +02:00
Steffen Jaeckel
a80d3c00a8
no need for DH_BUF_SIZE
2017-06-23 14:05:57 +02:00
Steffen Jaeckel
c15d656a23
crypt{,.exe} is now ltcrypt{,.exe}
2017-06-23 14:05:57 +02:00
Steffen Jaeckel
e68d846429
hopefully finally fix usage of $(DESTDIR)
...
This closes #232
2017-06-23 14:05:57 +02:00
Steffen Jaeckel
cd6e602b48
Merge pull request #240 from fperrad/20170622_lint
...
more linting
2017-06-23 10:06:13 +02:00
Francois Perrad
446fec1bc4
refactor switch with default
2017-06-22 17:13:40 +02:00
Steffen Jaeckel
1725b87098
Merge pull request #234 from libtom/cleanup/3
...
Third general clean-up
2017-06-22 16:01:14 +02:00
Steffen Jaeckel
5ce602558f
Revert "also use DESTDIR in makefile.m{ingw,svc}"
...
This reverts commit 1655e63c49 .
As of @karel-m [1]
"I am not sure whether DESTDIR concept make sense for MS Windows
paths. For example: `make -f makefile.mingw DESTDIR=c:\builddir\
PREFIX=c:\installdir` means that `"$(DESTDIR)$(PREFIX)\bin"` will
expand to `"c:\builddir\c:\installdir\bin"` which is obviously
invalid.
I propose reverting `also use DESTDIR in makefile.m{ingw,svc}`."
[1] https://github.com/libtom/libtomcrypt/pull/234#issuecomment-310366602
2017-06-22 14:41:37 +02:00
Steffen Jaeckel
09c4d4c93b
proper use of $(DESTDIR)
...
@rofl0r @ [1]
"...still it's unusual/unexpected to embed DESTDIR in LIBPATH
etc. where this could hickup is when for example hardcoded paths need
to be embedded into the resulting binary. for example, in the
netbsd-curses makefile i linked earlier, such a case would be reference
to the terminfo DB location, which is derived from PREFIX.
other possible cases might be stuff that dlopen()s its own libs using an
absolute path, or uses other data files. for such a case a contributor
would typically re-use DATAPATH oslt and put it into CPPFLAGS or write
it into a header, to find the required files. when now these paths have
DESTDIR in them too, this will not work. thus it is good practice to use
$(DESTDIR) only in install targets, and keep it out of other vars."
[1] 8e29a6061f (commitcomment-22678488)
This closes #232
2017-06-22 14:21:14 +02:00
Steffen Jaeckel
e3937a2906
fix compile warning when building w/o tests
2017-06-22 14:21:14 +02:00
Steffen Jaeckel
11338d2496
introduce XMEMMOVE and check for its usage
2017-06-22 14:21:14 +02:00
Steffen Jaeckel
e9c90e7f63
no need to use XMEM_NEQ() in PK crypto
2017-06-22 14:21:14 +02:00
Steffen Jaeckel
ae698927ff
improve mem_neq() documentation
2017-06-22 14:21:14 +02:00
Steffen Jaeckel
1655e63c49
also use DESTDIR in makefile.m{ingw,svc}
2017-06-22 14:21:14 +02:00
Steffen Jaeckel
af984dc33e
exclude more sources from "static function check"
2017-06-22 14:21:14 +02:00
Steffen Jaeckel
1bf42ea99a
update some of the static functions
2017-06-22 14:21:14 +02:00
Karel Miko
8f433f1a36
add check for static function names
2017-06-22 14:21:14 +02:00
Steffen Jaeckel
27b3ffc627
use compare_testvector() instead of XMEMCMP() in tests
2017-06-22 14:21:14 +02:00
Steffen Jaeckel
05e28d6cfa
fix potential timing attacks in rsa, eax, ocb and ocb3
2017-06-22 14:21:14 +02:00
Steffen Jaeckel
b03b93099d
allow to give only a part as parameter to ./test
2017-06-22 14:21:14 +02:00
Steffen Jaeckel
36132b016f
update title page of pdf doc
2017-06-22 14:21:14 +02:00
karel-m
316450c20e
Merge pull request #237 from libtom/pr/dh-facelift-part1
...
DH facelift part 1
2017-06-22 14:16:36 +02:00
Karel Miko
243a1dc33e
drop _dh_make_key_ex
2017-06-22 13:19:48 +02:00
Karel Miko
cba1569c82
fix tomcrypt_pk.h
2017-06-22 13:19:48 +02:00
Karel Miko
a0257df999
update makefiles
2017-06-22 13:19:47 +02:00
Karel Miko
5eaff56d90
remove dh_export_radix.c dh_import_radix.c
2017-06-22 13:19:47 +02:00
Karel Miko
f4ce5a21c8
helper.pl - enable check_comments for --check-all
2017-06-22 13:19:47 +02:00
Karel Miko
f9802359c9
update makefiles
2017-06-22 13:19:47 +02:00
Karel Miko
771d67e102
DH facelift part1
2017-06-22 13:19:47 +02:00
Steffen Jaeckel
5e71ac27e2
Merge pull request #230 from libtom/math/miller-rabin
...
Fix number of Miller-Rabin rounds
2017-06-22 12:44:33 +02:00
Steffen Jaeckel
26b57032e7
use correct amount of M-R tests in dsa_make_params()
2017-06-22 11:55:08 +02:00
Steffen Jaeckel
7453eddae9
improve ltc_math_descriptor a bit
...
* introduce LTC_MILLER_RABIN_REPS which is used as default value
in the isprime() implementations
2017-06-22 11:55:08 +02:00
karel-m
6f85293672
Merge pull request #235 from libtom/pr/ecc_sign+verify_hash_rfc7518
...
ECC ecc_sign+verify_hash_raw > ecc_sign+verify_hash_rfc7518
2017-06-21 14:33:37 +02:00
Karel Miko
ac02f7422b
ecc_sign+verify_hash_rfc7518 tests
2017-06-21 13:43:25 +02:00
Karel Miko
b8f22157b3
PK_MAX_RETRIES
2017-06-21 13:38:39 +02:00
Karel Miko
0c115a162d
whitespace
2017-06-21 13:26:52 +02:00
Karel Miko
fff832091f
ecc_sign_hash max_iterations
2017-06-21 13:25:06 +02:00
Karel Miko
cdf04b6140
fix mp_montgomery_setup
2017-06-21 13:01:22 +02:00
Karel Miko
a937f23821
static functions name fix
2017-06-21 12:49:19 +02:00
Karel Miko
67200b641d
ecc_sign+verify_hash_raw > ecc_sign+verify_hash_rfc7518
2017-06-21 12:11:35 +02:00
Steffen Jaeckel
c14bcf4d30
Merge pull request #233 from libtom/cleanup/2
...
Second general clean-up
2017-06-20 17:51:16 +02:00
Steffen Jaeckel
18c00ddcd6
better usage of find()
2017-06-20 15:16:11 +02:00
Steffen Jaeckel
5246c7de64
fix links in pdf doc
2017-06-20 15:16:11 +02:00
Steffen Jaeckel
8e29a6061f
use {BIN,DATA,INC,LIB}PATH in makefile.unix
2017-06-20 15:16:11 +02:00
Steffen Jaeckel
6fc0a90a1e
fix headers & footers in demos & tests
2017-06-20 15:16:11 +02:00
Steffen Jaeckel
4cd1355b8f
more clean-up of headers/footers
2017-06-20 15:16:11 +02:00
Steffen Jaeckel
fe19dad623
replace SVN tags
2017-06-20 15:16:11 +02:00
Steffen Jaeckel
8c11490e2d
fix usage of PREFIX vs. DESTDIR
...
This closes #232
2017-06-20 15:16:11 +02:00
Steffen Jaeckel
7597d20c78
use CROSS_COMPILE instead of PREFIX to indicate toolchain prefix
2017-06-20 15:16:11 +02:00
Steffen Jaeckel
b16066cbfc
Add possibility to change install options
...
This closes #231
2017-06-20 15:16:11 +02:00
Steffen Jaeckel
66527b3e5e
include "tomcrypt.h", not <tomcrypt.h>
...
we want to include the local version of the header, not the system-version
2017-06-20 15:16:11 +02:00
Steffen Jaeckel
fb35d5be54
more clean-up of headers
2017-06-20 15:16:11 +02:00
Steffen Jaeckel
4dc211e19d
clean-up headers
2017-06-20 15:16:11 +02:00
Karel Miko
2fd5808897
timing - silence valgrind warning (memleak)
2017-06-20 01:33:23 +02:00
Karel Miko
e5f25b6553
tests+timing - silence valgrind warning (memleak)
2017-06-19 20:34:08 +02:00
Karel Miko
03437a1bdd
timing - silence valgrind warning
2017-06-19 18:51:04 +02:00
Karel Miko
8dec4d9ac4
prng_test - silence valgrind warning
2017-06-19 12:28:22 +02:00
Steffen Jaeckel
cbc4260314
Merge pull request #229 from libtom/cleanup/1
...
First general clean-up
2017-06-15 10:31:14 +02:00
Steffen Jaeckel
f2076f0700
use zeromem() where appropriate
2017-06-15 01:07:44 +02:00
Steffen Jaeckel
258de3cecc
use ltc_mp_digit instead of unsigned long
2017-06-15 01:07:44 +02:00
Steffen Jaeckel
d6e2a585d0
sync doc from ltc_math_descriptor
2017-06-15 01:07:44 +02:00
Steffen Jaeckel
98b500e873
update crypt_build_settings et al.
2017-06-15 01:07:44 +02:00
Steffen Jaeckel
0cf7c49045
sync ltc_math_descriptor from doc
2017-06-15 00:46:50 +02:00
Steffen Jaeckel
a0e5c2e4ff
add some makefile docs
2017-06-15 00:46:50 +02:00
Steffen Jaeckel
3995f971d7
make sure to use makefile.shared on Mac
2017-06-15 00:46:50 +02:00
Steffen Jaeckel
048cbc55b0
disable yet another warning
2017-06-15 00:46:50 +02:00
Karel Miko
2cd69fb541
improved helper.pl (check mandatory comments - not included in "--check-all" yet)
2017-06-14 17:16:26 +02:00
Steffen Jaeckel
23d5a02ecd
Merge pull request #217 from libtom/scan-build
...
Travis-CI: clang static analyzer
2017-06-14 09:19:19 +02:00
Steffen Jaeckel
31ddf7c894
...
...
https://www.youtube.com/watch?v=6bbIBs0P2t0
2017-06-13 18:41:09 +02:00
Steffen Jaeckel
ac41d07247
try libtommath from ubuntu
2017-06-13 18:41:09 +02:00
Steffen Jaeckel
ea08fbb777
use libtommath from debian sid
2017-06-13 18:41:09 +02:00
Steffen Jaeckel
ba94b536be
this is a horrible PR
2017-06-13 18:41:09 +02:00
Steffen Jaeckel
1ee2662ab5
only run scan_build.sh once
2017-06-13 18:41:09 +02:00
Steffen Jaeckel
52672bc358
m(
2017-06-13 18:41:09 +02:00
Steffen Jaeckel
9baba0a83a
fix usage of makefile.unix
2017-06-13 18:41:09 +02:00
Steffen Jaeckel
ebfd164246
alright, let's also use ltm from packagecloud
2017-06-13 18:41:09 +02:00
Steffen Jaeckel
3bb9193d6f
alright, let's try if upgrading to trusty helps...
2017-06-13 18:41:09 +02:00
Steffen Jaeckel
75e00e097c
well, then install a new clang version and see...
2017-06-13 18:41:09 +02:00
Steffen Jaeckel
ff2de0b07a
looks like precise doesn't have scan-build under that name
...
...but we should be able to find it somewhere in /usr/bin/
2017-06-13 18:41:09 +02:00
Steffen Jaeckel
742b4cee78
add clang scan-build
2017-06-13 18:41:09 +02:00
Steffen Jaeckel
bda493d770
Merge pull request #226 from fperrad/20170609_lint
...
some linting
[skip ci]
2017-06-13 12:17:16 +02:00
Steffen Jaeckel
caa05540b7
Merge pull request #172 from libtom/test_tfm
...
Run tests for tomsfastmath
[skip ci]
2017-06-12 23:08:10 +02:00
Francois Perrad
0bc0d55245
refactor REGISTER_*
2017-06-12 20:07:23 +02:00
Francois Perrad
ec51f880b5
Right hand side of assignment needs parenthesis
2017-06-12 20:07:23 +02:00
Francois Perrad
f40bda7cb3
fix indentation
2017-06-12 20:07:23 +02:00
Steffen Jaeckel
f45f2f4faf
only create coverage for ltm build
2017-06-12 18:45:24 +02:00
Steffen Jaeckel
a9838f7745
fix linking to tomsfastmath & clean-up
2017-06-12 18:45:24 +02:00
Steffen Jaeckel
104a451def
use packagecloud repo to install tfm
2017-06-12 18:45:24 +02:00
Steffen Jaeckel
e2af986085
make output verbose again
2017-06-12 18:45:24 +02:00
Steffen Jaeckel
fec05471ae
the latest tfm version has fp_rand() available, so we can test this now
2017-06-12 18:45:24 +02:00
Steffen Jaeckel
a4671110d5
Merge pull request #198 from libtom/test/pthread
...
Travis-CI: a new build with -DLTC_PTHREAD
[skip ci]
2017-06-12 18:44:01 +02:00
Steffen Jaeckel
5de7e58e84
disable yet another clang warning
2017-06-12 17:19:43 +02:00
Steffen Jaeckel
73934ad2fd
add ld option -pthread when LTC_PTHREAD is enabled
2017-06-12 17:19:43 +02:00
Steffen Jaeckel
48e4ec07be
use LTC_ARGCHK() for all mutex operations
2017-06-12 17:19:43 +02:00
Steffen Jaeckel
3b4e5df858
create separate no_prng instances
...
now they shouldn't collide anymore and can always be unregistered
2017-06-12 17:19:43 +02:00
Steffen Jaeckel
42a82ce3ed
fix valgrind errors
...
Uninitialized key caused the following error:
Conditional jump or move depends on uninitialised value(s)
at ...: __memcmp_sse4_1 (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
...
2017-06-12 17:19:43 +02:00
Steffen Jaeckel
a06cba4cb5
fix tests when compiled for pthread
2017-06-12 17:19:43 +02:00
Steffen Jaeckel
b38cf104f0
move prng-tests away from cipher_hash_test()
2017-06-12 17:19:43 +02:00
Steffen Jaeckel
904366eb0f
check that all ciphers/hashes/prngs are unregistered
2017-06-12 17:19:43 +02:00
Steffen Jaeckel
be9c598ee7
add new travis tests with pthread support
2017-06-12 17:19:43 +02:00
Steffen Jaeckel
e6cd8e8112
fix failing tests with pthreads enabled
2017-06-12 17:19:43 +02:00
Steffen Jaeckel
d6a77f5d6d
implement pthread support for tests
2017-06-12 17:19:43 +02:00
karel-m
4a6d107227
Merge pull request #225 from libtom/pr/fix-114-dh-primes
...
Better DH primes
2017-06-12 17:12:33 +02:00
Karel Miko
4f12e41d29
fix trailing ;
2017-06-12 16:35:27 +02:00
Karel Miko
114b694735
trying to fix dh_shared_secret - #119
2017-06-11 23:20:46 +02:00
Karel Miko
bc4236d90f
tuning dh_make_key
2017-06-11 21:12:14 +02:00
Karel Miko
361778d2ac
another dh_make_key redesign
2017-06-11 19:43:08 +02:00
Karel Miko
71884788e3
fix warning: comparison between signed and unsigned integer
2017-06-11 10:12:18 +02:00
Karel Miko
532c511f52
improved dh_make_key
2017-06-10 23:02:30 +02:00
Steffen Jaeckel
c9f4628693
don't call rng_make_prng() from dh_make_key()
...
While testing with multiple threads I had spurious errors where some tests
can't read from the PRNG.
If I tracked it down correctly that's caused by `dh_make_key()`
calling `rng_make_prng()` which re-initializes the selected PRNG.
I like the idea of "refreshing" the PRNG with entropy from a hopefully
secure RNG before generating a new key, but I don't think it's the duty
of a key-generation function to ensure that, but merely the application
that implements key-generation.
2017-06-09 18:56:04 +02:00
Steffen Jaeckel
e3329bec26
make it possible to pass a single timing test to run
2017-06-09 18:33:51 +02:00
Steffen Jaeckel
e60d2076c5
resurrect DH in timing
2017-06-09 18:33:51 +02:00
Steffen Jaeckel
f31d8ff864
implement smaller private key sizes
2017-06-09 18:33:51 +02:00
Karel Miko
f46b32ba2e
better DH primes
2017-06-09 14:14:07 +02:00
karel-m
3922868082
Merge pull request #224 from libtom/pr/fix-154-dsa-api
...
Do not expose dsa_make_params as a public API
2017-06-09 14:13:04 +02:00
Karel Miko
2a883b44c7
do not expose dsa_make_params as a public API
2017-06-09 13:01:30 +02:00
Steffen Jaeckel
4fa9e96d49
Merge pull request #157 from libtom/feature/rsa_import_pkcs8
...
RSA import pkcs8
[skip ci]
2017-06-09 11:38:35 +02:00
Steffen Jaeckel
ef450fe14a
fix error handling
2017-06-08 23:34:16 +02:00
Karel Miko
2d8816607b
update makefiles
2017-06-08 23:34:16 +02:00
Karel Miko
52a496e9e1
rsa_import_pkcs8 - passwd is now "const void *"
2017-06-08 23:34:16 +02:00
Karel Miko
d96f4bdcff
rsa_import_pkcs8
2017-06-08 23:34:16 +02:00
Steffen Jaeckel
2816da42af
Merge pull request #219 from libtom/feature/common
...
Introduce testprof/common.c
[skip ci]
2017-06-08 23:30:28 +02:00
Karel Miko
d72d7d1d32
tuning makefile.mingw+msvc
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
f47a71bc6c
Update makefiles
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
5a3a27bbd6
rename der_tests to der_test
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
4bbce780c4
always provide compare_testvector() as a function
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
ad45277745
use print_hex() in rsa_test()
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
e45e02d635
Update makefiles
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
4e971a8518
don't use print_hex() from library
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
fe0b72ef51
remove dependency of demos to tests/common
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
da3b61c7b6
re-structure tests/common.c
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
4ceb82bf54
add register_all_{ciphers,hashes,prngs}()
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
7f91e5ae65
requiring 'name != NULL' in find_cipher_any() doesn't make sense
2017-06-08 22:20:45 +02:00
Karel Miko
7aaa423004
tuning makefiles - mingw, msvc, cygwin
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
b51a3f6dab
update notes/hashsum_tv.txt
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
8c1d55f4c0
fix error when compiling w/ LTC_CLEAN_STACK but w/o LTC_FAST
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
40747cfcfd
add a build-run with debugging-options
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
b83f9472c0
Update makefiles
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
b78c5551f7
move compare_testvector() implementation to the library
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
e1a1145802
rename 'testprof/' to 'tests/'
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
07ffa0f1a2
remove tomcrypt_prof test-only library
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
201681ee3b
merge testprof/timing_test.c into demos/timing.c
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
70a27a852e
Update makefiles
2017-06-08 22:20:45 +02:00
Steffen Jaeckel
8ef805817c
rename time_cipher[2-4]? appropriately
2017-06-08 22:20:44 +02:00
Steffen Jaeckel
9d4094b8e9
rename x86_prof.c to timing_test.c
2017-06-08 22:20:44 +02:00
Steffen Jaeckel
abe8d26246
move epoch_usec() to test.c
2017-06-08 22:20:44 +02:00
Steffen Jaeckel
f7d3c2bfa1
merge testprof/test_driver.c to testprof/common.c
2017-06-08 22:20:44 +02:00
Steffen Jaeckel
0a23c6d32e
also check for cipher descriptors
2017-06-08 22:20:44 +02:00
Steffen Jaeckel
1c4c84e7f9
fix tv_gen
2017-06-08 22:20:44 +02:00
Steffen Jaeckel
3f66f7df83
Update makefiles
2017-06-08 22:20:44 +02:00
Steffen Jaeckel
eaf20dda5b
demos must now link against testprof/common.o
2017-06-08 22:20:44 +02:00
Steffen Jaeckel
9b8fff6260
add testprof/common.c
...
so we can remove all the duplicate registration implementations
...and we can put some other shared stuff in there as well
2017-06-08 22:20:44 +02:00
Steffen Jaeckel
db5438ca55
don't build openssl-enc for tests
2017-06-08 22:19:48 +02:00
Steffen Jaeckel
08a461b39c
also build openssl-enc
2017-06-08 21:32:10 +02:00
Steffen Jaeckel
4929860641
fix file modes
2017-05-31 01:57:40 +02:00
Steffen Jaeckel
1de3f2a1f6
correctly NOP
...
there's still mac_test() which doesn't NOP correctly but who cares anyway?
2017-05-30 11:20:18 +02:00
Steffen Jaeckel
f1118b4647
Merge pull request #222 from bmwiedemann/develop
...
sort input files
2017-05-29 18:18:57 +02:00
Bernhard M. Wiedemann
704055810f
sort input files
...
when building packages (e.g. for openSUSE Linux)
(random) filesystem order of input files
influences ordering of functions in the output,
thus without the patch, builds (in disposable VMs) would differ.
See https://reproducible-builds.org/ for why this matters.
2017-05-29 14:58:07 +02:00
Steffen Jaeckel
04573d8100
Merge pull request #221 from ksherlock/echo-n
...
echo -n portability
2017-05-24 09:46:02 +02:00
Kelvin Sherlock
9913c1dcb8
AIX and OS X (and maybe BSD) sh has a built-in echo which doesn’t support the -n flag (OS X sh is actually bash but it doesn’t support -n based on compile-time flags and the POSIXLY_CORRECT environment variable).
...
AIX /bin/echo doesn’t support -n.
AIX echo and OS X /bin/echo support \c to prevent a trailing newline but linux echo (bash builtin and /bin/echo) don’t support it unless you also use the -e flag (which is not support by AIX /bin/echo or OS X sh or /bin/echo).
The BSD echo man page suggests using printf to avoid trailing newline, which is available on linux, OS X, and AIX.
2017-05-22 17:30:30 -04:00
Steffen Jaeckel
88eec86d1a
Merge pull request #220 from ksherlock/compare_testvector
...
replace XMEMCMP with compare_testvector
2017-05-22 21:50:04 +02:00
Kelvin Sherlock
a8d81a7214
fix sha3 test numbers
2017-05-21 15:32:16 -04:00
Kelvin Sherlock
30f8aaad8c
replace XMEMCMP with compare_testvector, other consistency cleanup in testing code.
2017-05-14 22:17:59 -04:00
Steffen Jaeckel
4efe229726
Merge pull request #208 from libtom/improve/makefiles
...
Re-work, improve & fix makefiles
2017-05-11 23:56:47 +02:00
Steffen Jaeckel
a12b97f84e
travis doesn't seem to provide lcov...
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
90d5fe5bdb
re-format .travis.yml
...
no sudo required to gem install
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
56283c947a
improve coverage creation
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
6a4978ef5e
better EXTRALIBS
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
81f0297285
small fix-ups
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
7379c94f0a
merge .include and .common makefiles
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
2c27aee5d4
fixup df733f79fa
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
ea67579298
further clean-up
...
- improve doc generation
- update version handling
no need for VERSION_{MAJ,MIN}
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
6cd8f2504b
clean-up some makefiles
...
move shared variables between makefile and makefile.shared
to makefile.include
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
d996958133
move biggest part of install rules to makefile.common
2017-05-11 23:04:37 +02:00
Karel Miko
2b9dbb4ff7
cosmetics in makefile.unix|mingw|msvc
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
0cd9e94736
Partially revert "don't include testprof for library build"
...
This partially reverts commit 3a1cbcfee2a16d15167876423b6ca720458e801a.
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
794a416715
fix libtomcrypt.pc installation
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
abe9116de5
introduce makefile.common
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
ee0874b50b
minor improvements
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
3c5ec6b699
split-out binary installation in separate install target
2017-05-11 23:04:37 +02:00
Karel Miko
7ed5a832b0
tuning makefile.msvc+mingw
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
37fa03829c
use gnu-make wildcard to get source files
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
12cf50d4e2
move translation rule after modifications of CFLAGS
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
39f12dafc4
make travis build a bit more verbose
2017-05-11 23:04:37 +02:00
Karel Miko
ab34b0bd93
or perhaps exclude .git*
2017-05-11 23:04:37 +02:00
Karel Miko
85197a485a
do not exclude anything during make zipup
2017-05-11 23:04:37 +02:00
Karel Miko
add3495bfc
fix perlcritics warnings in helper.pl
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
5e4415427a
OSX touch has no "--reference" long-option, only "-r"
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
c93bee9575
rename perlcritic make target & also run helper.pl -a
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
b35ce0467b
move documentation-related files to doc folder
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
6e484cd420
use make internal macros
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
c0abe2a5dc
crypt doesn't exist anymore
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
8ee458b625
don't include testprof for library build
...
...well msvc still does it as I can't test it...
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
1b71e23e42
fix some testprof related errors
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
544f7cc6ce
ignore eclipse special files
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
ee17cc2e67
compress archive to xz
2017-05-11 23:04:37 +02:00
Karel Miko
1300c5ade5
make fixupind.pl part of helper.pl
2017-05-11 23:04:37 +02:00
Karel Miko
3176103c15
fix makefile.icc in makefile update scripts
2017-05-11 23:04:37 +02:00
Karel Miko
31cf796011
updated makefile.unix should work fine with Intel C compiler, so no need to keep an extra clone - makefile.icc
2017-05-11 23:04:37 +02:00
Karel Miko
9a3db508bb
typo in "git commit: .."
2017-05-11 23:04:37 +02:00
Karel Miko
5c2bea093a
zipup target facelift
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
3fd1771d35
also install useful demos
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
90daad0764
add new make-target 'bins'
...
so you can easily build the useful demos
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
85dc39483f
rename crypt to ltcrypt
...
a binary called crypt already exists and creates a name-clash as we won't
implement the entire CLI even if this tool implements similar functionality
2017-05-11 23:04:37 +02:00
Karel Miko
f544418d56
re-work makefile.mingw in the same style as makefile.unix
2017-05-11 23:04:37 +02:00
Karel Miko
c225f22a23
remove building dynamic libs from makefile.unix
2017-05-11 23:04:37 +02:00
Karel Miko
ceb7332631
typo
2017-05-11 23:04:37 +02:00
Karel Miko
3540eedb4a
HP-UX make does not like ?= and $<
2017-05-11 23:04:37 +02:00
Karel Miko
bb4a051e40
makefile.unix facelift
2017-05-11 23:04:37 +02:00
Karel Miko
bf45ea66e5
drop the need for testprof/makefile*
2017-05-11 23:04:37 +02:00
Karel Miko
2c97498554
wipe out testprof/makefile*
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
93067e189a
fix testprof/makefile.shared
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
7ac857686d
add git version as compile flag
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
7898864b24
use glibtool on Macs
2017-05-11 23:04:37 +02:00
Steffen Jaeckel
d21d01bcb5
consolidate makefiles a bit
2017-05-11 23:04:37 +02:00
karel-m
c2bb38555e
Merge pull request #218 from libtom/pr/fix-clang-static-analyzer-warnings
...
Clang static analyzer warnings/errors - related to #217
2017-05-11 22:55:39 +02:00
Karel Miko
43e46a2efc
fix clang static analyzer warnings/errors - see #217
2017-05-11 20:37:06 +02:00
karel-m
08cc78007b
Merge pull request #211 from libtom/pr/win32-rng_nix
...
Windows: fix various compiler warnings
2017-05-11 18:10:08 +02:00
Karel Miko
786853cb5c
move #if defined(LTC_BASE64)
2017-05-11 17:42:43 +02:00
Karel Miko
ef6223f013
fix misleading-indentation warnings (mingw + gcc 7.1 + -Wall -Wextra)
2017-05-11 17:42:43 +02:00
Karel Miko
9d2b352867
fix ulong64 related format errors
2017-05-11 17:42:43 +02:00
Karel Miko
af4f6b374d
better warning fix in der_tests
2017-05-11 17:42:43 +02:00
Karel Miko
9ba9677d94
x86_prof - spd1, spd2, avg are now ulong64
2017-05-11 17:42:43 +02:00
Karel Miko
a69e55ba54
tuning win warnings fixes
2017-05-11 17:42:43 +02:00
Karel Miko
e2cf11da25
fix windows warnings - #212 and #213
2017-05-11 17:42:43 +02:00
Karel Miko
6d70827d1f
Windows: fix warning: 'rng_nix' defined but not used
2017-05-11 17:42:43 +02:00
karel-m
55a7eead7f
Merge pull request #215 from libtom/pr/lint-20170509
...
Another fixes related to #199
2017-05-10 19:36:20 +02:00
Karel Miko
91b61630be
improved #ifdefs - related to: 'num' not referenced
2017-05-09 21:43:28 +02:00
Karel Miko
04262d3aec
fix: local struct member 'poly_div' not referenced
2017-05-09 21:31:12 +02:00
Karel Miko
f6ea738fee
fix: Loss of sign (initialization) (int to unsigned long long)
2017-05-09 21:30:44 +02:00
karel-m
b439f83018
Merge pull request #210 from libtom/pr/aix-fix
...
IBM xlc compiler related fixes
2017-05-05 19:58:14 +02:00
Karel Miko
421266cf5f
fix void *orig
2017-05-05 19:57:20 +02:00
Karel Miko
adf0ad95c9
IBM xlc compiler does not like "static inline" (related to #209 )
2017-05-05 19:57:20 +02:00
Steffen Jaeckel
87be6d3d70
Merge pull request #203 from libtom/improve/crypt
...
Improve hashsum
2017-05-04 16:03:57 +02:00
Steffen Jaeckel
85c2186ae6
better output on stderr
2017-05-03 18:10:46 +02:00
Steffen Jaeckel
e9923129c8
fix LTC_EASY compilation
2017-05-03 18:10:46 +02:00
Steffen Jaeckel
b472ef31a2
looks like the previous output was not really shaXsum compatible...
2017-05-03 18:10:46 +02:00
Steffen Jaeckel
28f8a85246
update coverage.sh
...
* hashsum requires now a '-a' option flag for the algorithm
* '-h' is required to output the list of algorithms to stdout
* the algorithms are printed in columns, so we have to sort differently
2017-05-03 18:10:46 +02:00
Steffen Jaeckel
9893566ae9
add shasum compatibility for '-a' option
2017-05-03 18:10:45 +02:00
Steffen Jaeckel
ea7115dc65
implement file checking
2017-05-03 18:10:45 +02:00
Steffen Jaeckel
31dcb9ff2a
only set outlen on success
2017-05-03 18:10:45 +02:00
Steffen Jaeckel
d02531d4d2
improve hashsum a bit
2017-05-03 18:10:45 +02:00
karel-m
1712c0eae1
Merge pull request #205 from libtom/pr/shake-be-fix
...
SHAKE (SHA3 related) big endian fix
2017-05-03 17:06:27 +02:00
Karel Miko
4e66160ac2
one more readable for loop
2017-05-03 17:01:18 +02:00
Karel Miko
f831e27702
more readable for loops
2017-05-03 12:56:25 +02:00
Karel Miko
a1615daa3c
shake be fix (hopefully final)
2017-05-03 12:56:25 +02:00
Karel Miko
961b6109d5
cosmetics
2017-05-03 12:56:25 +02:00
Karel Miko
da8501f55a
sha3_shake_done another be fix
2017-05-03 12:56:25 +02:00
Karel Miko
c3f2e4530a
declaration of ‘i’ shadows a previous local (better)
2017-05-03 12:56:25 +02:00
Karel Miko
df4e47978e
declaration of ‘i’ shadows a previous local
2017-05-03 12:56:25 +02:00
Karel Miko
e5c0e7ffd3
SHAKE (SHA3 related) big endian fix
2017-05-03 12:56:25 +02:00
Steffen Jaeckel
67ca1c0b9a
fix for compilation with LTC_DEBUG
2017-05-03 12:37:24 +02:00
karel-m
d936273711
Merge pull request #207 from libtom/feature/pkcs1ssl
...
PKCS #1 v1.5 padding - No ASN.1
2017-05-02 09:17:16 +02:00
Karel Miko
f00f857224
tests for rsa_sign|verify with LTC_PKCS_1_V1_5_NA1
2017-05-01 23:17:32 +02:00
Steffen Jaeckel
aa4bae5ae9
add option to do PKCS#1 v1.5 EMSA without ASN.1 around hash
...
Somehow someone forgot to add the OID in the signature field
of a SERVER_KEY_EXCHANGE message in early versions of the SSL protocol.
Therefore provide an option to be able to sign/verify a message
in that format.
2017-05-01 23:15:11 +02:00
Steffen Jaeckel
25878ed632
Merge pull request #202 from fperrad/20170430_lint
...
more linting
2017-05-01 22:07:51 +02:00
Francois Perrad
a52b586ed2
Unusual use of a Boolean expression
2017-05-01 14:51:35 +02:00
Steffen Jaeckel
2858373e2e
clean stack properly
2017-05-01 14:12:47 +02:00
Steffen Jaeckel
3e2ac192a1
Merge pull request #200 from fperrad/20170429_lint
...
LTC_PTHREAD: some linting
2017-05-01 14:08:59 +02:00
karel-m
91c0071b6b
Merge pull request #201 from libtom/pr/lint-20170429
...
lint fixes discussed in #199
2017-04-30 09:43:47 +02:00
Karel Miko
87142382da
lint fixes discussed in #199
2017-04-29 19:59:03 +02:00
Francois Perrad
7e72dafe5f
remove useless semicolon
...
the macro LTC_MUTEX_TYPE already contains a semicolon
see https://github.com/libtom/libtomcrypt/blob/develop/src/headers/tomcrypt_custom.h#L552
2017-04-29 17:52:27 +02:00
karel-m
253f3c45e1
Merge pull request #186 from libtom/pr/stream_rc4_sober128
...
Move rc4 + sober128 to src/stream/
2017-04-29 15:50:38 +02:00
Karel Miko
6417f96ea9
fortuna - import does not fail when input data are larger than export_size
2017-04-29 14:12:36 +02:00
Karel Miko
d7f2b2dd6e
fortuna - move LBL_UNLOCK before zeromem
2017-04-29 13:39:48 +02:00
Karel Miko
c6cee7bef0
prngs/sober128 - import fix
2017-04-29 13:36:45 +02:00
Karel Miko
9c972c833d
fix chacha20poly1305_test
2017-04-29 13:30:19 +02:00
Karel Miko
eb209aa2f9
more error checking in *_test
2017-04-28 19:24:58 +02:00
Karel Miko
90b482aa1e
stream/chacha - improved counter increment
2017-04-28 19:24:58 +02:00
Karel Miko
9232f2e970
fortuna/yarrow & export_size
2017-04-28 19:24:58 +02:00
Karel Miko
1732ed8ce8
increase coverage
2017-04-28 19:24:58 +02:00
Karel Miko
784a009efe
increase coverage
2017-04-28 19:24:58 +02:00
Karel Miko
da25a23712
increasing prngs/rc4 coverage
2017-04-28 19:24:58 +02:00
Karel Miko
28927be1dd
typo LTC_CHACHA_PRNG / LTC_CHACHA20_PRNG
2017-04-28 19:24:58 +02:00
Karel Miko
0df0c9b12c
LTC_CHACHA_STREAM >> LTC_CHACHA
2017-04-28 19:24:58 +02:00
Karel Miko
dd35e86c60
renaming rc4+sober128 stream API to *_stream_*
2017-04-28 19:24:58 +02:00
Karel Miko
28835a513f
update makefiles
2017-04-28 19:24:58 +02:00
Karel Miko
fe14c8bfaf
Move RC4 + SOBER128 to src/stream/
2017-04-28 19:24:58 +02:00
Steffen Jaeckel
93317a1d6a
Merge pull request #54 from libtom/feature/doc
...
Feature/doc (only crypt.tex + changes)
2017-04-26 00:23:34 +02:00
Steffen Jaeckel
0094552828
add doc for ASN.1 GeneralizedTime
2017-04-25 21:23:25 +02:00
Steffen Jaeckel
57c703b14c
update doc process a bit
...
* remove crypt.pdf from repo
* ignore generated PDF's
* make refman.pdf generation silent
2017-04-25 21:23:25 +02:00
Kelvin Sherlock
b234e6b4ca
add missing hash descriptors to the documentation. sha1 no longer recommended.
2017-04-25 21:23:25 +02:00
Steffen Jaeckel
8e03799eb6
fix/improve doxygen generation
2017-04-25 21:23:25 +02:00
Steffen Jaeckel
6c1d614a92
update Doxyfile to a more recent version of doxygen
2017-04-25 21:23:25 +02:00
Steffen Jaeckel
434280587a
also apply the verbosity settings to the doc generation
2017-04-25 21:23:25 +02:00
Michael Stapelberg
deeea5a1ec
fix crypt.tex with newer LaTeX: s/here/h/g
...
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790321 for context
2017-04-25 21:23:24 +02:00
Steffen Jaeckel
84606ab8de
minor spelling corrections
2017-04-25 21:23:24 +02:00
Pascal Brand
1cf965cfcc
Add doc for CCM Authentication full set of functions
...
Change-Id: I2830ea3c04fd0410cc12137be41e6c511c4a47fe
2017-04-25 21:23:24 +02:00
Steffen Jaeckel
699f52418e
don't use SHA1
...
@buggywhip is right
[skip ci]
2017-04-25 21:23:24 +02:00
Steffen Jaeckel
17b961e554
update changes document
...
include changes proposed by @buggywhip
fix typos
[skip ci]
2017-04-25 21:23:24 +02:00
Steffen Jaeckel
6a47cb5931
describe behavior of the flexi decoder on unknown identifiers
2017-04-25 21:23:24 +02:00
Steffen Jaeckel
627aef962c
add documentation of ASN.1 context-specific decoding
2017-04-25 21:23:24 +02:00
Steffen Jaeckel
3233e51a23
update documentation regarding RSA key import/export
2017-04-25 21:23:24 +02:00
Steffen Jaeckel
2a98d0a11f
adapt dynamic language documentation to modified API and functionality
2017-04-25 21:23:24 +02:00
Larry Bugbee
d2047f4b61
added sec 11.3, dynamic lang support
2017-04-25 21:23:24 +02:00
Steffen Jaeckel
3c8743e102
add SHA512/t documentation
2017-04-25 21:23:24 +02:00
Steffen Jaeckel
a5d95448e1
use ulong32 resp. ulong64 in the tables of the Macros section
...
This closes #16
2017-04-25 21:23:23 +02:00
Steffen Jaeckel
1367c1d685
fix build error
2017-04-25 21:23:23 +02:00
Steffen Jaeckel
d010f19587
add documentation of the new RSA API functions
2017-04-25 21:23:23 +02:00
Steffen Jaeckel
331f76c0ec
add documentation of the newly added ASN.1 types
2017-04-25 21:23:23 +02:00
Steffen Jaeckel
df8814dfef
some minor corrections/improvements
2017-04-25 21:23:23 +02:00
Steffen Jaeckel
e212f04f0f
trim trailing spaces
2017-04-25 21:23:23 +02:00
Steffen Jaeckel
82ea2ee3da
update changes document
2017-04-25 21:23:23 +02:00
Steffen Jaeckel
f73a342b17
oops, it's not yet released
...
[skip ci]
2017-04-25 21:23:23 +02:00
Steffen Jaeckel
f44c972b10
update changes document
...
[skip ci]
2017-04-25 21:23:23 +02:00
Steffen Jaeckel
4d35336e38
more documentation
2017-04-25 21:23:22 +02:00
Steffen Jaeckel
94f1b407d1
start updating documentation
2017-04-25 21:23:22 +02:00
Karel Miko
0d998fd4c8
stream/chacha ivlen cosmetics
2017-04-25 01:10:15 +02:00
karel-m
e4793b50d0
Merge pull request #193 from libtom/pr/mac-blake2
...
BLAKE2 based MACs
2017-04-25 00:11:45 +02:00
Karel Miko
0f0f1e40be
indentation
2017-04-24 21:59:21 +02:00
Karel Miko
3ea8a00ecd
new multi_test
2017-04-23 23:29:10 +02:00
Karel Miko
08ea7fc0f4
demos/multi.c -> testprof/multi_test.c
2017-04-23 23:27:54 +02:00
Karel Miko
d587b380e6
updating demos/multi.c
2017-04-23 23:27:54 +02:00
Karel Miko
61105b67f4
test vectors from https://github.com/BLAKE2
2017-04-23 23:27:54 +02:00
Karel Miko
1c68bf9a74
update file_test
2017-04-23 23:27:54 +02:00
Karel Miko
f767ea3dcd
update makefiles
2017-04-23 23:27:54 +02:00
Karel Miko
0d585958c1
BLAKE2 based MACs
2017-04-23 23:27:54 +02:00
Steffen Jaeckel
76fbac87e2
Merge pull request #195 from libtom/pr/hashes
...
improve hashsum
2017-04-23 23:24:11 +02:00
Steffen Jaeckel
943c7a7cfc
use hash_filehandle() to read from stdin
2017-04-23 22:37:32 +02:00
Steffen Jaeckel
a6b8e52c43
make output equal to output of sha1sum etc.
2017-04-23 17:32:21 +02:00
Steffen Jaeckel
4ddee31de7
run hashsum for all hash algorithms
2017-04-23 16:10:01 +02:00
Steffen Jaeckel
7a83cea4db
use appropriate names for sha3 hashes
2017-04-23 15:55:49 +02:00
karel-m
7ad6fcfa63
Merge pull request #194 from libtom/pr/helperpl-check-hashes
...
helper.pl --check-hashes + related fixes
2017-04-21 21:21:19 +02:00
Karel Miko
6d404afc97
helper.pl --check-hashes + related fixes
2017-04-21 21:20:31 +02:00
Steffen Jaeckel
75f2529cdf
also run multi for coverage
2017-04-21 19:45:59 +02:00
Steffen Jaeckel
290926fe8a
include CFLAGS when building demos
2017-04-21 19:45:59 +02:00
karel-m
65ace1a378
Merge pull request #184 from libtom/pr/file-related-tests
...
Facelift of *_file functions
2017-04-21 17:20:41 +02:00
Karel Miko
dae70f9ba4
update testprof/makefile*
2017-04-21 16:12:41 +02:00
Karel Miko
d1ae2889ae
add file_test()
2017-04-21 16:12:18 +02:00
Karel Miko
336c52ca5f
Facelift of *_file functions
2017-04-21 16:11:22 +02:00
Steffen Jaeckel
513fcf35fe
Merge pull request #191 from ksherlock/blake2s
...
blake2s hash
2017-04-20 21:03:14 +02:00
Kelvin Sherlock
609d0afd00
updated hash_tv.txt
2017-04-20 12:28:38 -04:00
Kelvin Sherlock
56a2efa729
fix blake2s-160/224 hash sizes.
2017-04-20 11:22:16 -04:00
Kelvin Sherlock
4f7264135f
update test vectors
2017-04-20 09:36:35 -04:00
Kelvin Sherlock
0109e3ca78
update tv_gen.c
2017-04-19 17:03:34 -04:00
Kelvin Sherlock
4905232eda
more tests.
2017-04-19 16:50:34 -04:00
Kelvin Sherlock
c65d24222e
always zeromem hash_state when done
2017-04-19 16:47:03 -04:00
Kelvin Sherlock
2dc574d477
use - in hash descriptors.
2017-04-19 16:46:36 -04:00
Kelvin Sherlock
4ee9d767bb
add key/keylen parameters to blake2x_init
2017-04-10 18:29:51 -04:00
Kelvin Sherlock
0f97bb7415
fix burn blake2b stack size.
2017-04-10 16:37:34 -04:00
Kelvin Sherlock
55450078ea
use compare_testvector in tests.
2017-04-10 12:00:22 -04:00
Kelvin Sherlock
ea8dde7f63
formatting
2017-04-10 11:34:59 -04:00
Kelvin Sherlock
dfbdb626c3
add missing const.
2017-04-10 10:50:34 -04:00
Kelvin Sherlock
6b46b447b5
replace packed parameter struct with offsets into a unsigned char buffer.
2017-04-10 10:40:20 -04:00
Kelvin Sherlock
6acdfe9a55
cleanup, resins with updated reference source
2017-04-10 10:22:50 -04:00
Kelvin Sherlock
afc6e8d370
minor cleanup.
2017-04-10 10:21:51 -04:00
Kelvin Sherlock
b4594ab3c6
remove inline and c99 variable declarations.
2017-04-09 17:22:42 -04:00
Kelvin Sherlock
268c87e33d
add LTC_ARGCHK for blake2b_process.
2017-04-08 17:00:39 -04:00
Kelvin Sherlock
b412ab539a
update makefiles for blake2b.
2017-04-08 15:44:30 -04:00
Kelvin Sherlock
6f6e2d30a8
clang-format
2017-04-08 15:43:38 -04:00
Kelvin Sherlock
7c5fef9b71
add blake2b hash
2017-04-08 15:40:56 -04:00
Kelvin Sherlock
5924bd43e6
tweak source to conform a little better
2017-04-08 15:40:20 -04:00
Kelvin Sherlock
b0e9a23e31
makefile updates.
2017-04-07 23:47:16 -04:00
Kelvin Sherlock
51075724c1
use hash_state * for all arguments.
2017-04-07 23:46:52 -04:00
Kelvin Sherlock
063df0bffe
more tests.
2017-04-07 23:46:17 -04:00
Kelvin Sherlock
4449cdcea3
sort and number the ltc_hash_descriptors.
2017-04-07 23:45:49 -04:00
Kelvin Sherlock
1b5ae955d2
moe clang-format
2017-04-07 21:24:47 -04:00
Kelvin Sherlock
51f6b063d6
clang format
2017-04-07 21:12:54 -04:00
Kelvin Sherlock
647b53d880
add blake2s to various places.
2017-04-07 20:50:28 -04:00
Kelvin Sherlock
68296e0608
blake2s hash
2017-04-07 20:47:44 -04:00
Steffen Jaeckel
904eee0975
Merge pull request #190 from fperrad/20170407_lint
...
chacha: more linting
2017-04-07 18:49:47 +02:00
Francois Perrad
b6c27c2f08
no room for nul terminator
2017-04-07 12:16:48 +02:00
Francois Perrad
0be45a6341
remove unreachable code
2017-04-07 12:16:44 +02:00
Steffen Jaeckel
13b2220c61
Merge pull request #189 from fperrad/20170406_lint
...
remove suspicious ;
2017-04-07 10:35:11 +02:00
Francois Perrad
9941648125
remove suspicious ;
2017-04-07 00:17:43 +02:00
Steffen Jaeckel
08415d37f3
fix compare_testvector() macro
2017-04-06 22:47:36 +02:00
Steffen Jaeckel
e4331bcc17
Merge pull request #188 from fperrad/20170405_lint
...
misuse of compare_testvector
2017-04-06 22:46:24 +02:00
Francois Perrad
168472f753
misuse of compare_testvector
2017-04-05 09:28:32 +02:00
karel-m
fbe7d222c3
Merge pull request #185 from libtom/pr/chacha_prng-chacha20_prng
...
chacha_prng > chacha20_prng
2017-04-04 00:47:17 +02:00
Karel Miko
eefb8dc479
renaming prngs/chacha.c prngs/chacha20.c
2017-04-03 22:54:27 +02:00
Karel Miko
bfe9484a3d
renaming chacha_prng > chacha20_prng
2017-04-03 22:52:17 +02:00
karel-m
5199b54635
Merge pull request #171 from libtom/pr/chacha20poly1305
...
RFC 7539 - ChaCha20 and Poly1305 + ChaCha20 based PRNG
2017-04-03 21:21:20 +02:00
Karel Miko
2520e6c061
add link to arc4random.c which was the inspiration for chacha_prng
2017-04-03 20:04:00 +02:00
Karel Miko
7b93f04390
wrong use of sizeof(buf)
2017-04-03 19:54:51 +02:00
Karel Miko
ce37498ec6
chacha_prng_desc > chacha20_prng_desc
2017-04-03 19:52:03 +02:00
Karel Miko
08a028ab04
missing LTC_FILE_READ_BUFSIZE in crypt.c
2017-04-02 18:13:45 +02:00
Karel Miko
883db95da2
FILE_READ_BUFSIZE > LTC_FILE_READ_BUFSIZE
2017-04-02 18:13:45 +02:00
Karel Miko
06b1582de6
new #define FILE_READ_BUFSIZE
2017-04-02 18:13:45 +02:00
Karel Miko
ff5b02d371
LTC_CHACHA vs. LTC_CHACHA20_PRNG
2017-04-02 18:13:45 +02:00
Karel Miko
2656a040e0
chacha_prng > chacha20_prng
2017-04-02 18:13:45 +02:00
Karel Miko
3a05f0331d
chachapoly_state > chacha20poly1305_state
2017-04-02 18:13:45 +02:00
Karel Miko
11a9dc50b3
poly_state > poly1305_state
2017-04-02 18:13:45 +02:00
Karel Miko
39028bbeed
more tests in chacha20poly1305_test
2017-04-02 18:13:45 +02:00
Karel Miko
31b52a354d
padlen in chacha20poly1305_decrypt
2017-04-02 18:13:45 +02:00
Karel Miko
5797b0cc1e
test for chacha_ivctr64 (2)
2017-04-02 18:13:45 +02:00
Karel Miko
53c00d14e5
test for chacha_ivctr64
2017-04-02 18:13:45 +02:00
Karel Miko
a517db2514
cosmetics
2017-04-02 18:13:45 +02:00
Karel Miko
3cfb58c2f4
update makefiles
2017-04-02 18:13:45 +02:00
Karel Miko
c8cb714e08
added chacha_done
2017-04-02 18:13:45 +02:00
Karel Miko
ff6abc776c
RFC 7539 - ChaCha20 and Poly1305 + chacha based PRNG
2017-04-02 18:13:45 +02:00
Karel Miko
6844275e82
silence MSVC compiler warning
2017-04-02 17:42:28 +02:00
Karel Miko
df733f79fa
removing VS2005 residual that should be removed in #168
2017-04-02 17:42:22 +02:00
Steffen Jaeckel
e3b5a858c3
Merge pull request #182 from libtom/feature/generalizedtime
...
add GeneralizedTime DER processing
2017-03-31 20:22:38 +02:00
Steffen Jaeckel
78a32430d4
more tests
2017-03-31 18:24:42 +02:00
Steffen Jaeckel
2c52bf75f4
bugfixing
2017-03-31 18:24:42 +02:00
Steffen Jaeckel
08503a02f5
update error codes
...
This closes #180
2017-03-31 15:12:12 +02:00
Steffen Jaeckel
1f0daf1eff
fix compiler warning
2017-03-31 00:57:22 +02:00
Steffen Jaeckel
83780d4764
add timezone-offset support to GeneralizedTime
...
this also fixes a bug in the length generation
2017-03-30 22:48:42 +02:00
Steffen Jaeckel
59b4026fa7
Update makefiles
2017-03-30 22:29:02 +02:00
Steffen Jaeckel
2bd517307c
add GeneralizedTime DER en-/decode
2017-03-30 22:29:02 +02:00
Steffen Jaeckel
f7cb199066
add test proposed by @karel-m
2017-03-30 22:29:02 +02:00
Steffen Jaeckel
77019928dd
Merge pull request #79 from libtom/feature/rsa_import_x509
...
RSA import x509
2017-03-30 22:28:24 +02:00
Steffen Jaeckel
ac7915ed13
Update makefiles
2017-03-30 18:46:05 +02:00
Steffen Jaeckel
856d542a1c
turn around the order when free'ing an rsa_key struct
2017-03-30 18:46:05 +02:00
Steffen Jaeckel
ec327b3d86
move x509 processing to rsa_import_x509()
2017-03-30 18:46:05 +02:00
Steffen Jaeckel
019a9e9850
add stinky certificate
2017-03-30 18:46:04 +02:00
Steffen Jaeckel
27722734b2
let's use an empty list element to signal an empty sequence
2017-03-30 18:46:04 +02:00
Steffen Jaeckel
39b2a8daca
add tests for new functionality of der_encode_flexi() and rsa_import()
2017-03-30 18:46:04 +02:00
Steffen Jaeckel
f9bce83329
add possibility to rsa_import() the public key of an x.509 certificate
2017-03-30 18:46:04 +02:00
Steffen Jaeckel
2e822a80a8
add der_sequence_shrink()
...
in case you want to keep a sequence over a longer time, but you don't
need all the raw constructed, set or sequence data
2017-03-30 18:46:04 +02:00
Steffen Jaeckel
7ddce245b8
save the plain constructed-, sequence- or set-data details
2017-03-30 18:46:04 +02:00
karel-m
0a400f465f
Merge pull request #181 from libtom/pr/demo-test-facelift
2017-03-30 16:59:43 +02:00
Karel Miko
2a2968ae92
demos/test facelift
2017-03-30 16:56:10 +02:00
Steffen Jaeckel
4874430dec
send travis notifications to #libtom-notifications
2017-03-30 15:49:04 +02:00
karel-m
4bcd48411a
Merge pull request #173 from libtom/pr/sha3
2017-03-29 13:46:04 +02:00
Karel Miko
c6a0362c88
SHA3
2017-03-29 13:44:04 +02:00
karel-m
1b81848576
Merge pull request #168 from libtom/pr/msvc-cleanup
...
Improving MS Windows builds (msvc)
2017-03-29 09:07:58 +02:00
Karel Miko
7bb7bdde1d
improving MS Windows builds (msvc)
2017-03-29 08:48:33 +02:00
Steffen Jaeckel
783cbc7917
Merge branch 'fix/25' into develop
...
This closes #25
2017-03-28 22:57:35 +02:00
Steffen Jaeckel
d153d1303a
Update makefiles
2017-03-28 22:57:22 +02:00
Steffen Jaeckel
8af93d1d0d
Remove ccm_memory_ex()
2017-03-28 22:57:22 +02:00
Steffen Jaeckel
363a57fc87
Merge branch 'fix/6' into develop
...
This closes #6 & #179
2017-03-28 22:55:49 +02:00
Steffen Jaeckel
8518b56dbf
Revert "fix rotate_test to pass rotate by zero with LTC_NO_ASM"
...
This reverts commit 82080f0b87 .
2017-03-28 21:18:22 +02:00
Steffen Jaeckel
70ee598c5e
fix LTC_NO_ASM rotate macros when compiling with clang
2017-03-28 21:18:22 +02:00
Karel Miko
82080f0b87
fix rotate_test to pass rotate by zero with LTC_NO_ASM
2017-03-27 22:03:33 +02:00
Karel Miko
e5aa2bd453
added rotate_test
2017-03-27 19:32:05 +02:00
Steffen Jaeckel
7532b89a6d
Merge pull request #177 from libtom/pr/177
...
Add -Wdeclaration-after-statement to travis-ci tests
2017-03-26 23:47:42 +02:00
Steffen Jaeckel
862a02767d
fix constants and sizes demo
2017-03-26 21:38:02 +02:00
Steffen Jaeckel
101a7a71ae
enable -Wdeclaration-after-statement by default
2017-03-26 19:30:18 +02:00
Steffen Jaeckel
7885c91af3
print math provider when running tests
2017-03-26 15:46:41 +02:00
Steffen Jaeckel
ea355dbc79
there's no reason to disable DH when using GMP as MPI provider
2017-03-24 16:58:04 +01:00
Steffen Jaeckel
ba338eced8
also build executables in makefile.shared from template
2017-03-24 16:42:49 +01:00
Karel Miko
b465881b58
fix "declaration-after-statement" warnings (tests only)
2017-03-24 10:17:02 +01:00
Steffen Jaeckel
fd1e351316
Merge pull request #78 from libtom/idea/ltc_rng
...
add ltc_rng function pointer
2017-03-22 12:16:46 +01:00
Karel Miko
15db3eab59
fix travis failure
2017-03-22 11:24:21 +01:00
Steffen Jaeckel
27f8e8bf75
Update makefiles
2017-03-22 11:24:21 +01:00
Steffen Jaeckel
cd08a8cec3
disable ltc_rng by default
2017-03-22 11:24:21 +01:00
Steffen Jaeckel
fcae7e2c49
test the ltc_rng
2017-03-22 11:24:21 +01:00
Steffen Jaeckel
fe7c4e3993
add ltc_rng function pointer
...
the idea is to be able to easily provide a plug-in rng for a specific
platform without the need to touch the library.
2017-03-22 11:24:21 +01:00
Steffen Jaeckel
a00aba8370
add pre-commit hook
2017-03-22 11:21:49 +01:00
Steffen Jaeckel
f7bd454dd5
Revert "add release flag to makefile.shared"
...
This reverts commit 14272976d0 .
This is neither a 'package-internal library' nor
one 'whose interfaces change very frequently' so we remove the
release information again from the shared library.
2017-03-22 11:21:39 +01:00
Karel Miko
283ea0c426
improving helper.pl
2017-03-21 19:56:43 +01:00
karel-m
63e6f7647f
Merge pull request #169 from libtom/pr/more-src-checks
...
Improved source checks
2017-03-15 23:14:40 +01:00
Karel Miko
39425a94c5
improved source checks
2017-03-15 23:13:46 +01:00
Steffen Jaeckel
9babf374ee
add '-c' option (again) to updatemakes.sh
2017-03-15 22:21:53 +01:00
karel-m
6df687403a
Merge pull request #167 from libtom/pr/avoid-cpp-style-comments
...
avoid C++ style comments
2017-03-15 15:22:40 +01:00
Karel Miko
54a26525dc
avoid C++ style comments
2017-03-15 15:22:06 +01:00
Karel Miko
db32cc3a81
Merge branch 'fperrad-20170315_lint' into develop
2017-03-15 13:07:54 +01:00
karel-m
bda8019862
Merge pull request #161 from libtom/pr/83-polished
...
Just polished #83 (Add OpenSSL-Compatible PKCSv5#1)
2017-03-15 09:05:58 +01:00
Karel Miko
3396513e81
improving demos/openssl-enc.c
2017-03-15 08:59:49 +01:00
Francois Perrad
937f186db1
use #ifdef instead of #if
2017-03-15 06:55:19 +01:00
Karel Miko
4503868da2
fix pkcs_5_test crash
2017-03-14 18:22:46 +01:00
Karel Miko
0e9b3da3ea
PKCS#5 alg1 tests
2017-03-14 18:22:46 +01:00
BJ Black
c7d6c3ad28
Add OpenSSL-compatible PKCS#5v1 KDF, demo of OpenSSL-compatible aes-256-cbc command.
2017-03-14 18:22:46 +01:00
karel-m
bbe54053ec
Merge pull request #109 from libtom/fix/109-alternative-approach
...
crc32 test fails on ppc64 BE (tomcrypt_cfg.h facelift)
2017-03-14 18:18:44 +01:00
Karel Miko
e26078d2f7
fix #109 - improved arch/endianness detection + tomcrypt_cfg.h facelift
2017-03-14 18:14:57 +01:00
karel-m
44f29d895c
Merge pull request #164 from libtom/pr/wchar-warnings-visual-studio-2008
...
fix wchar_t related warnings on Visual Studio 2008
2017-03-09 21:01:26 +01:00
Karel Miko
591ef19c7a
comment: it might happen that LTC_WCHAR_MAX is undefined
2017-03-09 20:48:24 +01:00
Karel Miko
02b92405e2
simplified #ifdef
2017-03-09 20:48:24 +01:00
Karel Miko
7ab76a464e
introducing LTC_WCHAR_MAX
2017-03-09 20:48:24 +01:00
Karel Miko
2f9c426487
fix wchar_t related warnings on Visual Studio 2008
2017-03-09 20:48:24 +01:00
karel-m
78e9b0fca8
Merge pull request #122 from libtom/fix/122
...
adler32 vs. crc32 inconsistency
2017-03-09 20:33:13 +01:00
Karel Miko
a4d61e0bea
fixes #122 adler32 vs. crc32 inconsistency (bad byte order)
2017-03-09 20:32:29 +01:00
karel-m
33e1c4acca
Merge pull request #158 from libtom/pr/check-makefiles
...
check makefiles (check_source.sh)
2017-03-09 20:29:28 +01:00
Karel Miko
84f2557cc2
updatemakes.sh newline at end of file
2017-03-09 20:19:54 +01:00
Karel Miko
6f9e427f77
comment with aes_enc "hack" (but still disabled for MS Win *.vcproj builds)
2017-03-09 20:19:53 +01:00
Karel Miko
df258453ba
msvc sorting hack
2017-03-09 20:19:52 +01:00
Karel Miko
c260954b52
ordering file list whe generating msvc.proj
2017-03-09 20:19:51 +01:00
Karel Miko
8c831e1e30
no aes_enc on ms windows
2017-03-09 20:19:50 +01:00
Karel Miko
2711e40309
updatet MSVC projects
2017-03-09 20:19:48 +01:00
Karel Miko
58375b0287
updatemakes.sh now updates MS Visual C++ projects as well
2017-03-09 20:19:47 +01:00
Karel Miko
421a241ccf
travis script - check wheather makefiles are updated
2017-03-09 20:19:46 +01:00
karel-m
14a7ed4609
Merge pull request #156 from libtom/improve/tests
...
Improve tests
2017-03-09 20:10:50 +01:00
Steffen Jaeckel
ea1228d3ab
I like aligned output :)
...
...and I dislike c&p'ed code
2017-03-09 20:09:55 +01:00
Steffen Jaeckel
90da7e71e1
There's no need running the same test multiple times
...
If there would be some random input okay, but like that it's just running
the same functionality over and over again.
2017-03-09 20:09:55 +01:00
karel-m
4ef8c27031
Merge pull request #163 from libtom/pr/xts_test-move-declaration
...
move declaration at block beginning (+msvc 2008 tuning)
2017-03-09 20:08:45 +01:00
Karel Miko
ac3f55fd92
there is no snprintf before Visual C++ 2015
2017-03-09 20:07:39 +01:00
Karel Miko
52eaabefa9
msvc 2008 does not like { } initialization
2017-03-06 19:53:04 +01:00
Karel Miko
fb749199db
moving declaration to block beginning
2017-03-06 19:51:46 +01:00
Karel Miko
081ee45712
move declaration at block beginning
2017-03-06 10:43:39 +01:00
karel-m
456908eb90
Merge pull request #159 from libtom/fix/159
...
Travis-CI + the latest libtommath
2017-03-02 19:45:13 +01:00
Steffen Jaeckel
2277b420f0
also install binutils from debian-sid
2017-03-02 12:18:47 +01:00
Steffen Jaeckel
f94ee4a5a7
location of new libtommath.a has changed
2017-03-02 11:41:01 +01:00
Steffen Jaeckel
8c90cba6f6
install libtommath-dev from debian sid
2017-03-02 11:27:39 +01:00
Karel Miko
61ae75a823
sort filenames on perl level during updatemakes.sh
2017-03-01 22:07:28 +01:00
Steffen Jaeckel
1e977e662f
fix updatemakes.sh indentation
2017-03-01 17:52:05 +01:00
Steffen Jaeckel
199ff63e5f
add '-c' option to updatemakes.sh
2017-03-01 16:00:35 +01:00
Steffen Jaeckel
2df86d65e8
don't execute coverage script for private travis
2017-03-01 15:19:34 +01:00
Steffen Jaeckel
d4cc79011b
Merge branch 'pr/crc32-declaration-block-beginning' into develop
...
This closes #155
2017-03-01 15:03:16 +01:00
Karel Miko
1a1addcefd
move declarations at the block beginning (ANSI C)
2017-03-01 15:02:08 +01:00
Steffen Jaeckel
9092470843
fix doxygen warnings
2017-03-01 15:00:41 +01:00
Steffen Jaeckel
3dd0845dec
Merge pull request #139 from libtom/fix/139
...
rand_prime undefined reference when using CFLAGS="-DLTM_DESC -DLTC_EASY
2017-03-01 14:58:35 +01:00
Steffen Jaeckel
4f120531ab
add separate CHECK_SOURCES build target
2017-03-01 14:09:29 +01:00
Karel Miko
631a11cd35
removing "checking white spaces" part from build.sh
2017-03-01 14:00:45 +01:00
Karel Miko
be9c66ab43
tuning build.sh to handle -DLTC_EASY
2017-03-01 13:35:19 +01:00
Karel Miko
856be9cae8
tv_gen needs more #ifdefs
2017-03-01 12:09:50 +01:00
Karel Miko
dde11de781
fixing compile failure in demos for -DLTC_EASY
2017-03-01 11:48:39 +01:00
Steffen Jaeckel
00308d8651
fix base64url related errors when only LTC_BASE64 is defined
2017-03-01 11:37:49 +01:00
Steffen Jaeckel
0b79bbaf5b
fix missing symbol rand_prime
2017-03-01 11:37:49 +01:00
Steffen Jaeckel
6cfc27d310
add EASY build to tests
2017-03-01 11:37:49 +01:00
Karel Miko
50aedb099c
fixing warning introduced by __WCHAR_MAX__ patch
2017-02-28 23:20:19 +01:00
Karel Miko
b3534def42
Merge branch 'fperrad-20170225_lint' into develop
2017-02-28 23:07:31 +01:00
Francois Perrad
eca2290b1e
missing prototypes
2017-02-28 23:07:06 +01:00
Francois Perrad
27280b86b3
static functions
2017-02-28 23:07:06 +01:00
Steffen Jaeckel
acfd16c60a
fix compile error
2017-02-28 21:23:39 +01:00
karel-m
c8c0898bcb
Merge pull request #149 from libtom/feature/travis_clang
...
Add clang to the travis build matrix
2017-02-28 20:30:15 +01:00
Steffen Jaeckel
3dbd250bc9
Add clang to the travis build matrix
2017-02-28 20:29:36 +01:00
karel-m
2edc0aeb66
Merge pull request #152 from libtom/pr/wchar-troubles-max-FFFF
...
better handling wchar_t when __WCHAR_MAX__ is 0xFFFF (2 bytes only)
2017-02-28 20:27:03 +01:00
Karel Miko
4bd327a4cc
better handling wchar_t when __WCHAR_MAX__ is 0xFFFF (2 bytes only)
2017-02-28 20:24:49 +01:00
Karel Miko
05f85c3e6d
RS2 remove 40bit limit
2017-02-28 20:20:51 +01:00
Karel Miko
797031170d
Merge branch 'fix/135' into develop
2017-02-28 20:17:11 +01:00
Steffen Jaeckel
03f0674985
add compare_testvector() prototype to tomcrypt_misc.h
2017-02-28 20:09:32 +01:00
Steffen Jaeckel
9a29428f8e
Add secondary rc2 setup function
...
...to be able to pass the effective key length.
2017-02-28 20:09:32 +01:00
Steffen Jaeckel
43c50423ad
add yet another testvector
2017-02-28 20:09:32 +01:00
Steffen Jaeckel
952caf3cd7
add testvectors for smaller RC2 keysizes
...
originates from rfc2268
1 byte keylen is commented
2017-02-28 20:09:32 +01:00
Steffen Jaeckel
19c81bbbee
fix typo
2017-02-28 20:09:32 +01:00
Karel Miko
344620a0e7
fixes #135 RC2 min keylen 40bit (was 64bit)
2017-02-28 20:09:32 +01:00
Karel Miko
e96a895d0d
Merge branch 'fperrad-perlcritic' into develop
2017-02-28 20:00:25 +01:00
Francois Perrad
808616d406
sanitize some Perl scripts
...
(Perl4 is gone)
2017-02-28 19:59:58 +01:00
karel-m
4cdc304e37
Merge pull request #153 from libtom/fix/54-part1
...
part of feature/doc changes from #54
2017-02-28 19:53:03 +01:00
Karel Miko
6c8d00d1fd
part of feature/doc changes
2017-02-28 17:35:57 +01:00
karel-m
b44aa8fa83
Merge pull request #151 from libtom/pr/adler32-declaration-block-beginning
...
move declarations at the block beginning (ANSI C)
2017-02-28 16:41:05 +01:00
Karel Miko
efbd73fbc8
move declarations at the block beginning (ANSI C)
2017-02-28 16:11:42 +01:00
karel-m
6596746c5d
Merge pull request #150 from libtom/pr/conversion-related-troubles
...
conversion related troubles (int, size_t, ptrdiff_t ..)
2017-02-28 11:38:32 +01:00
Karel Miko
88412a9fc2
conversion related troubles (int, size_t, ptrdiff_t ..)
2017-02-28 11:30:19 +01:00
karel-m
8141ca617a
Merge pull request #106 from libtom/fix/106
...
_base64_decode_internal not compliant with RFC4648
2017-02-28 01:28:44 +01:00
Steffen Jaeckel
abf0a18290
add some testcases
2017-02-28 01:27:07 +01:00
Steffen Jaeckel
eee936d752
add base64url_strict_encode()
2017-02-28 01:27:06 +01:00
Karel Miko
006c601efb
no trailing = for base64url
2017-02-28 01:27:05 +01:00
Karel Miko
ff3a03a1d0
tuning base64 decoding implementation
2017-02-28 01:27:04 +01:00
Steffen Jaeckel
c1dd1cbe30
re-work strict/relaxed base64 decoding implementation
...
Instead of one API function with an option parameter, provide two API
functions.
Instead of defaulting to strict decoding, default to relaxed decoding.
2017-02-28 01:27:03 +01:00
Steffen Jaeckel
53359ccfc6
fix failing test
2017-02-28 01:27:02 +01:00
Steffen Jaeckel
bc16c149fc
fix base64[url] strict/relaxed decode
2017-02-28 01:27:01 +01:00
Steffen Jaeckel
063bac396d
add LTC_BASE64_STRICT to crypt_build_settings and crypt_constants
2017-02-28 01:27:00 +01:00
Steffen Jaeckel
1c0edfdead
add/fix tests
...
add explicit strict&loose base64-decode tests
2017-02-28 01:26:58 +01:00
Steffen Jaeckel
b10f9502f8
add RFC4648 base64 decoding compliance
2017-02-28 01:26:57 +01:00
karel-m
30382d0e31
Merge pull request #144 from libtom/fix/coverity-dsa_import-double-free
...
fix coverity finding: dsa_import double free
2017-02-28 01:17:18 +01:00
Karel Miko
faa18e71c8
tuning indentation
2017-02-28 00:51:25 +01:00
Karel Miko
1e260eeaae
fir coverity finding: dsa_import double free
2017-02-28 00:51:25 +01:00
Karel Miko
6499c70492
Merge branch 'mattkelly-fix-clang-cast-align-warnings' into develop
2017-02-27 18:13:44 +01:00
Steffen Jaeckel
ce1043c55d
ignore warnings of clang created by my stdlib
2017-02-27 18:12:22 +01:00
Matt Kelly
e187f4cbf4
Fix all warnings from -Wcast-align
2017-02-26 10:12:16 -05:00
karel-m
d777f9d1dc
Merge pull request #145 from libtom/fix/coverity-cbc_decrypt-out-of-bounds-read
...
fix coverity finding: cbc_decrypt out-of-bound read
2017-02-25 20:44:47 +01:00
Karel Miko
7246ab50da
fix coverity finding: cbc_decrypt out-of-bound read
2017-02-25 19:53:52 +01:00
karel-m
7c2cc079ec
Merge pull request #146 from libtom/fix/85-part3
...
Fix for #85 (part3)
2017-02-25 13:23:03 +01:00
Francois Perrad
4349993ad3
Suspicious use of & (part 2)
2017-02-25 13:21:34 +01:00
Karel Miko
824f3af98c
check-source.pl cosmetics
2017-02-24 20:57:47 +01:00
Karel Miko
c911427cf2
check-source.pl script for checking whitespace related troubles
2017-02-24 20:51:31 +01:00
Karel Miko
953080bcea
more trailing spaces + tabs outside of "src" dir
2017-02-24 20:50:37 +01:00
Karel Miko
477d621224
more trailing spaces + tabs in src
2017-02-24 20:31:48 +01:00
karel-m
f60e045034
Merge pull request #143 from libtom/fix/85-part2
...
Fix/85 part2
2017-02-24 19:04:46 +01:00
Francois Perrad
fc55a8fd1b
remove trailing spaces
2017-02-24 19:02:43 +01:00
Francois Perrad
b0f06ed1ec
add parenthese in macro
2017-02-24 19:00:36 +01:00
Francois Perrad
79d6e61aca
use the variable 'err'
2017-02-24 19:00:32 +01:00
Francois Perrad
31f88a9c9b
default for switch
2017-02-24 19:00:28 +01:00
Francois Perrad
203087d6d7
bug: wrong parentheses in condition with assignment
2017-02-24 19:00:24 +01:00
Karel Miko
649ef0faef
forgotten trailing space
2017-02-24 16:54:01 +01:00
karel-m
01bb22e865
Merge pull request #142 from libtom/fix/85-part1
...
Fix/85 part1
2017-02-24 16:35:19 +01:00
Francois Perrad
58353f51e2
remove trailing spaces
2017-02-24 16:29:54 +01:00
Francois Perrad
5d7036ebe2
remove hard tab
2017-02-24 16:26:48 +01:00
Francois Perrad
9f8df116be
remove useless code
2017-02-24 16:23:27 +01:00
Francois Perrad
cebf33cdce
add some const
2017-02-24 16:23:23 +01:00
Francois Perrad
9749958fe5
the comment FALLTHROUGH is common for several lint tool
2017-02-24 16:23:19 +01:00
Francois Perrad
c22acc2d07
remove useless include
2017-02-24 16:23:15 +01:00
Francois Perrad
7b48f4d5f7
fix indentation
2017-02-24 16:23:10 +01:00
Steffen Jaeckel
ecb2402ba8
remove [X]CLOCKS_PER_SEC
2017-02-24 00:28:59 +01:00
Karel Miko
979e9a9d15
fix for #90 ltc_ecc_mul2add.c integer sign issue (sjaeckel's way)
2017-02-24 00:18:55 +01:00
Karel Miko
0c226834cc
introducing LTC_INLINE
2017-02-23 23:47:56 +01:00
Steffen Jaeckel
c39390dba1
Merge branch 'fix/132' into develop
...
This closes #132
2017-02-23 11:04:10 +01:00
Karel Miko
3d5b90d24d
LTC_NO_PROTOTYPES related cosmetics
2017-02-23 11:03:55 +01:00
Steffen Jaeckel
76b289833c
only define LTC_NO_PROTOTYPES on one point
...
This closes #132
2017-02-23 11:03:55 +01:00
Steffen Jaeckel
ef023f3329
fix rsa/dsa test duplicate symbols
2017-02-21 17:32:30 +01:00
Steffen Jaeckel
fa4637e7a9
Merge branch 'fix/97' into develop
...
This closes #97
2017-02-21 16:57:38 +01:00
Steffen Jaeckel
55776b0ac9
update makefiles
2017-02-21 16:57:21 +01:00
Karel Miko
bbbbf5f1d5
adding rsa_import_radix tests
2017-02-21 16:55:10 +01:00
Karel Miko
a2c87f54de
adding rsa_import_radix
2017-02-21 16:55:09 +01:00
Steffen Jaeckel
0cf80ef631
Merge branch 'fix/98' into develop
...
This closes #98
2017-02-21 16:54:25 +01:00
Karel Miko
ac6f69e8fe
adding dsa_import_radix tests
2017-02-21 16:54:11 +01:00
Steffen Jaeckel
43517bca83
update makefiles
2017-02-21 16:54:11 +01:00
Karel Miko
10545366d2
adding dsa_import_radix
2017-02-21 16:54:10 +01:00
Steffen Jaeckel
a8df316581
Merge branch 'pr/133' into develop
...
This closes #133
2017-02-21 16:45:12 +01:00
Karel Miko
bcf7753a26
use MIN macro
2017-02-21 16:36:17 +01:00
Karel Miko
ecbac7324e
DSA: properly handle FIPS 186-4 (4.6 + 4.7)
2017-02-21 16:36:17 +01:00
Steffen Jaeckel
498538f6ef
Merge pull request #103 from libtom/fix/103
...
Serious bug in rng_get_bytes @ MS Windows
2017-02-21 14:39:54 +01:00
Karel Miko
b36e75b7f1
don't read from c:\dev\random on windows
2017-02-21 13:34:52 +01:00
Steffen Jaeckel
d727b16898
use proper defines as of [1]
...
[1] http://predef.sourceforge.net
2017-02-21 13:34:52 +01:00
Steffen Jaeckel
5757fdb035
Merge branch 'pr/124' into develop
...
This closes #124
2017-02-21 11:50:25 +01:00
zeromus
c341d36c6a
do it differently
2017-02-21 11:49:35 +01:00
zeromus
32f19995f8
do it differently
2017-02-21 11:49:35 +01:00
zeromus
793ff08986
do it differently
2017-02-21 11:49:35 +01:00
zeromus
c83763bd46
fix tiny compile error in tomcrypt_pk.h macro
...
An ARM compiler gives me this:
libtomcrypt\pk\asn1\der\sequence\der_decode_subject_public_key_info.c(65,4): error #188-D: enumerated type mixed with another type
Since der_decode_subject_public_key_info's parameters_type is of type 'unsigned long', an attempt to assign it to ltc_asn1_list's member 'ltc_asn1_type type' fails.
My fix solves this in a simple way by casting it at the point of assignment.
But while studying this I noticed there's no use of enum in the codebase other than a few PK-related things. Perhaps a more appropriate solution would be to remove these enums. I mean, enums seem like an OK enough idea, but I don't know anything about the practicality of using enums in archaic C dialects like libtomcrypt conforms (thankfully!) to...
2017-02-21 11:49:35 +01:00
Steffen Jaeckel
600004fecc
print ascii in print_hex()
2017-02-21 11:42:24 +01:00
Steffen Jaeckel
60bb5440fb
add compare_testvector()
2017-02-21 11:42:24 +01:00
Steffen Jaeckel
383f200cb6
fix LTC_MINIMAL
2017-02-20 19:19:44 +01:00
Steffen Jaeckel
fd99c3e3c0
remove duplicate define
2017-02-20 18:58:20 +01:00
Steffen Jaeckel
08aabc7f8c
improve print_hex() prototype
2017-02-17 11:53:14 +01:00
Steffen Jaeckel
8fc1af1b7e
make implementation easier to read
...
damn you negated logic...
2017-02-15 23:15:43 +01:00
Steffen Jaeckel
f784793891
Merge pull request #129 from libtom/fix/gcm_counter_reuse
...
GCM counter incrementation isn't stopped at 2^32 blocks, which breaks GCM
2016-10-02 20:51:01 +02:00
Steffen Jaeckel
7d418b34b3
Fix GCM counter reuse
...
GCM should error out after processing (2^32)-1 blocks / (2^39)-256 bits
2016-09-28 20:18:09 +02:00
Karel Miko
6ad5225268
removing forgotten debug comment
2016-07-07 15:03:33 +02:00
Steffen Jaeckel
bb56ef08eb
bring coverage results near reality
2016-04-03 17:45:16 +02:00
Steffen Jaeckel
892342c769
automatically determine the number of parallel make jobs for the tests
2016-04-03 14:12:27 +02:00
Steffen Jaeckel
da3ade0807
increase coverage by running 'sizes' and 'constants'
2016-04-03 14:12:27 +02:00
Steffen Jaeckel
1c6c02e18d
fix gitignore
2016-04-03 14:12:27 +02:00
Steffen Jaeckel
f2f1b61164
Merge pull request #115 from fperrad/install
...
install without USER and GROUP
2016-04-03 01:46:24 +02:00
Francois Perrad
5d5694dbc4
install without USER and GROUP
...
like in libtommath.
really more friendly for packaging.
2016-04-01 09:26:28 +02:00
Steffen Jaeckel
912eff4949
make testprof/makefile silent
2016-01-23 19:11:30 +01:00
Steffen Jaeckel
61d730323a
introduce new all_test make-target
2016-01-23 19:11:30 +01:00
Steffen Jaeckel
23cad07701
refactor makefile a bit more
2016-01-23 19:00:23 +01:00
Steffen Jaeckel
d1eeecb137
fix some compiler warnings
2016-01-23 18:59:44 +01:00
Steffen Jaeckel
4572357e87
make easily built demos in a template
2016-01-23 18:59:30 +01:00
Steffen Jaeckel
7c9450084f
fix some compile errors
2016-01-23 18:42:50 +01:00
Steffen Jaeckel
3184c6d8a0
Merge branch 'miko-GCM-HPUX-IA64-fix' into develop
...
This closes #100
2016-01-23 18:11:01 +01:00
Karel Miko
966496ea1a
fixing GCM troubles at HP-UX/IA64
2016-01-23 18:09:03 +01:00
Steffen Jaeckel
a6417387c0
make check_defines silent
2016-01-23 17:06:57 +01:00
Steffen Jaeckel
6905e4113f
make build process silent
2016-01-19 00:38:05 +01:00
Steffen Jaeckel
de15a6fad9
Merge branch 'miko-const-int-fix' into develop
...
This closes #92 and closes #96
2016-01-19 00:04:27 +01:00
Karel Miko
af77f1fae9
RORc instead of ROR
2016-01-19 00:03:54 +01:00
Karel Miko
d0a534393a
fix for issue #92 - const is meaningless on cast type
2016-01-19 00:03:54 +01:00
Steffen Jaeckel
4a3b53dbee
Merge branch 'miko-avoid-declaration-after-statements' into develop
...
This closes #101
2016-01-14 21:47:16 +01:00
Karel Miko
15b3f39a4f
avoid using declaration after statements (rng_win32)
2016-01-14 21:46:53 +01:00
Karel Miko
7c1e251e75
avoid using declaration after statements
2016-01-14 21:46:53 +01:00
Steffen Jaeckel
f108863dc3
Merge branch 'miko-ecc_ansi_x963_export-fix' into develop
...
This closes #58 and closes #99
2016-01-14 21:33:04 +01:00
Steffen Jaeckel
10e577e24a
there's no need to check out on function entry
...
...someone could then do something like this...
unsigned char* out = NULL;
unsigned long len = 0;
while(ecc_ansi_x963_export(key, out, &len) == CRYPT_BUFFER_OVERFLOW &&
len == 0) {
out = malloc(len);
}
...as if someone would ever like to do something like that...
2016-01-14 21:32:33 +01:00
Karel Miko
42bad9f580
fix for issue #58 - possible overflow in ecc_ansi_x963_export
2016-01-11 00:25:13 +01:00
Steffen Jaeckel
af70cb6a01
Merge remote-tracking branch 'km/miko-setbit-fix' into develop
...
This closes #91
2016-01-11 00:23:25 +01:00
Karel Miko
8cf7eb1801
fix for issue #91 - redefinition of macro "setbit"
2016-01-10 18:45:04 +01:00
Steffen Jaeckel
7c2ff8ebfe
show ROtate operator configuration in build settings
...
[skip ci]
2016-01-05 23:55:06 +01:00
Steffen Jaeckel
645a82d9e6
travis: update local package index as first step
2016-01-05 23:24:47 +01:00
Steffen Jaeckel
012dfe8001
Make the build output cleaner so diagnostics are easier to spot
...
Signed-off-by: Tom St Denis <tstdenis82@gmail.com>
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
2015-12-05 14:31:38 +01:00
Steffen Jaeckel
8def190877
Merge branch 'fix/hkdf' into develop
...
This fixes #81
2015-12-05 14:31:38 +01:00
Steffen Jaeckel
f5016d88dd
Prevent undefined behavior
...
Don't call XMEMCPY() in case info (the source parameter to memcpy) is NULL
as this would trigger UB
2015-12-05 14:31:38 +01:00
Steffen Jaeckel
318dbbccc3
fix wrongly used LTC_ARGCHK/LTC_ARGCHKVD macros
2015-12-05 14:31:37 +01:00
Steffen Jaeckel
460b8716c9
fix clang-analyzer warnings
...
This fixes #80
2015-12-05 14:31:01 +01:00
Steffen Jaeckel
16f397d55c
prevent segfault in case we hit an empty sequence
2015-09-10 19:17:42 +02:00
Steffen Jaeckel
d4945ac521
add (nearly) all defines from tomcrypt_custom.h to crypt_build_settings
...
... and provide a new make target to check if something is missing
2015-09-08 21:09:49 +02:00
Steffen Jaeckel
0b140206cf
Merge branch 'feature/rsa-crt_hardening' into develop
...
This fixes #77
2015-09-08 21:04:54 +02:00
Steffen Jaeckel
733c52aa00
add LTC_RSA_CRT_HARDENING to crypt_build_settings
2015-09-08 21:04:33 +02:00
Steffen Jaeckel
01f1845402
harden RSA CRT by implementing the proposed countermeasure
...
... from ch. 1.3 of [1]
[1] https://people.redhat.com/~fweimer/rsa-crt-leaks.pdf
2015-09-08 02:44:17 +02:00
Steffen Jaeckel
19e2526b82
add some make targets regarding code coverage
2015-09-08 02:35:35 +02:00
Steffen Jaeckel
7db5760c91
add possibility to create combined coverage
...
Define the environment variable LTC_COVERAGE to something, run testme.sh
with all the coverage compile time options enabled and then 'make lcov'
creates the combined coverage for all combinations of compile-time
options handled in testme.sh.
e.g. LTC_COVERAGE=1 ./testme.sh "makefile -j3" "-DUSE_LTM -DLTM_DESC -I../libtommath -fprofile-arcs -ftest-coverage" "../libtommath/libtommath.a -lgcov"
2015-09-08 01:36:13 +02:00
Steffen Jaeckel
21ed315527
ignore output of 'make doxy'
2015-09-08 01:14:57 +02:00
Steffen Jaeckel
fd94034ba7
sort HEADERS in makefiles, so it doesn't change spontaneously
2015-09-01 17:36:43 +02:00
Steffen Jaeckel
6ec93afa3c
clean-up test-build and extend tomcrypt_custom.h
...
added LTC_MINIMAL to be able do a build without nearly any
functionality :)
make sure timing resistant RSA & ECC are enabled if not said otherwise
2015-09-01 17:36:43 +02:00
Steffen Jaeckel
8cb20e6059
add more DES test vectors
2015-08-31 15:09:36 +02:00
Steffen Jaeckel
eb26b7efd4
Merge branch 'fix/ccm_constant_time' into develop
...
This closes #73 and closes #76
2015-08-26 00:16:09 +02:00
Sebastian Verschoor
75b114517a
make sure no cache-based timing attack is possible
...
instead of two different buffers, there is just one buffer. Based upon the verification result, a mask is applied to the buffer before it is written to the output buffer.
2015-08-26 00:08:38 +02:00
Steffen Jaeckel
09e4b0ec9b
don't reveal plaintext if authentication failed
...
Create two buffers of the same size as the input data.
Copy the input data to the first one and work with that version to hold the
decrypted data, zeroize the second one.
Copy depending on the verification result, either the zero-buffer or the
real plaintext to the output buffer.
2015-08-26 00:08:38 +02:00
Steffen Jaeckel
6c11ca771b
fix compile error of tests
2015-08-26 00:08:38 +02:00
Sebastian Verschoor
25af184cd5
Quickfix for issue #73
...
The API of the function is changed (for decryption, tag is now an input
parameter). With the old API it is impossible to confirm to the NIST
specification and a timing sidechannel leak is inevitable.
2015-08-26 00:08:38 +02:00
Steffen Jaeckel
38bfef2996
Merge branch 'aes-xts-accel' into develop
...
This fixes #70
2015-08-26 00:05:31 +02:00
Steffen Jaeckel
f9c8c9c229
also test XTS accelerators
2015-08-26 00:05:07 +02:00
Steffen Jaeckel
181d2f2df7
auto-format xts code
2015-08-26 00:02:50 +02:00
Steffen Jaeckel
b25d04ed94
fix pointer check
2015-08-25 23:58:22 +02:00
Jerome Forissier
5c3f177b34
Add function pointers for accelerated XTS to ltc_cipher_descriptor
...
Similar to what already exists for other modes.
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
2015-08-25 23:58:22 +02:00
Steffen Jaeckel
99214b53f6
add .clang-format
2015-08-25 23:58:08 +02:00
Steffen Jaeckel
a13257094e
handle LTC_NO_FAST before handling LTC_FAST
2015-08-23 22:59:15 +02:00
Steffen Jaeckel
61efc10852
update makefiles
2015-08-23 22:59:14 +02:00
Steffen Jaeckel
ee03c97cde
add crc32
2015-08-23 22:59:14 +02:00
Steffen Jaeckel
9585faca2b
re-work debug output of some tests
2015-08-23 22:59:14 +02:00
Steffen Jaeckel
1987a2f975
add adler32 checksum algorithm
2015-08-23 22:59:14 +02:00
Steffen Jaeckel
d6cea55b13
Merge branch 'pascal-brand-st-dev/ecc_raw' into develop
...
This fixes #69
2015-08-21 22:18:42 +02:00
Pascal Brand
3605983f09
Introduce ECC raw algorithms for sign and verify
...
As it is performed on dsa, raw sign and verify on ECC
are introduced.
Signed-off-by: Pascal Brand <pascal.brand@st.com>
2015-08-21 22:14:03 +02:00
Steffen Jaeckel
0e8d8f8d81
Merge branch 'pascal-brand-st-dev/ecctest' into develop
...
This fixes #68
2015-08-21 22:12:02 +02:00
Pascal Brand
7313d1e6b0
Update ECC timing tests
...
Signed-off-by: Pascal Brand <pascal.brand@st.com>
2015-08-21 22:09:25 +02:00
Steffen Jaeckel
08629ed2b0
Merge branch 'fix/issue74' into develop
...
This closes #74
2015-08-21 21:30:38 +02:00
Sebastian Verschoor
67973b04ae
fix #74
2015-08-21 21:29:56 +02:00
Steffen Jaeckel
c28cc9e3e9
crypt_build_settings: remove build date and time
2015-05-07 10:32:12 +02:00
Karel Miko
aeaa6d4a51
cygwin related fix - variable name B0 changed to B_0 (part 2)
2015-04-17 08:59:35 +02:00
Karel Miko
6a257e15cd
cygwin related fix - variable name B0 changed to B_0 as it caused collision when compiling libtomcrypt as a perl module (for some reason only on cygwin)
2015-04-17 08:56:42 +02:00
Karel Miko
a8e91afb16
cygwin/64bit related fix - added !defined(__x86_64__)
2015-04-17 08:50:38 +02:00
Steffen Jaeckel
4981e2ab3f
Merge pull request #61 from ulikoehler/reffix
...
Fix config file reference
2015-03-28 08:31:21 -04:00
Uli Köhler
d24e9cd32d
Fix config file reference
2015-03-27 21:41:51 +01:00
Steffen Jaeckel
925f1ec0e6
Merge pull request #60 from pascal-brand-st-dev/memneq
...
Use XMEM_NEQ instead of mem_neq
2015-02-27 10:11:14 +01:00
Pascal Brand
f20b5daf39
Use XMEM_NEQ instead of mem_neq
...
mem_neq is no more used directly. XMEM_NEQ is used instead,
in the same way XMEMCMP, XMEMCPY,... are.
Signed-off-by: Pascal Brand <pascal.brand@st.com>
2015-02-27 08:54:30 +01:00
Steffen Jaeckel
dfa938a4f6
verify outcome when defining LTC_NOTHING
...
check that LTC_NOTHING really creates nothing but the libraries' basic
API functions
2015-02-15 17:25:45 +01:00
Steffen Jaeckel
90e968a202
der_decode_subject_public_key_info: fix compile error
...
also make it possible to define min/max RSA key sizes externally
This closes #59
2015-02-15 16:32:12 +01:00
Saleem Abdulrasool
62878de0c5
adjust inline asm requiring constants
...
In order to ensure that the shift is within range, convert the inline assembly
routines into macros with compound statements.
2015-01-20 22:36:07 +01:00
Steffen Jaeckel
e9f9c6fa55
create a makefile.include
...
it contains all the preparation and targets for the static and shared lib
2015-01-20 22:36:07 +01:00
Steffen Jaeckel
0b6915740c
saferp: enclose macros in do{}while(0) loop
2015-01-20 22:36:07 +01:00
Steffen Jaeckel
9782c09a3a
use XMEM{CMP, CPY, SET} macros instead of standard versions
2015-01-20 22:36:06 +01:00
Steffen Jaeckel
b8bf2f13b8
Merge branch 'feature/const_memcmp' into develop
...
This closes #57
2015-01-20 22:35:44 +01:00
Steffen Jaeckel
46c038f7d4
adapt rsa_test() to modified pkcs#1 decoding routines
2014-11-13 22:30:07 +01:00
Steffen Jaeckel
1e9e98aa0d
make pkcs#1 decode functions constant-time
...
as proposed in RFC 3447 only one error return code is used when there are
errors while decoding the pkcs#1 format.
also, all steps are executed and only the "output" is skipped if something
went wrong.
Sorry this could break backwards compatibility, since there's no more
BUFFER_OVERFLOW messaging.
Former error-handling code could also be affected because now there's only
OK as return code in cases where "res" is also set to '1'.
2014-11-13 22:26:59 +01:00
Steffen Jaeckel
e57c92fd23
replace calls to standard memcmp with constant memcmp where necessary
2014-11-13 22:09:45 +01:00
Steffen Jaeckel
d54425adb4
update makefiles
2014-11-13 22:09:20 +01:00
Steffen Jaeckel
26c5d54e5c
add constant-time memcmp()
...
[skip ci]
2014-11-12 23:59:27 +01:00
Steffen Jaeckel
ddca3d6422
Merge branch 'pascal-brand-st-dev/ccm' into develop
...
This closes #55
2014-11-02 17:02:21 +01:00
Steffen Jaeckel
f2f8342c43
ccm test: add missing AAD
2014-11-02 17:01:56 +01:00
Steffen Jaeckel
943a858d6c
also run testvectors on new CCM API
...
[skip ci]
2014-10-31 19:41:14 +01:00
Steffen Jaeckel
4efa27ead1
add missing pointer checks
2014-10-31 19:39:03 +01:00
Steffen Jaeckel
53917750d8
trim trailing spaces
2014-10-31 19:38:47 +01:00
Pascal Brand
992506cb49
Add incremental CCM authentication processing
...
CCM is only meant for packet mode where the length of the input is known in
advance. Since it is a packet mode function, CCM only had one function that
performs the protocol.
However, incremental authentication is usefull in some usecases. It also
ensure some kind of coherencies when processing with a given authentication
mode or another. To achieve this aim, this commit adds the following functions:
ccm_init()
ccm_add_aad()
cm_add_nonce()
ccm_process()
ccm_done()
ccm_reset()
as well as the data structure
ccm_state
Change-Id: I5225a42bb098708c4af07518b561bb00f85bc243
2014-10-17 09:00:19 +02:00
Steffen Jaeckel
ed28703804
der_decode_sequence_multi: calm coverity
2014-10-10 01:07:58 +02:00
Steffen Jaeckel
e6b1c7101e
der test: also run der_length_utf8_string()
2014-10-10 00:56:23 +02:00
Steffen Jaeckel
3ecdd29847
fix coverity script
2014-10-10 00:55:18 +02:00
Steffen Jaeckel
ee1631f8b3
dsa import: no output on stderr please
2014-10-06 19:00:50 +02:00
Steffen Jaeckel
f75b5ec8f4
der tests: improve/implement handling of context-specific data
...
no more "EOL" in the output as the flexi decoder handles now
context-specific data
2014-10-06 18:59:40 +02:00
Steffen Jaeckel
6da3b856d6
der test: print list-element details on EOL
...
EOL indicates an unitialized list-element
2014-10-06 18:57:42 +02:00
Steffen Jaeckel
6bd6319fb0
der flexi decoder: implement decoding of context-specific data
2014-10-06 18:57:42 +02:00
Steffen Jaeckel
2d8933e4f1
der: add new enum element for context-specific encodings
2014-10-06 18:57:42 +02:00
Steffen Jaeckel
f0a1235614
der flexi decoder: remove duplicate code
2014-10-06 18:57:41 +02:00
Steffen Jaeckel
3d1231ab15
der flexi decoder: improve CONSTRUCTED type decoding
...
remove all teh flags
save the entire original identifier
2014-10-06 17:51:25 +02:00
Steffen Jaeckel
2e426e2d57
der test: add example of decoding a X.509 v3 cert with the flexi decoder
...
you can define "LTC_DER_TESTS_PRINT_FLEXI" at compile time to print
the decoded cert whenn running the test executable...
well not all of it, since some parts of the cert are marked as
"context-specific" so we would need to do some further digging
...these are the parts that are output as "EOL"...
2014-09-30 17:57:53 +02:00
Steffen Jaeckel
c1e81ad469
minor changes
...
print MP_DIGIT_BIT when running test
der_test: improve error output of 'short integer' test
2014-09-30 13:26:18 +02:00
Steffen Jaeckel
1cc26da35c
fix coverity script
2014-09-30 10:53:05 +02:00
Steffen Jaeckel
b1b3d5870f
Merge branch 'feature/formatRsaDsa' into develop
...
This closes #50
2014-09-29 23:45:34 +02:00
Steffen Jaeckel
eea24fe2c0
bring back possibility to import/export old DSA key format
2014-09-29 23:44:47 +02:00
Steffen Jaeckel
f58c87866e
add possibility to export RSA public key in SubjectPublicKeyInfo format
2014-09-29 23:44:47 +02:00
Steffen Jaeckel
b1f29539be
Revert "removed testing of "stripped" rsa key"
...
This reverts commit 496453f289 .
2014-09-29 23:44:47 +02:00
Steffen Jaeckel
7842e338bf
fix API of dynamic language helpers
...
it is easier to handle 'int' than 'long' in the foreign language
2014-09-29 23:30:02 +02:00
Steffen Jaeckel
b3b93675f5
Merge branch 'feature/sha2t' into develop
2014-09-29 19:57:43 +02:00
Steffen Jaeckel
1924e6fd47
add sha512/224 and sha512/256 to tests and crypt_build_settings
2014-09-29 19:57:21 +02:00
Steffen Jaeckel
06321b8602
update makefiles
2014-09-29 19:57:21 +02:00
Steffen Jaeckel
c58e2cae75
add special build rules for sha512/224 and sha512/256
2014-09-29 19:57:21 +02:00
Steffen Jaeckel
23fb224e19
add sha512/224 and sha512/256
2014-09-29 19:57:21 +02:00
Steffen Jaeckel
5ce0c7f70e
Merge branch 'pascal-brand-st/xts' into develop
...
This closes #52
2014-09-29 19:47:44 +02:00
Steffen Jaeckel
3d905ca178
add testcase for multiple XTS encryption/decryption
2014-09-29 19:47:18 +02:00
Pascal Brand
adc54d08d0
Enable multiple XTS encryption or decryption
...
multiple xts_encrypt() cannot be performed because the
tweak is not updated. That means that
xts_encrypt(buffer1, tweak)
xts_encrypt(buffer2, tweak)
is not the same as
xts_encrypt(concat(buffer1, buffer2), tweak)
Current patch enables such functionalities by
updating the tweak as output of the encryption.
Note that the tweak is no more constant.
The very same modification is performed
on xts_decrypt()
Signed-off-by: Pascal Brand <pascal.brand@st.com>
2014-09-28 22:55:02 +02:00
Steffen Jaeckel
824c7bf16a
Merge branch 'pascal-brand-st/rsa' into develop
...
This closes #53
2014-09-28 22:53:22 +02:00
Steffen Jaeckel
94363b601c
add testcase to verify that this patch is working
2014-09-28 22:52:32 +02:00
Pascal Brand
a6e89d58d4
RSA in CRT optimization parameters are empty
2014-09-28 22:48:21 +02:00
Pascal Brand
2bb3f0246f
RSA in case CRT optimization parameters are not populated
...
rsa_exptmod(), ran on the private key, makes use of CRT optimization
parameters. In some use-cases, the given key does not include the
optimization parameters.
This patch allows rsa_exptmod() to run without the CRT parameters,
using directly mp_exptmod().
Signed-off-by: Pascal Brand <pascal.brand@st.com>
2014-09-28 22:45:46 +02:00
Steffen Jaeckel
cb2322f8de
Merge branch 'fix/x32' into develop
...
This closes #51
2014-09-28 22:43:58 +02:00
Steffen Jaeckel
afaef3993c
fix compiler warning when compiling with GMP_DESC
2014-09-10 16:16:46 +02:00
Steffen Jaeckel
f597f29ece
math: change get_digit() return value
...
unsigned long is 32bit wide when compiling with the compiler flag "-mx32"
but the digit size of the math libraries is still 64 bit which lead to
the buggy ecc code.
Therefore define a new type ltc_mp_digit with the correct width and use
that as return value of get_digit()
Has been tested with all three math providers
2014-09-10 16:15:35 +02:00
Steffen Jaeckel
1793072c67
fix CC parameter given to make in testprof folder
2014-09-10 16:08:49 +02:00
Steffen Jaeckel
67b9cd8a95
trim trailing spaces
2014-09-02 02:17:43 +02:00
Steffen Jaeckel
e8d4598616
Merge branch 'fix/mingw64' into develop
2014-09-01 19:29:44 +02:00
Steffen Jaeckel
fff4fd15c4
build.sh: improve diff parameters
2014-08-31 18:47:21 +02:00
Steffen Jaeckel
ee4c00b753
some more ASN.1 fixes
...
these should have been in #49
2014-08-31 18:26:14 +02:00
Steffen Jaeckel
c342cb5a21
Merge branch 'fix/asn1' into develop
...
This closes #49
[skip ci]
2014-08-31 18:02:52 +02:00
Steffen Jaeckel
e5fb4d5ebe
use DO() macro when calling API functions in tests
2014-08-28 14:02:57 +02:00
Steffen Jaeckel
7a5ea10e60
add missing ASN1 types in der_encode_set()
2014-08-28 14:02:57 +02:00
Steffen Jaeckel
ddede01d16
trim trailing spaces
2014-08-28 14:02:57 +02:00
Steffen Jaeckel
b06270645e
add missing check of the OID
2014-08-28 14:02:57 +02:00
Steffen Jaeckel
6bba3a2a70
change the ASN1 type to be a typedef
...
replace all 'default' cases in the switch statements
2014-08-28 14:02:57 +02:00
Steffen Jaeckel
00c111b1c8
add missing types to decode routines
2014-08-28 14:02:57 +02:00
Steffen Jaeckel
800182338e
unwind conditional expressions
...
I prefer readability
2014-08-28 14:02:57 +02:00
Christopher Brown
3cdb64eca6
bypass constructed type identification for sets / sequences
2014-08-28 14:02:56 +02:00
Christopher Brown
678b6d9641
fix constructed type identifier check
2014-08-28 14:02:56 +02:00
Steffen Jaeckel
171eae5378
asn1: use LTC_SET_ASN1 macro to access ltc_asn1_list elements
2014-08-28 14:02:56 +02:00
Steffen Jaeckel
4071475558
fix compiler warnings
2014-08-28 13:53:51 +02:00
Steffen Jaeckel
78e367895a
Merge branch 'feature/testRsaPkcs1' into develop
...
This closes #48
2014-08-28 13:35:13 +02:00
Steffen Jaeckel
efc6844f9c
tests: add function print_hex()
2014-08-28 13:30:26 +02:00
Steffen Jaeckel
64f887e8f3
predictable rand() values please
2014-08-28 13:30:26 +02:00
Steffen Jaeckel
8ce125f8a8
mp_rand() assumes the number of digits and not the bitsize as parameter
2014-08-28 13:30:26 +02:00
Steffen Jaeckel
f86d36c676
rsa_test: improve a bit
2014-08-28 13:30:26 +02:00
Steffen Jaeckel
536a199203
rsa_test: fix valgrind warnings
2014-08-28 13:30:26 +02:00
Steffen Jaeckel
d51715db72
pkcs#1 v1.5 decode: fix missing check of PS length in EMSA mode
2014-08-28 13:30:26 +02:00
Steffen Jaeckel
2b3c603c6c
udpate bleichenbacher signature attack
...
also test for too short padding strings
2014-08-28 13:30:26 +02:00
Steffen Jaeckel
e227000578
tests: remove surplus ';' in DO()/DOX() macros
2014-08-28 13:30:26 +02:00
Steffen Jaeckel
5eb9743410
rsa_verify_hash: fix possible bleichenbacher signature attack
2014-08-28 13:30:26 +02:00
Steffen Jaeckel
c6dfef95eb
testprof/rsa_test: add testcase for bleichenbacher signature attack
2014-08-28 13:30:26 +02:00
Steffen Jaeckel
dc0c6ed9d9
regen rsa-testvectors
2014-08-28 13:30:26 +02:00
Steffen Jaeckel
7c10ec9dd2
add makefile for rsa-testvectors
2014-08-28 13:30:26 +02:00
Steffen Jaeckel
2c69088be8
execute only one testcase per default
2014-08-28 13:30:26 +02:00
Steffen Jaeckel
92274aafb5
add testprof/pkcs_1_eme_test
2014-08-28 13:30:26 +02:00
Steffen Jaeckel
c24e2a1e6b
fix pkcs1v15crypt-vectors.txt
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
b51824748a
rt.py: extend for PKCS#1 v1.5 EME
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
7302a7cfcb
add testprof/pkcs_1_emsa_test
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
25fcd4c70f
rt.py: add possibility to parse PKCS#1 v1.5 EMSA testvectors
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
95f9d527f6
rt.py: start making even more generic, fixed naming of p and q
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
c99a147d4a
add testprof/pkcs_1_oaep_test
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
ed0982b7e7
add oaep testvectors
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
b0c7cbfaae
improve testprof/pkcs_1_pss_test
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
60b9c5a6f1
make pkcs1 test more generic
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
faa9c6a607
add missing unregister of no_prng
2014-08-28 13:30:25 +02:00
Jonathan Herzog
3324da2601
Fixed small padding error in the PKCS#1 PSS code.
...
The existing LTC code for padding meassages for PSS signatures
contained a small error. In particular, the PSS-passing algorithms is
supposed to be given (bitlength of key - 1) as an argument. The LTC
code passes (bitlength of key), and subtracts 1 in the middle of the
PSS-padding. This subtraction unfortunately comes too late: a
calculation using that argument has already been made. Fortunately,
this bug only appeared if the bit-length of the key was 1 mod 8, and
so is unlikely to show up in practice. Still, this patch fixes the
problem.
Conflicts:
src/pk/pkcs1/pkcs_1_pss_decode.c
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
fe1b6eced7
add testprof/pkcs_1_pss_test
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
b570175b47
add testprof/no_prng
...
a PRNG that is no PRNG as its output is predefined and can be set
by calling add_entropy()
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
4a819b2f1b
add generated file pss-vect.c
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
269516533c
rt.py: add name of testcase in struct
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
055c515161
fix pss-vect.txt
2014-08-28 13:30:25 +02:00
Steffen Jaeckel
6dfe0013e1
rt.py: initial version
2014-08-28 13:30:24 +02:00
Steffen Jaeckel
b2317279b8
add original RSA testvector files
2014-08-28 13:30:24 +02:00
Steffen Jaeckel
394806cab1
tests: use correct format string parameter for 64bit values on windows
2014-08-28 13:27:52 +02:00
Steffen Jaeckel
14272976d0
add release flag to makefile.shared
2014-08-27 18:20:47 +02:00
Steffen Jaeckel
47b8ccc07c
fix hash ID's of ripemd 256 & 320
2014-08-26 17:42:10 +02:00
Steffen Jaeckel
473b0319ad
re-enable "unused-parameters" warning
2014-08-24 18:25:24 +02:00
Steffen Jaeckel
01c34dc236
trim trailing spaces
2014-08-24 18:25:24 +02:00
Steffen Jaeckel
1fb649d394
chc: don't execute tests if LTC_TEST is not defined
2014-08-07 01:36:03 +02:00
Steffen Jaeckel
f8449f55d9
trim trailing spaces
2014-08-07 01:36:03 +02:00
Jonathan Herzog
ff736a61bb
Hash functions now check for input-length overflow.
...
Because many of the hash-functions implemented by LTC use the length
of the input when padding the input out to a block-length, LTC keeps
track of the input length in a 64-bit integer. However, it did not
previously test for overflow of this value. Since many of the
hash-functions implemented by LTC are defined for inputs of length
2^128 bits or more, this means that LTC was incorrectly implementing
these hash functions for extremely long inputs. Also, this might have
been a minor security problem: A clever attacker might have been able
to take a message with a known hash and find another message (longer
by 2^64 bits) that would be hashed to the same value by LTC.
Fortunately, LTC uses a pre-processor macro to make the actual code
for hashing, and so this problem could be fixed by adding an
overflow-check to that macro.
2014-08-06 19:06:00 +02:00
Steffen Jaeckel
757ac982a5
if selected, always make targets 'test' and 'testprof/$(LIBTEST)'
2014-08-06 15:16:37 +02:00
Steffen Jaeckel
09a0de69a0
update makefile.mingw
2014-08-06 15:16:30 +02:00
Steffen Jaeckel
98e05b10a0
trim trailing spaces in mingw makefiles
2014-08-06 15:11:45 +02:00
Steffen Jaeckel
a8598b0faf
fix unregister_prng() where always the first prng would have been removed
2014-08-05 17:47:50 +02:00
Steffen Jaeckel
3cda802deb
fixed ecc_test.c
...
luckily gcc 4.6 of travis CI complained!
shame on you gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1)
2014-07-17 12:10:05 +02:00
Steffen Jaeckel
48bd6702aa
uncomment argchk in camellia_setup()
2014-07-17 11:32:52 +02:00
Steffen Jaeckel
155a54ba40
add LTC prefix to most macros
2014-07-17 10:50:36 +02:00
Steffen Jaeckel
3c76dcdd29
fix compiler warning when enabling LTC_GCM_TABLES_SSE2
2014-07-17 10:50:35 +02:00
Steffen Jaeckel
1a61b42775
update output; remove unused define
2014-07-16 15:11:14 +02:00
Steffen Jaeckel
97256daeed
remove surplus ';'
2014-07-15 20:26:40 +02:00
Steffen Jaeckel
f8c536a349
add CC tag when linking
2014-07-15 20:25:32 +02:00
Steffen Jaeckel
9af6d311ec
Merge branch 'buggywhip/dynHlp2' into develop
...
This closes #41
2014-07-15 15:51:43 +02:00
Steffen Jaeckel
7189998ba1
update gitignore
2014-07-15 15:45:39 +02:00
Steffen Jaeckel
5fa34ad171
update makefiles
2014-07-15 15:45:33 +02:00
Steffen Jaeckel
542ba9995c
update math inititializers
...
make math initializer functions dependant on the xxx_DESC macro instead
of the USE_xxx macro, which is only relevant when building tests etc.
2014-07-15 15:38:18 +02:00
Steffen Jaeckel
746fd583c9
update demos according to changed naming
2014-07-15 15:28:29 +02:00
Steffen Jaeckel
fc7eeac218
update/rework constants and sizes
2014-07-15 15:27:31 +02:00
Steffen Jaeckel
fd7b3cd875
use snprintf() instead of sprintf()
2014-07-15 14:09:50 +02:00
Steffen Jaeckel
e628fb9203
clean up/trim trailing spaces
2014-07-15 13:58:48 +02:00
Larry Bugbee
a6b6884982
minor editorial changes
2014-07-14 15:47:20 +02:00
Larry Bugbee
46b6e36ea6
to know if LTC compiled big/little endian, 32/64-bit word
2014-07-14 15:47:20 +02:00
Larry Bugbee
f07234fd93
removed redundant include
2014-07-14 15:47:20 +02:00
Larry Bugbee
ef1fe79ca5
added missing signatures
2014-07-14 15:47:20 +02:00
Larry Bugbee
a543e0caa6
changed to keep it simple
2014-07-14 15:47:20 +02:00
Larry Bugbee
3f9144c9a7
added signatures to header file
2014-07-14 15:47:20 +02:00
Larry Bugbee
d99b970a8b
added a Python demo
2014-07-14 15:47:20 +02:00
Larry Bugbee
1b29ce896f
include compiler defines and other minor refinements
2014-07-14 15:47:20 +02:00
Steffen Jaeckel
fd140d4535
clean up makefile
2014-07-14 15:42:32 +02:00
Steffen Jaeckel
4089cc963c
update shared makefiles
...
split up install target in "install" and "install_test" as in
standard makefile
use libtool to compile and link
clean up and bring in sync with standard makefile targets
2014-07-14 15:35:04 +02:00
Steffen Jaeckel
a0d0a17acf
update gitignore
2014-07-14 15:35:04 +02:00
Steffen Jaeckel
9e2e7fdfd4
tests: bring back mult and sqr timing
2014-07-12 17:31:03 +02:00
Steffen Jaeckel
3c6a80525f
current icc defines the same macros and functionset as gcc
...
as a result the special detection of icc has been removed
2014-07-12 17:28:54 +02:00
Steffen Jaeckel
6dfb080810
spit errors if 32- AND 64-bit wordsize is defined
2014-07-12 17:26:30 +02:00
Steffen Jaeckel
1f96647d70
update icc makefiles to current compiler versions
...
As the current icc can act as a gcc drop-in, I took over all compile flags
from the standard makefile.
The "-x?" options have been deprecated, so they're updated.
The "-xP" has been removed, since it makes no sense in my eyes to define
the optimization for a specific architecture in the makefile.
2014-07-12 17:25:12 +02:00
Steffen Jaeckel
098bc9f06d
tests: use the gcc rdtsc() implementation also for intel cc
2014-07-12 16:46:36 +02:00
Steffen Jaeckel
8c488289f0
improve some error and informational output
2014-07-12 16:44:28 +02:00
Steffen Jaeckel
79bc7ef2e5
testprof: add missing object files to makefiles
2014-07-12 16:19:08 +02:00
Steffen Jaeckel
6ac2d6141d
update clean target of makefile and testprof/makefile
2014-07-12 16:18:29 +02:00
Steffen Jaeckel
98893c077b
fix possible free of not yet allocated key parameters
...
There would have been a call to mp_clear_multi() of all the key parameters
that are not yet allocated, in the case where the calculations of p, q,
tmp1 or tmp2 created an error.
This also includes a proposed improvement from the OLPC project to free
elements in the reverse order as they were allocated.
2014-07-11 16:44:43 +02:00
Steffen Jaeckel
30278d1121
fix possible missing free of rnd and rndi
...
There could have been a 'goto error', which misses the free of rnd and
rndi even if they were initialized.
This could happen in cases where a private key operation was done and
afterwards one of the operations like reading back or conversion, would
have failed (which is likely not to happen)
This also includes a proposed improvement from the OLPC project to free
elements in the reverse order as they were allocated.
2014-06-15 11:51:38 +02:00
Steffen Jaeckel
48f521688f
ltc_init_multi: fix missing call to va_end()
2014-05-25 00:35:03 +02:00
Steffen Jaeckel
8652f33f35
pmac_init: prevent possible out of bounds access of polys[]
2014-05-25 00:35:03 +02:00
Steffen Jaeckel
ea9b2a858a
der_encode_utf8_string: calm coverity
2014-05-25 00:35:03 +02:00
Steffen Jaeckel
4c8949e449
aes: calm coverity
2014-05-25 00:35:03 +02:00
Steffen Jaeckel
50d10790e3
trim trailing spaces
2014-05-25 00:35:03 +02:00
Steffen Jaeckel
f9984d1e24
add coverity badge
2014-05-25 00:35:03 +02:00
Steffen Jaeckel
389bbf0d05
update gitignore
2014-05-25 00:35:03 +02:00
Steffen Jaeckel
2de05c4d3e
add coverity build and upload script
2014-05-25 00:35:03 +02:00
Steffen Jaeckel
681e5fcdfc
Merge branch 'fix/dsa' into develop
2014-05-11 18:10:03 +02:00
Steffen Jaeckel
03385a4419
rand_bn: fix call to zeromem()
2014-05-09 23:29:11 +02:00
Steffen Jaeckel
ca42862d52
math descriptor: add parameter "b" to isprime()
2014-05-09 23:07:41 +02:00
Steffen Jaeckel
5d2fe0da8c
trim trailing spaces
2014-05-09 23:07:41 +02:00
Steffen Jaeckel
dc31ca545f
dsa_make_key: fix free of wrong pointer resulting in double-free
2014-05-09 23:07:40 +02:00
Steffen Jaeckel
198ad7ef50
update makefiles
2014-05-09 23:07:33 +02:00
Steffen Jaeckel
c9f93f6571
dsa_make_key: remove surplus semicolon
2014-05-09 22:43:29 +02:00
Karel Miko
e9a0a27917
DSA params+key generation according FIPS-186-4 (part 1)
2014-05-09 17:58:50 +02:00
Karel Miko
77b4b16030
dsa_make_key minor isuue
2014-05-09 17:58:50 +02:00
Karel Miko
a43bb0fda6
dsa_encrypt_key small correction
2014-05-09 17:58:50 +02:00
Karel Miko
655336f0cb
tuning RSA interoperability + small fixes
2014-05-09 17:58:50 +02:00
Karel Miko
67a547086c
DSA sign improvement
2014-05-09 17:58:50 +02:00
Karel Miko
3908c70d68
tuning DSA key generation
2014-05-09 17:58:50 +02:00
Karel Miko
e271b9fdbe
ECC key pair generation according to FIPS-186-4
2014-05-09 17:58:39 +02:00
Karel Miko
e600ab9d35
dsa_sign_hash: testing k < q
2014-05-09 16:26:24 +02:00
Karel Miko
72022edb8d
dsa_make_key: improved testing x < q
2014-05-09 16:26:24 +02:00
Steffen Jaeckel
24d03dd823
testme.sh: add test runs without "timing resistance"
2014-05-08 15:11:38 +02:00
Steffen Jaeckel
e723d1289f
travis.yml: add test runs without "timing resistance"
2014-05-08 15:10:09 +02:00
Steffen Jaeckel
3b97738ee9
travis.yml: rewrite to be better human-readable; trim trailing spaces
2014-05-08 15:08:31 +02:00
Steffen Jaeckel
c63c0433c1
enable timing resistant ECC calculations by default
2014-05-08 15:06:42 +02:00
Steffen Jaeckel
26743d0749
ecc_mulmod_timing: fix compiler warnings
2014-05-08 13:06:24 +02:00
Steffen Jaeckel
5707e319c2
Merge branch 'feature/coverage' into develop
2014-05-08 12:57:31 +02:00
Steffen Jaeckel
3dcf2df988
coverage: exclude some folders
2014-05-07 17:36:50 +02:00
Steffen Jaeckel
a59e5548ec
tests: unregister ciphers etc. at exit, call error_to_string()
2014-05-07 17:36:09 +02:00
Steffen Jaeckel
2b04f3d8ed
Readme: display the coverage status
...
[skip ci]
2014-05-07 17:03:12 +02:00
Steffen Jaeckel
1a44e2d22d
send coverage results to coveralls
2014-05-07 16:16:08 +02:00
Steffen Jaeckel
f9a1041222
printinfo: display version of correct compiler if CC does not point to gcc
...
[skip ci]
2014-05-07 16:15:50 +02:00
Steffen Jaeckel
be5418368c
Merge branch 'fix/anubis' into develop
2014-05-01 23:02:40 +02:00
Steffen Jaeckel
bbf278c779
anubis: fix left-shift
...
this has been brought up in #26
2014-05-01 23:02:21 +02:00
Steffen Jaeckel
ca1a1d18ab
anubis: trim trailing spaces
2014-05-01 23:02:21 +02:00
Steffen Jaeckel
d2318d6c24
travis.yml: fix typo
2014-05-01 23:02:05 +02:00
Steffen Jaeckel
a06e40aa17
only run tests when build was without warnings
2014-05-01 18:13:21 +02:00
Steffen Jaeckel
4929e4e989
fix warnings in tests
2014-05-01 18:01:13 +02:00
Steffen Jaeckel
c211ce7f66
omac: fix accidentally reverted patch
...
introduced in 6816ac3f3f
reverted in 8e7777b554
2014-05-01 15:44:09 +02:00
Steffen Jaeckel
aa72cfe1d9
ccm: clarify pt and ct parameters in doc and API description
...
this fixes #42
[skip ci]
2014-04-30 20:19:11 +02:00
mudzot
3b7c6512ac
Add #ifdef to make it easier to embed libtomcrypt with LTC_NOTHING
...
Restore LTC_NO_MATH and make rand_prime.c depend on LTC_NO_MATH & LTC_NO_PRNGS
2014-04-30 01:13:51 +02:00
Steffen Jaeckel
b895f13484
minor changes/clean-up sources
2014-04-30 01:10:22 +02:00
Steffen Jaeckel
b10c03aead
flush content of CVS/SVN tags
2014-04-29 21:13:49 +02:00
Steffen Jaeckel
8a2bd89518
don't use assembler rotate when compiling for windows 64bit
2014-04-29 19:15:28 +02:00
karel-m
8afdb8831d
ifdefs related to 64bit MS Windows build
...
Conflicts:
src/headers/tomcrypt_cfg.h
src/prngs/rng_get_bytes.c
2014-04-29 19:15:28 +02:00
karel-m
232f412709
makefiles for MS Windows gcc compiler
2014-04-29 18:25:15 +02:00
Karel Miko
0bda0770d9
fix for ASM failures on freebsd/netbsd
2014-04-29 17:32:14 +02:00
Steffen Jaeckel
e08480f621
update documentation according to new 3des mode
2014-04-28 21:08:56 +02:00
Steffen Jaeckel
f4d7baaacc
Merge pull request #43 from pghmcfc/develop
...
Add support for two-key Triple-DES
2014-04-28 21:05:26 +02:00
Paul Howarth
445dfa67a6
des.c: Add support for two-key Triple-DES
...
Add two-key 3DES support, needed by pycrypto.
This commit is based on the one for the bundled libtomcrypt 1.16
code in pycrypto:
65085f16
2014-04-15 11:25:18 +01:00
Steffen Jaeckel
449d5e718d
gitignore: add files that are generated while profiling
2014-04-04 01:03:58 +02:00
Steffen Jaeckel
ae5cc35298
surround most macros with "do{}while(0)"
2014-04-04 01:03:54 +02:00
Steffen Jaeckel
2849087906
Merge branch 'feature/rmCincludes' into develop
2014-04-04 00:54:14 +02:00
Steffen Jaeckel
1ce4e766ff
update makefiles
2014-04-04 00:38:10 +02:00
Steffen Jaeckel
a15ea906c1
genlist.sh: update
2014-04-04 00:38:09 +02:00
Steffen Jaeckel
2bdebb3932
dh: remove including of c-files
2014-04-04 00:38:08 +02:00
Steffen Jaeckel
71ccad06bd
dh: remove unused variables
2014-04-04 00:38:07 +02:00
Steffen Jaeckel
f3cdac05ec
sha2: remove including of c-files
2014-04-04 00:38:06 +02:00
Steffen Jaeckel
cbd59421bd
protect all tables by an ifdef; adjust safer to the same concept
2014-04-04 00:38:05 +02:00
Steffen Jaeckel
5d8091b6cf
Merge branch 'fix/strict-aliasing' into develop
2014-04-04 00:36:07 +02:00
Steffen Jaeckel
ffeb70b48a
fix typedef of LTC_FAST_TYPE on x86_64
2014-04-03 22:22:01 +02:00
Steffen Jaeckel
68bfdd0fac
move mac_test() before modes_test()
...
since lrw uses gcm it makes sense to fail already at gcm
2014-04-03 15:08:17 +02:00
Steffen Jaeckel
53f04b8e6b
only use ulong32 or ulong64 in the macros
2014-04-03 15:06:56 +02:00
Steffen Jaeckel
1f7cf9dc0b
move typedefs from tomcrypt_macros.h to tomcrypt_cfg.h
2014-04-03 15:05:56 +02:00
Steffen Jaeckel
e027dda26f
travis: add "after_failure" section
2014-03-12 10:53:23 +02:00
Steffen Jaeckel
561fe83532
fix strict-aliasing compiler warnings
2014-03-04 21:59:16 +01:00
Steffen Jaeckel
0aee5f3217
fix wrong spelled macros
2014-03-04 21:50:18 +01:00
Steffen Jaeckel
84298440f4
trim trailing spaces
2014-03-04 21:50:17 +01:00
Steffen Jaeckel
621a75ab28
base64: add and most important - execute tests
2014-03-04 21:50:16 +01:00
Steffen Jaeckel
1d52f3b49b
tomcrypt_custom.h: move dependency checks together
2014-03-04 18:09:12 +01:00
Steffen Jaeckel
ec73cfa257
Merge branch 'stapelberg/respect-ldflags' into develop
2014-02-25 10:47:20 +01:00
Michael Stapelberg
ed2743d524
makefile.shared: respect LDFLAGS when linking
2014-02-25 10:47:05 +01:00
Steffen Jaeckel
6b7e79e1ee
Merge branch 'stapelberg/pkgconfig' into develop
2014-02-25 10:46:40 +01:00
Michael Stapelberg
90928d6dfd
pkgconfig: set libdir= to $LIBPATH (for multi-arch)
2014-02-25 10:45:20 +01:00
Michael Stapelberg
30022b114c
add and install pkgconfig file for the shared library
2014-02-25 10:45:19 +01:00
Steffen Jaeckel
4dfd24d434
Merge branch 'stapelberg/fix-spelling' into develop
2014-02-25 10:44:28 +01:00
Michael Stapelberg
8d7e3d8216
fix typo: s/Endianess/Endianness/
2014-02-25 10:38:29 +01:00
Steffen Jaeckel
722c128051
Merge branch 'feature/travis' into develop
2014-02-25 10:32:10 +01:00
Steffen Jaeckel
e97d921c8d
travis: print version information in build scripts
2014-02-25 10:31:13 +01:00
Steffen Jaeckel
c5b57cfee4
travis: use build matrix instead of testme script
2014-02-25 10:09:59 +01:00
Steffen Jaeckel
feaa31968e
travis: add IRC notifications
2014-02-25 10:09:58 +01:00
Steffen Jaeckel
65fd19c1fb
dh: fix renamed macro
2014-02-25 10:09:35 +01:00
Steffen Jaeckel
77cca4175f
ccm_memory_ex: disable until documented and fixed
2014-02-18 16:07:24 +01:00
Steffen Jaeckel
8b24397f84
update makefiles
2014-02-18 15:23:23 +01:00
Steffen Jaeckel
8e02874031
Merge branch 'stapelberg/deterministic-latex' into develop
2014-02-16 18:55:29 +01:00
Steffen Jaeckel
460bcfe31b
remove crypt.lof from the repository
2014-02-16 18:55:28 +01:00
Steffen Jaeckel
a3811e2000
add -b flag to sed that enables binary processing (required on windows)
2014-02-16 18:55:27 +01:00
Michael Stapelberg
4ab63ccd3a
deterministically build crypt.pdf
...
This entails:
• Using pdflatex to influence the modification/creation timestamp in
the resulting PDF
• Replacing the unique ID with 0/0
• Using the timestamp from crypt.tex instead of the current date/time
See also http://superuser.com/a/130804
This change is necessary because for Multi-Arch Debian packages,
non-arch-dependent files need to have the same checksum, which is not
guaranteed without this commit. See http://bugs.debian.org/734109
2014-02-16 18:55:25 +01:00
Steffen Jaeckel
ed9940175d
hmac test: add some more tests from RFC's
2014-02-16 18:55:24 +01:00
Steffen Jaeckel
ddb26a4276
hmac test: remove comments, prepare for extension
2014-02-16 18:41:33 +01:00
Steffen Jaeckel
2adca46735
pkcs#5: add tests for 'algo 2'
2014-02-16 18:41:33 +01:00
Steffen Jaeckel
e48838559b
der_encode_setof: fix compiler warning when compiling for windows 64bit
2014-02-16 18:41:32 +01:00
Karel Miko
45dcbc654d
fixing broken camellia
2014-02-16 18:41:31 +01:00
Steffen Jaeckel
d2c1329f77
camellia: add new testvector
2014-02-16 18:41:30 +01:00
karel-m
f3789b31b6
fixing warnings when compiling camellia.c with 64bit MS compiler
2014-02-16 18:41:30 +01:00
Steffen Jaeckel
3da9adc366
aes: remove compiler warning when compiled with ENCRYPT_ONLY
2014-02-16 18:41:29 +01:00
Steffen Jaeckel
8e7777b554
trim trailing spaces/clean up
2014-02-16 18:41:28 +01:00
Steffen Jaeckel
d78aa37c10
base64: add define LTC_BASE64_URL, make _internal functions static
2013-11-24 22:11:44 +01:00
Karel Miko
947fe41bbb
Add URL safe base64 de-/encoding
2013-10-27 21:49:26 +02:00
Steffen Jaeckel
4f86ad7dcf
hkdf: don't compile if not requested
2013-10-15 10:17:53 +02:00
Steffen Jaeckel
b1b15910ed
fix rng_get_bytes() when compiling with mingw-gcc
2013-10-15 10:17:17 +02:00
Steffen Jaeckel
5fd9b5057d
Merge branch 'feature/rsaGetSizes' into develop
2013-10-14 14:18:54 +02:00
Steffen Jaeckel
bf1ccb629b
fix rsa_sign_saltlen_get_max_ex()
2013-10-14 14:16:44 +02:00
Steffen Jaeckel
25f4817d48
update makefiles
2013-10-14 14:16:43 +02:00
Steffen Jaeckel
aacfec441e
add rsa_sign_saltlen_get_max_ex()
2013-10-14 14:16:42 +02:00
Steffen Jaeckel
73c201da1f
add rsa_get_size()
2013-10-14 14:16:41 +02:00
Steffen Jaeckel
fb65cd0772
fix clang compiler warnings
2013-10-02 01:03:40 +02:00
Steffen Jaeckel
a667a93d52
trim trailing spaces
2013-10-02 01:02:58 +02:00
Steffen Jaeckel
3eae4b42fb
makefile: allow CC to be replaced
...
this allows building with clang by doing:
CC=clang PREFIX=llvm- make
2013-10-01 23:08:30 +02:00
Steffen Jaeckel
61a3206f06
clean-up makefiles
2013-09-03 14:27:32 +02:00
Steffen Jaeckel
ab07d6a283
updatemakes.sh: trim trailing spaces
2013-09-03 14:25:50 +02:00
Steffen Jaeckel
c02097e74b
Readme: fix link to travis-ci
2013-08-14 16:58:14 +02:00
Steffen Jaeckel
031e551c57
tomcrypt_custom.h: improve and clean-up
...
Add the possibility to define LTC_NOTHING that disables everything
Remove LTC_NO_MATH as it didn't do anything at all
Enable RSA blinding by default
2013-08-14 16:12:56 +02:00
Steffen Jaeckel
10511d329c
update makefiles
2013-08-14 15:56:10 +02:00
Steffen Jaeckel
c0b8774cc1
move hkdf to misc
2013-08-14 15:47:07 +02:00
Steffen Jaeckel
d0a83df7f8
update makefile to be able to define a target platform prefix
2013-08-06 13:52:26 +02:00
Steffen Jaeckel
e5e8cc2e50
Update README.md
...
add Build status
2013-05-29 14:30:47 +03:00
Steffen Jaeckel
50ad0b8639
fix makefiles
2013-05-29 12:58:15 +02:00
Steffen Jaeckel
be96ed3ba9
add travis-ci configuration
2013-05-29 12:52:00 +02:00
Steffen Jaeckel
1748cc616b
der_tests: trim trailing spaces
2013-04-18 11:22:25 +02:00
Steffen Jaeckel
9cb6c6b910
Merge branch 'fix/xtea' into develop
2013-03-22 16:08:31 +02:00
Steffen Jaeckel
d2e7b0c38f
fixed 'golden' XTEA testvectors that are used when running testme.sh
2013-03-22 15:15:07 +02:00
Steffen Jaeckel
9e88fcb9b1
remove unused variable in demos/encrypt.c
2013-03-22 15:15:06 +02:00
Steffen Jaeckel
bfcf1eb200
trim trailing spaces in header files
2013-03-22 15:15:05 +02:00
Steffen Jaeckel
2526d5df8f
xtea: use correct load and store macros
2013-03-22 15:15:04 +02:00
Steffen Jaeckel
0f0b182610
xtea: add new testvectors
2013-03-22 15:15:04 +02:00
Steffen Jaeckel
1050ecea4a
demos/encrypt.c: add possibility to use parameter -t for testing a cipher
2013-03-22 15:15:03 +02:00
Steffen Jaeckel
fa7051c21e
xtea: trim trailing spaces
2013-03-22 15:15:02 +02:00
Steffen Jaeckel
e531af7add
ecc: fix compiler warnings
2013-03-22 15:14:44 +02:00
Steffen Jaeckel
14b3a5290e
include stddef.h per default
2013-03-22 15:14:44 +02:00
Steffen Jaeckel
9203472789
dsa: fix compiler warning
2013-03-22 15:14:43 +02:00
Steffen Jaeckel
2addbcf315
noekeon: fix compiler warning
2013-03-22 15:14:42 +02:00
Steffen Jaeckel
57ea144874
README: add section 'Branches'
2013-03-20 17:47:23 +01:00
Steffen Jaeckel
ee4a9477ec
update gitignore
2013-03-20 18:34:16 +02:00
Steffen Jaeckel
f107e6e465
demos: trim trailing spaces
2013-03-20 18:34:00 +02:00
Steffen Jaeckel
5d0eadcd42
Merge branch 'feature/OCBv3' into develop
2013-03-20 18:32:38 +02:00
Steffen Jaeckel
6b5b35e6cc
ocb3: don't zero ocb3 context in ocb3_{de,en}crypt_last
2013-03-20 18:10:51 +02:00
Steffen Jaeckel
05b050b943
update makefiles
2013-03-15 17:46:58 +02:00
Steffen Jaeckel
faaa17aec2
add OCBv3 testvectors
2013-03-15 17:46:45 +02:00
Karel Miko
c5c067fd12
ocb_init fix (preventing index overflow)
2013-03-15 13:30:40 +02:00
Karel Miko
9c2193b722
ocb3_init fix (preventing index overflow)
2013-03-15 13:30:39 +02:00
karel-m
abab7089a3
OCBv3 according http://tools.ietf.org/html/draft-krovetz-ocb-03
2013-03-15 13:30:29 +02:00
Larry Bugbee
8e22b17a8e
fix define LTC_YARROW_AES
2013-03-15 12:24:00 +02:00
Steffen Jaeckel
7efe74427b
update gitignore
2013-03-15 12:23:59 +02:00
Steffen Jaeckel
d540496db1
Merge branch 'feature/hkdf' into develop
2013-03-15 11:17:16 +01:00
RyanC
fe18c95e76
add the rest of the hkdf test cases
2013-03-15 11:16:17 +01:00
RyanC
11f50bfb3c
fix hkdf_expand arguments
2013-03-15 11:16:17 +01:00
Steffen Jaeckel
1c779b88f1
moar debug output
2013-03-15 11:16:17 +01:00
Steffen Jaeckel
8fcd408a98
fixed latex compile errors
2013-03-15 11:16:17 +01:00
Steffen Jaeckel
e81ac102bd
add misc_test()
2013-03-15 11:16:17 +01:00
Steffen Jaeckel
c1243feef2
hkdf: improve argument validation
2013-03-15 11:16:16 +01:00
Steffen Jaeckel
13c42a00f6
hkdf: fix compiler warning
2013-03-15 11:16:16 +01:00
Steffen Jaeckel
abeddd6c4b
add hkdf_test()
2013-03-15 11:16:16 +01:00
RyanC
d7a1480f9e
docs for HKDF
2013-03-15 11:16:16 +01:00
RyanC
c98857a47e
add hkdf impl
2013-03-15 11:16:16 +01:00
Steffen Jaeckel
d84af284a3
build/testme: remove -j4 parameter
2013-03-15 11:08:54 +01:00
Steffen Jaeckel
2b2f5de743
rename README
2013-02-13 11:42:19 +01:00
Steffen Jaeckel
8a53674b18
updated README
2013-02-13 11:38:25 +01:00
Steffen Jaeckel
eb9bad79bf
udpate testme to display correct version when run out of repository
2013-02-13 11:33:39 +01:00
Steffen Jaeckel
dda83c9da1
Merge branch 'ccbrown/master' into develop
2013-02-13 10:05:02 +01:00
Christopher Brown
9953c69455
update makefiles
2013-02-13 10:01:21 +01:00
Christopher Brown
2cb8c44113
der fixes and additions
2013-02-13 10:01:20 +01:00
Steffen Jaeckel
7050bdb7c8
use corrected version of zeromem() from @dtrebbien
2012-11-23 00:53:54 +01:00
Steffen Jaeckel
f32e52d5ac
mark scripts as executable
2012-11-23 00:49:26 +01:00
Steffen Jaeckel
21ddcf3568
fix multi2 as proposed by kmx
2012-11-18 18:44:14 +01:00
Steffen Jaeckel
8cda684a0e
improved multi2_test()
2012-11-18 18:41:46 +01:00
Steffen Jaeckel
bb8bd034f5
Merge branch 'ppelleti/ltc-fix-noekeon-gmp' into develop
2012-11-18 15:24:52 +01:00
Patrick Pelletier
5b662d6ed8
Fix some small typos in documentation
2012-11-18 15:24:15 +01:00
Patrick Pelletier
80ef95f3c1
Checked in program which generates Noekeon vectors using BouncyCastle.
2012-11-18 15:24:15 +01:00
Patrick Pelletier
e7b4705fca
corrected Noekeon vectors
2012-11-18 15:24:14 +01:00
Patrick Pelletier
0e143a5cfe
EAX-noekeon vectors from BouncyCastle
2012-11-18 15:24:14 +01:00
Patrick Pelletier
6dc089015a
Fix LTC's bug in PI1/PI2 of Noekeon. Add vectors from BouncyCastle.
2012-11-18 15:24:13 +01:00
Patrick Pelletier
5708adb6c1
Add Camellia to the test vectors.
2012-11-18 15:24:12 +01:00
Patrick Pelletier
65254f65bf
Fix camellia_keysize() to not change the keysize if it is correct.
...
It was rounding 32 down to 24, 24 down to 16, and claiming 16 was invalid.
2012-11-18 15:24:12 +01:00
Patrick Pelletier
e3acd4cabe
Make GMP use uppercase to match LibTomMath.
2012-11-18 15:24:11 +01:00
Patrick Pelletier
3fbccfcb5c
support base 64 for GMP
2012-11-18 15:24:11 +01:00
Steffen Jaeckel
20f0c74d17
Merge branch 'ppelleti/ltc-fixes' into develop
2012-11-18 15:21:51 +01:00
Patrick Pelletier
382c9d4d85
Some fixes necessary to support the Clang compiler
...
First of all, it had a failure in SEED:
LTC_KSEED failed for x=0, I got:
expected actual (ciphertext)
5e == 5e
ba == ba
c6 == c6
e0 == e0
05 != 00
4e != 00
16 != 00
68 != 00
19 == 19
af == af
f1 == f1
cc == cc
6d != 00
34 != 00
6c != 00
db != 00
Since SEED uses the 32H macros, this is really analogous to the
problem I saw with the 64H macros in Camellia with gcc. Not sure why
gcc only had a problem with 64H and not 32H, but since this is an
interaction with the optimizer, it's not going to happen every time
the macro is used (hence why the store tests pass; only when you get
into the complexity of a real cipher do you start having problems) and
it makes sense it will vary from compiler to compiler.
Anyway, I went ahead and added the ability to use __builtin_bswap32,
in addition to __builtin_bswap64, which I already did in a previous
commit. This solves the problem for clang, although I had to add new
logic to detect the bswap builtins in clang, since it has a different
way to detect them than gcc (see the comments in the code). The
detection logic was complicated enough, and applied to both the 32H
and 64H macros, so I factored out the detection logic into
tomcrypt_cfg.h.
2012-11-18 15:20:12 +01:00
Patrick Pelletier
ad566e1b00
Use __builtin_bswap64 if it is available
...
This produces slightly better performance than the inline assembly,
and has the added benefit that it should be portable to other systems
that use gcc, not just x86-64.
Here are the results on my "AMD Athlon(tm) 7450 Dual-Core Processor"
with "gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3":
with portable 64H macros:
camellia : Schedule at 1659
camellia [ 23]: Encrypt at 431, Decrypt at 434
whirlpool : Process at 55
with inline assembly (with "memory clobber" for correctness):
camellia : Schedule at 1380
camellia [ 23]: Encrypt at 406, Decrypt at 403
whirlpool : Process at 50
with __builtin_bswap64:
camellia : Schedule at 1352
camellia [ 23]: Encrypt at 396, Decrypt at 391
whirlpool : Process at 46
2012-11-18 15:20:12 +01:00
Patrick Pelletier
cefff85550
Add "memory" as a clobber for bswap inline assembly.
...
This had been causing Camellia (the only cipher that uses these
macros) to fail when compiling "out-of-the-box" with gcc version
"4.3.3-5ubuntu4". I think because the compiler had no idea any memory
access was going on in these macros.
Adding "memory" as a clobber solves the problem, but is probably
overkill. I suspect that if we specify the constraint for y
differently, we could get rid of both "memory" and __volatile__, which
would allow the compiler to optimize much more.
Also, in gcc versions that support it, we should probably use the
bswap builtins instead.
2012-11-18 15:20:11 +01:00
Patrick Pelletier
ee7c031ddf
Added some code (commented out) to print details about Camellia test failure
...
(and ditto for SEED)
This is modeled after similar commented-out code in sober128_test(),
but slightly fancier.
2012-11-18 15:20:10 +01:00
Patrick Pelletier
cecbbb88fc
When a test fails, print the algorithm that it failed on.
...
As near as I can tell, LibTomCrypt doesn't provide any way to tell
which cipher failed when it reports a cipher test failure. For
example, I was getting:
Algorithm failed test vectors. (5)
cipher_hash_test.c:14:cipher_descriptor[x].test()
But there's no way to tell what value x has, and even if there was, it
would take a bit of digging to determine which algorithm that
corresponds to. So, I added a variant of the DO() macro, DOX(), which
takes an additional string argument which is displayed on failure. So
now I get:
Algorithm failed test vectors. (5) - camellia
cipher_hash_test.c:14:cipher_descriptor[x].test()
2012-11-18 15:20:10 +01:00
Patrick Pelletier
9228cbbd1e
don't delete doc/crypt.pdf in "make clean"
...
"make clean" was deleting "doc/*.pdf", despite the fact that there
were two comments (one above and one below) stating that it did not.
Since doc/crypt.pdf is checked into git, running "make clean" made my
git state dirty, which seems undesirable.
I took sort of a compromise position and had "make clean" continue to
delete any other .pdf files in doc (such as refman.pdf), but
explicitly not delete crypt.pdf.
2012-11-18 15:20:09 +01:00
Patrick Pelletier
4a2b54a446
Changed "make clean" to not delete crypt.lof (which is checked into git)
...
This line:
rm -f `find . -type f | grep "[.]lo" | xargs`
was deleting crypt.lof, which seemed undesirable. One solution would
be to end the grep expression with "$", but it seemed more
straightforward just to pass "-name" to "find", rather than piping
through grep.
2012-11-18 15:20:08 +01:00
Patrick Pelletier
d61c537a2a
missing a comma
2012-11-18 15:20:08 +01:00
Patrick Pelletier
233f207c17
Use "GMP_DESC" instead of "GPM_DESC"
...
This seemed to be the only place in the code that was using this
particular transposition. And, indeed, when compiling with
"GMP_DESC", it looks like it is necessary to disable Diffie-Hellman.
(Otherwise, the test fails for me.)
2012-11-18 15:20:07 +01:00
Steffen Jaeckel
bd7933cc2b
add check for defines of math provider
2012-10-08 10:20:21 +02:00
Steffen Jaeckel
77860ba866
yarrow: prevent access to NULL pointer
2012-05-04 01:01:24 +02:00
Steffen Jaeckel
9c4fc762fc
yarrow: trim trailing spaces
2012-05-04 01:00:25 +02:00
Steffen Jaeckel
2cd666f284
rsa_import: prevent double-free
2012-04-24 18:08:13 +02:00
Steffen Jaeckel
5c9fa403ff
Merge pull request #3 from gpakosz/patch-1
...
replaced free(in) by XFREE(in) at line 56
2011-07-12 06:01:19 -07:00
Gregory Pakosz
1346ccdee8
replaced free(in) by XFREE(in) at line 56
2011-07-12 05:56:48 -07:00
Steffen Jaeckel
8859f6e73d
fixed wrong return value interpretation of register_crypt/hash/prng function calls
2011-06-14 20:56:42 +02:00
Steffen Jaeckel
2b0ce25778
testme.sh: added parameter checking
2011-05-20 09:41:57 +02:00
Steffen Jaeckel
5ec1e53e02
updated gitignore
2011-03-21 22:59:59 +01:00
Steffen Jaeckel
8dc8a2d551
Added define LTC_RSA_BLINDING to be able to disable rsa blinding
2011-03-21 22:50:49 +01:00
Steffen Jaeckel
380693edd9
fixed error causing segmentation fault
2011-03-21 21:17:59 +01:00
Steffen Jaeckel
496453f289
removed testing of "stripped" rsa key
2011-03-21 21:17:31 +01:00
Steffen Jaeckel
25bd5c1275
added missing handling of new type LTC_ASN1_RAW_BIT_STRING in der_encode_sequence_multi()
2011-03-21 21:12:46 +01:00
Steffen Jaeckel
43c6b5ab89
make build.sh less verbose when test fails
2011-03-21 21:10:23 +01:00
Nikos Mavrogiannopoulos
fa22e791d4
RSA and DSA public keys are stored using the SubjectPublicKeyInfo format.
2011-03-21 19:24:10 +01:00
Nikos Mavrogiannopoulos
8c2850f8d9
Added RSA blinding (requires mp_rand()).
2011-03-21 08:26:41 +01:00
Nikos Mavrogiannopoulos
ed6897d90f
DSA private keys are being exported to a compatible with OpenSSL and GnuTLS format.
2011-03-21 08:26:27 +01:00
Steffen Jaeckel
2895c9d7fe
updated gitignore
2011-01-25 11:27:28 +01:00
Steffen Jaeckel
5b1c0108c9
updated gitignore and VS2008 project file
2011-01-24 10:41:30 +01:00
Steffen Jaeckel
412b2ee1fc
after multiple objections of libtom users [1], we decided to change licensing
...
to a dual licensing model.
[1] https://groups.google.com/group/libtom/browse_thread/thread/d7b67bc6410250b3
2011-01-19 10:18:15 +01:00
Steffen Jaeckel
4a8927d5c0
updated gitignore to ignore files generated when executing build.sh
2011-01-19 09:21:19 +01:00
Steffen Jaeckel
edf11c62c0
Diffie-Hellman/Math: introduced the proposed changes by Alexander Kurpiers
...
addmod and submod are moved to the end of the math descriptor, in order
to be able to run existing software against a new version of ltc without need
to rebuild the software.
2011-01-18 21:16:11 +01:00
Steffen Jaeckel
6fecec107d
rejoined diffie hellman code from ltc 1.05, thanks to Alexander Kurpiers
2011-01-18 20:06:03 +01:00
Steffen Jaeckel
5039e6520f
fixed tests and testvectors
2011-01-18 19:42:38 +01:00
Steffen Jaeckel
77e31fb6a9
Re-licensed all code under WTFPL, c.f. http://sam.zoy.org/wtfpl/
2010-10-26 16:02:34 +02:00
Steffen Jaeckel
e7ce129e9b
flushed content of CVS/SVN tags
2010-06-16 20:02:51 +02:00
Steffen Jaeckel
c3018d69d0
removed gcc compiler warnings
2010-06-16 20:02:11 +02:00
Steffen Jaeckel
59f9c00f98
removed IAR compiler warnings
2010-06-16 20:02:01 +02:00
Daniel Akesson
e960ff887c
Added project and solution files for Visual Studio 2005 and Visual Studio 2008.
2010-06-16 20:01:47 +02:00
Steffen Jaeckel
3522c754aa
changed LTC_LTC_PKCS_1_* enum members to LTC_PKCS_1_*
2010-06-16 20:01:31 +02:00
Steffen Jaeckel
0a432b6b08
adjusted file dependant functions
...
when LTC_NO_FILE is defined, the functions hash_filehandle()
and hash_file() won't be available at all instead of returning CRYPT_NOP
2010-06-16 20:00:50 +02:00
Steffen Jaeckel
6816ac3f3f
modification to suppress compiler warning when LTC_FAST is not defined
2010-06-16 19:59:39 +02:00
Steffen Jaeckel
fcd5faf947
added gitignore to suppress .o and .a files
2010-06-16 19:58:57 +02:00
Steffen Jaeckel
2f1fc7c50d
import of libtomcrypt
...
out of
lt_tree.tar.bz2
checksums of lt_tree.tar.bz2
MD5: 3c36e1ca95518f4d00a76dc9b7049952
SHA1: 4f31d1aa8cd1b9d7452b777cd52f8280dc7ebcbc
2010-06-16 19:58:20 +02:00
Tom St Denis
bbc52b9e1b
added libtomcrypt-1.17
2010-06-16 12:39:13 +02:00
Tom St Denis
e24b01d392
added libtomcrypt-1.16
2010-06-16 12:39:09 +02:00
Tom St Denis
2de2976d25
added libtomcrypt-1.15
2010-06-16 12:39:06 +02:00
Tom St Denis
479cc9c261
added libtomcrypt-1.14
2010-06-16 12:39:03 +02:00
Tom St Denis
1eed98f629
added libtomcrypt-1.13
2010-06-16 12:39:00 +02:00
Tom St Denis
2945dea3e2
added libtomcrypt-1.12
2010-06-16 12:38:57 +02:00
Tom St Denis
64d7ebe166
added libtomcrypt-1.11
2010-06-16 12:38:54 +02:00
Tom St Denis
99b6d03203
added libtomcrypt-1.10
2010-06-16 12:38:51 +02:00
Tom St Denis
a3ce807bae
added libtomcrypt-1.09
2010-06-16 12:38:49 +02:00
Tom St Denis
1eeff0bfb4
added libtomcrypt-1.08
2010-06-16 12:38:47 +02:00
Tom St Denis
4a1a5796de
added libtomcrypt-1.07
2010-06-16 12:38:44 +02:00
Tom St Denis
72412f6dac
added libtomcrypt-1.06
2010-06-16 12:38:41 +02:00
Tom St Denis
9264e34ffb
added libtomcrypt-1.05
2010-06-16 12:38:39 +02:00
Tom St Denis
9da48eb84b
added libtomcrypt-1.04
2010-06-16 12:38:36 +02:00
Tom St Denis
3964a6523a
added libtomcrypt-1.03
2010-06-16 12:38:34 +02:00
Tom St Denis
65c1317eee
added libtomcrypt-1.02
2010-06-16 12:38:32 +02:00
Tom St Denis
6ac9952498
added libtomcrypt-1.01
2010-06-16 12:38:29 +02:00
Tom St Denis
bfc2f5b078
added libtomcrypt-1.00
2010-06-16 12:38:26 +02:00
Tom St Denis
1c1822d510
added libtomcrypt-0.99
2010-06-16 12:38:24 +02:00
Tom St Denis
69f289d6dc
added libtomcrypt-0.98
2010-06-16 12:38:22 +02:00