PERFORCE change 1198445 for review
John-Mark Gurney
jmg at FreeBSD.ORG
Thu Aug 7 00:22:08 UTC 2014
http://p4web.freebsd.org/@@1198445?ac=10
Change 1198445 by jmg at 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);
More information about the p4-projects
mailing list