Skip to content

Commit

Permalink
[crypto] Make AES context size and algorithm structure externally ava…
Browse files Browse the repository at this point in the history
…ilable

This is required to support modes of AES beyond cipher-block chaining.

Signed-off-by: Marty Connor <mdc@etherboot.org>
  • Loading branch information
rwcr authored and Marty Connor committed Jan 5, 2010
1 parent ff4d61d commit 2dfe4c4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
13 changes: 1 addition & 12 deletions src/crypto/axtls_aes.c
Expand Up @@ -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
*
Expand Down Expand Up @@ -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,
Expand Down
17 changes: 17 additions & 0 deletions src/include/gpxe/aes.h
Expand Up @@ -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 */

0 comments on commit 2dfe4c4

Please sign in to comment.