diff options
author | NIIBE Yutaka <[email protected]> | 2023-07-25 03:02:26 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2023-07-25 03:10:07 +0000 |
commit | 1ddd69935da629188dcf9215cd9e7a8f68b34a97 (patch) | |
tree | 3dd81fc60bf6b5ee9be63d1748f60afbb2df24d5 /g10/filter.h | |
parent | sm: Use estream for I/O. (diff) | |
download | gnupg-1ddd69935da629188dcf9215cd9e7a8f68b34a97.tar.gz gnupg-1ddd69935da629188dcf9215cd9e7a8f68b34a97.zip |
gpg: Add parallelized filter for hashing.
* g10/options.h (COMPAT_PARALLELIZED): New.
* g10/filter.h (md_thd_filter_context_t): New type.
(md_thd_filter_set_md, md_thd_filter): New.
* g10/gpg.c (compatibility_flags): Update to support
COMPAT_PARALLELIZED.
* g10/mdfilter.c (struct md_thd_filter_context): New.
(lock_md, unlock_md, get_buffer_to_hash, put_buffer_to_recv): New.
(get_buffer_to_fill, put_buffer_to_send, md_thread): New.
(md_thd_filter, md_thd_filter_set_md): New.
* g10/sign.c (sign_file): Add support for md_thd_filter.
(sign_symencrypt_file): Likewise.
--
GnuPG-bug-id: 6570
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'g10/filter.h')
-rw-r--r-- | g10/filter.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/g10/filter.h b/g10/filter.h index 4b4fc55ff..321b553dc 100644 --- a/g10/filter.h +++ b/g10/filter.h @@ -29,6 +29,9 @@ typedef struct { size_t maxbuf_size; } md_filter_context_t; +typedef struct md_thd_filter_context *md_thd_filter_context_t; +void md_thd_filter_set_md (md_thd_filter_context_t mfx, gcry_md_hd_t md); + typedef struct { int refcount; /* Initialized to 1. */ @@ -165,6 +168,7 @@ typedef struct { /*-- mdfilter.c --*/ int md_filter( void *opaque, int control, iobuf_t a, byte *buf, size_t *ret_len); +int md_thd_filter( void *opaque, int control, iobuf_t a, byte *buf, size_t *ret_len); void free_md_filter_context( md_filter_context_t *mfx ); /*-- armor.c --*/ |