summaryrefslogtreecommitdiff
path: root/crypto.h
blob: dc145855ddd9ad79ae3820309f26bb2a6bc9b4f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef CRYPTO_H
#define CRYPTO_H

#include "taia.h"
#include "crypto_verify_32.h"
#include "crypto_hash_sha512.h"
#include "crypto_box_curve25519xsalsa20poly1305.h"
#include "crypto_scalarmult_curve25519.h"
#include "crypto_auth_hmacsha512256.h"

#define crypto_box_zerobytes		crypto_box_curve25519xsalsa20poly1305_ZEROBYTES
#define crypto_box_boxzerobytes		crypto_box_curve25519xsalsa20poly1305_BOXZEROBYTES
#define crypto_box_noncebytes		crypto_box_curve25519xsalsa20poly1305_NONCEBYTES
#define crypto_box_beforenmbytes	crypto_box_curve25519xsalsa20poly1305_BEFORENMBYTES
#define crypto_box_beforenm		crypto_box_curve25519xsalsa20poly1305_beforenm
#define crypto_box_afternm		crypto_box_curve25519xsalsa20poly1305_afternm
#define crypto_box_open_afternm		crypto_box_curve25519xsalsa20poly1305_open_afternm
#define crypto_box_pub_key_size		crypto_box_curve25519xsalsa20poly1305_PUBLICKEYBYTES
#define crypto_box_sec_key_size		crypto_box_curve25519xsalsa20poly1305_SECRETKEYBYTES

#define NONCE_LENGTH			(sizeof(struct taia))
#define NONCE_RND_LENGTH		(crypto_box_boxzerobytes - NONCE_LENGTH)
#define NONCE_ALL_LENGTH		(crypto_box_boxzerobytes + NONCE_LENGTH)
#define NONCE_OFFSET			(crypto_box_noncebytes - NONCE_LENGTH)
#define NONCE_EDN_OFFSET(x)		((x) + NONCE_OFFSET)
#define NONCE_PKT_OFFSET(x)		((x) + NONCE_RND_LENGTH)

#endif /* CRYPTO_H */
70795bc9f70dc15f51f8bb84 (diff)
Merge branch 'dsa-add-fabric-notifier'
Vivien Didelot says: ==================== net: dsa: add fabric notifier When a switch fabric is composed of multiple switch chips, these chips must be programmed accordingly when an event occurred on one of them. Examples of such event include hardware bridging: when a Linux bridge spans interconnected chips, they must be programmed to allow external ports to ingress frames on their internal ports. Another example is cross-chip hardware VLANs. Switch chips in-between interconnected bridge ports must also configure a given VLAN to allow packets to pass through them. In order to support that, this patchset introduces a non-intrusive notifier mechanism. It adds a notifier head in every DSA switch tree (the said fabric), and a notifier block in every DSA switch chip. When an even occurs, it is chained to all notifiers of the fabric. Switch chips can react accordingly if they are cross-chip capable. On a dynamic debug enabled system, bridging a port in a multi-chip fabric will print something like this (ZII Rev B board): # brctl addif br0 lan3 mv88e6085 0.1:00: crosschip DSA port 1.0 bridged to br0 mv88e6085 0.4:00: crosschip DSA port 1.0 bridged to br0 # brctl delif br0 lan3 mv88e6085 0.1:00: crosschip DSA port 1.0 unbridged from br0 mv88e6085 0.4:00: crosschip DSA port 1.0 unbridged from br0 Currently only bridging events are added. A patchset introducing support for cross-chip hardware bridging configuration in mv88e6xxx will follow right after. Then events for switchdev operations are next on the line. We should note that non-switchdev events do not support rolling-back switch-wide operations. We'll have to work on closer integration with switchdev for that, like introducing new attributes or objects, to benefit from the prepare and commit phases. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat
-rw-r--r--include/net/dsa.h17
-rw-r--r--net/dsa/Makefile1
-rw-r--r--net/dsa/dsa.c16
-rw-r--r--net/dsa/dsa2.c6
-rw-r--r--net/dsa/dsa_priv.h8
-rw-r--r--net/dsa/slave.c121
-rw-r--r--net/dsa/switch.c85
7 files changed, 205 insertions, 49 deletions
diff --git a/include/net/dsa.h b/include/net/dsa.h