summaryrefslogtreecommitdiff
path: root/doc
Commit message (Collapse)AuthorAgeFilesLines
* Add AES-GCM-SIV mode (RFC 8452)Jussi Kivilinna2021-08-261-6/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cipher/Makefile.am: Add 'cipher-gcm-siv.c'. * cipher/cipher-gcm-siv.c: New. * cipher/cipher-gcm.c (_gcry_cipher_gcm_setupM): New. * cipher/cipher-internal.h (gcry_cipher_handle): Add 'siv_keylen'. (_gcry_cipher_gcm_setupM, _gcry_cipher_gcm_siv_encrypt) (_gcry_cipher_gcm_siv_decrypt, _gcry_cipher_gcm_siv_set_nonce) (_gcry_cipher_gcm_siv_authenticate) (_gcry_cipher_gcm_siv_set_decryption_tag) (_gcry_cipher_gcm_siv_get_tag, _gcry_cipher_gcm_siv_check_tag) (_gcry_cipher_gcm_siv_setkey): New prototypes. (cipher_block_bswap): New helper function. * cipher/cipher.c (_gcry_cipher_open_internal): Add 'GCRY_CIPHER_MODE_GCM_SIV'; Refactor mode requirement checks for better size optimization (check pointers & blocksize in same order for all). (cipher_setkey, cipher_reset, _gcry_cipher_setup_mode_ops) (_gcry_cipher_setup_mode_ops, _gcry_cipher_info): Add GCM-SIV. (_gcry_cipher_ctl): Handle 'set decryption tag' for GCM-SIV. * doc/gcrypt.texi: Add GCM-SIV. * src/gcrypt.h.in (GCRY_CIPHER_MODE_GCM_SIV): New. (GCRY_SIV_BLOCK_LEN, gcry_cipher_set_decryption_tag): Add to comment that these are also for GCM-SIV in addition to SIV mode. * tests/basic.c (check_gcm_siv_cipher): New. (check_cipher_modes): Check for GCM-SIV. * tests/bench-slope.c (bench_gcm_siv_encrypt_do_bench) (bench_gcm_siv_decrypt_do_bench, bench_gcm_siv_authenticate_do_bench) (gcm_siv_encrypt_ops, gcm_siv_decrypt_ops) (gcm_siv_authenticate_ops): New. (cipher_modes): Add GCM-SIV. (cipher_bench_one): Check key length requirement for GCM-SIV. -- GnuPG-bug-id: T4485 Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
* Add SIV mode (RFC 5297)Jussi Kivilinna2021-08-261-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cipher/Makefile.am: Add 'cipher-siv.c'. * cipher/cipher-ctr.c (_gcry_cipher_ctr_encrypt): Rename to _gcry_cipher_ctr_encrypt_ctx and add algo context parameter. (_gcry_cipher_ctr_encrypt): New using _gcry_cipher_ctr_encrypt_ctx. * cipher/cipher-internal.h (gcry_cipher_handle): Add 'u_mode.siv'. (_gcry_cipher_ctr_encrypt_ctx, _gcry_cipher_siv_encrypt) (_gcry_cipher_siv_decrypt, _gcry_cipher_siv_set_nonce) (_gcry_cipher_siv_authenticate, _gcry_cipher_siv_set_decryption_tag) (_gcry_cipher_siv_get_tag, _gcry_cipher_siv_check_tag) (_gcry_cipher_siv_setkey): New. * cipher/cipher-siv.c: New. * cipher/cipher.c (_gcry_cipher_open_internal, cipher_setkey) (cipher_reset, _gcry_cipher_setup_mode_ops, _gcry_cipher_info): Add GCRY_CIPHER_MODE_SIV handling. (_gcry_cipher_ctl): Add GCRYCTL_SET_DECRYPTION_TAG handling. * doc/gcrypt.texi: Add documentation for SIV mode. * src/gcrypt.h.in (GCRYCTL_SET_DECRYPTION_TAG): New. (GCRY_CIPHER_MODE_SIV): New. (gcry_cipher_set_decryption_tag): New. * tests/basic.c (check_siv_cipher): New. (check_cipher_modes): Add call for 'check_siv_cipher'. * tests/bench-slope.c (bench_encrypt_init): Use double size key for SIV mode. (bench_aead_encrypt_do_bench, bench_aead_decrypt_do_bench) (bench_aead_authenticate_do_bench): Reset cipher context on each run. (bench_aead_authenticate_do_bench): Support nonce-less operation. (bench_siv_encrypt_do_bench, bench_siv_decrypt_do_bench) (bench_siv_authenticate_do_bench, siv_encrypt_ops) (siv_decrypt_ops, siv_authenticate_ops): New. (cipher_modes): Add SIV mode benchmarks. (cipher_bench_one): Restrict SIV mode testing to 16 byte block-size. -- GnuPG-bug-id: T4486 Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
* doc: Fix a typo.NIIBE Yutaka2021-07-221-1/+1
| | | | | | -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* doc: Clarify gcry_md_setkey for keyed BLAKE hashes.Werner Koch2021-04-261-2/+2
| | | | --
* build: Fix for make distcheck, no EPS support.NIIBE Yutaka2021-03-301-3/+1
| | | | | | | * Makefile.am (AM_DISTCHECK_DVI_TARGET): Specify 'pdf'. * doc/Makefile.am (EXTRA_DIST, BUILT_SOURCES): Remove .eps files. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* build: Revert the previous commit.NIIBE Yutaka2021-03-251-1/+3
| | | | | | | | | -- The .fig format is vector graphics format. It is not good to convert it to raster format to be included by TeX. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* build: Remove intermediate PDF files from EXTRA_DIST.NIIBE Yutaka2021-03-251-3/+1
| | | | | | | | | | | | | * doc/Makefile.am (EXTRA_DIST): Remove PDF files. (BUILT_SOURCES): Likewise. -- When texi2pdf is invoked, etex is invoked. And it's actually pdftex these days, which can process PNG files directly. So, no need to prepare PDF files. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* doc: Document newly added optimizationsJakub Jelen2021-03-061-0/+8
| | | | | | | | | | | | * doc/gcrypt.texi: Add HW features 'intel-vaes-vpclmul', 'ppc-vcrypto', 'ppc-arch_3_00', 'ppc-arch_2_07', 's390x-msa', 's390x-msa-4', 's390x-msa-8' and 's390x-vx'. -- Signed-off-by: Jakub Jelen <jjelen@redhat.com> [jk: fixed "pc-" and "390x-" typos to "ppc-" and "s390x-" ] GnuPG-bug-id: 5337 Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
* doc: Fix swapped GCM/CCM constants.Werner Koch2021-02-171-1/+1
| | | | | -- GnuPG-bug-id: 5306
* ecc: Change an error code of gcry_ecc_mul_point.Werner Koch2021-01-181-3/+39
| | | | | | | | | | | | | * cipher/ecc-ecdh.c (_gcry_ecc_mul_point): Return GPG_ERR_UNKNOWN_CURVE. -- Unknown_curve is more specific than unknown_algorithm. This patch also adds documentation and renames rthe parameter from 'algo' to 'curveid'. Signed-off-by: Werner Koch <wk@gnupg.org>
* doc: Add missing OIDs to the list of supported curvesWerner Koch2021-01-071-8/+64
| | | | | | | | | -- Also add brainpool curves. GnuPG-bug-id: 3220 Signed-off-by: Werner Koch <wk@gnupg.org>
* Add SM4 symmetric cipher algorithmTianjia Zhang2020-06-161-0/+10
| | | | | | | | | | | | | | | | | | | | | * cipher/Makefile.am (EXTRA_libcipher_la_SOURCES): Add sm4.c. * cipher/cipher.c (cipher_list, cipher_list_algo301): Add _gcry_cipher_spec_sm4. * cipher/mac-cmac.c (map_mac_algo_to_cipher): Add cmac SM4. (_gcry_mac_type_spec_cmac_sm4): Add cmac SM4. * cipher/mac-internal.h: Declare spec_cmac_sm4. * cipher/mac.c (mac_list, mac_list_algo201): Add cmac SM4. * cipher/sm4.c: New. * configure.ac (available_ciphers): Add sm4. * doc/gcrypt.texi: Add SM4 document. * src/cipher.h: Add declarations for SM4 and cmac SM4. * src/gcrypt.h.in (gcry_cipher_algos): Add algorithm ID for SM4. -- Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com> [jk: add missing mapping in mac-cmac.c:map_mac_algo_to_cipher] [jk: add GCRY_MAC_CMAC_SM4 to gcrypt.texi] Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
* doc: add GCRY_MD_SM3, GCRY_MAC_HMAC_SM3 and GCRY_MAC_GOST28147_IMITJussi Kivilinna2020-06-161-0/+12
| | | | | | | | * doc/gcrypt.texi: add GCRY_MD_SM3, GCRY_MAC_HMAC_SM3 and GCRY_MAC_GOST28147_IMIT. -- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
* doc: The shortest doc dot fix ever.Werner Koch2020-06-051-1/+1
| | | | --
* ecc: Make 1.3.101.112 and alias for Ed25519Werner Koch2020-05-131-3/+6
| | | | | | -- Fixes-commit: c750b784d2bee0a32be72bcfb818e0a7683fa914
* doc: Really minor fixes.Werner Koch2020-05-061-4/+4
| | | | --
* sexp: Extend gcry_sexp_extract_param with a multi-string extractor.Werner Koch2020-04-141-0/+8
| | | | | | | | | | * src/sexp.c (_gcry_sexp_vextract_param): Implement "%#s" control sequence. -- This comes handy to extract a list of flags. Signed-off-by: Werner Koch <wk@gnupg.org>
* sexp: Extend gcry_sexp_extract_param with new format specifiers.Werner Koch2020-04-091-1/+20
| | | | | | | * src/sexp.c (_gcry_sexp_vextract_param): Add new conversion methods. * tests/t-sexp.c (check_extract_param): Add corresponding tests. Signed-off-by: Werner Koch <wk@gnupg.org>
* gost28147: add support for CryptoPro key meshing per RFC 4357Dmitry Baryshkov2020-03-201-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | * cipher/gost28147.c (gost_do_set_sbox, cryptopro_key_meshing, CryptoProMeshingKey, gost_encrypt_block_mesh): New. (_gcry_cipher_spec_gost28147_mesh): New cipher with keymeshing, (_gcry_cipher_spec_gost28147): Remove OIDs for this cipher should not be selected using these OIDs (they are for CFB with keymeshing). * cipher/cipher.c (cipher_list, cipher_list_algo301): add _gcry_cipher_spec_gost28147_mesh. * src/gcrypt.h.in (GCRY_CIPHER_GOST28147_MESH): New cipher with keymeshing. * doc/gcrypt.texi (GCRY_CIPHER_GOST28147_MESH): Add definition. * tests/basic.c (check_gost28147_cipher, check_gost28147_cipher_basic): Run basic tests on GCRY_CIPHER_GOST28147_MESH. -- Add actual cipher implementing CryptoPro KeyMeshing. This has been requested by AltLinux team to properly support CFB-encrypted CMS files. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com>
* doc: Fix description of hash algorithmsSébastien Helleu2020-03-031-2/+2
| | | | --
* gcrypt.texi: fix GCRYCTL_GET_ALGO_NENCR typoJussi Kivilinna2020-01-191-1/+1
| | | | | | | * doc/gcrypt.texi: Fix GCRYCTL_GET_ALGO_NENC to GCRYCTL_GET_ALGO_NENCR. -- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
* build: Use {CFLAGS,CPPFLAGS,LDFLAGS}_FOR_BUILD for helper programs.NIIBE Yutaka2019-07-221-1/+2
| | | | | | | | | | * configure.ac (CC_FOR_BUILD): Use AX_CC_FOR_BUILD. * cipher/Makefile.am (gost-s-box): Add {CFLAGS,CPPFLAGS,LDFLAGS}_FOR_BUILD. * doc/Makefile.am (yat2m): Likewise. * m4/ax_cc_for_build.m4: New. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* Limit and document Blowfish key lengths to 8-576 bitsJussi Kivilinna2019-04-181-3/+3
| | | | | | | | | | | | | | | | | | * cipher/blowfish.c (BLOWFISH_KEY_MIN_BITS) (BLOWFISH_KEY_MAX_BITS): New. (do_bf_setkey): Check input key length to MIN_BITS and MAX_BITS. * doc/gcrypt.texi: Update supported Blowfish key lengths. * tests/basic.c (check_ecb_cipher): New, with Blowfish test vectors for different key lengths. (check_cipher_modes): Call 'check_ecb_cipher'. -- As noted by Peter Wu, Blowfish cipher implementation already supports key lengths 8 to 576 bits [1]. This change updates documentation to reflect that and adds new test vectors to check handling of different key lengths. [1] https://lists.gnupg.org/pipermail/gcrypt-devel/2019-April/004680.html Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
* Add SHA512/224 and SHA512/256 algorithmsJussi Kivilinna2019-04-051-2/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cipher/mac-hmac.c (map_mac_algo_to_md): Add mapping for SHA512/224 and SHA512/256. (_gcry_mac_type_spec_hmac_sha512_256) (_gcry_mac_type_spec_hmac_sha512_224): New. * cipher/mac-internal.h (_gcry_mac_type_spec_hmac_sha512_256) (_gcry_mac_type_spec_hmac_sha512_224): New. * cipher/mac.c (mac_list, mac_list_algo101): Add SHA512/224 and SHA512/256. * cipher/md.c (digest_list, digest_list_algo301) (prepare_macpads): Ditto. * cipher/sha512.c (run_selftests): Ditto. (sha512_init_common): Move common initialization here. (sha512_init, sha384_init): Use common initialization function. (sha512_224_init, sha512_256_init, _gcry_sha512_224_hash_buffer) (_gcry_sha512_224_hash_buffers, _gcry_sha512_256_hash_buffer) (_gcry_sha512_256_hash_buffers, selftests_sha512_224) (selftests_sha512_256, sha512_224_asn, oid_spec_sha512_224) (_gcry_digest_spec_sha512_224, sha512_256_asn, oid_spec_sha512_256) (_gcry_digest_spec_sha512_256): New. * doc/gcrypt.texi: Add SHA512/224 and SHA512/256; Add missing HMAC-BLAKE2s and HMAC-BLAKE2b. * src/cipher.h (_gcry_digest_spec_sha512_224) (_gcry_digest_spec_sha512_256): New. * src/gcrypt.h.in (GCRY_MD_SHA512_256, GCRY_MD_SHA512_224): New. (GCRY_MAC_HMAC_SHA512_256, GCRY_MAC_HMAC_SHA512_224): New. * tests/basic.c (check_digests): Add SHA512/224 and SHA512/256 test vectors. -- This change adds truncated SHA512/224 and SHA512/256 algorithms specified in FIPS 180-4. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
* doc: add mention about aligning data to cachelines for best performanceJussi Kivilinna2019-03-241-0/+6
| | | | | | | | | * doc/gcrypt.text: Add mention about aligning data to cachelines for best performance. -- GnuPG-bug-id: 2388 Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
* doc/gcrypt.texi: update HW feature listJussi Kivilinna2019-03-231-0/+7
| | | | | | | * doc/gcrypt.texi: Update FW feature list. -- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
* doc: Fix library initialization examplesAndreas Metzler2018-11-191-6/+10
| | | | Signed-off-by: Andreas Metzler <ametzler@bebt.de>
* doc: Update yat2m.c from upstream (libgpg-error)Werner Koch2018-10-241-12/+30
| | | | | | | -- GnuPG-bug-id: 4102 Signed-off-by: Werner Koch <wk@gnupg.org>
* doc: Fix example for gcry_sexp_extract_paramWerner Koch2018-10-231-4/+5
| | | | --
* RFC-8439 was published.NIIBE Yutaka2018-07-041-1/+1
| | | | | | * cipher/cipher-poly1305.c: Update RFC reference. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* doc: Clarify the value range of the use-rsa-e parameter.Werner Koch2018-03-221-1/+3
| | | | | | -- Signed-off-by: Werner Koch <wk@gnupg.org>
* doc: fix double "See" in front of referenceJussi Kivilinna2018-01-201-6/+6
| | | | | | | | | | | * doc/gcrypt.texi: Change @xref to @ref when text already has 'see' in the front. -- @xref references start with `See ...'. Use @ref instead when text already has 'see' in front. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
* Add EAX modeJussi Kivilinna2018-01-201-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cipher/Makefile.am: Add 'cipher-eax.c'. * cipher/cipher-cmac.c (cmac_write): Rename to ... (_gcry_cmac_write): ... this; Take CMAC context as new input parameter; Return error code. (cmac_generate_subkeys): Rename to ... (_gcry_cmac_generate_subkeys): ... this; Take CMAC context as new input parameter; Return error code. (cmac_final): Rename to ... (_gcry_cmac_final): ... this; Take CMAC context as new input parameter; Return error code. (cmac_tag): Take CMAC context as new input parameter. (_gcry_cmac_reset): New. (_gcry_cipher_cmac_authenticate): Remove duplicate tag flag check; Adapt to changes above. (_gcry_cipher_cmac_get_tag): Adapt to changes above. (_gcry_cipher_cmac_check_tag): Ditto. (_gcry_cipher_cmac_set_subkeys): Ditto. * cipher-eax.c: New. * cipher-internal.h (gcry_cmac_context_t): New. (gcry_cipher_handle): Update u_mode.cmac; Add u_mode.eax. (_gcry_cmac_write, _gcry_cmac_generate_subkeys, _gcry_cmac_final) (_gcry_cmac_reset, _gcry_cipher_eax_encrypt, _gcry_cipher_eax_decrypt) (_gcry_cipher_eax_set_nonce, _gcry_cipher_eax_authenticate) (_gcry_cipher_eax_get_tag, _gcry_cipher_eax_check_tag) (_gcry_cipher_eax_setkey): New prototypes. * cipher/cipher.c (_gcry_cipher_open_internal, cipher_setkey) (cipher_reset, cipher_encrypt, cipher_decrypt, _gcry_cipher_setiv) (_gcry_cipher_authenticate, _gcry_cipher_gettag, _gcry_cipher_checktag) (_gcry_cipher_info): Add EAX mode. * doc/gcrypt.texi: Add EAX mode. * src/gcrypt.h.in (GCRY_CIPHER_MODE_EAX): New. * tests/basic.c (_check_gcm_cipher, _check_poly1305_cipher): Constify test vectors array. (_check_eax_cipher, check_eax_cipher): New. (check_ciphers, check_cipher_modes): Add EAX mode. * tests/bench-slope.c (bench_eax_encrypt_do_bench) (bench_eax_decrypt_do_bench, bench_eax_authenticate_do_bench) (eax_encrypt_ops, eax_decrypt_ops, eax_authenticate_ops): New. (cipher_modes): Add EAX mode. * tests/benchmark.c (cipher_bench): Add EAX mode. -- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
* api: Add GCRYCTL_AUTO_EXPAND_SECMEM.Werner Koch2017-11-241-3/+14
| | | | | | | | | | | | * src/gcrypt.h.in (GCRYCTL_AUTO_EXPAND_SECMEM): New enum. * src/global.c (_gcry_vcontrol): Implement that. * src/secmem.c (auto_expand): New var. (_gcry_secmem_set_auto_expand): New. (_gcry_secmem_malloc_internal): Act upon AUTO_EXPAND. -- GnuPG-bug-id: 3530 Signed-off-by: Werner Koch <wk@gnupg.org>
* doc: Clarify gcry_mpi_divWerner Koch2017-11-151-1/+3
| | | | --
* api: New function gcry_mpi_get_ui.Werner Koch2017-10-171-1/+13
| | | | | | | | | | | | | | | | | | | * src/gcrypt.h.in (gcry_mpi_get_ui): New. (mpi_get_ui): New macro. * src/libgcrypt.def, src/libgcrypt.vers: Add new function. * src/visibility.c (gcry_mpi_get_ui): New. * src/visibility.h: Mark that function. (gcry_mpi_get_ui): New. * mpi/mpiutil.c (MY_UINT_MAX): New macro. (_gcry_mpi_get_ui): Re-implemented. This function existed but was never imported or used. * tests/mpitests.c (test_maxsize): Add some test for this function. -- Note that in libgcrypt.def the cardinal 91 is used which was never used in the past. Signed-off-by: Werner Koch <wk@gnupg.org>
* Release 1.8.0libgcrypt-1.8.0Werner Koch2017-07-181-1/+1
| | | | Signed-off-by: Werner Koch <wk@gnupg.org>
* api: New function gcry_mpi_point_copy.Werner Koch2017-07-181-0/+7
| | | | | | | | | | | * src/gcrypt.h.in (gcry_mpi_point_copy): New. (mpi_point_copy): New macro. * src/visibility.c (gcry_mpi_point_copy): New. * src/libgcrypt.def, src/libgcrypt.vers: Add function. * mpi/ec.c (_gcry_mpi_point_copy): New. * tests/t-mpi-point.c (set_get_point): Add test. Signed-off-by: Werner Koch <wk@gnupg.org>
* api: New function gcry_get_config.Werner Koch2017-06-211-1/+24
| | | | | | | | | | | | | | | | | | * src/misc.c (_gcry_log_info_with_dummy_fp): Remove. * src/global.c (print_config): New arg WHAT. Remove arg FNC and use gpgrt_fprintf directly. (_gcry_get_config): New. (_gcry_vcontrol) <GCRYCTL_PRINT_CONFIG>: Use _gcry_get_config instead of print_config. * src/gcrypt.h.in (gcry_get_config): New. * src/libgcrypt.def, src/libgcrypt.vers: Add new function. * src/visibility.c (gcry_get_config): New. * src/visibility.h: Mark new function. * tests/version.c (test_get_config): New. (main): Call new test. Signed-off-by: Werner Koch <wk@gnupg.org>
* New global config option "only-urandom".Werner Koch2017-06-161-2/+17
| | | | | | | | | | | * random/rand-internal.h (RANDOM_CONF_ONLY_URANDOM): New. * random/random.c (_gcry_random_read_conf): Add option "only-urandom". * random/rndlinux.c (_gcry_rndlinux_gather_random): Implement that option. * tests/keygen.c (main): Add option --no-quick for better manual tests. Signed-off-by: Werner Koch <wk@gnupg.org>
* Implement global config file /etc/gcrypt/random.confWerner Koch2017-06-161-0/+15
| | | | | | | | | | | | | | | * src/hwfeatures.c (my_isascii): Move macro to ... * src/g10lib.h: here. * tests/random.c (main): Dump random stats. * random/random.c (RANDOM_CONF_FILE): New. (_gcry_random_read_conf): New. (_gcry_random_dump_stats): Call rndjent stats. * random/rndjent.c (jent_rng_totalcalls, jent_rng_totalbytes): New. (_gcry_rndjent_poll): Take care of config option disable-jent. Wipe buffer. Bump counters. (_gcry_rndjent_dump_stats): New. Signed-off-by: Werner Koch <wk@gnupg.org>
* New hardware feature flag HWF_INTEL_RDTSC.Werner Koch2017-06-141-0/+1
| | | | | | | | * src/g10lib.h (HWF_INTEL_RDTSC): New. * src/hwfeatures.c (hwflist): Add "intel-rdtsc". * src/hwf-x86.c (detect_x86_gnuc): Get EDX features and test for TSC. Signed-off-by: Werner Koch <wk@gnupg.org>
* Spelling fixes in docs and comments.NIIBE Yutaka2017-04-281-3/+3
| | | | | | | | -- GnuPG-bug-id: 3120 Reported-by: ka7 (klemens) Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
* Add BLAKE2b and BLAKE2s hash algorithms (RFC 7693)Jussi Kivilinna2017-02-271-3/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | * cipher/blake2.c: New. * cipher/Makefile.am: Add 'blake2.c'. * cipher/md.c (digest_list, prepare_macpads): Add BLAKE2. (md_setkey): New. (_gcry_md_setkey): Call 'md_setkey' for non-HMAC md. * configure.ac: Add BLAKE2 digest. * doc/gcrypt.texi: Add BLAKE2. * src/cipher.h (_gcry_blake2_init_with_key) (_gcry_digest_spec_blake2b_512, _gcry_digest_spec_blake2b_384) (_gcry_digest_spec_blake2b_256, _gcry_digest_spec_blake2b_160) (_gcry_digest_spec_blake2s_256, _gcry_digest_spec_blake2s_224) (_gcry_digest_spec_blake2s_160, _gcry_digest_spec_blake2s_128): New. * src/gcrypt.h.in (GCRY_MD_BLAKE2B_512, GCRY_MD_BLAKE2B_384) (GCRY_MD_BLAKE2B_256, GCRY_MD_BLAKE2B_160, GCRY_MD_BLAKE2S_256) (GCRY_MD_BLAKE2S_224, GCRY_MD_BLAKE2S_160, GCRY_MD_BLAKE2S_128): New. * tests/basic.c (check_one_md): Add testing for keyed hashes. (check_digests): Add BLAKE2 test vectors; Add testing for keyed hashes. * tests/blake2b.h: New. * tests/blake2s.h: New. * tests/Makefile.am: Add 'blake2b.h' and 'blake2s.h'. -- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
* w32: New envvar GCRYPT_RNDW32_DBG.Werner Koch2017-01-271-0/+7
| | | | | | | * random/rndw32.c (_gcry_rndw32_gather_random): Use getenv to set DEBUG_ME. Signed-off-by: Werner Koch <wk@gnupg.org>
* Add XTS cipher modeJussi Kivilinna2017-01-061-3/+20
| | | | | | | | | | | | | | | | | | | | | | | | * cipher/Makefile.am: Add 'cipher-xts.c'. * cipher/cipher-internal.h (gcry_cipher_handle): Add 'bulk.xts_crypt' and 'u_mode.xts' members. (_gcry_cipher_xts_crypt): New prototype. * cipher/cipher-xts.c: New. * cipher/cipher.c (_gcry_cipher_open_internal, cipher_setkey) (cipher_reset, cipher_encrypt, cipher_decrypt): Add XTS mode handling. * doc/gcrypt.texi: Add XTS mode to documentation. * src/gcrypt.h.in (GCRY_CIPHER_MODE_XTS, GCRY_XTS_BLOCK_LEN): New. * tests/basic.c (do_check_xts_cipher, check_xts_cipher): New. (check_bulk_cipher_modes): Add XTS test-vectors. (check_one_cipher_core, check_one_cipher, check_ciphers): Add XTS testing support. (check_cipher_modes): Add XTS test. * tests/bench-slope.c (bench_xts_encrypt_init) (bench_xts_encrypt_do_bench, bench_xts_decrypt_do_bench) (xts_encrypt_ops, xts_decrypt_ops): New. (cipher_modes, cipher_bench_one): Add XTS. * tests/benchmark.c (cipher_bench): Add XTS testing. -- Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
* tests: Add option --disable-hwf to the version utility.Werner Koch2017-01-031-4/+8
| | | | | | | | | * src/hwfeatures.c (_gcry_disable_hw_feature): Rewrite to allow passing a colon delimited feature set. (parse_hwf_deny_file): Remove unused var I. * tests/version.c (main): Add options --verbose and --disable-hwf. Signed-off-by: Werner Koch <wk@gnupg.org>
* Document the overflow pools and add a stupid test case.Werner Koch2016-12-071-3/+9
| | | | | | | * tests/t-secmem.c (test_secmem_overflow): New func. (main): Disable warning and call new function. Signed-off-by: Werner Koch <wk@gnupg.org>
* Put blocking calls into Libgpg-error's system call clamp.Werner Koch2016-11-121-0/+15
| | | | | | | | | | | | | | | * src/gcrypt.h.in (GCRYCTL_REINIT_SYSCALL_CLAMP): New. * configure.ac: Require Libgpg-error 1.25. Set version number to 1.8.0. * src/gcrypt-int.h: Remove error code emulation. * src/global.c (pre_syscall_func, post_syscall_func): New. (global_init): Call gpgrt_get_syscall_clamp. (_gcry_vcontrol) <GCRYCTL_REINIT_SYSCALL_CLAMP>: Ditto. (_gcry_pre_syscall, _gcry_post_syscall): New. * random/rndlinux.c (_gcry_rndlinux_gather_random): Use the new functions. Signed-off-by: Werner Koch <wk@gnupg.org>
* doc: Update yat2m.Werner Koch2016-06-251-8/+56
| | | | | | | | | | * doc/yat2m.c: Update from Libgpg-error -- Taken from Libgpg-error commit 9b5e3d1608922f4aaf9958e022431849d5a58501 Signed-off-by: Werner Koch <wk@gnupg.org>