summaryrefslogtreecommitdiffstats
path: root/sys/geom/eli/g_eli.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2010-10-22 22:13:11 +0000
committerpjd <pjd@FreeBSD.org>2010-10-22 22:13:11 +0000
commitb022d9547307fbceeac6ec2faa6ad85e69251dce (patch)
tree316a922a431709968ee4aa1c264bec80ddf0e9e2 /sys/geom/eli/g_eli.c
parentb7d601dc3a6d6bf34e079e05898cf7ec033754f4 (diff)
downloadFreeBSD-src-b022d9547307fbceeac6ec2faa6ad85e69251dce.zip
FreeBSD-src-b022d9547307fbceeac6ec2faa6ad85e69251dce.tar.gz
Move sc_akeyctx and sc_ivctx initialization to the g_eli_mkey_propagate()
function which eliminates code duplication and will ensure proper order of operation.
Diffstat (limited to 'sys/geom/eli/g_eli.c')
-rw-r--r--sys/geom/eli/g_eli.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/sys/geom/eli/g_eli.c b/sys/geom/eli/g_eli.c
index 3b9ffdd81b..fd04ee2 100644
--- a/sys/geom/eli/g_eli.c
+++ b/sys/geom/eli/g_eli.c
@@ -817,30 +817,6 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_provider *bpp,
*/
g_eli_mkey_propagate(sc, mkey);
sc->sc_ekeylen = md->md_keylen;
- if (sc->sc_flags & G_ELI_FLAG_AUTH) {
- /*
- * Precalculate SHA256 for HMAC key generation.
- * This is expensive operation and we can do it only once now or
- * for every access to sector, so now will be much better.
- */
- SHA256_Init(&sc->sc_akeyctx);
- SHA256_Update(&sc->sc_akeyctx, sc->sc_akey,
- sizeof(sc->sc_akey));
- }
- /*
- * Precalculate SHA256 for IV generation.
- * This is expensive operation and we can do it only once now or for
- * every access to sector, so now will be much better.
- */
- switch (sc->sc_ealgo) {
- case CRYPTO_AES_XTS:
- break;
- default:
- SHA256_Init(&sc->sc_ivctx);
- SHA256_Update(&sc->sc_ivctx, sc->sc_ivkey,
- sizeof(sc->sc_ivkey));
- break;
- }
LIST_INIT(&sc->sc_workers);
OpenPOWER on IntegriCloud