diff options
author | Joshua Oreman <oremanj@rwcr.net> | 2009-07-03 16:06:05 -0700 |
---|---|---|
committer | Marty Connor <mdc@etherboot.org> | 2010-01-05 09:04:25 -0500 |
commit | 2dfe4c414ac8f9992f6c6ded2f990c5a8e487815 (patch) | |
tree | 817542e9deeb20be25a8a7bdf71a7db88518b8e5 /src | |
parent | ff4d61de962a11517fd9958d0a40fbd8bcbd92ec (diff) | |
download | ipxe-2dfe4c414ac8f9992f6c6ded2f990c5a8e487815.tar.gz |
[crypto] Make AES context size and algorithm structure externally available
This is required to support modes of AES beyond cipher-block chaining.
Signed-off-by: Marty Connor <mdc@etherboot.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/crypto/axtls_aes.c | 13 | ||||
-rw-r--r-- | src/include/gpxe/aes.h | 17 |
2 files changed, 18 insertions, 12 deletions
diff --git a/src/crypto/axtls_aes.c b/src/crypto/axtls_aes.c index 9e4044ea..8bd37586 100644 --- a/src/crypto/axtls_aes.c +++ b/src/crypto/axtls_aes.c @@ -32,17 +32,6 @@ FILE_LICENCE ( GPL2_OR_LATER ); * */ -/** Basic AES blocksize */ -#define AES_BLOCKSIZE 16 - -/** AES context */ -struct aes_context { - /** AES context for AXTLS */ - AES_CTX axtls_ctx; - /** Cipher is being used for decrypting */ - int decrypting; -}; - /** * Set key * @@ -154,7 +143,7 @@ static void aes_decrypt ( void *ctx, const void *src, void *dst, } /** Basic AES algorithm */ -static struct cipher_algorithm aes_algorithm = { +struct cipher_algorithm aes_algorithm = { .name = "aes", .ctxsize = sizeof ( struct aes_context ), .blocksize = AES_BLOCKSIZE, diff --git a/src/include/gpxe/aes.h b/src/include/gpxe/aes.h index bdc32bd6..9e0e34a9 100644 --- a/src/include/gpxe/aes.h +++ b/src/include/gpxe/aes.h @@ -5,6 +5,23 @@ FILE_LICENCE ( GPL2_OR_LATER ); struct cipher_algorithm; +/** Basic AES blocksize */ +#define AES_BLOCKSIZE 16 + +#include "crypto/axtls/crypto.h" + +/** AES context */ +struct aes_context { + /** AES context for AXTLS */ + AES_CTX axtls_ctx; + /** Cipher is being used for decrypting */ + int decrypting; +}; + +/** AES context size */ +#define AES_CTX_SIZE sizeof ( struct aes_context ) + +extern struct cipher_algorithm aes_algorithm; extern struct cipher_algorithm aes_cbc_algorithm; #endif /* _GPXE_AES_H */ |