summaryrefslogtreecommitdiff
path: root/testsuite
Commit message (Collapse)AuthorAgeFilesLines
* Fix compile error in --disable-public-key configuration.Niels Möller2023-05-102-0/+2
|
* Rework SIV tests.Niels Möller2023-04-252-341/+112
|
* Rework OCB tests.Niels Möller2023-04-243-137/+228
|
* Delete an obsolete comment and an obsolete forward declaration.Niels Möller2023-04-231-4/+0
|
* Rename siv-test.c --> siv-cmac-test.c.Niels Möller2023-04-232-3/+3
|
* Rewrite of table-based ghash code, for side-channel silence.Niels Möller2023-04-131-0/+15
|
* Add tests of ocb message functions.Niels Möller2023-02-071-0/+157
|
* Implement OCB mode, RFC 7253.Niels Möller2023-02-072-1/+236
|
* Extend aead tests.Niels Möller2023-02-061-56/+81
| | | | | | * testsuite/testutils.c (test_aead): Always use set_nonce function pointer if non-NULL, test varying alignment, output the unexpected data when test fails.
* Merge branch 'ecdsa-duplication-fix'Niels Möller2022-09-283-15/+56
|\
| * Fix ECDSA verify corner caseNiels Möller2022-09-142-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | * ecc-ecdsa-verify.c (ecc_ecdsa_verify): Use ecc_nonsec_add_jjj, to produce correct result in a corner case where point addition needs to use point duplication. Also use ecc_j_to_a rather than ecc->h_to_a, since ecdsa supports only weierstrass curves. * ecc-gostdsa-verify.c (ecc_gostdsa_verify): Analogous change. * testsuite/ecdsa-verify-test.c (test_main): Add corresponding test. * testsuite/ecdsa-sign-test.c (test_main): And a test producing the problematic signature.
| * New function ecc_nonsec_add_jjjNiels Möller2022-09-141-15/+29
| |
* | Stricter validation of nettle_cipher and nettle_hash in tests.Niels Möller2022-09-282-2/+7
| | | | | | | | Increase NETTLE_MAX_HASH_BLOCK_SIZE to 144, to accommodate sha3_224.
* | Merge branch 'wip/dueno/aes-gcm-siv' into 'master'Niels Möller2022-09-283-1/+733
|\ \ | | | | | | | | | | | | Implement AES-GCM-SIV See merge request nettle/nettle!52
| * | Implement AES-GCM-SIVDaiki Ueno2022-09-273-1/+733
| |/ | | | | | | | | | | | | | | | | This implements AES-GCM-SIV, described in RFC8452, on top of the existing AES-GCM primitives. In particular, its hash algorithm POLYVAL is implemented using the GHASH with additional byte order conversion according to RFC8452 Appendix A. Signed-off-by: Daiki Ueno <dueno@redhat.com>
* | Delete fail variable in testsZoltan Fridrich2022-09-241-12/+5
| |
* | Implement balloon password hashingZoltan Fridrich2022-09-143-1/+144
|/
* gcm: Add SM4 as the GCM underlying cipherTianjia Zhang2022-08-182-0/+19
| | | | Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
* testsuite: add test for SM4 symmetric algorithmTianjia Zhang2022-08-183-1/+21
| | | | | | | Add a testuite for SM4 symmetric algorithm. Test vectors are based on: https://tools.ietf.org/id/draft-ribose-cfrg-sm4-10.html Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
* Introduce SM4 symmetric cipher algorithmTianjia Zhang2022-08-181-1/+2
| | | | | | | | | | | | | | | Introduce the SM4 cipher algorithms (OSCCA GB/T 32907-2016). SM4 (GBT.32907-2016) is a cryptographic standard issued by the Organization of State Commercial Administration of China (OSCCA) as an authorized cryptographic algorithms for the use within China. SMS4 was originally created for use in protecting wireless networks, and is mandated in the Chinese National Standard for Wireless LAN WAPI (Wired Authentication and Privacy Infrastructure) (GB.15629.11-2003). Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
* tests: Define mpz_urandomm when building with mini-gmp.Niels Möller2022-08-172-0/+9
|
* Fix memory leak in new test.Niels Möller2022-08-161-0/+2
|
* Reduce output range of ecc_mod_sub.Niels Möller2022-08-162-2/+160
| | | | | | | | | | * ecc-mod-arith.c (ecc_mod_sub): Ensure that if inputs are in the range 0 <= a, b < 2m, then output is in the same range. * eccdata.c (output_curve): New outputs ecc_Bm2p and ecc_Bm2q. * ecc-internal.h (struct ecc_modulo): New member Bm2m (B^size - 2m), needed by ecc_mod_sub. Update all curves. * testsuite/ecc-mod-arith-test.c: New tests for ecc_mod_add and ecc_mod_sub.
* Additional tests for sha1 and sha256 compression.Niels Möller2022-06-202-0/+104
| | | | | | | * testsuite/sha1-test.c (test_sha1_compress): New function. (test_main): Add tests for compressing 0, 1 or 2 blocks. * testsuite/sha256-test.c (test_sha256_compress): New function. (test_main): Add tests for compressing 0, 1 or 2 blocks.
* Refactor GCM C implementation.Niels Möller2022-02-181-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Assembly implementations not yet updated. * Makefile.in (nettle_SOURCES): Add ghash-set-key.c ghash-update.c. (DISTFILES): Replaced gcm-internal.h with ghash-internal.h. * testsuite/gcm-test.c (test_ghash_internal): Updated to use _ghash_set_key and _ghash_update. * gcm.c (INC32): Deleted macro, used in only one place. (gcm_set_key): Update to use _ghash_set_key. (gcm_hash): Renamed, was _gcm_hash, and implemented in terms of _ghash_update. (bswap_if_le): New function (copied from nist-keywrap.c). (gcm_hash_sizes): Use bswap_if_le and _ghash_update. (gcm_set_iv): Updated to use gcm_hash and block16_zero. (gcm_digest): Use _ghash_digest. * ghash-internal.h: New file, declaring new internal ghash interface. * gcm-internal.h: Deleted file. * ghash-update.c (gcm_gf_shift_8): Moved here (from gcm.c) (gcm_gf_mul): Likewise. (_ghash_update): New function, extracted from _nettle_gcm_hash_c. (_ghash_digest): New function. * ghash-set-key.c (_ghash_set_key): New file and function. Extracted from _nettle_gcm_init_key_c and _nettle_gcm_set_key.
* Rearrange gcm configuration defines, and add tests for internal functions.Niels Möller2022-02-101-1/+90
|
* Add tests for edge cases in poly1305 digest folding.Niels Möller2022-01-281-18/+68
|
* Simplify poly1305-test, more use of tstring length.Niels Möller2022-01-241-28/+17
|
* Add randomized tests of poly1305.Niels Möller2022-01-231-0/+130
|
* Arrange so that GMP or mini-gmp is always available for tests.Niels Möller2022-01-232-2/+8
|
* tests: Use inline function for dummy definition of test_randomize.Niels Möller2022-01-171-2/+3
|
* Share ecc point validation function in testutils.c.Niels Möller2022-01-174-144/+76
| | | | | | | | * testsuite/testutils.c (test_ecc_point_valid_p): New function, moved from... * testsuite/ecdsa-keygen-test.c (ecc_valid_p): ... old copy. * testsuite/gostdsa-keygen-test.c (ecc_valid_p): ... old copy. * testsuite/testutils.h: Declare it.
* Whitespace cleanupNiels Möller2022-01-172-8/+8
|
* hmac: add support for SM3 hash functionTianjia Zhang2021-12-012-0/+7
| | | | | | Add support for calculating HMAC using SM3 hash functions. Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
* testsuite: add test for SM3 hash functionTianjia Zhang2021-12-013-1/+22
| | | | | | | Add a testuite for SM3 hash function. Test vectors are based on: https://datatracker.ietf.org/doc/html/draft-shen-sm3-hash-01 Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
* Add OSCCA SM3 hash algorithmTianjia Zhang2021-12-011-1/+2
| | | | | | | Add OSCCA SM3 secure hash (OSCCA GM/T 0004-2012 SM3) generic hash transformation. Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
* Delete function mpz_limbs_read_n.Niels Möller2021-11-192-5/+15
|
* Delete function mpz_limbs_cmp.Niels Möller2021-11-193-8/+8
|
* Randomize more testsNiels Möller2021-11-156-0/+8
|
* Reduce allocation in modinv testNiels Möller2021-11-151-1/+1
|
* Fix sqrt_ratio test for v = 0 case.Niels Möller2021-11-151-0/+4
|
* Reduce allocation in sqrt testsNiels Möller2021-11-151-2/+2
|
* Move NETTLE_TEST_SEED logic to testutils.c.Niels Möller2021-11-134-113/+67
| | | | | | | | | * testsuite/testutils.c (get_random_seed): Move function here. (test_randomize): New function. * testsuite/ecc-mod-test.c (get_random_seed): Delete old copy. (test_main): Use test_randomize. * testsuite/rsa-compute-root-test.c (get_random_seed): Delete old copy. (test_main): Use test_randomize.
* Delete obsolete comment.Niels Möller2021-11-131-1/+0
|
* Fix and test for sqrt(0) special case.Niels Möller2021-11-131-0/+40
|
* New function ecc_mod_equal_p, based on patch by Wim Lewis.Niels Möller2021-11-081-13/+1
|
* Implement secp192r1 square root, based on patch by Wim Lewis.Niels Möller2021-11-081-5/+92
|
* Renamed sqrt_itch --> sqrt_ratio_itch, and curve25519 and curve448 sqrt ↵Niels Möller2021-11-071-1/+1
| | | | functions.
* Rename ecc sqrt --> sqrt_ratio.Niels Möller2021-11-061-3/+3
| | | | | | | * ecc-internal.h (ecc_mod_sqrt_ratio_func): Renamed typedef... (ecc_mod_sqrt_func): ... from old name. (struct ecc_modulo): Renamed corresponding function pointer to sqrt_ratio. Updated all uses.
* New function ecc_mod_zero_p.Niels Möller2021-10-261-12/+11
| | | | | | | | | | * ecc-mod-arith.c (ecc_mod_zero_p): New function. * ecc-curve25519.c (ecc_curve25519_zero_p): Use it. * ecc-curve448.c (ecc_curve448_zero_p): Deleted, usage replaced with ecc_mod_zero_p. * testsuite/ecc-modinv-test.c (mod_eq_p): Rewritten to use ecc_mod_zero_p, and require that one input is canonically reduced. (zero_p): Deleted, usage replaced with ecc_mod_zero_p.