diff options
| author | Ken Raeburn <raeburn@mit.edu> | 2010-01-03 23:39:12 +0000 |
|---|---|---|
| committer | Ken Raeburn <raeburn@mit.edu> | 2010-01-03 23:39:12 +0000 |
| commit | b71168c7fbe2143bc72c674f1e74a239b90b5007 (patch) | |
| tree | 9dbe00201d0e4a0fa0c45a358af683ffe14d304a /src/include | |
| parent | ca56ca345f0cd89c0bc1e544158a21b394c2616a (diff) | |
| download | krb5-b71168c7fbe2143bc72c674f1e74a239b90b5007.tar.gz krb5-b71168c7fbe2143bc72c674f1e74a239b90b5007.tar.xz krb5-b71168c7fbe2143bc72c674f1e74a239b90b5007.zip | |
Enable caching of key-derived context info such as key schedules from
one encryption operation to another. Use a new function in the
enc_provider structure for cleanup. Implement caching of aes_ctx
values.
Using Greg's performance tests from the derived-key caching work, on a
2.8GHz Xeon, I see 1 million AES-128 encryptions of 16 bytes improved
by 5-6%; encryptions of 1024 bytes and checksums are not significantly
affected.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23574 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/k5-int.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 2a4f1d8191..8a37e08e10 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -640,6 +640,16 @@ struct krb5_key_st { krb5_keyblock keyblock; int refcount; struct derived_key *derived; + /* + * Cache of data private to the cipher implementation, which we + * don't want to have to recompute for every operation. This may + * include key schedules, iteration counts, etc. + * + * The cipher implementation is responsible for setting this up + * whenever needed, and the enc_provider key_cleanup method must + * then be provided to dispose of it. + */ + void *cache; }; /* new encryption provider api */ @@ -668,6 +678,8 @@ struct krb5_enc_provider { krb5_data *out_state); krb5_error_code (*free_state)(krb5_data *state); + /* May be NULL if there is no key-derived data cached. */ + void (*key_cleanup)(krb5_key key); }; struct krb5_hash_provider { |
