From 2d2c5ea24243eb3ed12f232b2aef43981fa15360 Mon Sep 17 00:00:00 2001 From: Tariq Toukan Date: Tue, 20 Sep 2022 16:01:47 +0300 Subject: net/tls: Describe ciphers sizes by const structs Introduce cipher sizes descriptor. It helps reducing the amount of code duplications and repeated switch/cases that assigns the proper sizes according to the cipher type. Signed-off-by: Tariq Toukan Signed-off-by: Gal Pressman Signed-off-by: Jakub Kicinski --- include/net/tls.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/net') diff --git a/include/net/tls.h b/include/net/tls.h index cb205f9d9473..154949c7b0c8 100644 --- a/include/net/tls.h +++ b/include/net/tls.h @@ -51,6 +51,16 @@ struct tls_rec; +struct tls_cipher_size_desc { + unsigned int iv; + unsigned int key; + unsigned int salt; + unsigned int tag; + unsigned int rec_seq; +}; + +extern const struct tls_cipher_size_desc tls_cipher_size_desc[]; + /* Maximum data size carried in a TLS record */ #define TLS_MAX_PAYLOAD_SIZE ((size_t)1 << 14) -- cgit v1.2.3-59-g8ed1b