From 9aa61ad5a26e04493a38bf4f9b6bd1228fef7a79 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 24 Jul 2007 17:11:31 +0100 Subject: Add per-file error identifiers --- src/include/gpxe/crypto.h | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) (limited to 'src/include/gpxe/crypto.h') diff --git a/src/include/gpxe/crypto.h b/src/include/gpxe/crypto.h index fc1f50bc5..95665acc5 100644 --- a/src/include/gpxe/crypto.h +++ b/src/include/gpxe/crypto.h @@ -9,7 +9,6 @@ #include #include -#include /** A cryptographic algorithm */ struct crypto_algorithm { @@ -101,30 +100,17 @@ static inline int cipher_setkey ( struct crypto_algorithm *crypto, return crypto->setkey ( ctx, key, keylen ); } -static inline int cipher_encrypt ( struct crypto_algorithm *crypto, - void *ctx, const void *src, void *dst, - size_t len ) { - if ( ( len & ( crypto->blocksize - 1 ) ) ) { - return -EINVAL; - } - crypto->encode ( ctx, src, dst, len ); - return 0; -} - -static inline int cipher_decrypt ( struct crypto_algorithm *crypto, - void *ctx, const void *src, void *dst, - size_t len ) { - if ( ( len & ( crypto->blocksize - 1 ) ) ) { - return -EINVAL; - } - crypto->decode ( ctx, src, dst, len ); - return 0; -} - static inline int is_stream_cipher ( struct crypto_algorithm *crypto ) { return ( crypto->blocksize == 1 ); } extern struct crypto_algorithm crypto_null; +extern int cipher_encrypt ( struct crypto_algorithm *crypto, + void *ctx, const void *src, void *dst, + size_t len ); +extern int cipher_decrypt ( struct crypto_algorithm *crypto, + void *ctx, const void *src, void *dst, + size_t len ); + #endif /* _GPXE_CRYPTO_H */ -- cgit v1.2.3-55-g7522