/* * Common values for the Poly1305 algorithm */ #ifndef _CRYPTO_POLY1305_H #define _CRYPTO_POLY1305_H #include #include #define POLY1305_BLOCK_SIZE 16 #define POLY1305_KEY_SIZE 32 #define POLY1305_DIGEST_SIZE 16 struct poly1305_desc_ctx { /* key */ u32 r[5]; /* finalize key */ u32 s[4]; /* accumulator */ u32 h[5]; /* partial buffer */ u8 buf[POLY1305_BLOCK_SIZE]; /* bytes used in partial buffer */ unsigned int buflen; /* r key has been set */ bool rset; /* s key has been set */ bool sset; }; int crypto_poly1305_init(struct shash_desc *desc); int crypto_poly1305_setkey(struct crypto_shash *tfm, const u8 *key, unsigned int keylen); unsigned int crypto_poly1305_setdesckey(struct poly1305_desc_ctx *dctx, const u8 *src, unsigned int srclen); int crypto_poly1305_update(struct shash_desc *desc, const u8 *src, unsigned int srclen); int crypto_poly1305_final(struct shash_desc *desc, u8 *dst); #endif 8c'/> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarno Rajahalme <jarno@ovn.org>2017-02-09 11:22:01 -0800
committerDavid S. Miller <davem@davemloft.net>2017-02-09 22:59:34 -0500
commit316d4d78cf9b6795b83f97c45368748741df418c (patch)
treee1a5001b3df43bc608a143fc16c6a7f2ff039807 /net/openvswitch
parentdd41d33f0b033885211a5d6f3ee19e73238aa9ee (diff)
openvswitch: Pack struct sw_flow_key.
struct sw_flow_key has two 16-bit holes. Move the most matched conntrack match fields there. In some typical cases this reduces the size of the key that needs to be hashed into half and into one cache line. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Joe Stringer <joe@ovn.org> Acked-by: Pravin B Shelar <pshelar@ovn.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch')
-rw-r--r--net/openvswitch/conntrack.c40
-rw-r--r--net/openvswitch/conntrack.h8
-rw-r--r--net/openvswitch/flow.h14
-rw-r--r--net/openvswitch/flow_netlink.c11
4 files changed, 39 insertions, 34 deletions
diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c