Tobias Brunner
6cbd93838b
Add configure option to disable testing key exchange methods
...
If this is used, the functionality to set a private key/value/seed for
key exchange methods is removed (including from the interface to avoid
accidentally forgetting to wrap implementations and uses of set_seed()).
The set_seed() method is assigned outside the INIT() macro to avoid
potentially undefined behavior (preprocessing directives in macro
arguments).
The test done by the crypto tester is a simple functionality test.
2025-04-10 08:31:09 +02:00
Andreas Steffen
40676786aa
key-exchange: Joint ke_test_vector format for DH and KEM
...
Both Diffie-Hellman (DH) and Key Encapsulation Mechanism (KEM) based
key exchange methods use a common ke_test_vector format. The
set_seed() function is used to provide deterministic private key
material for the crypto tests.
2024-11-21 14:26:35 +01:00
Tobias Brunner
f73d8699b3
crypto-tester: Fix build with DEBUG_LEVEL < 1
2023-05-08 14:06:43 +02:00
Tobias Brunner
3af7c6db87
Rename diffie_hellman_t to key_exchange_t and change the interface etc.
...
This makes it more generic so we can use it for QSKE methods.
2022-06-29 10:28:50 +02:00
Tobias Brunner
19ef2aec15
Update copyright headers after acquisition by secunet
2022-06-28 10:22:56 +02:00
Tobias Brunner
37dbc87960
crypto: Add new KDF type for IKEv2 PRFs
2022-04-14 19:02:56 +02:00
Tobias Brunner
7bde56a9bc
crypto: Adapt kdf_t interface to support KDFs with fixed output length
2022-04-14 19:02:56 +02:00
Tobias Brunner
0c6baa8997
crypto-tester: Add facility to test KDFs
2022-04-14 18:54:24 +02:00
Andreas Steffen
11e9d2b8d1
drbg: The drbg instance owns the entropy rng
2019-11-28 09:55:56 +01:00
Andreas Steffen
737375a2d2
drbg: Implemented NIST SP-800-90A DRBG
2019-10-16 16:46:24 +02:00
Tobias Brunner
1b67166921
Unify format of HSR copyright statements
2018-05-23 16:32:53 +02:00
Andreas Steffen
04208ac5d4
xof: Defined Extended Output Functions
2016-07-29 12:36:14 +02:00
Martin Willi
a94955e88a
crypto-tester: Support testing DH groups using DH test vectors
2015-04-15 14:37:38 +02:00
Martin Willi
3a5106caea
crypto-tester: Use the plugin feature key size to benchmark crypters/aeads
...
We previously didn't pass the key size during algorithm registration, but this
resulted in benchmarking with the "default" key size the crypter uses when
passing 0 as key size.
2015-04-15 11:35:26 +02:00
Martin Willi
9310d4250a
crypto-tester: Explicitly exclude FIPS-PRF from append mode tests
...
This was implicitly done by the seed length check before 58dda5d6 , but we
now require an explicit check to avoid that unsupported use.
2015-03-28 08:38:52 +01:00
Martin Willi
58dda5d6ab
crypto-tester: Test set_key() after a doing a partial append on prf/signers
...
While that use is uncommon in real-world use, nonetheless should HMAC set a
correct key and reset any underlying hasher.
2015-03-27 15:53:47 +01:00
Martin Willi
89c3ff6d2c
windows: Check for clock_gettime() function itself as well
...
CLOCK_THREAD_CPUTIME_ID seems to be defined sometimes even if clock_gettime() is
missing.
2014-06-04 15:53:05 +02:00
Martin Willi
922ee2c529
windows: Add a common Windows header for platform specific wrappers
...
Include some more basic system headers in utils.h, so we can use that common
header on the different platforms.
2014-06-03 12:24:34 +02:00
Martin Willi
e5d73b0dfa
aead: Support custom AEAD salt sizes
...
The salt, or often called implicit nonce, varies between AEAD algorithms and
their use in protocols. For IKE and ESP, GCM uses 4 bytes, while CCM uses
3 bytes. With TLS, however, AEAD mode uses 4 bytes for both GCM and CCM.
Our GCM backends currently support 4 bytes and CCM 3 bytes only. This is fine
until we go for CCM mode support in TLS, which requires 4 byte nonces.
2014-03-31 15:56:12 +02:00
Tobias Brunner
510c900479
crypto-tester: Don't fail if key size is not supported
...
The Blowfish and Twofish implementations provided by the gcrypt plugin
only support specific key lengths, which we don't know when testing
against vectors (either during unit tests or during algorithm
registration). The on_create test with a specific key length will be
skipped anyway, so there is no point in treating this failure differently.
2014-03-20 15:49:05 +01:00
Tobias Brunner
8dc6e71632
lib: All settings use configured namespace
2014-02-12 14:34:32 +01:00
Tobias Brunner
162c06f2f5
Fix cleanup in crypto_tester if a crypter fails
2013-05-08 15:02:38 +02:00
Tobias Brunner
a89ebab62e
Fix cleanup in crypto_tester if AEAD implementation fails
2013-02-28 18:17:42 +01:00
Tobias Brunner
f05b427265
Moved debug.[ch] to utils folder
2012-10-24 16:00:51 +02:00
Tobias Brunner
12642a6831
Moved data structures to new collections subfolder
2012-10-24 16:00:49 +02:00
Tobias Brunner
91a8dc2dec
Fixed RNG crypto tester
2012-09-28 19:13:40 +02:00
Martin Willi
44fc169579
Test reset() of hasher in crypto tester
2012-07-16 14:55:07 +02:00
Martin Willi
67ea663d7c
Refactored error handling in crypto tester
2012-07-16 14:55:07 +02:00
Martin Willi
73264a81b8
Set a key before benching PRFs
2012-07-16 14:55:07 +02:00
Martin Willi
87dd205b61
Add a return value to hasher_t.allocate_hash()
2012-07-16 14:55:06 +02:00
Martin Willi
8bd6a30af1
Add a return value to hasher_t.get_hash()
2012-07-16 14:55:06 +02:00
Martin Willi
ce73fc19db
Add a return value to crypter_t.set_key()
2012-07-16 14:53:38 +02:00
Martin Willi
3b96189a2a
Add a return value to crypter_t.decrypt()
2012-07-16 14:53:38 +02:00
Martin Willi
e35abbe588
Add a return value to crypter_t.encrypt
2012-07-16 14:53:37 +02:00
Tobias Brunner
8a8364f26e
Check rng return value in crypto tester
2012-07-16 14:53:34 +02:00
Martin Willi
f3ca96b2bf
Add a return value to prf_t.set_key()
2012-07-16 14:53:34 +02:00
Martin Willi
ecc080b393
Add a return value to prf_t.allocate_bytes()
2012-07-16 14:53:34 +02:00
Martin Willi
bc47488323
Add a return value to prf_t.get_bytes()
2012-07-16 14:53:33 +02:00
Martin Willi
2d56575d52
Add a return value to signer_t.set_key()
2012-07-16 14:53:33 +02:00
Martin Willi
2e96de60a8
Add a return value to signer_t.get_signature()
2012-07-16 14:53:33 +02:00
Martin Willi
cbfbba7d86
Add a return value to signer_t.allocate_signature()
2012-07-16 14:53:32 +02:00
Martin Willi
ad08730a4b
Add a return value to aead_t.set_key()
2012-07-16 14:53:32 +02:00
Martin Willi
e2ed7bfd22
Add a return value to aead_t.encrypt()
2012-07-16 14:53:32 +02:00
Martin Willi
1b82fdb2e5
Use correct integrity_algorithm_t enum type in bench_signer()
2012-05-14 14:11:22 +02:00
Tobias Brunner
7171d8765e
Disable crypto benchmarking if CLOCK_THREAD_CPUTIME_ID is not available.
2012-01-30 11:04:55 +01:00
Martin Willi
6dc36a73e2
Fixed debug statement if algorithm benchmarking enabled
2011-04-08 14:55:10 +02:00
Andreas Steffen
690d5aed59
disable AEAD crypto algorithm if no key size is supported
2010-12-25 16:14:55 +01:00
Andreas Steffen
d733a3babb
disable crypto algorithm if no key size is supported
2010-12-25 16:11:50 +01:00
Andreas Steffen
c6a043fad0
log if an AEAD algorithm does not support a given key size
2010-12-25 15:53:15 +01:00
Andreas Steffen
90288c76f8
log if a crypto algorithm does not support a given key size
2010-12-25 15:49:29 +01:00