1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00
Werner Koch 492792378d gpg: Cache keybox searches.
* common/iobuf.c (iobuf_seek): Fix for temp streams.
* g10/pubkey-enc.c (get_session_key, get_it): Add some log_clock calls.
* g10/keydb.c (dump_search_desc): New.
(enum_keyblock_states, struct keyblock_cache): New.
(keyblock_cache_clear): New.
(keydb_get_keyblock, keydb_search): Implement a keyblock cache.
(keydb_update_keyblock, keydb_insert_keyblock, keydb_delete_keyblock)
(keydb_rebuild_caches, keydb_search_reset): Clear the cache.
--

Gpg uses the key database at several places without a central
coordination.  This leads to several scans of the keybox for the same
key.  To improve that we now use a simple cache to store a retrieved
keyblock in certain cases.  In theory this caching could also be done
for old keyrings, but it is a bit more work and questionable whether
it is needed; the keybox scheme is anyway much faster than keyrings.

Using a keybox with 20000 384 bit ECDSA/ECHD keypairs and a 252 byte
sample text we get these values for encrypt and decrypt operations on
an Core i5 4*3.33Ghz system.  The option --trust-model=always is used.
Times are given in milliseconds wall time.

|           | enc | dec | dec,q |
|-----------+-----+-----+-------|
| key 1     |  48 |  96 |    70 |
| key 10000 |  60 |  98 |    80 |
| key 20000 |  69 | 106 |    88 |
| 10 keys   | 540 | 290 |    70 |

The 10 keys test uses a mix of keys, the first one is used for
decryption but all keys are looked up so that information about are
printed.  The last column gives decryption results w/o information
printing (--quiet).

The keybox is always scanned sequentially without using any index.  By
adding an index to the keybox it will be possible to further reduce
the time required for keys stored to the end of the file.
2013-01-08 14:46:06 +01:00
..
2011-02-04 12:57:53 +01:00
2007-07-04 19:49:40 +00:00
2012-04-26 09:52:25 +02:00
2011-02-04 12:57:53 +01:00
2013-01-08 14:46:06 +01:00
2007-07-04 19:49:40 +00:00
2013-01-08 14:35:27 +01:00
2013-01-07 16:51:24 +01:00
2012-11-20 19:03:49 +01:00
2012-11-20 19:03:49 +01:00
2012-12-12 18:47:21 +01:00
2012-03-27 19:46:20 +02:00
2012-12-13 16:11:21 +01:00
2012-11-20 19:03:49 +01:00
2011-02-04 12:57:53 +01:00

Stuff used by several modules of GnuPG.

These directories use it:

gpg
sm
agent

These directories don't use it:

kbx