From owner-p4-projects@FreeBSD.ORG Thu Aug 7 00:22:08 2014 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E018375E; Thu, 7 Aug 2014 00:22:07 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8903C75C for ; Thu, 7 Aug 2014 00:22:07 +0000 (UTC) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:1900:2254:2068::682:0]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A3052179 for ; Thu, 7 Aug 2014 00:22:07 +0000 (UTC) Received: from perforce (uid 213) (envelope-from jmg@freebsd.org) id 2e6b by skunkworks.freebsd.org (DragonFly Mail Agent v0.9+); Thu, 07 Aug 2014 00:22:07 +0000 From: John-Mark Gurney Subject: PERFORCE change 1198445 for review To: Perforce Change Reviews Precedence: bulk Date: Thu, 07 Aug 2014 00:22:07 +0000 Message-Id: <53e2c6af.2e6b.745914e7@skunkworks.freebsd.org> X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.18 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Aug 2014 00:22:08 -0000 http://p4web.freebsd.org/@@1198445?ac=10 Change 1198445 by jmg@jmg_carbon2 on 2014/08/07 00:21:25 add explicit_bzero, copied from OpenBSD... convert to using my faster version of GHASH instead of OpenBSD's version... In pure userland (w/o AES) I was getting ~250MB/sec... I haven't benchmarked it in the kernel, but in my quick testing, this matches results... I'll have more complete tests later... Sponsored by: FreeBSD Foundation Affected files ... ... //depot/projects/opencrypto/sys/conf/files#3 edit ... //depot/projects/opencrypto/sys/libkern/explicit_bzero.c#1 add ... //depot/projects/opencrypto/sys/modules/crypto/Makefile#3 edit ... //depot/projects/opencrypto/sys/opencrypto/gfmult.c#1 add ... //depot/projects/opencrypto/sys/opencrypto/gfmult.h#1 add ... //depot/projects/opencrypto/sys/opencrypto/xform.c#3 edit ... //depot/projects/opencrypto/sys/opencrypto/xform.h#3 edit ... //depot/projects/opencrypto/sys/sys/systm.h#2 edit Differences ... ==== //depot/projects/opencrypto/sys/conf/files#3 (text+ko) ==== @@ -3106,6 +3106,7 @@ libkern/bcd.c standard libkern/bsearch.c standard libkern/crc32.c standard +libkern/explicit_bzero.c standard libkern/fnmatch.c standard libkern/iconv.c optional libiconv libkern/iconv_converter_if.m optional libiconv @@ -3798,6 +3799,7 @@ opencrypto/cryptosoft.c optional crypto opencrypto/cryptodeflate.c optional crypto opencrypto/gmac.c optional crypto +opencrypto/gfmult.c optional crypto opencrypto/rmd160.c optional crypto | ipsec opencrypto/skipjack.c optional crypto opencrypto/xform.c optional crypto ==== //depot/projects/opencrypto/sys/modules/crypto/Makefile#3 (text+ko) ==== @@ -18,7 +18,7 @@ SRCS += des_ecb.c des_enc.c des_setkey.c SRCS += sha1.c sha2.c sha256c.c SRCS += siphash.c -SRCS += gmac.c +SRCS += gmac.c gfmult.c SRCS += opt_param.h cryptodev_if.h bus_if.h device_if.h SRCS += opt_ddb.h ==== //depot/projects/opencrypto/sys/opencrypto/xform.c#3 (text+ko) ==== @@ -348,7 +348,7 @@ struct auth_hash auth_hash_nist_gmac_aes_128 = { CRYPTO_AES_128_NIST_GMAC, "GMAC-AES-128", - 16, 16, sizeof(AES_GMAC_CTX), GMAC_BLOCK_LEN, + 16, 16, sizeof(struct aes_gmac_ctx), GMAC_BLOCK_LEN, (void (*)(void *)) AES_GMAC_Init, (void (*)(void *, const u_int8_t *, u_int16_t)) AES_GMAC_Setkey, (void (*)(void *, const u_int8_t *, u_int16_t)) AES_GMAC_Reinit, @@ -358,7 +358,7 @@ struct auth_hash auth_hash_nist_gmac_aes_192 = { CRYPTO_AES_192_NIST_GMAC, "GMAC-AES-192", - 24, 16, sizeof(AES_GMAC_CTX), GMAC_BLOCK_LEN, + 24, 16, sizeof(struct aes_gmac_ctx), GMAC_BLOCK_LEN, (void (*)(void *)) AES_GMAC_Init, (void (*)(void *, const u_int8_t *, u_int16_t)) AES_GMAC_Setkey, (void (*)(void *, const u_int8_t *, u_int16_t)) AES_GMAC_Reinit, @@ -368,7 +368,7 @@ struct auth_hash auth_hash_nist_gmac_aes_256 = { CRYPTO_AES_256_NIST_GMAC, "GMAC-AES-256", - 32, 16, sizeof(AES_GMAC_CTX), GMAC_BLOCK_LEN, + 32, 16, sizeof(struct aes_gmac_ctx), GMAC_BLOCK_LEN, (void (*)(void *)) AES_GMAC_Init, (void (*)(void *, const u_int8_t *, u_int16_t)) AES_GMAC_Setkey, (void (*)(void *, const u_int8_t *, u_int16_t)) AES_GMAC_Reinit, ==== //depot/projects/opencrypto/sys/opencrypto/xform.h#3 (text+ko) ==== @@ -81,7 +81,7 @@ SHA256_CTX sha256ctx; SHA384_CTX sha384ctx; SHA512_CTX sha512ctx; - AES_GMAC_CTX aes_gmac_ctx; + struct aes_gmac_ctx aes_gmac_ctx; }; extern struct enc_xform enc_xform_null; ==== //depot/projects/opencrypto/sys/sys/systm.h#2 (text+ko) ==== @@ -232,6 +232,7 @@ #define ovbcopy(f, t, l) bcopy((f), (t), (l)) void bcopy(const void *from, void *to, size_t len) __nonnull(1) __nonnull(2); void bzero(void *buf, size_t len) __nonnull(1); +void explicit_bzero(void *buf, size_t len) __nonnull(1); void *memcpy(void *to, const void *from, size_t len) __nonnull(1) __nonnull(2); void *memmove(void *dest, const void *src, size_t n) __nonnull(1) __nonnull(2);