From 634a86093af9a6d134be8662f25616f4edfec683 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 7 Nov 2022 23:42:02 +0000 Subject: [tls] Allow for arbitrary-length initialisation vectors Restructure the encryption and decryption operations to allow for the use of ciphers where the initialisation vector is constructed by concatenating the fixed IV (derived as part of key expansion) with a record IV (prepended to the ciphertext). Signed-off-by: Michael Brown --- src/include/ipxe/crypto.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/include/ipxe/crypto.h') diff --git a/src/include/ipxe/crypto.h b/src/include/ipxe/crypto.h index ba09c9468..a15d5eba0 100644 --- a/src/include/ipxe/crypto.h +++ b/src/include/ipxe/crypto.h @@ -249,6 +249,10 @@ static inline int is_stream_cipher ( struct cipher_algorithm *cipher ) { return ( cipher->blocksize == 1 ); } +static inline int is_block_cipher ( struct cipher_algorithm *cipher ) { + return ( cipher->blocksize > 1 ); +} + static inline int is_auth_cipher ( struct cipher_algorithm *cipher ) { return cipher->authsize; } -- cgit v1.2.3-55-g7522